
function TestataReload()
{ 	
	window.onerror=null;
	//quando effettuo il reload forzo il reload di pagine per traduzione	
	try
	{	
	if (top.main != null)
	{
	
		if (parent.main.location.href == '')
		{
	 		changePage('webfrmHome.aspx');
		}
		else
		{
	 		changePage(parent.main.location.href);
		}
		
		locMenuChiudi();
	}
	}
	catch(error){return true;}
} 
 
 function foo(){
    return true; // true means ignore errors!
}

function CustomLoadUsername()
{ 
	//RefreshPageCorrente();
}


var toutRefreshPage;

function changePage(strPage) 
{ 
	try
	{
	if (strPage == '' )
	{
		alert("Pagina Vuota");
	}

	parent.main.location.href = strPage ; /*This line is the one that changes the baseFrame frame URL.  strPage can be substituded with a hardcoded string.*/ 
	//parent.banner.location.reload();
	//Debbo effetuare il reload della PaginaCorrente per visualizzare la pagina corretta
	// siccome vi sono ritardi da indagare inesco un timer che effettua dopo un po tale operazione
	//parent.paginacorrente.location.reload();
	//toutRefreshPage=setTimeout("RefreshPageCorrente()",2000);
	//alert(parent.banner.forms(0).ID);
	//parent.main.location.document.Form1.LabPaginaCorrente.text = strPage
	//come si interagisce con le variabili del server e session
	locMenuChiudi();
	}
	catch(error){return true;}

} 

function ReloadMenu() 
{
	try	
	{	
	M_HOME.style.background='transparent';
	M_AZIENDA.style.background='transparent';
	M_PRODOTTI.style.background='transparent';
	M_FAQ.style.background='transparent';
	M_CONTATTI.style.background='transparent';
	M_REGISTRAZIONE.style.background='transparent';
	M_LINK.style.background='transparent';
	
	//patch per evitae errore quando si fa reload con POST ??
	if (parent.main.location != 'undefined')
	{
		if (parent.main.location.href.indexOf("Home.aspx") > 0)	
			{M_HOME.style.background='Black';}
		if (parent.main.location.href.indexOf("Azienda.aspx") > 0)	
			{M_AZIENDA.style.background='Black';}
		if (parent.main.location.href.indexOf("Prodotti.aspx") > 0)	
			{M_PRODOTTI.style.background='Black';}
		if (parent.main.location.href.indexOf("Faq.aspx") > 0)	
			{M_FAQ.style.background='Black';}
		if (parent.main.location.href.indexOf("Contatti.aspx") > 0)	
			{M_CONTATTI.style.background='Black';}
		if (parent.main.location.href.indexOf("Registrazione.aspx") > 0)	
			{M_REGISTRAZIONE.style.background='Black';}
		if (parent.main.location.href.indexOf("Link.aspx") > 0)	
			{M_LINK.style.background='Black';}		
	}
	}
	catch(error){return true;}

}


function RefreshPageCorrente() 
{
	try
	{	
	//parent.paginacorrente.location.reload();
	//NB viene fatto il reload che se in POST manda il messaggio con Riprova e Annulla
	//parent.main.location.reload(); da errore quando si effettua un post
	//parent.main.location.submit();
	parent.frames['main'].document.forms[0].submit();
	//setTimeout("top.frames['main'].document.forms[0].submit();",2000);
	//var id = window.setTimeout("parent.main.location.reload()",2000);
	//setTimeout(alert('pippo'),5000);
	}
	catch(error){return true;}

}

function RefreshHome() 
{
	//parent.main.location.replace('webfrmHome.aspx');
	//changePage('webfrmHome.aspx');
	//window.setTimeout('parent.main.location.reload();',5000);
	//parent.main.location.reload();
}


function RefreshMenu() 
{
	try
	{	
	parent.menu.location.reload();
	}
	catch(error){return true;}
}

function RefreshUsername() 
{
	try
	{	
	parent.username.location.reload();
	//parent.menu.location.reload();
	}
	catch(error){return true;}
}



var oPopup;
var tout;
var ElementoSelezionato=0;

function contextMenuFamiglie(Compatibilita)
{
	var lefter = 218;//event.offsetX+10;
	var topper = 17;//event.offsetY+10;
	if (Compatibilita != "0")
	{
		oPopup = window.createPopup();
		//this.style.background='gold'	
		oPopup.document.body.innerHTML = oContextHTML_FAMIGLIA.innerHTML; 
		oPopup.show(lefter, topper, 300, 18*8, document.body);
	}
	ElementoSelezionato=0;
}

function contextMenuFaq(Compatibilita)
{
	var lefter = 328;//event.offsetX+10;
	var topper = 17;//event.offsetY+10;
	if (Compatibilita != "0")
	{
		oPopup = window.createPopup();
		//oPopup.Background = "Transparent"
		//this.style.background='gold'	
		// si deve creare della giusta dimensione che puņ essere definita
		// dal numero di famigie e faq	
		oPopup.document.body.innerHTML = oContextHTML_FAQ.innerHTML; 
		oPopup.show(lefter, topper, 300, 18*9, document.body);
	}
	ElementoSelezionato=0;
}



