// script per nuovo tool di copertura
	var voce='null';
	var adsl='null';
	var last_case = 0;
	var content_empty='<img src="/img/v003/btn/btn_prosegui.png" alt="Prosegui" class="bot_prosegui_off" />';
	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';
		
		//$("input[type='text']").click(function(){$(this).css('border','1px solid #DCDCDC')});	
		
		$("#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_off_acquista.png' style='margin-top:10px' />")		}
		});

		$("#btn_contatti,#contattiFromImg").click(function(){
			if ($("#boxTc").is(":hidden")){
				$("#boxTc").slideDown();				
				$.scrollTo($("#boxTc"), 500 );
				$("#contatti").html("<img id='btn_acquista_off' src='/img/v002/btn/btn_contattaci_off.png' style='margin-top:10px' />")		}
		});

		$("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();
		 });


		 // risposta hai una linea telefonica
		$("input:radio[name='voce']").click(function () {
			voce = $(this).val();
			if ($(this).val()==1){
				$("select[name='OTHER_OLO_TEL_NAME']").val(["TELECOM ITALIA"]).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']").val(["TELECOM ITALIA / ALICE"]).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();
		});		
		
		$("._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
	
	/*
		* 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/gateway.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").show();	
				coverageCheck(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);
	
}

function coverageCheckByPhone(uriRequest){	
	var OtherOLOFlag	=$("input[name='OtherOLOFlag']").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 OtherOLOName	=$("input[name='OtherOLOName']").val();
	var directBuy		=$("input[name='directBuy']").val();	// acquisto diretto senza passare per la vetrina (0/1)
	var IPTV_CHECK		=$("input[name='IPTV_CHECK']").val();
	var CliPrefix		=$("input[name='CliPrefix']").val();
	var CliNumber		=$("input[name='CliNumber']").val();
	var Request_Code	=$("input[name='Request_Code']").val();
	var FOR_LINEA_DATI	=$("input[name='FOR_LINEA_DATI']").val();
	
	/* DEBUG
	alert("OtherOLOFlag: "+OtherOLOFlag+"\n");
	alert("Start_From: "+Start_From+"\n");
	alert("Start_From_Lna: "+Start_From_Lna+"\n");
	alert("OT: "+OT+"\n");
	alert("OA: "+OA+"\n");
	alert("OtherOLOName: "+OtherOLOName+"\n");
	alert("directBuy: "+directBuy+"\n");
	alert("IPTV_CHECK: "+IPTV_CHECK+"\n");
	alert("CliPrefix: "+CliPrefix+"\n");
	alert("CliNumber: "+CliNumber+"\n");
	alert("Request_Code: "+Request_Code+"\n");
	alert("FOR_LINEA_DATI: "+FOR_LINEA_DATI+"\n");
	*/
	$.ajax({		
   		type: "POST",
   		url: uriRequest,
   		data: "ajaxRequest=1&CliPrefix="+CliPrefix+"&CliNumber="+CliNumber+"&FOR_LINEA_DATI="+FOR_LINEA_DATI+"&Request_Code="+Request_Code+"&OtherOLOFlag="+OtherOLOFlag+"&Start_From="+Start_From+"&Start_From_Lna="+Start_From_Lna+"&IPTV_CHECK="+IPTV_CHECK+"&OT="+OT+"&OA="+OA+"&OtherOLOName="+OtherOLOName,
   		dataType: "text",
   		success: function(xml){
   			
   			$("#wait").hide();
   			eval(xml);	// esegui l'eval del js che mi viene restituito dall'ajax
   			if (resultCode!=2){ // chiedo il cli, la visualizzazione del box blocca la richiesta ajax
   				//alert("codice:"+resultCode+"\nredirect:"+redirect);
   				document.location=redirect;   		   				
   			}else{
   				//alert("copertura ok, redirect verso:"+redirect+", directBuy: "+directBuy);
   				
   				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 coverageCheck(uriRequest){	
	var StreetAddress	=$("input[name='StreetAddress']").val();
	var marker			=StreetAddress.indexOf(" ")
	var City			=$("input[name='City']").val();
	var AddressNum		=$("input[name='AddressNum']").val();
	var County			=StreetAddress.slice(0,marker); 
	var Province		=$("input[name='prov']").val();
	var Request_Code	=$("input[name='Request_Code']").val();
	var OtherOLOFlag	=$("input[name='OtherOLOFlag']").val();
	var Start_From		=$("input[name='Start_From']").val();
	var Start_From_Lna	=$("input[name='Start_From_Lna']").val();
	var PostalCode		=$("input[name='zip']").val();
	var OT				=$("input[name='OT']").val();	
	var OA				=$("input[name='OA']").val();	
	var OtherOLOName	=$("input[name='OtherOLOName']").val();
	var directBuy		=$("input[name='directBuy']").val();	// acquisto diretto senza passare per la vetrina (0/1)
	var FOR_LINEA_DATI	='Y';
	var IPTV_CHECK		=$("input[name='IPTV_CHECK']").val();
	StreetAddress=StreetAddress.substr(++marker,StreetAddress.length);
	$.ajax({		
   		type: "POST",
   		url: uriRequest,
   		data: "ajaxRequest=1&CLI_PREFIX=&CLI_NUMBER=&FOR_LINEA_DATI="+FOR_LINEA_DATI+"&StreetAddress="+StreetAddress+"&City="+City+"&AddressNum="+AddressNum+"&Province="+Province+"&PostalCode="+PostalCode+"&County="+County+"&Request_Code="+Request_Code+"&OtherOLOFlag="+OtherOLOFlag+"&Start_From="+Start_From+"&Start_From_Lna="+Start_From_Lna+"&IPTV_CHECK="+IPTV_CHECK+"&OT="+OT+"&OA="+OA+"&OtherOLOName="+OtherOLOName,
   		dataType: "text",
   		success: function(xml){
   			$("#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
   				//alert("codice:"+resultCode+"\nredirect:"+redirect);
   				$("#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{
   				//alert("copertura ok, redirect verso:"+redirect+", directBuy:"+directBuy);
   				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(){
	$("#tc_msg").text($("#level1").text());
	$("#boxAddress").show();
	$("#addressText").html('').hide();
	$("#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) {
			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");
			
		// 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]==7){
			if (!geolab && last_case!= 'xx')
				setTimeout('init(\''+geolab+'\');',500);
			else{				
				add_geolab();								
				geolab=false;
			}		
		}
		
		last_case = caso[voce][adsl][0];
		
		
		// chiamata ajax per upselling
		/*
		var startFrom=$("input[name='Start_From']").val();
		 $.ajax({
   			type: "GET",
   			url: "upselling_xml.php",
   			data: "StartFrom="+startFrom+"&voce="+voce+"&adsl="+adsl,
   			success: function(xml){
					var noentry = $(xml).find('noentry').text();
					if (noentry=='empty'){
						if (!$("#upselling").is(":hidden"))
							$("#upselling").slideUp("fast");
					}else{
						 var new_form=Array();
						 new_form['startFrom']= $(xml).find('StartFrom').text();
						 new_form['html']			= $(xml).find('html_code').text();
						 new_form['qo']				= $(xml).find('qo').text();
						 new_form['ot']				= $(xml).find('ot').text();
						 new_form['oa']				= $(xml).find('oa').text();
						 new_form['sel_tel']		= $(xml).find('sel_tel').text();
						 new_form['sel_adsl']		= $(xml).find('sel_adsl').text();
						 new_form['otherOLOname']	= $(xml).find('otherOLOname').text();
						 new_form['OtherOLOFlag']	= $(xml).find('OtherOLOFlag').text();
						 new_form['Request_Code']	= $(xml).find('Request_Code').text();
						 new_form['Start_From']		= $(xml).find('Start_From').text();
						 new_form['Start_From_Lna']	= $(xml).find('Start_From_Lna').text();
						 new_form['FOR_LINE_DATI']	= $(xml).find('FOR_LINE_DATI').text();

						$("#upselling").html(new_form['html']+'<a href="#" id="compra">compra</a>');
						$("#compra").click(function(){upselling(new_form)});

						if ($("#upselling").is(":hidden"))
							$("#upselling").slideDown("fast");
					}
   			}
 		});
		*/

	}
	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");
}
// fine script







// 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(){

  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;
}

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();
	}
}


// script.js

// ripulisce gli input del tc

/*
function clearInput(type,val){
		if(type == 'prefix'){
			if (val=='prefisso')ch().CliPrefix.value='';
		}
		else if(type =='number'){
			if (val=='numero')ch().CliNumber.value='';
		}
		else if(type =='StreetAddress'){
			if (val=='indirizzo')ch().StreetAddress.value='';
		}
		else if(type =='AddressNum'){
			if (val=='n. civico')ch().AddressNum.value='';
		}
		else if(type =='City'){
			if (val=='citta')ch().City.value='';
		}
		// pagine upgrade
		else if(type =='numero'){
			if (val=='numero')document.adsl.CLI_NUMBER.value='';
		}		
		else if(type =='prefisso'){
			if (val=='prefisso')document.adsl.CLI_PREFIX.value='';
		}
		else if(type =='accountNumber'){
			if (val=='numero cliente')document.adsl.accountNumber.value='';
		}
		else if(type =='email'){
			if (val=='e-mail')document.adsl.UserID.value='';
		}
		else if(type =='psw'){
			document.adsl.Password.type='password';
			document.adsl.Password.value='';
		}
}
*/
	
// 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(){

  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 clLayer(id){

	$(id).css({'visibility':'hidden'});

}


