function startFrom(obj){
	var startsFroms = obj.split("|");
	$("input[name='Start_From']").val(startsFroms[0]);
	$("input[name='Start_From_back']").val(startsFroms[0]);
	$("input[name='Start_From_Lna']").val(startsFroms[1]);
}

	var notClick = true;

// script per nuovo tool di copertura
	var voce='null';
	var adsl='null';
	var last_case = 0;
	var content_empty='<div class="boxProsegui"><img src="/img/v003/btn/btn_prosegui.png" alt="Prosegui" class="bot_prosegui_off" /></div>';
	var xml_debug='';
	// varibili d'ambiente per geolab
	var geolab=true; // switch di controllo per caricare solo una volta il js 
	var local=false;      
	var provRic=false;
	var provFormatLong=true;
	var toMap = false;
	var elemTownRic = "City";
	var elemTown = "City";
	var elemAddress = "StreetAddress";
	var elemStreetType = "";
	var elemVillage="";
	var elemProv = "prov";
	var elemZip = "zip";
	// fine
		
	$(document).ready(function () {
		flash('','644','66','');
		// array per matrice valori usata dal gatway.php
		var olo = Array();
		olo['Telecom']	='TI';
		olo['Fastweb']	='OLO';
		olo['Libero']	='OLO';
		olo['Altro']	='OLO';
		olo['Tiscali']	='Tiscali';

		$("#case_content").html(content_empty);
		$("#compra").html("<img id='btn_acquista_off' src='/img/v003/btn/btn_prosegui.png' style='margin-top:10px' />");
		
		$("#btn_acquista,#compraFromImg").click(function(){
			if ($("#boxTc").is(":hidden")){
				$("#case_content").html(content_empty);
				$("#boxTc").slideDown();				
				ch().reset();
				$.scrollTo($("#boxTc"), 500 );
				$("#compra").html("<img id='btn_acquista_off' src='/img/v003/btn/btn_prosegui.png' style='margin-top:10px' />")		}
		});
		/*
		$("#compraFromImg").click(function(){
			$("#boxTc").slideDown('fast');	
			ch().reset();
			$("#compra").html("<img src='http://abbonati.tiscali.it/img/bt_acquista_grigio.gif' />")		
		});
		*/
		$("select[name='OTHER_OLO_TEL_NAME']").val(["-scelta voce-"]).attr("disabled","disabled");
		$("select[name='OTHER_OLO_ADSL_NAME']").val(["-scelta voce-"]).attr("disabled","disabled");

		 // gestione OLO voce
		 $("select[name='OTHER_OLO_TEL_NAME']").change(function (){
		 	var v = $("select[name='OTHER_OLO_TEL_NAME'] option:selected").val();
		 	$("input[name='OT']").val(olo[v]);
		 	voce=$(this).val();
		 	check();
		 });

		 // gestione OLO adsl
		 $("select[name='OTHER_OLO_ADSL_NAME']").change(function(){
		 	var v = $("select[name='OTHER_OLO_ADSL_NAME'] option:selected").val();
		 	$("input[name='OA']").val(olo[v]);
		 	adsl=$(this).val();
		 	check();
		 });


			if(notClick){
			 // risposta hai una linea telefonica
			$("input:radio[name='voce']").click(function () {
				voce = $(this).val();
				if ($(this).val()==1){
					$("select[name='OTHER_OLO_TEL_NAME']").removeAttr("disabled");
	
					var v = $("select[name='OTHER_OLO_TEL_NAME'] option:selected").val();
					$("input[name='OT']").val(olo[v]);
					voce=v;				
					
				} else {
					$("select[name='OTHER_OLO_TEL_NAME']").val(["- scelta operatore -"]).attr("disabled","disabled");
					$("input[name='OT']").val('');
				}
				check();
			});
	
			// risposta hai una adsl
			$("input:radio[name='adsl']").click(function () {
				adsl = $(this).val();
				if ($(this).val()==1){
					$("select[name='OTHER_OLO_ADSL_NAME']").removeAttr("disabled");			
					var v = $("select[name='OTHER_OLO_ADSL_NAME'] option:selected").val();
					$("input[name='OA']").val(olo[v]);
					adsl=v;
				}
					
					
				else {
					
					$("select[name='OTHER_OLO_ADSL_NAME']").val(["- scelta operatore -"]).attr("disabled","disabled");
					$("input[name='OA']").val('');
				}
				check();
			});	
		}
		else{
			voce = $("input:radio[name='voce']").val();
			check();
			adsl = $("input:radio[name='adsl']").val();
			check();
		}	
		
		//$("._verifica").click(submitForm);
			
	});

	
	