function contextMenuFamiglieChiusuraForzata()
{
	if (ElementoSelezionato == 0)
	{
	locMenuChiudi();
	}
}


function contextMenuFamiglieEsci()
{
	tout=setTimeout("locMenuChiudi()",200);
	ElementoSelezionato = 0;
}

function contextMenuFamiglieEntra()
{
	clearTimeout(tout);
	ElementoSelezionato = 1;
}

function locMenuChiudi()
{
	if (oPopup == null) return;
	oPopup.hide();
}

function NavigatorCompatibility()
{
	var Compatibile
	var browser = new Object();
		
	Compatibile = 0;
	browser.version =parseInt(navigator.appVersion);
	alert(browser.version);
	browser.isNavigator = false;
	browser.isIE = false;
	if (navigator.appName.indexOf("Netscape") != -1)
		browser.isNavigator = true;
	else if (navigator.appName.indexOf("Microsoft") != -1)
		browser.isIE = true;
	
	if (browser.isIE && browser.version >= 5.5)
	{
		Compatibile = 1
	}		
	NavigatorCompatibitity = Compatibile
}

function BrowserInformation()
{
	var strBrowser
		
	for (var propname in navigator)
	{strBrowser += propname + " : " + navigator[propname] + "\n"}
	alert(strBrowser)
}

  //function CustomLoadUsername()
  //{
  //  document.getElementById("ButOK").focus();
  //}
  
  
  //function doSubmit()
  //{
  // if ((event.which && event.which == 13) ||  (event.keyCode && event.keyCode == 13))
  // {
  //  document.getElementById("ButOK").click();
  //  document.getElementById("ButOK").focus();
  // }  
  //}


/*
var s=0;
var tm;
var t=new Array();
t[1]='<img src="image\web.gif" width="146" height="10" align="left">';
t[2]='<img src="image\web.gif" width="236" height="100" align="left">';
t[3]='<img src="image\web.gif" width="326" height="10" align="left">';
t[4]='<img src="image\web.gif" width="416" height="10" align="left">';
t[5]='<img src="image\web.gif" width="498" height="10" align="left">';

var m=new Array();
m[1]="<a href='Azienda.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>AZIENDA</font></a> | <a href='ComeContattarci.htm' class='l"+cm+"' target='_top' ><font color='#FFFFFF#'> ComeContattarci </font> </a>";
m[2]="<a href='Novita.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>NOVITA'</font></a>";
m[3]="<a href='Prodotti.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>PRODOTTI</font></a> | <a href='Industria.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Industria</font></a> | <a href='Veicoli.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Veicoli</font></a> | <a href='GasEquipment.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Gas Equipment</font></a> | <a href='Custom.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Custom</font></a>";
m[4]="<a href='Servizi.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>SERVIZI</font></a> | <a href='Hardware.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Hardware</font></a> | <a href='Software.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Software</font></a> | <a href='PCB.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>PCB</font></a> | <a href='Firmware.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Firmware</font></a>";
m[5]="<a href='Tecnologie.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>TECNOLOGIE</font></a>";

function ml(i) {
clearTimeout(tm);
if(navigator.appName=='Microsoft Internet Explorer') {this.innerHTML='<B>Mouse out to change back.</B>';}  //;t[i]+m[i];}
else {document.le.document.li.document.write('<span>'+t[i]+m[i]+'</span>'); document.le.document.li.document.close()}
s=i;
tm=setTimeout("nl()",6000);
}


var n=new Array();
n[1]="<a href='Azienda.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>AZIENDA</font></a> | <a href='ComeContattarci.htm' class='l"+cm+"' target='_top' ><font color='#FFFFFF#'> ComeContattarci </font> </a>";
n[2]="<a href='Novita.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>NOVITA'</font></a>";
n[3]="<a href='Prodotti.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>PRODOTTI</font></a> | <a href='Industria.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Industria</font></a> | <a href='Veicoli.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Veicoli</font></a> | <a href='GasEquipment.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Gas Equipment</font></a> | <a href='Custom.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Custom</font></a>";
n[4]="<a href='Servizi.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>SERVIZI</font></a> | <a href='Hardware.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Hardware</font></a> | <a href='Software.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Software</font></a> | <a href='PCB.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>PCB</font></a> | <a href='Firmware.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>Firmware</font></a>";
n[5]="<a href='Tecnologie.htm' class='l"+cm+"' target='_top'><font color='#FFFFFF#'>TECNOLOGIE</font></a>";

function nl() {
if (s>0) {if(navigator.appName=='Microsoft Internet Explorer') {this.innerHTML=' ';}
else {document.le.document.li.document.write('<span> </span>'); document.le.document.li.document.close()} };
s=0;
}

function v() {
if (s>0) {if(navigator.appName=='Microsoft Internet Explorer') {this.innerHTML=' ';}
else {document.le.document.li.document.write('<span> </span>'); document.le.document.li.document.close()} };
s=0;

}

*/

