function NomeHotel(lingua,form){
	switch(lingua){
		case'it':
			inserire_nome = "Inserire il nome dell'hotel";
		break;
		case'en':
			inserire_nome = "Inserire il nome dell'hotel";
		break;
		case'fr':
			inserire_nome = "Inserire il nome dell'hotel";
		break;
		case'de':
			inserire_nome = "Inserire il nome dell'hotel";
		break;
	}
	if( (eval("document."+form+".ric_nome_hotel.value")=="") || (eval("document."+form+".ric_nome_hotel.value")=="nome hotel") ) {
		alert(inserire_nome);
		eval("document."+form+".ric_nome_hotel.value='';");
		eval("document."+form+".ric_nome_hotel.focus()");
		return false;
	}

	eval("document."+form+".submit()");
	return true;
}

function mostraDiv(div){
	var nome_div = document.getElementById(div);
	nome_div.style.display = 'block';
}

function nascondiDiv(div){
	var nome_div = document.getElementById(div);
	nome_div.style.display = 'none';
}

function mostra_nascondiDiv(div){
	var nome_div = document.getElementById(div);
	if(nome_div.style.display =='block'){
		nome_div.style.display = 'none';
	}else{
		nome_div.style.display = 'block';
	}
}

function bookmarksite(title, url){
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

function CambioSfondo(div,nomeClasse){
	var nome_div = document.getElementById(div);
	nome_div.className=nomeClasse;
}

/** Controlla la correttezza dell'indirizzo email.
	Forse si pu� sostituire con una funzione PHP per il controllo delle expr regolari, tipo eregi(). */
function checkMail(mail){
	var iAtPosition;
	var iDotPosition;

	iAtPosition = mail.indexOf("@");
	if (iAtPosition < 1 || iAtPosition == mail.length)
		return false;
	iDotPosition = mail.indexOf('.', iAtPosition);
	if (iDotPosition < 0)
		return false;
	return true;
}	// checkMail()



// FUNZIONE PER DATE - Inizio
	//La funzione verifica il formato del campo data contenuto nel form
	// Parametri: campo --> nome campo data
	//            form  --> nome form 
	//            lingua  --> alert in lingua 
	//            campo_focus  --> nome del campo su cui fare il focus 
function Check_dmg(campo,form,lingua,campo_focus) {
	var valore,giorno,barra1,mese,barra2,anno,str_mesi,str_giorni,pos_mese,max_giorno_mese;
	str_mesi   = '01*02*03*04*05*06*07*08*09*10*11*12*';
	str_giorni = '31*29*31*30*31*30*31*31*30*31*30*31*';
	valore = eval(form+"."+campo+".value");
	// gg/mm/aaaa
	// 0123456789
	// il secondo parametro di substring indica la posizione +1 dell'ultimo carattere da selezionare
	giorno = valore.substring(0,2);
	barra1 = valore.substring(2,3);
	mese = valore.substring(3,5);
	barra2 = valore.substring(5,6);
	anno = valore.substring(6,10);

	switch(lingua){
		case'it':
			data_arrivo_valori_alert = 'Data '+valore+' non valida. Formato gg/mm/aaaa';
		break;
		case'en':
			data_arrivo_valori_alert = 'Date '+valore+' is wrong. Format gg/mm/aaaa';
		break;
		case'fr':
			data_arrivo_valori_alert = 'Date '+valore+' est mal. Format gg/mm/aaaa';
		break;
		case'de':
			data_arrivo_valori_alert = 'Datum '+valore+' ung�ltig. Format gg/mm/aaaa';
		break;
	}

	if (isNaN(giorno)){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}else if(giorno <1 || giorno >31){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}
		
/*	if(barra1 != '/' || barra1 != '-'){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}
*/	if (isNaN(mese)){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}else if(mese <1 || mese >12){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}else{
		pos_mese = str_mesi.indexOf(mese+'*');
		max_giorno_mese = str_giorni.substring(pos_mese,pos_mese + 2);
		if (giorno > max_giorno_mese){
			alert (data_arrivo_valori_alert);
			eval("document."+form+"."+campo_focus+".focus()");
			return false;
		}
	}

/*	if(barra2 != '/' || barra2 != '-'){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}
*/		
	if (isNaN(anno)){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}else if(anno < 1900){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}else if(valore.length != 10){
		alert (data_arrivo_valori_alert);
		eval("document."+form+"."+campo_focus+".focus()");
		return false;
	}

	// Gestione bisestile
	if (mese === '02'){
		if (eBisestile(anno)){
			if (giorno > 29){
				alert (data_arrivo_valori_alert);
				eval("document."+form+"."+campo_focus+".focus()");
				return false;
			}
		}else if (giorno > 28){
			alert (data_arrivo_valori_alert);
			eval("document."+form+"."+campo_focus+".focus()");
			return false;
		}
	}
	return true;
}	

/*
L'anno bisestile cade normalmente ogni quattro anni, 
Il problema di questo 'strano' 29 febbraio nasce dal calendario gregoriano, introdotto nel 1582, 
che fissa un anno bisestile ogni quattro, ma prevede anche che la regola non si applichi agli anni divisibili per 100,
esclusi quelli divisibili per 400. Non sono quindi stati bisestili il 1700, il 1800 e il 1900, mentre lo � stato il 1600 e lo � il 2000.
La fonte di potenziali problemi sta nel fatto che non tutti i programmatori possono aver conosciuto nel dettaglio 
la clausola del 'bisesto se divisibile per 400' e che quindi abbiano considerato il 2000 'divisibile per 100' e quindi con un febbraio da 28 giorni.
*/
function eBisestile(anno){ 
	if(anno%4 == 0 && (anno%100!=0 || anno%400==0)){
	//	alert (anno + ' bisestile');
		return true; 
	}else {
	//	alert (anno + ' NON bisestile');
		return false; 
	}
}


function VerificaNewsletter(lingua,form){
	var error = '';

/*	switch(lingua){
		case'it':*/
			indirizzo_email = "Specificare l'indirizzo email.";
			indirizzo_email_sbagliato = "L'indirizzo email non � stato digitato correttamente.";
			riconferma_email="Inserisci l'indirizzo email di conferma.";
			riconferma_non_uguale="Le due mail non coincidono.";
			autorizzo = "Autorizzare al trattamento dei dati.";
/*		break;
		case'en':
			indirizzo_email = 'Specify email address';
			indirizzo_email_sbagliato = 'The Email address is not correct';
			autorizzo = "To authorize to the treatment of the data";
		break;
		case'fr':
			indirizzo_email = "Sp�cifier l'adresse email";
			indirizzo_email_sbagliato = "Le email address n'est pas correct";
			autorizzo = "Pour autoriser au traitement des donn�es";
		break;
		case'de':
			indirizzo_email = "Geben Sie Ihre Email-Addresse an";
			indirizzo_email_sbagliato = "Die Email-Addresse ist nicht korrekt";
			autorizzo = "Zur Verarbeitung der Daten autorisieren";
		break;
	}*/
	if( (eval("document."+form+".tua_email.value")=="") || (eval("document."+form+".tua_email.value")=="inserisci la tua email...") ){
		alert(indirizzo_email);
		eval("document."+form+".tua_email.focus()");
		return false;
	}

	if(!checkMail(eval("document."+form+".tua_email.value"))){
		alert(indirizzo_email_sbagliato);
		eval("document."+form+".tua_email.focus()");
		return false;
	}

	if( (eval("document."+form+".riconferma_tua_email.value")=="") || (eval("document."+form+".riconferma_tua_email.value")=="riconferma la tua email...") ) {
		alert(riconferma_email);
		eval("document."+form+".riconferma_tua_email.focus()");
		return false;
	}

	if(eval("document."+form+".tua_email.value")!=eval("document."+form+".riconferma_tua_email.value")){
		alert(riconferma_non_uguale);
		eval("document."+form+".tua_email.focus()");
		return false;
	}

	if(eval("document."+form+".privacy.checked")==false){
		alert(autorizzo);
		eval("document."+form+".privacy.focus()");
		return false;
	}

	if (error == ''){
		eval("document."+form+".submit()");
		return true;
	}else{
		alert(error);
		return false;
	}
}

function VerificadatiRegolamento(lingua,path){
	var error = '';

	/*switch(lingua){
		case'it':
	*/		inserire_nome = 'Inserire il nome';
			inserire_cognome = "Inserire il cognome";
			inserire_telefono = "Inserire il telefono";
			indirizzo_email = "Specificare l'indirizzo email";
			indirizzo_email_sbagliato = "L'indirizzo email non è stato digitato correttamente";
			autorizzo = "Autorizzare al trattamento dei dati";
/*	break;
		case'en':
			inserire_nome = 'Insert name';
			inserire_cognome = "Inserire il cognome";
			inserire_telefono = "Inserire il telefono";
			indirizzo_email = 'Specify email address';
			indirizzo_email_sbagliato = 'The Email address is not correct';
			autorizzo = "To authorize to the treatment of the data";
		break;
		case'fr':
			inserire_nome = 'Ins�rer le nom';
			inserire_cognome = "Inserire il cognome";
			inserire_telefono = "Inserire il telefono";
			indirizzo_email = "Sp�cifier l'adresse email";
			indirizzo_email_sbagliato = "Le email address n'est pas correct";
			autorizzo = "Pour autoriser au traitement des donn�es";
		break;
		case'de':
			inserire_nome = 'Geben Sie Ihren Namen an';
			inserire_cognome = "Inserire il cognome";
			inserire_telefono = "Inserire il telefono";
			indirizzo_email = "Geben Sie Ihre Email-Addresse an";
			indirizzo_email_sbagliato = "Die Email-Addresse ist nicht korrekt";
			autorizzo = "Zur Verarbeitung der Daten autorisieren";
		
		break;
	}*/
	if(document.regolamento.nome.value==""){
		alert(inserire_nome);
		document.regolamento.nome.focus();
		return false;
	}

	if(document.regolamento.cognome.value==""){
		alert(inserire_cognome);
		document.regolamento.cognome.focus();
		return false;
	}

	if(document.regolamento.telefono.value==""){
		alert(inserire_telefono);
		document.regolamento.telefono.focus();
		return false;
	}

	if(document.regolamento.email.value==""){
		alert(indirizzo_email);
		document.regolamento.email.focus();
		return false;
	}
	if(!checkMail(document.regolamento.email.value)){
		alert(indirizzo_email_sbagliato);
		document.regolamento.email.focus();
		return false;
	}

	if(document.regolamento.privacy.checked==false){
		alert(autorizzo);
		document.regolamento.privacy.focus();
		return false;
	}

	document.regolamento.submit();
	return true;
}


function checkPriority(source){
	//if (source.value != "")
	if (parseFloat(source.value) >= 0.1 && parseFloat(source.value) <= 1.0)
		source.value = parseFloat(source.value).toFixed(1);
	else
		source.value = 0.5;

}	// checkFloat()

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 apriFinestra(path){
	window.open(path,'_new','width=500,height=400,resizable=yes,scrollbars=yes');
	return false;
}

//function Verificadati_completo(lingua,form,contatore){
function Verificadati_completo(form){
	var error = '';
	data_arrivo=new Date()
	data_partenza=new Date()
	today = new Date()
	today=Date.parse(today);


//	switch(lingua){
//		case'it':
			inserire_nome = 'Inserire il nome';
			indirizzo_email = "Specificare l'indirizzo email";
			indirizzo_email_sbagliato = "L'indirizzo email non è stato digitato correttamente";
			autorizzo = "Autorizzare al trattamento dei dati";
			data_arrivo_data_odierna="La data di arrivo non può essere inferiore dalla data odierna";
			data_partenza_data_arrivo="La data di partenza non può essere inferiore dalla data di arrivo";
			inserire_data_arrivo = "Inserire la data di arrivo";
			inserire_data_partenza = "Inserire la data di partenza";
/*		break;
		case'en':
			inserire_nome = 'Insert name';
			indirizzo_email = 'Specify email address';
			indirizzo_email_sbagliato = 'The Email address is not correct';
			autorizzo = "To authorize to the treatment of the data";
			data_arrivo_data_odierna="The arrival date cannot today be inferior from the date";
			data_partenza_data_arrivo="The departure date cannot be inferior from the arrival date";
			inserire_data_arrivo = "Insert the arrival date";
			inserire_data_partenza = "Insert the departure date";
		break;
		case'fr':
			inserire_nome = 'Ins�rer le nom';
			indirizzo_email = "Sp�cifier l'adresse email";
			indirizzo_email_sbagliato = "Le email address n'est pas correct";
			autorizzo = "Pour autoriser au traitement des donn�es";
			data_arrivo_data_odierna="La date d'arriv�e ne peut pas aujourd'hui �tre inf�rieure de la date";
			data_partenza_data_arrivo="La date de d�part ne peut pas �tre inf�rieure de la date d'arriv�e";
			inserire_data_arrivo = "Ins�rer la date d'arriv�e";
			inserire_data_partenza = "Ins�rer la date de d�part";
		break;
		case'de':
			inserire_nome = 'Geben Sie Ihren Namen an';
			indirizzo_email = "Geben Sie Ihre Email-Addresse an";
			indirizzo_email_sbagliato = "Die Email-Addresse ist nicht korrekt";
			autorizzo = "Zur Verarbeitung der Daten autorisieren";
			data_arrivo_data_odierna="Das Ankunft Datum kann nicht vom Datum minderwertig heute sein";
			data_partenza_data_arrivo="Das Abfahrtdatum kann nicht vom Ankunft Datum minderwertig sein";
			inserire_data_arrivo = "Geben Sie das Ankunft Datum";
			inserire_data_partenza = "Geben Sie das Abfahrtdatum";
		break;
	}
*/
	if(eval("document."+form+".nome.value")==""){
		alert(inserire_nome);
		eval("document."+form+".nome.focus()");
		return false;
	}
	if(eval("document."+form+".email.value")==""){
		alert(indirizzo_email);
		eval("document."+form+".email.focus()");
		return false;
	}
	if(!checkMail(eval("document."+form+".email.value"))){
		alert(indirizzo_email_sbagliato);
		eval("document."+form+".email.focus()");
		return false;
	}
	if(eval("document."+form+".privacy.checked")==false){
		alert(autorizzo);
		eval("document."+form+".privacy.focus()");
		return false;
	}

	giorno_arrivo=eval("document."+form+".gg_arrivo.selectedIndex")+1;
	mese_arrivo=eval("document."+form+".mm_arrivo.selectedIndex")+1;
	anno_arrivo=eval("document."+form+".aa_arrivo.selectedIndex")+1;
	giorno_partenza=eval("document."+form+".gg_partenza.selectedIndex")+1;
	mese_partenza=eval("document."+form+".mm_partenza.selectedIndex")+1;
	anno_partenza=eval("document."+form+".aa_partenza.selectedIndex")+1;

	/*Date della prenotazione*/
	if( (giorno_arrivo>0) || (mese_arrivo>0) || (anno_arrivo>0) || (giorno_partenza>0) || (mese_partenza>0) || (anno_partenza>0) ) {
		//data di arrivo
		gg_arrivo=new String()
		gg_arrivo=eval("document."+form+".gg_arrivo.options[document."+form+".gg_arrivo.selectedIndex].value;");
		mm_arrivo=new String()
		mm_arrivo=eval("document."+form+".mm_arrivo.options[document."+form+".mm_arrivo.selectedIndex].value;");
		aa_arrivo=new String()
		aa_arrivo=eval("document."+form+".aa_arrivo.options[document."+form+".aa_arrivo.selectedIndex].value;");
		data_arrivo=new Date( mm_arrivo + "/" + gg_arrivo + "/" + aa_arrivo );
		data_arrivo=Date.parse(data_arrivo);

		//data di partenza
		gg_partenza=new String()
		gg_partenza=eval("document."+form+".gg_partenza.options[document."+form+".gg_partenza.selectedIndex].value;");
		mm_partenza=new String()
		mm_partenza=eval("document."+form+".mm_partenza.options[document."+form+".mm_partenza.selectedIndex].value;");
		aa_partenza=new String()
		aa_partenza=eval("document."+form+".aa_partenza.options[document."+form+".aa_partenza.selectedIndex].value;");
		data_partenza=new Date( mm_partenza + "/" + gg_partenza + "/" + aa_partenza );
		data_partenza=Date.parse(data_partenza);

		if (data_arrivo <= today) {
			alert(data_arrivo_data_odierna);
			eval("document."+form+".gg_arrivo.focus()");
			return false;
		}
		if (data_partenza < data_arrivo) {
			alert(data_partenza_data_arrivo);
			eval("document."+form+".gg_partenza.focus()");
			return false;
		}
	}
	if( (giorno_arrivo==0) || (mese_arrivo==0) || (anno_arrivo==0) ) {
		alert(inserire_data_arrivo);
		eval("document."+form+".gg_arrivo.focus()");
		return false;
	}
	
	if( (giorno_partenza==0) || (mese_partenza==0) || (anno_partenza==0) ) {
		alert(inserire_data_partenza);
		eval("document."+form+".gg_partenza.focus()");
		return false;
	}

	if (error == ''){
		eval("document."+form+".submit()");
		return true;
	}else{
		alert(error);
		return false;
	}
}

function CambioClassiBoxMenu(sezione,evento,div){
	if(evento=="onmouseover"){
		switch(div){
			case "concorso_premi":
				CambioSfondo('concorso_premi', 'box_sotto_menu_'+sezione); 
				CambioSfondo('titolo_concorso_premi', 'titoli_box_sotto_menu_'+sezione); 
				CambioSfondo('link_concorso_premi', 'bianco');
			break;
			case "last_minute":
				CambioSfondo('last_minute', 'box_sotto_menu_'+sezione); 
				CambioSfondo('titolo_last_minute', 'titoli_box_sotto_menu_'+sezione+'_sx'); 
				CambioSfondo('titolo_offerte', 'titoli_box_sotto_menu_'+sezione+'_dx'); 
				CambioSfondo('link_last_minute', 'bianco');
				CambioSfondo('link_offerte', 'bianco');
			break;
			case "newsletter":
				CambioSfondo('newsletter', 'box_sotto_menu_'+sezione); 
				CambioSfondo('titolo_newsletter', 'titoli_box_sotto_menu_'+sezione); 
				CambioSfondo('link_newsletter', 'bianco');
			break;
			case "ricerche":
				CambioSfondo('ricerche', 'box_sotto_menu_'+sezione); 
				CambioSfondo('titolo_ricerca_avanzata', 'titoli_box_sotto_menu_'+sezione+'_sx'); 
				CambioSfondo('titolo_ricerca_geografica', 'titoli_box_sotto_menu_'+sezione+'_dx'); 
				CambioSfondo('link_ricerca_avanzata', 'bianco');
				CambioSfondo('link_ricerca_geografica', 'bianco');
			break;
		}
	}else{
		switch(div){
			case "concorso_premi":
				CambioSfondo('concorso_premi', 'box_sotto_menu_bianco');
				CambioSfondo('titolo_concorso_premi', 'titoli_box_sotto_menu_bianco');
				CambioSfondo('link_concorso_premi', 'grigio');
			break;
			case "last_minute":
				CambioSfondo('last_minute', 'box_sotto_menu_bianco');
				CambioSfondo('titolo_last_minute', 'titoli_box_sotto_menu_bianco_sx');
				CambioSfondo('titolo_offerte', 'titoli_box_sotto_menu_bianco_dx');
				CambioSfondo('link_last_minute', 'grigio');
				CambioSfondo('link_offerte', 'grigio');
			break;
			case "newsletter":
				CambioSfondo('newsletter', 'box_sotto_menu_bianco');
				CambioSfondo('titolo_newsletter', 'titoli_box_sotto_menu_bianco');
				CambioSfondo('link_newsletter', 'grigio');
			break;
			case "ricerche":
				CambioSfondo('ricerche', 'box_sotto_menu_bianco');
				CambioSfondo('titolo_ricerca_avanzata', 'titoli_box_sotto_menu_bianco_sx');
				CambioSfondo('titolo_ricerca_geografica', 'titoli_box_sotto_menu_bianco_dx');
				CambioSfondo('link_ricerca_avanzata', 'grigio');
				CambioSfondo('link_ricerca_geografica', 'grigio');
			break;
		}
	}
}

function Rollover(img,id){
	var nome_img = document.getElementById(id);
	nome_img.src=img;
}

/*
function MenuSchedaHotel(etichetta){
	switch(etichetta){
		case "descrizione":
			nascondiDiv('listinoprezzi'); nascondiDiv('offerta'); nascondiDiv('lastminute'); nascondiDiv('dovesiamo'); nascondiDiv('contatta');
			mostraDiv('descrizione');

			CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
			CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda'); CambioSfondo('contatta_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
			CambioSfondo('descrizione_hotel','linguetta_menu_scheda_hover');
		break;
		case "prezzi":
			nascondiDiv('descrizione'); nascondiDiv('offerta'); nascondiDiv('lastminute'); nascondiDiv('dovesiamo'); nascondiDiv('contatta');
			mostraDiv('listinoprezzi');

			CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('lastminute_hotel','linguetta_menu_scheda');
			CambioSfondo('offerta_hotel','linguetta_menu_scheda'); CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
			CambioSfondo('contatta_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda_hover');
		break;
		case "last_minute":
			nascondiDiv('listinoprezzi'); nascondiDiv('offerta'); nascondiDiv('descrizione'); nascondiDiv('dovesiamo'); nascondiDiv('contatta');
			mostraDiv('lastminute');

			CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
			CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda'); CambioSfondo('contatta_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
			CambioSfondo('lastminute_hotel','linguetta_menu_scheda_hover');
		break;
		case "offerta":
			nascondiDiv('listinoprezzi'); nascondiDiv('descrizione'); nascondiDiv('lastminute'); nascondiDiv('dovesiamo'); nascondiDiv('contatta');
			mostraDiv('offerta');

			CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('lastminute_hotel','linguetta_menu_scheda');
			CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda'); CambioSfondo('contatta_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
			CambioSfondo('offerta_hotel','linguetta_menu_scheda_hover');
		break;
		case "dove_siamo":
			nascondiDiv('listinoprezzi'); nascondiDiv('offerta'); nascondiDiv('lastminute'); nascondiDiv('descrizione'); nascondiDiv('contatta');

			CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('lastminute_hotel','linguetta_menu_scheda');
			CambioSfondo('offerta_hotel','linguetta_menu_scheda'); CambioSfondo('contatta_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
			CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda_hover');
		break;
		case "contatta":
			nascondiDiv('listinoprezzi'); nascondiDiv('offerta'); nascondiDiv('lastminute'); nascondiDiv('dovesiamo'); nascondiDiv('descrizione');
			mostraDiv('contatta');

			CambioSfondo('descrizione_hotel','linguetta_menu_scheda');
			CambioSfondo('lastminute_hotel','linguetta_menu_scheda');
			CambioSfondo('offerta_hotel','linguetta_menu_scheda');
			CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
			CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
			CambioSfondo('contatta_hotel','linguetta_menu_scheda_hover');
		break;
	}
}
*/

function MenuSchedaHotel(etichetta){
  switch(etichetta){
	case "descrizione":
		nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute'); nascondiDiv('offerta');
		mostraDiv('descrizione');

		CambioSfondo('servizi_hotel','linguetta_menu_scheda'); CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
		CambioSfondo('gallery_hotel','linguetta_menu_scheda'); CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		CambioSfondo('descrizione_hotel','linguetta_menu_scheda_hover');
	break;
	case "servizi":
		nascondiDiv('descrizione'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute'); nascondiDiv('offerta');
		mostraDiv('servizi');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('prezzi_hotel','linguetta_menu_scheda');
		CambioSfondo('gallery_hotel','linguetta_menu_scheda'); CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		CambioSfondo('servizi_hotel','linguetta_menu_scheda_hover');
	break;
	case "prezzi":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute'); nascondiDiv('offerta');
		mostraDiv('listinoprezzi');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('gallery_hotel','linguetta_menu_scheda'); CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda_hover');
	break;
	case "gallery":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute'); nascondiDiv('offerta');
		mostraDiv('gallery');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda'); CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('gallery_hotel','linguetta_menu_scheda_hover');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
	break;
	case "dove_siamo":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('lastminute'); nascondiDiv('offerta');
		mostraDiv('dovesiamo');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda'); CambioSfondo('gallery_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda_hover');
	break;
	case "last_minute":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('offerta');
		mostraDiv('lastminute');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda'); CambioSfondo('gallery_hotel','linguetta_menu_scheda');
		CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda'); //CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda_hover');
	break;
	case "offerta":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute');
		mostraDiv('offerta');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda'); CambioSfondo('gallery_hotel','linguetta_menu_scheda');
		CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda'); //CambioSfondo('lastminute_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda');
		//CambioSfondo('offerta_hotel','linguetta_menu_scheda_hover');
	break;
	case "contatta":
		nascondiDiv('descrizione');nascondiDiv('servizi'); nascondiDiv('listinoprezzi'); nascondiDiv('gallery'); nascondiDiv('dovesiamo'); nascondiDiv('lastminute'); nascondiDiv('offerta');

		CambioSfondo('descrizione_hotel','linguetta_menu_scheda'); CambioSfondo('servizi_hotel','linguetta_menu_scheda');
		CambioSfondo('prezzi_hotel','linguetta_menu_scheda'); CambioSfondo('gallery_hotel','linguetta_menu_scheda');
		CambioSfondo('dovesiamo_hotel','linguetta_menu_scheda');
		//CambioSfondo('lastminute_hotel','linguetta_menu_scheda'); CambioSfondo('offerta_hotel','linguetta_menu_scheda');
		CambioSfondo('contatta_hotel','linguetta_menu_scheda_hover');
	break;
  }
}

/*function changeHotel(codice_hotel){
  $('#hotelChange').load('http://www.italhotels.com/getChangeHotel.php',{idHotel: codice_hotel},reg);
}*/

function isIE7() {
  if ((document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") && !(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))) return true
  else return false
}
/*
function trackBnInvio() {
  pageTracker._trackPageview('invio-blocknotes.php');
}*/


function SchedaStampa(idHotel, comune, categoria){
	window.open('http://www.italhotels.com/stampa_hotel.php?sezione=hotel&idHotel='+idHotel+'&comune='+comune+'&categoria='+categoria,'_new','width=500,height=400,resizable=yes,scrollbars=yes');
	return false;
}


//conta click nella scheda
function conta(url){ 
	var s = document.createElement('SCRIPT');
	s.type = 'text/javascript';
	s.src = url;
	window.document.body.appendChild (s);
}

/**************************** per geomaps  - inizio ****************************************************************************/
function mostracartina(html, geomaps){
	google.setOnLoadCallback(initialize("mappa_google", html, geomaps));
}

function mostraDove_siamo(html, geomaps){
	google.setOnLoadCallback(initialize("map", html, geomaps));
}

// Call this function when the page has been loaded 
function initialize(div, html, geomaps) { 
	var map = new google.maps.Map2(document.getElementById(div));

	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());

	var array=geomaps.split(", ");
	var longi=parseFloat(array[0]);
	var latit=parseFloat(array[1]);

	point = new google.maps.LatLng(longi, latit);
	map.setCenter(point, 13);

	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
	  marker.openInfoWindowHtml(html);
	});
	map.addOverlay(marker);
}

