//----------------------------------------------------
//
//	START:	ClientSide HighLight
//
//	le due funzioni seguenti gistiscono la 
//	visualizzazione del body degli highlight 
//	client side, implementati per ora solo 
//	nell'oggetto SMAT id=9
//
//----------------------------------------------------
function hilightObject_show(v_strObjectId){
	var description = "";
	description = document.getElementById(v_strObjectId);
	description.className = "hilightObject_On";
}
function hilightObject_hide(v_strObjectId){
	var description = "";
	description = document.getElementById(v_strObjectId);
	description.className = "hilightObject_Off";
}
//----------------------------------------------------
//
//	END:	ClientSide HighLight
//
//----------------------------------------------------


function openPopUpWinFull(v_strUrl, v_strWidth, v_strHeight){
	window.open(v_strUrl,"","width=" + v_strWidth + ",height=" + v_strHeight + ",location=1,menubar=1,status=1,scrollbars=1,toolbar=1");
}

function openPopUpWin(v_strUrl, v_strWidth, v_strHeight){
	window.open(v_strUrl,"","width=" + v_strWidth + ",height=" + v_strHeight + ",location=0,menubar=0,status=0,scrollbars=1");
}

function openPopUpWinResize(v_strUrl, v_strWidth, v_strHeight){
	window.open(v_strUrl,"","width=" + v_strWidth + ",height=" + v_strHeight + ",location=0,menubar=0,status=0,scrollbars=1,resizable=1");
}

function PopUpForgottenEmail(v_strLinguaISO){
	window.open("tools/UserReg/frmForgottenEmail.aspx?linguaISO=" + v_strLinguaISO,"","width=330,height=280,location=0,menubar=0,status=0,scrollbars=0")
}
//openPageUrl(v_strUrl, v_strPageName, v_strWidth, v_strHeight, v_blnBoxLink, v_strTarget)
//
//gestione dei link nelle voci del top menu.
//La gestione dei link che aprono delle nuove finestre, cambia a seconda del browser 
//utilizzato dall'utente:
//	ie, NN6,	accettano il link anche sulla cella del menu, per evitare che sia il 
//				link sulla cella che quello sulla scritta vengano aperti (lo fa quando 
//				uso la funzione window.open), non metto quello sulla scritta
//	NN4,	supporta il link solo sulla scritta, non metto quello sulla cella
//
//argomenti:
//	v_strUrl	=	pagina da aprire
//	v_strPageName	=	nome da dare alla pagina
//	v_strWidth	=	larghezza della finestra da aprire
//	v_strHeight	=	altezza della finestra da aprore
//	v_blnBoxLink	=	flag che indica se la funzione è chiamata per gestire un link sulla cella (=true) o sulla scritta (=false)
//	v_strTarget	=	target del link
//
//valore di ritorno:
//	nessuno
function openPageUrl(v_strUrl, v_strPageName, v_strWidth, v_strHeight, v_blnBoxLink, v_strTarget){
	var strBrowserName = "";
	var strAppVersion = "";
	var intScreenWidth = 0;
	var intScreenHeight = 0;
	
	strBrowserName = whatbrowser();
	
	if(strBrowserName.indexOf("ie") != -1){
		intScreenWidth = parseInt(document.body.clientWidth);
		intScreenHeight = parseInt(document.body.clientHeight) - 30;
	}else{
		intScreenWidth = parseInt(window.innerWidth) - 10;
		intScreenHeight = parseInt(window.innerHeight);
	}
	
	
	if(v_strWidth == null || v_strWidth == "") v_strWidth = intScreenWidth;
	if(v_strHeight == null || v_strHeight == "") v_strHeight = intScreenHeight;
	
	if(v_blnBoxLink == true){
		switch(strBrowserName){
			case "ie":
			case "ie6":
			case "ie4":
			case "ieMac":
			case "NN6":{
				if(v_strTarget == "_blank"){
					window.open(v_strUrl, v_strPageName,"dependent=yes,Height=" + v_strHeight + ",Width=" + v_strWidth + ", top=0, left=0, location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,linksbar=yes");
				}else{
					location.href = v_strUrl;
				}
				break;
			}
			default:{
			}
		}
	}else{
		switch(strBrowserName){
			//case "ie4":
			//case "ieMac":
			case "NN4":{
				if(v_strTarget == "_blank"){
					window.open(v_strUrl, v_strPageName,"dependent=yes,Height=" + v_strHeight + ",Width=" + v_strWidth + ", top=0, left=0,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,linksbar=yes");
				}else{
					location.href = v_strUrl;
				}
				break;
			}
			case "ieMac":{
				if(v_strTarget != "_blank"){
					location.href = v_strUrl;
				}
				break;
			}
			default:{
			}
		}
	}
}








