// LIBRERIE PER CORTE DEI CONTI SU MOTORE RICERCA OPENSHARE
name = "SITE_BROWSER";

if (navigator.appName != "Netscape")
var DefErrHand = onerror;

function gotoURL (URLname, SelectForm)
{
      if (URLname != "")
	{
		if(URLname == "Site Map")
		{	
			SelectForm.target = "MAP_BROWSER";
			SelectForm.submit ();
		}
		else
			self.location = URLname;
	}
}
function IEErrHand ()
{
	onerror = DefErrHand;
	return true;
}

function GoToDBMode ()  // Function to start Content Editor
{
	var ScrWidth;
	var ScrHeight;
	var ScrOptions;

	if ((navigator.appName == "Netscape") && (navigator.appVersion.charAt(0) == '3'))
	{
		var toolkit = java.awt.Toolkit.getDefaultToolkit();
		var IE3screen = toolkit.getScreenSize();
		ScrWidth = IE3screen.width;
		ScrHeight = IE3screen.height;
	}
	else
	{
		ScrWidth = screen.width;
		ScrHeight = screen.height;
	}
	if(ScrWidth > 800)
	{
		ScrWidth = 760;
		ScrHeight = 550;
	}
	else
	if(ScrWidth == 800)
	{
		ScrWidth = 700;
		ScrHeight = 500;
	}
	else
	{
		ScrWidth = 630;
		ScrHeight = 380;
	}

	if (navigator.appName != "Netscape")
		onerror = IEErrHand;

	ScrOptions = "width=" + ScrWidth + ",height=" + ScrHeight + ",resizable=1,status=1,menubar=0,scrollbars=1";
	
	remote=window.open ("/wfcgi/webwork.exe?FNC=GoToFolder__AMapSite_htm___1___1", "MAIN_BROWSER", ScrOptions);
	remote.focus();

	if (navigator.appName != "Netscape")
		onerror = DefErrHand;
}

function RunPersonalSearch()
{
	document.UserSearch.submit();
}

function StartMapSite()  // Function to open the Site Map
{
	remote=window.open ("/wfprog/WebWork.exe?FNC=MapSite__ANavigatorHead_htm___1___Applet___Static", "MAP_BROWSER",	"width=250,height=470,resizable=1,status=1,menubar=0,scrollbars=1");
	remote.focus();
}

function SaStartMapSite()  // Function to open the Site Map
{
	remote=window.open ("/wfprog/WebWork.exe?FNC=MapSite__ANavigatorHead_htm___1___Applet___Static", "MAP_BROWSER",	"width=250,height=470,resizable=1,status=1,menubar=0,scrollbars=1");
	remote.focus();
}

function LanciaWindowMappa(Finestra)
{
	if (document.all) {
    	var y = window.screenTop;
	    var h = window.document.body.offsetHeight;
	}
	else {
	    var y = window.screenY;
	    var h = window.outerHeight;
	}
	if(Finestra=="") {
		var cntx = Math.round(screen.width-510);
		var cnty = Math.round((screen.height-600)/2);

Mappa=window.open('/'+'Mappa/index.asp','Mappa','width=500,height=600,location=no,resizable=yes,scrollbars=yes,status=yes, top='+cnty+', left='+cntx)
	}
	else
	{
		var cntx = x + Math.round((w - width) / 2);
		var cnty = y + Math.round((h - height) / 2);

Mappa=window.open('+Finestra+','Mappa','width=500,height=600,location=no,resizable=yes,scrollbars=yes,status=yes, top='+cnty+', left='+cntx)
	}
	timer=setTimeout("Mappa.focus()",500);
}

function LanciaWindow(Finestra)
{
	w=500
	h=470
//	var cntx = Math.round(screen.width-(w+10));
//	var cnty = Math.round((screen.height-h)/2);
	var cntx = Math.round(screen.width/2-(w/2));
	var cnty = Math.round(screen.height/2-(h/2));

	CC=window.open(''+Finestra+'','CC','width='+w+',height='+h+',location=no,resizable=yes,scrollbars=yes,status=yes, top='+cnty+', left='+cntx)
	timer=setTimeout("CC.focus()",500);
}

function LanciaWindowOrganigramma(Finestra)
{
	w=620
	h=470
//	var cntx = Math.round(screen.width-(w+10));
//	var cnty = Math.round((screen.height-h)/2);
	var cntx = Math.round(screen.width/2-(w/2));
	var cnty = Math.round(screen.height/2-(h/2));

	organigramma1=window.open(''+Finestra+'','organigramma1','width='+w+',height='+h+',location=no,resizable=yes,scrollbars=yes,status=yes, top='+cnty+', left='+cntx)
	timer=setTimeout("organigramma1.focus()",500);
}


