
//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 "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:{
			}
		}
	}
}



//npwidthmax()
//
//calcola width della pagina, toglie larghezza menu sinistra e larghezza menu 
//destra return (la differenza)
function npwidthmax(){
	size = parseInt(window.innerWidth) - 161;
	return size;
}

function openPage(v_strPagePath, v_strTitolo, v_intWidth, v_intHeight, v_blnScroll){
	if(v_blnScroll == false){
		window.open(v_strPagePath, v_strTitolo,"dependent=yes,Height=" + v_intHeight + ",Width=" + v_intWidth + ",location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=yes,toolbar=no");
	}else{
		window.open(v_strPagePath, v_strTitolo,"dependent=yes,Height=" + v_intHeight + ",Width=" + v_intWidth + ",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no");
	}
}

function openNormalPage(v_strPagePath, v_strTitolo, v_intWidth, v_intHeight){
	window.open(v_strPagePath, v_strTitolo,"dependent=yes,Height=" + v_intHeight + ",Width=" + v_intWidth + ", top=0, left=0,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes");
}

function openPageTopMenu(v_strPagePath, v_strTitolo, v_intWidth, v_intHeight){
	
	if((whatbrowser() == "NN6") || (whatbrowser() == "ie6") || (whatbrowser() == "ie4") || (whatbrowser() == "ieMac")){
		window.open(v_strPagePath, v_strTitolo,"dependent=yes,Height=" + v_intHeight + ",Width=" + v_intWidth + ",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes");
	}
}

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;
		}
	}
}
	
	
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 bordeauxArrow(v_strImageName){
	switch(whatbrowser()){
		case "NN6":{
			document.getElementById(v_strImageName).src = "img/shared/frecciaBordeaux.gif";
			break;
		}
		case "ie6":
		case "ie4":
		case "ieMac":{
			document.all(v_strImageName).src = "img/shared/frecciaBordeaux.gif";
			break;
		}
		default:{
			document.all(v_strImageName).src = "img/shared/frecciaBordeaux.gif";
		}
	}
}

function whiteArrow(v_strImageName){
	switch(whatbrowser()){
		case "NN6":{
			document.getElementById(v_strImageName).src = "img/shared/frecciaBianca.gif";
			break;
		}
		case "ie6":
		case "ie4":
		case "ieMac":{
			document.all(v_strImageName).src = "img/shared/frecciaBianca.gif";
			break;
		}
		default:{
			document.all(v_strImageName).src = "img/shared/frecciaBianca.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";
		}
	}
}

//prodotti selection spertura pagina colori
function openColor(v_strLocalLng){
	var strLocalLng = "";
	strLocalLng = (v_strLocalLng != null && v_strLocalLng != "") ? v_strLocalLng : "en";
	
	if(strLocalLng == "it"){
		window.open('prodotti/selectionFlashColori/selectionFlash.asp','_blank','scrollbars=no,menubar=0,width=552,height=428');
	}else{
		window.open('prodotti/selectionFlashColoriUK/selectionFlash.asp','_blank','scrollbars=no,menubar=0,width=552,height=428');
	}
}

function openRaceLine(v_strIdLanguage){
	location.href='prod_mod.asp?area=race&id=1&lng=' + v_strIdLanguage + '&ipag=plrace&swbox=1';
}
	
function openExciteLineHomeZoom(v_strNomeAttrezzo, v_strIdDetail){
	window.open('prodotti/excite/lineHomePageDetails/zoomPage.asp?nomeAttrezzo=' + v_strNomeAttrezzo + '&idimg=' + v_strIdDetail,'Details','dependent=yes,Height=357,Width=447,top=10,left=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no,linksbar=no');
}

function openFrLayoutZoomZoom(v_strIdLayout){
	window.open('filiali/fr/serviceCompanyLayout/layoutZoom.asp?layout=' + v_strIdLayout,'layoutFr','dependent=yes,Height=229,Width=517,top=10,left=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no,linksbar=no');
}


function openPersSelection(v_strIdLanguage){
	if(v_strIdLanguage == "12" || v_strIdLanguage == "1"){
		window.open('http://www.technogym.it/personalselection/selectionPopUp.asp?lng=12','personalSelection','dependent=yes,Height=368,Width=538,top=10,left=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no,linksbar=no');
	}else{
		window.open('http://www.technogym.com/personalselection/selectionPopUp.asp?lng=13','personalSelection','dependent=yes,Height=368,Width=538,top=10,left=10,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=yes,toolbar=no,linksbar=no');
	}
}