// inizio funzioni 
function redBorderRemove(e){
		e.style.border='1px solid #DCDCDC';
	}
function submitForm(id){	// id serve per decidere quali campi inseriti dall'utente controllare
	uChoice("1");
	
	/*
		* attenzione !! questa URI viene usata anche dal modulo ajax
		* se sostituite la action con una URL diversa avremo il problema del cross domanin per ajax.
	*/
	var actionUri = '/inc/coverage_check/callGateway.php';
	
	formCase.oloSetFlag(caso[voce][adsl][1]);
	formCase[caso[voce][adsl][0]]();
	//setTimeout("ch().submit()",500);
	trim_space('CliPrefix');
	trim_space('CliNumber');
	
	if ($("#cliBox").is(":visible")){	// verifico i campi cli e prefisso solo se sono visibili
		if((ch().CliPrefix.value == "") || (ch().CliNumber.value == "")){
			errore(id);	
			return false;	
		}else if((ch().CliPrefix.value.match(/\D/) ||ch().CliNumber.value.match(/\D/)) ){
			errore(id);	
			return false;
		}
	}
	
	if ($("#cliBox").is(":hidden")){
		if (id==3 || id == 1){
			// verifica dell'indirizzo						
			if (ch().StreetAddress.value == "" || ch().AddressNum.value=='' || ch().City.value==''){
				errore(id);	
				return false;		
			}
			// chiamata ajax per controllo di primo livello	
//			$("#wait").css({'padding-top':'120px','padding-left':'120px'});	
			//$("#wait").show();	
			//coverageCheck(actionUri);		
			coverageCheck(1,actionUri);		
			return;
		}		
	}
	if(id == 7){
//		$("#wait").css({'padding-top':'120px','padding-left':'120px'});	
//		$("#wait").show();	
		//coverageCheckPhoneAddr(actionUri);					
		coverageCheck(3,actionUri);					
		return;			
	}	
	
	//ch().action=actionUri;
	setNumber();
	var cBodyH = document.getElementById("cBody").offsetHeight;
	var boxTcH= document.getElementById("boxTc").offsetHeight;
	var hFlash = 100;
	boxTcHPad  = ((boxTcH-hFlash)/2);	
	boxTcH	   = (boxTcH - boxTcHPad);	 
	//$("body").css({'background':'#FFF'});
	$("#OTHER_OLO_TEL_NAME,#OTHER_OLO_ADSL_NAME").hide();
	$("#container").css({'visibility':'visible','background':'#FFF','height':cBodyH});	
	$("#layer").css({'visibility':'visible','height':boxTcH-3,'padding-top':boxTcHPad});
	//setTimeout("$(\"#checkForm\").submit();",1000);
	
	//coverageCheckByPhone(actionUri);
	coverageCheck(2,actionUri);
	
}