function showAddress(address, html, geomaps, address_hotel) {
  var map = new google.maps.Map2(document.getElementById("map"));
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());

  var array=geomaps.split(", ");
  var longi=parseFloat(array[0]);
  var latit=parseFloat(array[1]);

  point = new google.maps.LatLng(longi, latit);
  map.setCenter(point, 13);

  var marker = new GMarker(point);
  GEvent.addListener(marker, "click", function() {
	marker.openInfoWindowHtml(address_hotel);
  });
  map.addOverlay(marker);

  
  geocoder = new GClientGeocoder();
  if (geocoder) {
	geocoder.getLatLng(
	  address,
	  function(point) {
		if (!point) {
		  alert(address + " not found");
		} else {
		map.setCenter(point, 13);
		var marker2 = new GMarker(point);
		GEvent.addListener(marker2, "click", function() {
		  marker2.openInfoWindowHtml(address+html);
		});
		map.addOverlay(marker2);
		}
	  }
	);
  }
}


/**************************** per geomaps  - fine ****************************************************************************/

/**************************** init.js  - inizio ****************************************************************************/
function bn_init () {
	BnElencoClick();
	BnListClick();
	BnEmptyClick();
	BnTooltipInit();
	BnConfrontaInit();
}

function BnElencoClick(){
  var bnList = $('div.maniglia_hotel');
  if (bnList.length>0){
	for (var i=0; i<bnList.length; i++) {
	  var tmp = new BnInterface('pulsante');
	  var code = tmp.pulsante.getCode($(bnList[i]));
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
		tmp.pulsante.switchIco($(bnList[i]));
		$(bnList[i]).toggle(
		  function(e){tmp.pulsante.rem(e.target);},
		  function (e) {tmp.pulsante.add(e.target);}
		);
	  } else {
		$(bnList[i]).toggle(
		  function(e){tmp.pulsante.add(e.target);},
		  function (e) {tmp.pulsante.rem(e.target);}
		);
	  }
	}
  }
	BnIcoClick();
}