function changeStyle(v_strIDTd, v_strTopStyle, v_strBottStyle){
	switch(whatbrowser()){
		case "NN6":{
			document.getElementById(v_strIDTd + "Bottom").className = v_strBottStyle;
			break;
		}
		case "ie4":
		case "ie6":
		case "ieMac":{
			document.all(v_strIDTd + "Bottom").className = v_strBottStyle;
			break;
		}
		default:{
			document.all(v_strIDTd + "Bottom").className = v_strBottStyle;
		}
	}
}
	
	
//whatbrowser()
//
//determina con quale browser l'utente è collegato e restituisce la sigla corrispondente
//
//argomenti:
//	nessuno
//
//valore di ritorno:
//	stringa	=	sigla corrispondente al browser con cui l'utente è collegato
//				NN4	=	netscape4
//				NN6	=	netscape6
//				ie	=	internet explorer
function whatbrowser(){
	var thisbrowser = "";	//sigla del browser utilizzato dall'utente
	var strAppVersion = navigator.appVersion;

	var blnIsIe4 = (strAppVersion.indexOf("MSIE 4") == -1) ? 0 : 1;
	var blnIsIe5 = (strAppVersion.indexOf("MSIE 5") == -1) ? 0 : 1;
	var blnIsIe6 = (strAppVersion.indexOf("MSIE 6") == -1) ? 0 : 1;
	var blnIsMac = (strAppVersion.indexOf("Macintosh") == -1) ? 0 : 1;
	
	//interrogo l'oggetto document per capire quale broeser sta utilizzando l'utente
    if(document.layers){
        thisbrowser="NN4";
    }
    if(document.all){
         if(blnIsIe4 == 1 || blnIsIe5==1) thisbrowser="ie4";
         else if(blnIsIe6 == 1) thisbrowser="ie6";
         else if(blnIsMac == 1) thisbrowser="ieMac";
         else thisbrowser="ie";
         
         //alert(thisbrowser);
    }
    if(!document.all && document.getElementById){
         thisbrowser="NN6";
    }
    
    return(thisbrowser);
}

function greyArrow(v_strImageName){
	switch(whatbrowser()){
		case "NN6":{
			document.getElementById(v_strImageName).src = "img/shared/frecciaGrigia.gif";
			break;
		}
		case "ie6":
		case "ie4":
		case "ieMac":{
			document.all(v_strImageName).src = "img/shared/frecciaGrigia.gif";
			break;
		}
		default:{
			document.all(v_strImageName).src = "img/shared/frecciaGrigia.gif";
		}
	}
}

function trasparentImg(v_strImageName){
	switch(whatbrowser()){
		case "NN6":{
			document.getElementById(v_strImageName).src = "img/shared/np.gif";
			break;
		}
		case "ie6":
		case "ie4":
		case "ieMac":{
			document.all(v_strImageName).src = "img/shared/np.gif";
			break;
		}
		default:{
			document.all(v_strImageName).src = "img/shared/np.gif";
		}
	}
}