/* 	
	uriRequest 	: gatewayCall
	type		: 1 Covered check base indirizzo
	type		: 2 Covered check base prefisso e numero
	type		: 3 Covered check base prefisso e numero + indirizzo	
*/
function coverageCheck(type,uriRequest){
        var template        =$("input[name='template']").val();
	var ajaxRequest     =$("input[name='ajaxRequest']").val();
	var debug    	 	=$("input[name='debug']").val();
	var IPTV_CHECK		=$("input[name='IPTV_CHECK']").val();
	var OtherOLOFlag	=$("input[name='OtherOLOFlag']").val();
	var OtherOLOName	=$("input[name='OtherOLOName']").val();
	
	var OTHER_OLO_TEL_NAME 	= $("select[name='OTHER_OLO_TEL_NAME'] option:selected").val();
	var OTHER_OLO_ADSL_NAME = $("select[name='OTHER_OLO_ADSL_NAME'] option:selected").val();
	
	var Request_Code	=$("input[name='Request_Code']").val();
	var Start_From		=$("input[name='Start_From']").val();
	var Start_From_Lna	=$("input[name='Start_From_Lna']").val();
	var OT				=$("input[name='OT']").val();	
	var OA				=$("input[name='OA']").val();
	var directBuy		=$("input[name='directBuy']").val();	// acquisto diretto senza passare per la vetrina (0/1)
	var promoWe			=$("input[name='promoWe']").val();	// promo week end
	var brand			=$("input[name='brand']").val();	// promo week end
	if(type != 1){
		var CliPrefix		=$("input[name='CliPrefix']").val();
		var CliNumber		=$("input[name='CliNumber']").val();
		var CLI="&CliPrefix="+CliPrefix+"&CliNumber="+CliNumber;
	}
	if(type == 1){
		var FOR_LINEA_DATI	='Y';
		var CLI='';		
	}
	if(type == 2){
		var FOR_LINEA_DATI	=$("input[name='FOR_LINEA_DATI']").val();
	}	
	if(type == 3){
		var FOR_LINEA_DATI	=$("input[name='FOR_LINEA_DATI']").val();
		(FOR_LINEA_DATI == '')?FOR_LINEA_DATI='N':FOR_LINEA_DATI=FOR_LINEA_DATI;

	}
	
	if(type !=2){
		var StreetAddress	=$("input[name='StreetAddress']").val();
		var marker			=StreetAddress.indexOf(" ")
		var City			=$("input[name='City']").val();
		var AddressNum		=$("input[name='AddressNum']").val();
		var County			=(marker!=-1)?StreetAddress.slice(0,marker):'VIA'; 
		var Province		=$("input[name='prov']").val();
		var PostalCode		=$("input[name='zip']").val();
		
		StreetAddress=StreetAddress.substr(++marker,StreetAddress.length);
	}
	
	if(type != 2){
		var data ="&StreetAddress="+StreetAddress+"&City="+City+"&AddressNum="+AddressNum+"&Province="+Province+"&PostalCode="+PostalCode+"&County="+County;
	}

	$.ajax({
		type: "POST",
   		url: uriRequest,
   		//data:"ajaxRequest="+ajaxRequest+"&debug="+debug+CLI+"&FOR_LINEA_DATI="+FOR_LINEA_DATI+"&Request_Code="+Request_Code+"&IPTV_CHECK="+IPTV_CHECK+"&OT="+OT+"&OA="+OA+"&OtherOLOFlag="+OtherOLOFlag+"&Start_From="+Start_From+"&Start_From_Lna="+Start_From_Lna+"&OtherOLOName="+OtherOLOName+data+"&brand="+brand+"&promoWe="+promoWe,
		data:"ajaxRequest="+ajaxRequest+"&template="+template+"&debug="+debug+CLI+"&FOR_LINEA_DATI="+FOR_LINEA_DATI+"&Request_Code="+Request_Code+"&IPTV_CHECK="+IPTV_CHECK+"&OT="+OT+"&OA="+OA+"&OtherOLOFlag="+OtherOLOFlag+"&Start_From="+Start_From+"&Start_From_Lna="+Start_From_Lna+"&OtherOLOName="+OtherOLOName+data+"&promoWe="+promoWe+"&OTHER_OLO_TEL_NAME="+OTHER_OLO_TEL_NAME+"&OTHER_OLO_ADSL_NAME="+OTHER_OLO_ADSL_NAME,
   		dataType: "text",
   		success: function(xml){
   			if(debug == 1){
   				$("#boxTc").html(xml);
   			}
   			else{
   				$("#wait").hide();		
   				eval(xml);	// esegui l'eval del js che mi viene restituito dall'ajax      	
	   			$('#xml').text(xml_debug);
	   			if (resultCode!=2){ // chiedo il cli, la visualizzazione del box blocca la richiesta ajax
	   				if(type == 1){
	   					$("#tc_msg").html($("#level2").html());
	   					$("#boxAddress").hide();
	   					$("#addressText").html('<b>'+County+' '+StreetAddress+', '+AddressNum+' - '+PostalCode+' '+City+' ('+Province+')</b> <a href="javascript:modifyAddress()">modifica</a>').show();   				
	   					$("#cliBox").fadeIn('fast');	   				
	   				}
	   				else if(type == 2) document.location=redirect;
	   				else if(type == 3){
	   					$("#boxAddressOlo").hide(); 
	   					$("div#level3").removeClass('dN');	
	   					$("#addressText").html('<b>'+County+' '+StreetAddress+', '+AddressNum+' - '+PostalCode+' '+City+' ('+Province+') - '+CliPrefix+' / '+CliNumber+' </b> <a href="javascript:modifyAddressOlo(1)">modifica</a>').show();   				
	   					SetCookie('prefissolinea',CliPrefix,'','/','tiscali.it','');
						SetCookie('numerolinea',CliNumber,'','/','tiscali.it','');
						
						$("input[name='CliPrefix']").val('');
	   					$("input[name='CliNumber']").val('');
	   					$("input[name='City']").val('');
	   					$("input[name='StreetAddress']").val('');
	   					$("input[name='AddressNum']").val('');
	   					$("input[name='zip']").val('');
	   					$("input[name='prov']").val('');
	   				
	   					$("input[name='FOR_LINEA_DATI']").val('Y');
	   					$("#cliBox").fadeIn('fast');
	   					
	   				}
	   				
	   			}
	   			else{
	   				/*
	   					passaatiscali contiene l'ID dell'insieme di prodotti da visualizzare
	   					se non � presente viene verificato il directBuy per il salto diretto
	   					su selfcare
	   				*/
	   				if(passaatiscali != 0){
	   					redirect = redirect+'sp/'+passaatiscali;
	   				}else{
	   					redirect = (directBuy=='1') ? redirect+'?directBuy=1':redirect;
	   				}
	   				
	   				if(directBuy != 0){
		   				$.ajax({		
					   		type: "GET",
					   		url: redirect,
					   		dataType: "html",
					   		success: function(html){
					   			$("#directBuy").html(html);
					   			document.getElementById('adslDirectBuy').submit();		   			
					   		}
					   	});
	   				}
	   				else document.location=redirect;	
	   			}	   				
   			}
   		}
	}); 
	
}

