function deletelink(linkid,parent)
{
        location.href="?op=pagechg&cmd=dellink&id="+linkid+"&parent="+parent;
        return false;
}
function hideit(boxname)
{
		document.getElementById(boxname).style.visibility='hidden';
}
function rollshow(boxname)
{
	var done=0;
	if (document.getElementById(boxname).style.height=='auto' && done==0)
	{
		document.getElementById(boxname).style.height='20px';
        	document.getElementById('updown'+boxname).innerHTML='<a href="#" onclick="rollshow(\''+boxname+'\'); return false;">\\/</a>';
		done=1;
	}
	if (document.getElementById(boxname).style.height=='20px' && done==0)
	{
		document.getElementById(boxname).style.height='auto';
        	document.getElementById('updown'+boxname).innerHTML='<a href="#" onclick="rollshow(\''+boxname+'\'); return false;">/\\</a>';
		done=1;
	}
}
function addlink(symbolo,parent)
{
location.href="?op=pagechg&cmd=addlink&pagename="+symbolo+"&parent="+parent;
}
function addcustomlink()
{
        if (document.getElementById("param3").value==""){alert("Inserire URI");}
        if (document.getElementById("param4").value==""){alert("Inserire Titolo");}
        document.getElementById("customlinkform").submit();
}
function popupimage(myimage)
{
  html = '<HTML><HEAD><TITLE>Immagine Ingrandita</TITLE></HEAD>'
  + '<BODY LEFTMARGIN="0" MARGINWIDTH="0" TOPMARGIN="0" MARGINHEIGHT="0">'
  + '<div id="willdisappear" style="text-align:center; font-size:24px;"><img src="/img/telema-loading.gif"></div>' 
  + '<IMG SRC="' + myimage + '" BORDER=0 style="visibility: hidden;" id="image" ' 
  + 'onload="window.resizeTo(document.getElementById(\'image\').width+50+50,document.getElementById(\'image\').height+100+50); document.getElementById(\'willdisappear\').style.height=\'0px\'; document.getElementById(\'willdisappear\').style.visibility=\'hidden\'; document.getElementById(\'image\').style.visibility=\'visible\'; window.moveTo((window.screen.availWidth-document.getElementById(\'image\').width)/2,(window.screen.availHeight-document.getElementById(\'image\').height)/2);">'
  + '</CENTER>'
  + '</BODY></HTML>';
popup=
 window.open
  ('','image',
  'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0');
 popup.document.open();
 popup.document.write(html);
 popup.document.close()
 return false;
}

function showpicBIG(productid,tag)
{
	document.getElementById('picturebrowserContent').innerHTML='<table width="100%" height="100%"><tr valign="middle"><td align="center" valign="middle"><img src="?op=getprodimgbig&id=' + productid + '&tag='+tag+'" alt="'+tag+'"></td></tr></table>';
	document.getElementById('picturebrowser').style.left="2%";
	document.getElementById('picturebrowser').style.visibility = 'visible';	
	return false;
}
function showpic(picno,productid,tag)
{
	document.getElementById('picturebrowserContent').innerHTML='<table width="100%" height="100%"><tr valign="middle"><td align="center" valign="middle"><img src="?op=getprodimgbyparam&picno=' + picno + '&id=' + productid + '&tag='+tag+'" alt="'+tag+'"></td></tr></table>';
	document.getElementById('picturebrowser').style.left="2%";	
	document.getElementById('picturebrowser').style.visibility = 'visible';	
	return false;
}
function closepicturebrowser()
{
	document.getElementById('picturebrowserContent').innerHTML='';
	document.getElementById('picturebrowser').style.visibility = 'hidden';
	return false;
}
