

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function initBlue(p){
	if(p!=''){
	var toBeHighLighted=findObj(p);
	toBeHighLighted.className="m_prod_on";
	}
	
}
function initGreen(p){
	if(p!=''){
	var toBeHighLighted=findObj(p);
	toBeHighLighted.className="m_chi_on";
	}
	
}
function initGen(p){
	if(p!=''){
	var toBeHighLighted=findObj(p);
	toBeHighLighted.className="m_g_on";
	}
	
}
////

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_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_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 SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("elencoFaq").getElementsByTagName("div");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu_faq")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
/*/////*/
var arrayMenu=Array();
arrayMenu[0]="italia";
arrayMenu[1]="abruzzo";
arrayMenu[2]="aosta";
arrayMenu[3]="basilicata";
arrayMenu[4]="calabria";
arrayMenu[5]="campania";
arrayMenu[6]="emilia";
arrayMenu[7]="friuli";
arrayMenu[8]="lazio";
arrayMenu[9]="liguria";
arrayMenu[10]="lombardia";
arrayMenu[11]="marche";
arrayMenu[12]="molise";
arrayMenu[13]="piemonte";
arrayMenu[14]="puglia";
arrayMenu[15]="sardegna";
arrayMenu[16]="sicilia";
arrayMenu[17]="toscana";
arrayMenu[18]="trentino";
arrayMenu[19]="umbria";
arrayMenu[20]="veneto";




function updateStatus(reg){
	
	var toBeShown=findObj(reg);

	hideAll(reg)
	toBeShown.style.display="block";
}
function hideAll(reg){
	
	for (i=0;i<arrayMenu.length;i++){
		//if(reg!=arrayMenu[i]){
			var toTurnOff=findObj(arrayMenu[i]);
			if(toTurnOff!=undefined){
				toTurnOff.style.display="none";	
				//alert('hideAll  '+arrayMenu[i]);
			};
			
	//	}
	}
	
}
function thisMovie(movieName) {
		var isIE = navigator.appName.indexOf("Microsoft") != -1;
		return (isIE) ? window[movieName] : document[movieName];
}
function makeCall(reg) {
	var flashMovie=thisMovie("fl_movie");
	if(flashMovie!=undefined){
		flashMovie.asFunc(reg);
			/*alert(thisMovie("fl_movie"));*/
	}else{
		updateStatus(reg)
			
	}
}

/* DESIDERI */
function get_random()
{
    var ranNum= Math.floor(Math.random()*7);
    return ranNum;
}

function getanEvent()
{
   var whichEvent=get_random();

    var img1=new Array(7)
    img1[0]="prodotti_desideri01.jpg";
    img1[1]="prodotti_desideri02.jpg";
    img1[2]="prodotti_desideri03.jpg";
    img1[3]="prodotti_desideri04.jpg";
    img1[4]="prodotti_desideri05.jpg";;
	img1[5]="prodotti_desideri06.jpg";
	img1[6]="prodotti_desideri07.jpg";
	
	var links=new Array(7)
    links[0]="faq.htm";
    links[1]="servizi_viaggio.htm";
    links[2]="servizi_moto.htm";
    links[3]="servizi_sposi.htm";;
    links[4]="servizi_arredamento.htm";
	links[5]="servizi_casa.htm";
	links[6]="servizi_barca.htm";

	var testo1=new Array(7)
    testo1[0]="La tua nuova auto, il camper per le tue vacanze, l'auto per il 'nipotino' neopatentato, i veicoli in leasing per l'azienda. ";
    testo1[1]="Il viaggio che hai sempre sognato? Se non vuoi più aspettare, Figenpa ti offre soluzioni di finanziamento comode, convenienti e sicure.";
    testo1[2]="La moto &eacute; il tuo sogno nel cassetto?<br /> I tuoi figli o i tuoi nipoti sono pronti per un motorino nuovo fiammante? ";
    testo1[3]="La giornata più bella della tua vita deve essere veramente speciale?<br /> Pensi che tuo figlio o tuo nipote meriti un matrimonio da non dimenticare? ";
    testo1[4]="La casa è il tuo mondo e vuoi avere la libertà di rinnovarla e di farla diventare ancora più comoda e bella?";
	testo1[5]="La tua casa per la vita?<br /> Il 'rifugio' ideale per le tue vacanze? <br />Un investimento per il futuro? ";
	testo1[6]="Vuoi vivere in libert&aacute; la tua passione per il mare?<br /> Hai sempre desiderato una barca tutta tua?<br /> Vuoi goderti la tua pensione 'sulla  cresta dell'onda'? ";
	
	var testo2=new Array(7)
    testo2[0]="Ecco tutte soluzioni Figenpa per l'acquisto o la locazione del nuovo o dell'usato.";
    testo2[1]="Prodotti progettati &ldquo;su misura&rdquo; per aprirti nuovi orizzonti.";
    testo2[2]="Figenpa ti offre le soluzioni più comode, sicure e convenienti per cominciare subito a muoverti su due ruote.";
    testo2[3]="Figenpa ha preparato per te le soluzioni pensate per ogni esigenza di organizzazione del matrimonio.";
    testo2[4]="Con Figenpa puoi. Ecco le soluzioni pi&uacute; convenienti per rinnovare il tuo arredamento e la tua 'tecnologia'.";
	testo2[5]="Figenpa ti offre la pi&uacute; ampia gamma di mutui a tasso fisso, variabile o misto progettati specificamente per ogni tipologia di investimento immobiliare.";
	testo2[6]="Con Figenpa realizzare il tuo sogno non &eacute; impossibile. <br />Ecco tutte le soluzioni per l'acquisto o la locazione del nuovo o dell'usato.";
	
	
	var testo='';	
	testo+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	testo+='<tr>';
	testo+='<td background="immagini/'+img1[whichEvent]+'" class="cellalink">	</tr>';
	testo+='</table>';
	
	testo+='<br />';
	testo+='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	testo+='<tr> <td width="280"><p class="testo_generico_top">'+testo1[whichEvent]+'</p></td>';
	testo+='<td width="25">&nbsp;</td>';
	testo+='<td><p class="testo_generico_top">'+testo2[whichEvent]+'</p></td>';
	testo+='</tr><tr>';
	testo+='<td height="5">&nbsp;</td>';
	testo+='<td>&nbsp;</td><td>&nbsp;</td></tr>';
	testo+='<tr>';
	testo+='<td><a href="'+links[whichEvent]+'">scopri di pi&uacute;</a></td>';
	testo+='<td>&nbsp;</td>';
	testo+=' <td>&nbsp;</td>';
	testo+='</tr></table>';
	 
	document.writeln(testo);

  }