function BnIcoClick () {
  var bnIco = $('#hotelChange').find('.addIco');
  if (bnIco.length>0) {
	var tmp = new Array(bnIco[0]);
	var bnIco = tmp;
	for (var i=0;i<bnIco.length;i++) {
	  var tmp = new BnInterface('scheda');
	  var code = tmp.scheda.getCode(bnIco[i]);
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
		tmp.scheda.switchIco(bnIco[i]);
		$(bnIco[i]).toggle(
		  function(e){tmp.scheda.rem(e.target);},
		  function (e) {tmp.scheda.add(e.target);}
		);
	  } else {
		$(bnIco[i]).toggle(
		  function(e){tmp.scheda.add(e.target);},
		  function (e) {tmp.scheda.rem(e.target);}
		);
	  }
	}
  }
}

function BnListClick () {
  var bnIco = $('#corpo_testo').find('.addIco');
  if (bnIco.length>0) {
	for (var i=0;i<bnIco.length;i++) {
	  var tmp = new BnInterface('scheda');
	  var code = tmp.scheda.getCode(bnIco[i]);
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
//      tmp.scheda.switchIco(bnIco[i]);
		tmp.scheda.switchIco($('#hotelChange img.addIco'));
		$(bnIco[i]).toggle(
		  function(e){tmp.scheda.rem(e.target);},
		  function (e) {tmp.scheda.add(e.target);}
		);
	  } else {
		$(bnIco[i]).toggle(
		  function(e){tmp.scheda.add(e.target);},
		  function (e) {tmp.scheda.rem(e.target);}
		);
	  }
	}
  }
}