function modifyAddress(type){
	$("#tc_msg").text($("#level1").text());
	$("#boxAddress").show();
	$("#addressText").html('').hide();
	if(type){
		$("#cliBox").show();	
	}else{
		$("#cliBox").hide();
	}	
}
function modifyAddressOlo(type){
	var prefissolinea 	= GetCookie("prefissolinea");
	var numerolinea 	= GetCookie("numerolinea");
	var AddressNum 		= GetCookie("AddressNum");
	var StreetAddress 	= GetCookie("StreetAddress");
	var County 			= GetCookie("County");
	var City 			= GetCookie("City");
	var PostalCode 		= GetCookie("PostalCode");
	var Province 		= GetCookie("Province");
	
	$("input[name='FOR_LINEA_DATI']").val('N');
	$("#level3").addClass('dN');
	$("#tc_msg").text($("#level1").text());
	$("#boxAddressOlo").show();
	$("#addressText").html('').hide();
	$("input[name='CliPrefix']").val(prefissolinea);
   	$("input[name='CliNumber']").val(numerolinea);
   	
   	$("input[name='City']").val(City);
   	$("input[name='StreetAddress']").val(County+' '+StreetAddress);
   	$("input[name='AddressNum']").val(AddressNum);
   	$("input[name='zip']").val(PostalCode);
   	$("input[name='prov']").val(Province);
   	
   	
	if(type){
		$("#cliBox").show();	
	}else{
		$("#cliBox").hide();
	}	
}

function trim_space(element){
	var _value=$("input[name='"+element+"']").val();
	$("input[name='"+element+"']").val( _value.replace(/\s/g,''));
}

// messaggio di errore
function errore(id){
	var msg = new Array(7)
	msg[3] = msg[7] ="Verifica di aver compilato correttamente i campi evidenziati in rosso.";
	msg[1] = msg[2] ="Verifica di aver compilato correttamente i campi evidenziati in rosso.";
	
	$("#msg_errore").html(msg[id]).fadeIn("fast");
	//$("input[type='text']").not("[name='zip'],[name='prov']").css('border','1px solid #f00');			
	$("input[type='text']").css('border','1px solid #f00');			
	
	setTimeout('$("#msg_errore").fadeOut("slow");',7000);
	//setTimeout('$("input[type=\'text\']").css(\'border\',\'\');',15000);
}

