function btnconferma()
{
var SCELTA=document.getElementById("SCELTA").value;
var valueSCELTA="";
if (SCELTA!="SCEGLIPERME")
	{
	if (SCELTA!="") valueSCELTA=document.getElementById("SEL"+SCELTA).value;
	if ((SCELTA=="")||(valueSCELTA==""))
		{alert("Scelta non valida");return}
	}
var marchio=( (SCELTA=="MARCHIO") ? valueSCELTA : "");	
var tipologia=( (SCELTA=="TIPOLOGIA") ? valueSCELTA : "");	

document.getElementById("attendereprego").style.display="";
document.getElementById("tastigenerale").style.display="none";
//document.getElementById("impixelattesa").style.display="none";
//document.getElementById("attenderenew").style.display="";
setTimeout("faipromo()",1)
}
function faipromo()
{
var SCELTA=document.getElementById("SCELTA").value;
var valueSCELTA="";
if ((SCELTA!="")&&(SCELTA!="SCEGLIPERME")) valueSCELTA=document.getElementById("SEL"+SCELTA).value;
var marchio=( (SCELTA=="MARCHIO") ? valueSCELTA : "");	
var tipologia=( (SCELTA=="TIPOLOGIA") ? valueSCELTA : "");	
var qrystring="";
var arrayrequest=String(document.getElementById("qrystring").value).split("&");
for(var k=0;k<arrayrequest.length;k++)
	{
	if(String(arrayrequest[k]).substr(0,5)!="passo")
		{qrystring+=arrayrequest[k]+"&";}
	}
qrystring+="passo=calc";
//var qrystring=String(document.getElementById("qrystring").value).replace("undefined","").replace("&passo=2&","&passo=calc&").replace("?passo=2&","?passo=calc&").replace("&passo=3&","&passo=calc&").replace("?passo=3&","?passo=calc&");
//alert(document.getElementById("qrystring").value+"\n\n"+qrystring+"\n&marchio="+marchio+"&tipologia="+tipologia+"&valuescelta="+valueSCELTA)
if(String(urlattuale).indexOf("displaywizard.asp")!=-1)
	{
	var requestel="";
	var arrayqrystr=String(qrystring).split("&");
	for(var i=0;i<arrayqrystr.length;i++)
		{
		if(String(arrayqrystr[i]).indexOf("marchio=")==-1 && String(arrayqrystr[i]).indexOf("tipologia=")==-1 && String(arrayqrystr[i]).indexOf("valuescelta=")==-1)
			{requestel+=arrayqrystr[i]+"&";}
		}
		requestel=String(requestel).substr(0,String(requestel).length-1);
		requestel=String(requestel).replace(/&/gi,"~").replace(/=/gi,"~")+"~marchio~"+marchio+"~tipologia~"+tipologia+"~valuescelta~"+valueSCELTA;
	//alert("3\n\n"+requestel);
	void wizard_ukc_form(requestwzpasso,requestel);
	}
else
	{
	document.location.href=urlattuale+"?"+qrystring+"&marchio="+marchio+"&tipologia="+tipologia+"&valuescelta="+valueSCELTA;
	}
}
function entrapwdesk()
{
if(String(document.getElementById("pwdexe").value).replace("undefined","")=="" || String(document.getElementById("pwdexe").value).length<4)
	{alert("Password non corretta!");return;}
//if(!confirm("Sei sicuro di voler entrare in PowerDesk?")) {return;}
document.getElementById("cod_cli_exe").value=document.getElementById("codcliexe").value;
document.getElementById("pwd").value=document.getElementById("pwdexe").value;
//alert(document.getElementById("cod_cli_exe").value+"___"+document.getElementById("pwdexe").value);
void verifica_tipo_user();
}
function videoplay()
{
try {
	mySwf_serv=document.getElementById("flashwizard");
	void mySwf_serv.Play();
	} 
catch(e) 
	{}
}
function videostop()
{
try 
	{
	mySwf_serv=document.getElementById("flashwizard");
	void mySwf_serv.Stop();
	} 
catch(e) 
	{}
}

function TestEndSwfmini()
{
try
 {
 mySwf_serv = window.document.getElementById("flashwizard");
 //ReadyState (get only) - 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete.
 //TotalFrames (get only) - Returns the total number of frames in the movie. This is not available until the movie has loaded. Wait for ReadyState = 4.
 //FrameNum (get or set) - The currently displayed frame of the movie. Setting this will advance or rewind the movie.
 var ReadyState=mySwf_serv.ReadyState;
 if ((endFlash<4) && (ReadyState==4))
  {
  var TotalFrames=mySwf_serv.TotalFrames;
  var FrameNum=mySwf_serv.FrameNum;
  //alert("ReadyState:"+ReadyState+"\nFrameNum:"+FrameNum+"\nTotalFrames:"+TotalFrames); 
  if (FrameNum >= (TotalFrames-1))
   {
   setTimeout("swf_avanti();",1500);
   endFlash=4;
   clearInterval(idsetInterval);
   }
  }
 }
catch(e)
 {
// alert(e.description);
 endFlash=4;
 clearInterval(idsetInterval);
 }
}
function swf_avanti()
{
if (String(serviziovis)=="0" || String(serviziovis)=="")
 {
 var newl=pathsrvpwdesk+"srvpdeskf_scopra_clienti.swf";
 mySwf_serv.LoadMovie(0, newl); 
 }
return true;
}
function onloadfilmatomini()
{
var ok=true;
endFlash=2;
try
 {
 mySwf_serv = window.document.getElementById("flashwizard");
 }
catch(e)
 {
 ok=false;
 }
if (ok) {idsetInterval=setInterval( TestEndSwfmini, 5000);}
}