function BnEmptyClick() {
  $('a.svuotaBn').click(function() {
	var tmp = new BnInterface('empty');
	tmp.empty.empty();
  });
}

function BnTooltipInit() {
  $('#bn_elenco div.blocknotes').hover(
	function(e){
	  var tmp = new Tooltip();
	  tmp.create(e.target);
	},
	function(){}
  );
}

function BnConfrontaInit() {
  var bnConf = $('#modulo_disponibilita').find('.rem_bn');
  for (var i=0;i<bnConf.length;i++) {
	$(bnConf[i]).click(function(e){
	  var tmp = new BnInterface('confronto');
	  tmp.confronto.rem(e.target);
	});
  }
}

/*function reg() {
  $('a.reg').each(function() {
	$(this).click(function(){
	  var dati = $(this).parents('span').attr('class');
	  var tmp = dati.split(' ');
	  $.post('http://www.italhotels.com//statistiche.php',{'idHotel':tmp[0], 'percorso':tmp[1]});
	  //$.post('http://www.italhotels.com/statistiche.php',{'idHotel':tmp[0], 'percorso':tmp[1]});
	  return false;
	});
  });
 // BnIcoClick();
}

function reg() {
  $('a.reg').each(function(){
	$(this).click(function(){
	  var dati = $(this).parents('span').attr('class');
	  var tmp = dati.split(' ');
	  //$.post('<?php echo $PATH_WEB;?>statistiche.php',{'idHotel':tmp[0], 'percorso':tmp[1]});
		$.ajax({
		 type: "POST",
		 url: 'http://www.italhotels.com//statistiche.php',
		 data: "idHotel="+tmp[0]+'&percorso='+tmp[1],
		 success: function(){
		   //alert( "Data Saved");
		 },
		 async:false
	   });
  //return false;
	});
  });
}*/