/*
function border_color(item){
	$(item).css("border","");
}
*/
		var formCase = new Object();
		formCase[1]=function(){
			$("input[name='FOR_LINEA_DATI']").val('Y');
			var j = $("input[name='Start_From_Lna']").val();
			$("input[name='Start_From']").val(j);
		};
		formCase[2]=function(){};
		formCase[3]=function(){
			$("input[name='FOR_LINEA_DATI']").val('Y');
			var j = $("input[name='Start_From_Lna']").val();
			$("input[name='Start_From']").val(j);
			var oloTel 	= $("select[name='OTHER_OLO_TEL_NAME'] option:selected").val();
			var oloAdsl = $("select[name='OTHER_OLO_ADSL_NAME'] option:selected").val();
			var oloName	=(oloTel=='scelta')?oloAdsl:oloTel; 
			$("input[name='OtherOLOName']").val(oloName);   
		};
		formCase[4]=function(){};
		formCase[5]=function(){};
		formCase[6]=function(){};
		formCase[7]=function(){
			var oloTel 	= $("select[name='OTHER_OLO_TEL_NAME'] option:selected").val();
			var oloAdsl = $("select[name='OTHER_OLO_ADSL_NAME'] option:selected").val();
			var oloName	=(oloTel=='scelta')?oloAdsl:oloTel; 
			$("input[name='OtherOLOName']").val(oloName);   
		};
		formCase.oloSetFlag=function(c){
			if (c) $("input[name='OtherOLOFlag']").val('Yes'); 
			else $("input[name='OtherOLOFlag']").val('No'); 
		}
			
	function add_geolab(){
		$("head").append("<script type=\"text/javascript\" src=\"/inc/script/rapidaddressing.js\"></script>");
		setTimeout('init(\''+geolab+'\');',500);
	}
	
	function check(){
		if (voce=='null' || adsl=='null' || caso[voce][adsl]==undefined) {
			if (caso[voce]==undefined){
				caso[voce]=0;
			}
			last_case=emptyCase();
			return false;	// questa combinazione non esiste
		}				
		if (last_case == caso[voce][adsl][0]) return false;			// il nuovo caso � uguale al vecchio.
				
		
		var _url="/inc/tc/"+caso[voce][adsl][0]+".html?"+Math.random()*100000;
		// cancelliamo tutti i cookie perch� l'utente ha cambiato le ipostazioni del form
			Delete_Cookie("StreetAddress","/","tiscali.it");
			Delete_Cookie("County","/","tiscali.it");
			Delete_Cookie("City","/","tiscali.it");
			Delete_Cookie("AddressNum","/","tiscali.it");
			Delete_Cookie("PostalCode","/","tiscali.it");
			Delete_Cookie("Province","/","tiscali.it");	
			Delete_Cookie("CLI_NUMBER","/","tiscali.it");	
			Delete_Cookie("CLI_PREFIX","/","tiscali.it");	
			Delete_Cookie("prefisso","/","tiscali.it");	
			Delete_Cookie("numero","/","tiscali.it");
			Delete_Cookie("prefissolinea","/","tiscali.it");	
			Delete_Cookie("numerolinea","/","tiscali.it");
			
		// ripristino il valore di start from quando l'utente modifica le scelte
		$("input[name='Start_From']").val($("input[name='Start_From_back']").val());
					   			
		$("#case_content").load(_url);
		$("#case_content").slideDown('fast');
		
		// per i casi 1,3 e 7 carico la libreria geolab		
		if (caso[voce][adsl][0]==1 || caso[voce][adsl][0]==3 || caso[voce][adsl][0]==6 || caso[voce][adsl][0]==7){
			if (!geolab && last_case!= 'xx')
				setTimeout('init(\''+geolab+'\');',500);
			else{				
				add_geolab();								
				geolab=false;
			}		
		}
		
		last_case = caso[voce][adsl][0];		
	}
	function emptyCase(){
		$("input[type='text']").css("border","1px solid #e1e1e1");
		$("#case_content").html(content_empty);
		return 'xx';
	}
	
	function upselling(new_form){
		alert (new_form['startFrom']);
	}

	window.onunload=function(){
		void(0);
	}

