function autoLoadInternalPage(){

	if (gruppoPalchetto!=""){
		document.getElementById("hid_idgruppopalchetto").value = gruppoPalchetto;
	}

	if(hid_idAccesso!=""){
		if(hid_path!=""){caricaPagina(hid_idAccesso, hid_path)}		
		else{caricaPagina(hid_idAccesso,'highlights.asp')}
	}		
	else{
		if (pag!=""){
			//se ci sono parametri in pag, sostituisco ;; con ? e ; con &
			//è una convenzione usata perchè i motori di ricerca non riconoscevano
			//il ? e la & contenuti in pag
			sToSearch = /;;/i;
			pag = pag.replace(sToSearch, "?");

			sToSearch = /;/i;
			while (pag.search(sToSearch, "&") != -1) {
				pag = pag.replace(sToSearch, "&");
			}

			document.getElementById("hid_PaginaInterna").value = pag;

			sToSearch = /=/i;
			nResult = pag.search(sToSearch);
			if (nResult==-1) {
				document.getElementById("Form1").target = "iframe1"
				document.getElementById("Form1").action = pag
				document.getElementById("Form1").submit()
			}
			else {
				sDate = d.toString();

				sToSearch = /&hid_idFunzione=/i;
				nResult = pag.search(sToSearch);
				if (nResult==-1) {	
					document.getElementById("iframe1").src = pag + "&hid_idFunzione=" + document.getElementById("hid_idFunzione").value + "&cacheTime=" + sDate
				}
				else {
					var subPag = pag.substr(0, nResult);
					document.getElementById("iframe1").src = subPag + "&hid_idFunzione=" + document.getElementById("hid_idFunzione").value + "&cacheTime=" + sDate
				}
			}
		}
		else{			
			document.getElementById("Form1").target = "iframe1"
			document.getElementById("Form1").action = "highlights.asp"
			document.getElementById("Form1").submit()
		}
	}
}



function caricaPalchetti(idFunzione, idGruppoPalchetto) {
	document.getElementById("hid_idFunzione").value = idFunzione

	if (idGruppoPalchetto != '') {
		document.getElementById("hid_idgruppopalchetto").value = idGruppoPalchetto
		document.getElementById("Form1").action = "highlights.asp"
		document.getElementById("Form1").target = "_self"
		document.getElementById("Form1").submit()
	}
}

function caricaPalchetto(idFunzione, strHREF, idPalchetto){
	if (idFunzione==''){
		document.getElementById("hid_idFunzione").value = 0
	}else{
		document.getElementById("hid_idFunzione").value = idFunzione
	}
	
	document.getElementById("hid_idpalchetto").value = idPalchetto
	document.getElementById("Form1").target = "iframe1"

	if (strHREF.length>1){
		if (strHREF.lastIndexOf('?')==-1){
			document.getElementById("Form1").action = strHREF + '?hid_idpalchetto=' + idPalchetto
		}else{
			document.getElementById("Form1").action = strHREF + '&hid_idpalchetto=' + idPalchetto
		}
	}else{
		document.getElementById("Form1").action = "UnderConstruction.asp"
	}

	document.getElementById("Form1").submit()
}

// funzione per l'apertura della pagina di anteprima della foto per aprire n finestre per n immagini passare un nome differente 																																									tiziano coli 29-05-2003
function apri(foto,nome)
{
	var features,pagina
	pagina = "/geasar/anteprima.asp?immagine=" + foto
	features = "top=100,left=100,height=100,width=100,scrollbars=no,resizable=no"
	window.open(pagina, nome, features)
	features =""	
		
}

function caricaElemento(idFun, id, Tipo, Param){
	document.getElementById("hid_idFunzione").value = idFun;
	
	document.getElementById("Form1").target = "iframe1";
	document.getElementById("Form1").action = "/geasar/include/inc_VisualizzaElemento.asp?txtFun=" + idFun + "&txtID=" + id + "&txtTipo=" + Tipo + "&txtParam=" + Param
	document.getElementById("Form1").submit();
}

function callPageCerca(id,strHREF){
	var oldMethod
	document.getElementById("hid_idFunzione").value = id;
	// Carico la pagina del Cerca
	document.getElementById("Form1").target = "iframe1";
	document.getElementById("Form1").action = strHREF + 'txtCerca=' + document.getElementById("txtCerca").value;
	document.getElementById("Form1").submit();
}

function caricaPagina(id, strHREF, strPathLogo){
	alert("sono qui")
	if (id==''){
		document.getElementById("hid_idFunzione").value = 0
	}else{
		document.getElementById("hid_idFunzione").value = id
	}

	document.getElementById("Form1").target = "iframe1"
	if (strHREF.length>1){
		document.getElementById("Form1").action = strHREF
	}else{
		document.getElementById("Form1").action = "UnderConstruction.asp"
	}

	// gestione percoso logo sostitutivo al modulo ricerca voli
	if (typeof(strPathLogo)=='undefined'){
		document.getElementById("hid_PathLogoSX").value = ''
	}else{
		document.getElementById("hid_PathLogoSX").value = strPathLogo
	}
		
	document.getElementById("Form1").submit()
}