// JavaScript Document

function display(path){
  var shtml="";
  shtml += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
  shtml += " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"";
  shtml += "  width=\"948\" height=\"658\" >";
  shtml += " <param name=\"movie\" value=\"../"+path+"/template/saraTaccardi.swf\" id=\"ESM\">";
  if(subPaypal==""){
  shtml += " <param name=FlashVars value=\"p="+thisPage+"&l="+lang+"\">";
  }else{
  shtml += " <param name=FlashVars value=\"p="+thisPage+"&l="+lang+"&s="+subPaypal+"\">";
  }
  shtml += " <param name=\"wmode\" value=\"transparent\">";
  shtml += " <param name=\"quality\" value=\"high\">";
  if(subPaypal==""){
  shtml += " <embed src=\"../"+path+"/template/saraTaccardi.swf\" FlashVars=\"p="+thisPage+"&l="+lang+"\" quality=high wmode=transparent width=\"948\" height=\"658\" name=\"ESM\" ";
  }else{
  shtml += " <embed src=\"../"+path+"/template/saraTaccardi.swf\" FlashVars=\"p="+thisPage+"&l="+lang+"&s="+subPaypal+"\" quality=high wmode=transparent width=\"948\" height=\"658\" name=\"ESM\" ";
  }
  shtml += "  type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
  shtml += "     </object>";
  shtml += "</div>";
  
	var mv = document;
	var v = mv.getElementById("bgFlash");
	v.innerHTML = shtml;
}






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 fj_findObj(n, d) {
  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=fj_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function fj_showHideLayers() {
  var i,p,v,obj,args=fj_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=fj_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}





///////////////////////////funzione per fissare un bug su ie riguardo alla visibilità di layer nascosti
/*
function swapLayer( layer_name, pagina, lingua, file){
 
 
 	var mv = document;
	var layer = mv.getElementById(layer_name);
	//v.innerHTML = shtml;
 
 
 //setto in una var l'indirizzo principale per arrivare alle immagini del sito
  var trg1="template/images";
  
 // var layer = getListElemRefs( layer_name );
  var layer_text = layer.innerHTML;






//alert(layer_text);
  if( layer.css != null ){
  //  if( layer_text.search( /HELLO/ ) == -1 ){
	
	
	
	//se l'immagine nonè diversificate per lingua, si trova su /images e non gli passo due parametri
		if(lingua=="" && pagina ==""){
      layer.innerHTML = '<img src="'+trg1+'/'+file+'">';
		}else{
			
			
		}
    } else {
      layer.innerHTML = '';
    }
 }
}

*/

///////////////////////////////////////////////////////////////////////////////////////////////////




function mostra(div, stato){
	
	//fj_showHideLayers('htmlContent','','show');
	//stati: show  hide
	
	// con timeout
	
	window.setTimeout('fj_showHideLayers(\''+div+'\',\'\',\''+stato+'\')', 1000);
	
	//lancio le funzioni che attivanoi lo scrolling in questo punto anzichè internamente
	//alle pagine in questione per sinconizzare meglio gli eventi
	
	if(thisPage=="3" || thisPage=="5" || thisPage=="7" || (thisPage=="4" && subPaypal!="") || thisPage=="8"){
		
		
		//scrollIt('testo', 400, 'isScrolling')
		
		window.setTimeout('scrollIt(\'testo\', 400, \'isScrolling\')', 1500);
		
		
		
	}else if(thisPage=="1"){
		
		
		
		window.setTimeout('scrollIt(\'testo\', 375, \'isScrolling\')', 1500);
		
		
	
	}else if(thisPage=="2"){
		
		
		
		window.setTimeout('scrollIt(\'testoScroll\', 375, \'isScrolling\')', 1500);
		
	
	
	} else if(thisPage=="6"){
		
		
		
		window.setTimeout('scrollIt(\'testo\', 380, \'isScrolling\')', 1500);
		
		
	} 
	
	//senza timeout
	//fj_showHideLayers(div,'',stato);

}


//preloading immagini

function preload(path){
	
	

var s=thisPage;
var l=lang;
//home
if(s=="0"){
	
	MM_preloadImages('../'+path+'/template/images/'+s+'/t_newsletter.gif', '../template/images/'+s+'/'+l+'/t_discografia.gif', '../template/images/'+s+'/'+l+'/t_news.gif');
//


}//news
else if(s=="1"){
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_news.gif' );
	
}//tour
else if(s=="2"){
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_tour.gif' );
	
}//bio
else if(s=="3"){
	
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_bio.gif' );
	
}//esito paypal
else if(s=="4" && subPaypal!=""){

	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/titolo.gif' );

}
//links
else if(s=="5"){
	
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_links.gif' );
	
}//contatti
else if(s=="6"){
	
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_contatct.gif' );
	
}//disclaimer
else if(s=="7"){
	
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_disclaimer.gif' );
	
}//pagiona cancellazione newsletter
else if(s=="8"){
	
	MM_preloadImages('../'+path+'/template/images/arrow_down.gif', '../template/images/arrow_up.gif', '../template/images/'+s+'/'+l+'/t_newsletter.gif' );
	
}


}