function _clear(element,label){
	if ($(element).val()==label)
		$(element).val('');
	else if ($(element).val()=='')
		$(element).val(label);	
	$(element).css("border","1px solid #e1e1e1");
}


// setta il cookie del numero di telefono per le pagine callback
function setNumber() {
var prefix = ch().CliPrefix.value;
var num = ch().CliNumber.value;
SetCookie('prefisso',prefix,'','/','tiscali.it','');
SetCookie('numero',num,'','/','tiscali.it','');
}
// passa il cookie del numero di telefono al form del callback
function SubmitForm(){
uChoice("1");
  if (document.callback.num_tel.value == ""){
    alert ("Attenzione\nVerifica di aver inserito il numero telefonico.");
	}
	else {
	makeActionCb ();
	submit_utente=true;
	var num = GetCookie("numero");
	var pref = GetCookie("prefisso");
	document.callback.number.value = num;
	document.callback.prefix.value = pref;
	document.callback.submit();
	DeleteCookie("numero");
	DeleteCookie("prefisso");
  }
}

/* nasconde layer e container al rilascio della pagina */
function empty(){
		$("#container").css({'visibility':'hidden'});
		$("#layer").css({'visibility':'hidden'});		
};




function frm(d){
	return document.getElementById(d);
}

function ch(){
	return (document.getElementById('checkForm'))?document.getElementById('checkForm'):false;
}
	
// setta il cookie del numero di telefono per le pagine callback
function setNumber() {
var prefix = ch().CliPrefix.value;
var num = ch().CliNumber.value;
SetCookie('prefisso',prefix,'','/','tiscali.it','');
SetCookie('numero',num,'','/','tiscali.it','');
}
// passa il cookie del numero di telefono al form del callback
function SubmitForm(){
uChoice("1");
  if (document.callback.num_tel.value == ""){
    alert ("Attenzione\nVerifica di aver inserito il numero telefonico.");
	}
	else {
	makeActionCb ();
	submit_utente=true;
	var num = GetCookie("numero");
	var pref = GetCookie("prefisso");
	document.callback.number.value = num;
	document.callback.prefix.value = pref;
	document.callback.submit();
	DeleteCookie("numero");
	DeleteCookie("prefisso");
	
  }
}

function flash(percorso,width,height,id)
{
	var flashvars = {};
	flashvars.labelString = "stiamo elaborando la tua richiesta";
	var _params = {};
	var _attributes = {};
	_attributes.id = "flashID";
	//swfobject.embedSWF("/img/flash/loading.swf", "myAlternativeContent", "644", "66", "9.0.0", false, flashvars, _params, _attributes);	
} 



// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// this fixes an issue with the old method, ambiguous values
// with this test document.cookie.indexOf( name + "=" );
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

/* show layers */
function showLayer(u){
	var _url=u+"?"+Math.random()*100000;
	$("#content_prezzi").load(_url);
	$("#content_prezzi").css({'visibility':'visible','position':'absolute','top':'55px','left':'60px'});

}

function showRisp(u){
	var _url=u+"?"+Math.random()*100000;
	$("#risp").css({'visibility':'visible','position':'absolute','top':'50px','left':'320px'})
	$("#content_risp").css({'visibility':'visible'});
	$("#content_risp").load(_url);
}

/* MOSTRA IL FLASH DI ATTESA CHECK COPERTURA */
function loadFlash(f,w,h){
	document.write('<object width="'+w+'" height="'+h+'"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+f+'" /><param name="FlashVars" value="labelString=stiamo elaborando la tua richiesta"/><embed src="'+f+'" quality="high" bgcolor="#FFFFFF" allowScriptAccess="always" type="application/x-shockwave-flash" allowFullScreen="false" width="'+w+'" height="'+h+'" flashvars="labelString=stiamo elaborando la tua richiesta" /></object>');
}

function ch(){
	return (document.getElementById('checkForm'))?document.getElementById('checkForm'):false;
}

function tdc(){
	if((ch().CliPrefix.value == "") || (ch().CliNumber.value == "")){
		errore();
	}
	else{
		submit_utente=true;
		var prefix = ch().CliPrefix.value;
		var num = ch().CliNumber.value;
		SetCookie('prefisso',prefix,'','/','tiscali.it','');
		SetCookie('numero',num,'','/','tiscali.it','');
		ch().submit();
	}
}