function menuInit(){
  var localitaLink = $('#menu_localita').find('a');
  localitaLink.each(function(){
	$(this).click(function(e){
	  var stelle = $('input[name=stelle]:checked:first');
	  if($(stelle).val()!=undefined){
		$('#path').attr('value',$(e.target).attr('href'));
		$('#getLocalita').submit();
		return false;
	  }else return true;
	})
  });
}
/**************************** init.js  - fine ******************************************************************************/


/**************************** bocknotes.js  - inizio ***********************************************************************/
function BnInterface(tipo) {
  function Scheda(){
	this.getCode= function(targ) {
	   return $(targ).parent().parent().prev().attr("id");
	};

	this.switchIco= function(targ) { 
	   if ($(targ).attr('src')==undefined) var obj = $(targ).parents('div:first').find('img');
	   else obj = targ;
	   var tmp = $(obj).attr('src');
	   if (tmp.match('-meno\.jpg$')=='-meno.jpg' || tmp.match('-meno-on\.jpg$')=='-meno-on.jpg') {
		 if (tmp.match('-meno-on\.jpg$')=='-meno-on.jpg') $(obj).attr('src','http://www.italhotels.com//html/img/icona-blocknotes-piu-on.jpg');
		 else $(obj).attr('src','http://www.italhotels.com//html/img/icona-blocknotes-piu.jpg');
	   }else {
		 if (tmp.match('-piu-on\.jpg$')=='-piu-on.jpg') $(obj).attr('src','http://www.italhotels.com//html/img/icona-blocknotes-meno-on.jpg');
		 else $(obj).attr('src','http://www.italhotels.com//html/img/icona-blocknotes-meno.jpg');
	   }
	}

	this.getImg = function(targ) {
	   return $(targ).parent().parent().prev().find('img').attr('src');
	}

	this.add = function(targ) {
	  this.switchIco(targ);
	  code = this.getCode(targ);
	  if ($("#bn_elenco img[alt='"+code+"']").length==0){
		img = this.getImg(targ);
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'add',hotel:code});
		$.post('http://www.italhotels.com//blocknotes.php',{op:'add',hotel:code});
		var block = $('#bn_elenco div.blocknotes');
		var i = 0;
		while ($(block[i]).children('img.bn_img').length) i++;
		$(block[i]).append('<img class="bn_img" src="'+img+'" alt="'+code+'" />');
		this.sync(code);
	   } else return false
	 }

	 this.rem = function(targ) {
	  this.switchIco(targ);
	  code = this.getCode(targ);
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'rem',hotel:code});
		$.post('http://www.italhotels.com//blocknotes.php',{op:'rem',hotel:code});
		$("#bn_elenco img[alt='"+code+"']").remove();
		this.sync(code);
	  } else return false;
	 }

	 this.sync = function (code) {
	   if ($('#corpo_testo #'+code).length>0) $('#corpo_testo #'+code+' .maniglia_hotel').trigger('click');
	 }
  };

  function Pulsante(){
	this.getCode = function (targ) {
	   return $(targ).parents("div[id]:first").attr("id");
	 }

	this.switchIco = function (targ) {
	  //obj = $(targ).find('a');
	  if ($(targ).find('a').length>0) targ = $(targ).find('a');
	  if ($(targ).hasClass('bn_add')) {$(targ).removeClass('bn_add'); $(targ).addClass('bn_remove');}
	  else {$(targ).removeClass('bn_remove'); $(targ).addClass('bn_add');}
	}

	this.getImg = function (targ) {
	   return $(targ).parents("div[id]:first").find('img:first').attr('src');
	   return $(targ).prev().attr('src');
	}

	this.add = function(targ) {
	  this.switchIco(targ);
	  code = this.getCode(targ);
	  if ($("#bn_elenco img[alt='"+code+"']").length==0){
		img = this.getImg(targ);
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'add',hotel:code});
		$.post('http://www.italhotels.com//blocknotes.php',{op:'add',hotel:code});
		var block = $('#bn_elenco div.blocknotes');
		var i = 0;
		while ($(block[i]).children('img.bn_img').length) i++;
		$(block[i]).append('<img class="bn_img" src="'+img+'" alt="'+code+'" />');
		this.sync(code);
	  } else return false;
	}

	this.rem = function(targ) {
	  this.switchIco(targ);
	  code = this.getCode(targ);
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'rem',hotel:code});
		$.post('http://www.italhotels.com//blocknotes.php',{op:'rem',hotel:code});
		$("#bn_elenco img[alt='"+code+"']").remove();
		this.sync(code);
	  } else return false;
	}

	this.sync = function (code) {
	  if ($('#hotelChange').find('div#'+code).length>0) $('#hotelChange').find('.addIco:first').trigger('click');
	}

  }
  
  function Empty(){
	
	this.empty = function(){
	  var hotels = $('#bn_elenco .blocknotes .bn_img');
	//  $.post('http://www.italhotels.com/blocknotes.php',{op:'empty'},function(){
	  $.post('http://www.italhotels.com//blocknotes.php',{op:'empty'},function(){
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'redraw'},function(data){
		$.post('http://www.italhotels.com//blocknotes.php',{op:'redraw'},function(data){
		 $('#bn_elenco').empty().append(data);
		},'html');
	  });
	  this.sync(hotels);
	}

	this.partial = function(){
	  var obj = $('#notifica span.nosottolineato');
	  obj.each(function() {
		var clas = $(this).attr('class');
		var code = clas.substr(15);
		$("#bn_elenco img[alt='"+code+"']").remove();
	$("#blocknotes_confronta input[value='"+code+"']").parents('tr:first').remove();
	$('#notifica_close').trigger('click');
	  });
	}
	
	this.sync = function (hotels){
	  hotels.each(function() {
		code = $(this).attr('alt');
		if ($('#hotelChange').find('div#'+code).length>0) $('#hotelChange').find('.addIco:first').trigger('click');
		if ($('#corpo_testo #'+code).length>0) $('#corpo_testo #'+code+' .maniglia_hotel').trigger('click');
		if ($("#blocknotes_confronta .mailHotel img[alt='"+code+"']").length>0) $("#blocknotes_confronta .mailHotel img[alt='"+code+"']").parents('.mailHotel:first').remove();
	  });
	}
  }

  function Info(){
	this.getCode = function(targ) {
	  return $('#info img:first').attr('alt');
	}
	
	this.sync = function (code) {
	   if ($('#hotelChange').find('div#'+code).length>0) $('#hotelChange').find('.addIco:first').trigger('click');
	   if ($('#corpo_testo #'+code).length>0) $('#corpo_testo #'+code+' .maniglia_hotel').trigger('click');
	   if ($("#blocknotes_confronta .mailHotel img[alt='"+code+"']").length>0) $("#blocknotes_confronta .mailHotel img[alt='"+code+"']").parents('.mailHotel:first').remove();
	}
	
	this.rem = function(targ) {
	  code = this.getCode(targ);
	  if ($("#bn_elenco img[alt='"+code+"']").length>0){
		//$.post('http://www.italhotels.com/blocknotes.php',{op:'rem',hotel:code});
		$.post('http://www.italhotels.com//blocknotes.php',{op:'rem',hotel:code});
		$("#bn_elenco img[alt='"+code+"']").remove();
		this.sync(code);
	  } else return false;
	  return false;
	}
  }
  
  function Confronto(){
	this.getCode = function(targ) {
	   return $(targ).attr("alt");
	}
	this.rem = function(targ) {
	  code = this.getCode(targ);
	  //$.post('http://www.italhotels.com/blocknotes.php',{op:'rem',hotel:code});
	  $.post('http://www.italhotels.com//blocknotes.php',{op:'rem',hotel:code});
	  $(targ).parents('tr.mailHotel').remove();
	  $("#bn_elenco img[alt='"+code+"']").remove();
	  return false;
	}
  }
  if (tipo=='scheda') this.scheda = new Scheda();
  else if (tipo=='pulsante') this.pulsante = new Pulsante();
  else if (tipo=='empty') this.empty = new Empty();
  else if (tipo=='info') this.info = new Info();
  else this.confronto = new Confronto();
}

 function Tooltip() {
   this.create = function(targ){
	 $('#info').remove();
	 if ($(targ).find('img').length>0) var img = $(targ).find('img').clone();
	 else var img = $(targ).clone();
	 $(img).attr('style','');
	 var info = document.createElement('div');
	 $(info).attr('id','info');
	 code = $(img).attr('alt');
	 if (code==undefined) code = $(targ).attr('alt');
	 if (code!=undefined) {
	   //$.post('http://www.italhotels.com/getHotelTooltip.php',{idHotel:code},function(data){
	   $.post('http://www.italhotels.com//getHotelTooltip.php',{idHotel:code},function(data){
		 $(img).appendTo($(info));
		 $(data).appendTo($(info));
		 var pos = $(targ).attr('id');
		 if (pos==undefined || pos=='') pos = $(targ).parent('div:first').attr('id');
		 var template = 1;
		 var elevation = 0;
		 if (pos>=8) elevation=1;
		 if (pos<=4) {
		   var shift=36*pos;
		   var ieshift=parseInt(shift)-288;
		 } else if (pos<=7){
		   var shift = (288-(36*(8-pos)))-108;
		   var ieshift = parseInt(shift)-288;
		   var template=2;
		 } else if (pos>=8) {
		   var shift=36*(pos-8);
		   var ieshift=parseInt(shift)-288;
		 } else {
		   var shift = (288-(36*(8-(pos-8))))-108;
		   var ieshift = parseInt(shift)-288;
		   var template=2;
		 }
		 if (pos>=10) pos-=10;
		 if (template==1){
		   $(info).children('img').css({float:'left'});
		   $(info).children('#tooltip').css({float:'right'});
		 } else {
		   $(info).children('img').css({float:'right'})
		   $(info).children('#tooltip').css({float:'left'});
		 }
		 if (elevation==1) $(info).find('img:first').css({margin:'36px 0 0 0'});
		 $(info).css('cssText',"position:absolute; top:0px; left:"+shift+"px!important; left:"+ieshift+'px; background: transparent url(http://www.italhotels.com/html/img/pixel-grigio.jpg) repeat scroll 0 0; border:1px solid #999');
		 if (isIE7()) $(info).css('left',shift);
		 $(info).css('width','138px');
		 $(info).css('height','66px');
		 $('#bn_elenco').append(info);
		 $(info).find('a.drem').click(function (e){
		   var tmp = new BnInterface('info');
		   tmp.info.rem(e.target);
		 });
//	   $('#info').animate({width:'138px', height:'66px', opacity:0.9},150);
		 $(info).hover(function(){},function(){$('#info').remove();});
		 //reg();
	   },'html');
	 }
   }
   this.remove = function(){
	 $('#info').remove();
   }
}
/**************************** bocknotes.js  - fine *************************************************************************/