/*FUNZIONI GENERICHE UTILIZZABILI DA QUALSIASI PAGINA*/

function sendNews(lan){
	if (!lan) {lan='it';}
	nWidth=490;
	nHeight=450;
	window.open("/dyn/"+lan+"/popup/popSendNews.phtml?link="+escape(window.location.href),"WinPopUp","width="+nWidth+",height="+nHeight+",directories=no,toolbar=no,scrollbars=no,resizable=no,status=no");
}

function submitForm(button, form){
		button.disabled=true;
		form.submit();
}



/*FUNZIONI NON GENERICHE MA CONDIVISE DA DUE O PIU' PAGINE AVENTI SIMILE STRUTTURA*/
//Setta/resetta i flag dei consensi di MWOL
function pickConsensiMwol(bConsensoCondAcquisto, bConsensoDatiAcquisto, bConsensoDatiPubblicita) {
	// Abilitazione di iscrizione a MWOL
	  document.form_reg.tmpCOND_ACQUISTO[0].disabled=false;
	  document.form_reg.tmpCONSENSODIFFUSIONE[0].disabled=false;
	  document.form_reg.tmpMATERIALEINFORMATIVO[0].disabled=false;
	  document.form_reg.tmpCOND_ACQUISTO[1].disabled=false;
	  document.form_reg.tmpCONSENSODIFFUSIONE[1].disabled=false;
	  document.form_reg.tmpMATERIALEINFORMATIVO[1].disabled=false;	    							  
		//imposto i valori di default
	  document.form_reg.tmpCOND_ACQUISTO[0].checked=Boolean(bConsensoCondAcquisto);
	  document.form_reg.tmpCONSENSODIFFUSIONE[0].checked=Boolean(bConsensoDatiAcquisto);
	  document.form_reg.tmpMATERIALEINFORMATIVO[0].checked=Boolean(bConsensoDatiPubblicita);
	  document.form_reg.tmpCOND_ACQUISTO[1].checked=Boolean(!bConsensoCondAcquisto);
	  document.form_reg.tmpCONSENSODIFFUSIONE[1].checked=Boolean(!bConsensoDatiAcquisto);
	  document.form_reg.tmpMATERIALEINFORMATIVO[1].checked=Boolean(!bConsensoDatiPubblicita);
}

// Funzioni di apertura popup Emulatore i-mode
function popupEmu(filename){
	filepath = "/imode/it/emu/";
        if (filename=="popupEmuHome.phtml"){
	nWidth=732;
	nHeight=560;
      }else if (filename=="popupEmuTech.phtml"){
        nWidth=350;
        nHeight=632;
      }else{
        nWidth=800;
                nHeight=600;
      }
      var nXMax = screen.width;
        var nYMax = screen.height;
      var nXOffset = (nXMax - nWidth)/2;
        var nYOffset = (nYMax - nHeight)/2;
        window.open(filepath+filename,"emu","top="+nYOffset+",left="+nXOffset+", width="+nWidth+",height="+nHeight+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0");
    }


function GuidaConto() {
        win = window.open("guidaconto/guidaConto.html", "win", "height=600,width=700,top=50,left=50,toolbar=no,resizable=no,menubar=no,scrollbars=yes")
        if (win.window.focus) win.window.focus();
}

function flashGuidaConto()
{
        var flashmenu = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="660" height="1200" id="guidaConto_base" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="guidaConto_base.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="guidaConto_base.swf" quality="high" bgcolor="#ffffff" width="660" height="1200" name="guidaConto_base" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
        document.write(flashmenu);
}

