//----------------------------------------------
//
//----------------------------------------------
function indietro()
{
	history.go(-1);
}


//----------------------------------------------
//
//----------------------------------------------
function ApriFinestraMappa( inId ) 
{ //v3.0
 var location = window.location.href;
 var itPos = location.indexOf ("/it/");
 if (itPos>=0)
 {
	 var url = location.substr(0, itPos) + '/it/reception/mappa/mappa.php?carta='+inId;
	 var mywin = window.open( url , "mappa_win" , "menubar=no,resizable=no,toolbar=no,scrollbars=no,width=521,height=444");
     /*	 if ( typeof(mywin) != "undefined"  && (mywin != null) )
	 {
		 if (window.focus) mywin.focus(); 
 	 }*/
 }
}


//----------------------------------------------
//
//----------------------------------------------
function Link( inUrl ) 
{ //v3.0
	if ( inUrl.substring(0,4)=="http" ) {		
		mywin = window.open (inUrl, "");
	} else {
		document.location.href=inUrl;
	}		
}

//----------------------------------------------
//
//----------------------------------------------
function LinkEvento( CodiceEvento )
{ 
	var inUrl='/it/festival2004/evento.php' + '?id=' +  CodiceEvento;
	document.location.href=inUrl;
}

//----------------------------------------------
//
//----------------------------------------------
function LinkEv2005( CodiceEvento )
{ 
	var inUrl='/it/festival2005/evento.php' + '?id=' +  CodiceEvento;
	//alert(inUrl)
	document.location.href=inUrl;
}

//----------------------------------------------
//
//----------------------------------------------
function LinkEv2006( CodiceEvento )
{ 
	var inUrl='/it/festival2006/evento.php' + '?id=' +  CodiceEvento;
	//alert(inUrl)
	document.location.href=inUrl;
}

//----------------------------------------------
//
//----------------------------------------------
function LinkEv( CodiceEvento )
{ 
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href_new = location.substr(0, itPos) + '/it/programma/evento.php' + '?id=' +  CodiceEvento;
	 	window.location.href=href_new;
		return;
	}
	var enPos = location.indexOf ("/en/");
	if (enPos>=0) {
		var href_new = location.substr(0, enPos) + '/it/programma/evento.php' + '?id=' +  CodiceEvento;
	 	window.location.href=href_new;
		return;
	}
}
function LinkEv2008( CodiceEvento ) // ALIAS PER ERRORE NEL DB
{
	
	var inUrl='/it/festival2008/evento.php' + '?id=' +  CodiceEvento;
	//alert(inUrl)
	document.location.href=inUrl;
	
	//LinkEv( CodiceEvento );
}

function paginaInfo( )
{ 
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href_new = location.substr(0, itPos) + '/it/booking/index.php';
	 	window.location.href=href_new;
		return;
	}
	var enPos = location.indexOf ("/en/");
	if (enPos>=0) {
		var href_new = location.substr(0, itPos) + '/it/booking/index.php';
	 	window.location.href=href_new;
		return;
	}
}

//----------------------------------------------
//
//----------------------------------------------
function LinkDiario( CodiceDiario )
{ 
	var inUrl='/it/news2004/diario_index.php' + '?currentDiario=' +  CodiceEvento;
	document.location.href=inUrl;
}

//----------------------------------------------
//
//----------------------------------------------
function LinkNews( CodiceNew )
{ 
	var inUrl='/it/news2004/beagle_index.php' + '?currentNews=' +  CodiceEvento;
	document.location.href=inUrl;
}


//----------------------------------------------
//
//----------------------------------------------
function LinkComunicato( CodiceComunicato )
{ 
	var inUrl='/it/salastampa/index.php' + '?currentComu=' +  CodiceComunicato;
	document.location.href=inUrl;
}

//----------------------------------------------
//
//----------------------------------------------
function credits() 
{ //v3.0
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var url = location.substr(0, itPos) + '/it/home/credits.html';
	 	var mywin = window.open( url , "credits" , "menubar=no,resizable=no,toolbar=no,scrollbars=no,width=360,height=350");
     	if (window.focus) mywin.focus();
		return;
	}
	var enPos = location.indexOf ("/en/");
	if (enPos>=0) {
		var url = location.substr(0, itPos) + '/en/home/credits.html';
	 	var mywin = window.open( url , "credits" , "menubar=no,resizable=no,toolbar=no,scrollbars=no,width=360,height=350");
     	if (window.focus) mywin.focus();
	}
}

//----------------------------------------------
//
//----------------------------------------------

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//----------------------------------------------
//
//----------------------------------------------
function cerca_f() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href = location.substr(0, itPos) + '/it/programma/eventilist.php?FIND='+document.getElementById("findForm").value;
		window.location.href=href;
	}
}

//----------------------------------------------
//
//----------------------------------------------
function cerca_f_2006() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href = location.substr(0, itPos) + '/it/festival2006/eventilist.php?FIND='+document.getElementById("findForm").FIND.value;
		window.location.href=href;
	}
}

function cerca_f_2008() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href = location.substr(0, itPos) + '/it/festival2008/eventilist.php?FIND='+document.getElementById("findForm2").value;
		window.location.href=href;
	}
}

//----------------------------------------------
//
//----------------------------------------------
function cerca_f2() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var itPos = location.indexOf ("/it/");
	if (itPos>=0) {
		var href = location.substr(0, itPos) + '/it/programma/eventilist.php?FIND='+document.getElementById("findForm2").value;
		window.location.href=href;
	}
}

//----------------------------------------------
//
//----------------------------------------------
function cerca_f_en() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var enPos = location.indexOf ("/en/");
	if (enPos>=0) {
		var href = location.substr(0, enPos) + '/en/programma/eventilist_en.php?FIND='+document.getElementById("findForm_en").value;
		window.location.href=href;
	}
}
//----------------------------------------------
//
//----------------------------------------------
function cerca_f2_en() 
{
	//document.getElementById("findForm").submit();
	var location = window.location.href;
	var enPos = location.indexOf ("/en/");
	if (enPos>=0) {
		var href = location.substr(0, enPos) + '/en/programma/eventilist_en.php?FIND='+document.getElementById("findForm2_en").value;
		window.location.href=href;
	}
}

function apriFin(url)
{
	var mywin = window.open( url );
    if (window.focus) mywin.focus();
}

//------------------------------------
function ToggleMenu(theID) 
{
 if (document.getElementById(theID).style.display == "block") {
     document.getElementById(theID).style.display = "none";
     if (document.getElementById(theID+"_btn")) document.getElementById(theID+"_btn").src =  "../../common/img/div_sess_open.gif";; 
	}
 else 
 {
     document.getElementById(theID).style.display = "block";
     if (document.getElementById(theID+"_btn")) document.getElementById(theID+"_btn").src="../../common/img/div_sess_close.gif";
	} 
}
//-----------------------------------------------
//-----------------------------------
// es: apriWindow('../programma/spettacoli.php', 'spettacoliBox', 'menubar=no,resizable=no,toolbar=no,scrollbars=auto,width=640,height=444');
function apriWindow(url, name, par)
{
	var mywin = window.open( url,  name , par);
    if (window.focus) mywin.focus();
}

