


function IncludeJavaScript(jsFile)
{
  document.write('<script type="text/javascript" src="'
    + jsFile + '"></script>'); 
}

IncludeJavaScript('https://apis.google.com/js/plusone.js');
IncludeJavaScript('../scr/prototype.js');
IncludeJavaScript('../scr/effects.js');
IncludeJavaScript('../scr/lightwindow.js');
IncludeJavaScript('../scr/lb/lb.js');
IncludeJavaScript('../scr/chrome.js');



//slides
var fadebgcolor="#ffffff"
var fadearray=new Array()
var fadeclear=new Array()
var dom=(document.getElementById)
var iebrowser=document.all
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=100 //iop(10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();})
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array()
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative; z-index:3;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute; z-index:3;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute; z-index:3;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}
function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

function showhide(pageelement) {
	if (document.getElementById('visibile').value == 'si')
	{
		document.getElementById(pageelement).style.display = 'none';
		document.getElementById('visibile').value = 'no';
	} else {
		document.getElementById(pageelement).style.display = '';
		document.getElementById('visibile').value = 'si';
	}
}

today=new Date()
var dateto=new Date(today.getFullYear(), 5, 26)//0,xx=gennaio
if (today.getMonth()==7 && today.getDate()>26)
dateto.setFullYear(dateto.getFullYear()+1)
var one_day=1000*60*60*24

function OpenLink(LinkToOpen) {
	document.location.href = LinkToOpen;
}

function ApriFile(UrlFile){
	var wh = 500
	var hh = 500
	var winl = (screen.width - wh) / 2;
	var wint = (screen.height - hh) / 2;
	window.open(UrlFile,"FilPre","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width="+wh+",height="+hh+",top="+wint+",left="+winl+"");
}


function ValidLength(item, len) 
{	
	return(item.length >=len);
}

function ValidEmail(item)
{	
	if(!ValidLength(item,5)) return false;
	if(item.indexOf('@',0) == -1) return false;
	if(item.indexOf('.',0) == -1) return false;
	if(item.indexOf(',',0) > 0) return false;
	return true;	
}

function sendcancelDE()
{	
	errfound = false;
	
	if (!ValidLength(document.form1.nome.value,3))
		error(document.form1.nome,"Bitte geben Sie Ihren Namen ein.");
	if (!ValidLength(document.form1.cognome.value,3))
		error(document.form1.cognome,"Bitte geben Sie Ihren Nachnamen ein.");
	if (!ValidEmail(document.form1.email.value))
		error(document.form1.email, "Bitte geben Sie Ihre E-Mail Adresse ein.");
	if (!ValidLength(document.form1.prenotazione.value,3))
		error(document.form1.prenotazione,"Bitte geben Sie Ihre Buchungsnummer ein.");
	if (!ValidLength(document.form1.iban.value,3))
		error(document.form1.iban,"Bitte geben Sie Ihre IBAN Nummer ein.");
	if (!ValidLength(document.form1.swift.value,3))
		error(document.form1.swift,"Bitte geben Sie Ihre SWIFT Nummer ein.");
	if (errfound == false)
		{
			document.form1.BtnSend.disabled = true;
			document.form1.BtnSend.value = 'Ihre Anfrage wird gesendet...';
			document.form1.submit();
		}
}

function sendcancelIT()
{	
	errfound = false;
	
	if (!ValidLength(document.form1.nome.value,3))
		error(document.form1.nome,"Inserire il proprio nome.");
	if (!ValidLength(document.form1.cognome.value,3))
		error(document.form1.cognome,"Inserire il proprio cognome.");
	if (!ValidEmail(document.form1.email.value))
		error(document.form1.email, "Inserire il proprio indirizzo e-mail.");
	if (!ValidLength(document.form1.prenotazione.value,3))
		error(document.form1.prenotazione,"Inserire il numero di prenotazione.");
	if (!ValidLength(document.form1.iban.value,3))
		error(document.form1.iban,"Inserire il codice IBAN del proprio conto corrente.");
	if (errfound == false)
		{
			document.form1.BtnSend.disabled = true;
			document.form1.BtnSend.value = 'Invio della richiesta in corso...';
			document.form1.submit();
		}
}

function sendcancelEN()
{	
	errfound = false;
	
	if (!ValidLength(document.form1.nome.value,3))
		error(document.form1.nome,"Please enter your name.");
	if (!ValidLength(document.form1.cognome.value,3))
		error(document.form1.cognome,"Please enter your surname.");
	if (!ValidEmail(document.form1.email.value))
		error(document.form1.email, "Please enter your e-mail address.");
	if (!ValidLength(document.form1.prenotazione.value,3))
		error(document.form1.prenotazione,"Please enter your booking number.");
	if (!ValidLength(document.form1.iban.value,3))
		error(document.form1.iban,"Please enter your IBAN code.");
	if (!ValidLength(document.form1.swift.value,3))
		error(document.form1.swift,"Please enter your SWIFT code.");
	if (errfound == false)
		{
			document.form1.BtnSend.disabled = true;
			document.form1.BtnSend.value = 'Sending your request...';
			document.form1.submit();
		}
}




function error(elem, text)
{	
	if (errfound) return;
	window.alert(text)
	elem.select();
	elem.focus;
	errfound = true;
}


function price_update() { 
	var prezzo_corrente = parseFloat(document.FrmBuy.prezzo.value);
	var newIndex = document.FrmBuy.persone.selectedIndex;
	curno = document.FrmBuy.persone.options[ newIndex ].value;

	var prezzo_totale = (prezzo_corrente * 1) * curno;
	prezzo_totale = parseFloat(prezzo_totale).toFixed(2).replace('.',',');

	document.getElementById("testoprezzo1").innerHTML = prezzo_totale;
	document.getElementById("testoprezzo2").innerHTML = prezzo_totale;
} 



function caldal(){
	if(self.gfPop)gfPop.fPopCalendar(document.FrmBook.BookDal);
	return false;
}

function calal(){
	if(self.gfPop)gfPop.fPopCalendar(document.FrmBook.BookAl);
	return false;
}


function sendbook() {
	var data_dal = document.FrmBook.BookDal.value.split("/");
	var data_al = document.FrmBook.BookAl.value.split("/");
	document.FrmBook.dayFrom.value = data_dal[0];
	document.FrmBook.monthFrom.value = data_dal[1];
	document.FrmBook.yearFrom.value = data_dal[2];
	document.FrmBook.dayTo.value = data_al[0];
	document.FrmBook.monthTo.value = data_al[1];
	document.FrmBook.yearTo.value = data_al[2];
	//window.alert(data_al[0]+"/"+data_al[1]+"/"+data_al[2])
	document.FrmBook.submit();
}





function sendbuyDE()
{	
	errfound = false;
	var get_conferma = 0;
	for( i = 0; i < document.FrmBuy.conferma.length; i++ )
	{
		if( document.FrmBuy.conferma[i].checked == true )
		get_conferma = document.FrmBuy.conferma[i].value;
	}
	
	if (!ValidLength(document.FrmBuy.nome.value,3))
		error(document.FrmBuy.nome,"Bitte geben Sie Ihren Namen ein.");
	if (!ValidLength(document.FrmBuy.cognome.value,3))
		error(document.FrmBuy.cognome,"Bitte geben Sie Ihren Nachnamen ein.");
	if (!ValidEmail(document.FrmBuy.email.value))
		error(document.FrmBuy.email, "Bitte geben Sie Ihre E-Mail Adresse ein.");
	if (!ValidLength(document.FrmBuy.tel.value,3))
		error(document.FrmBuy.tel,"Bitte geben Sie Ihre Telefonnummer ein.");

	if (!ValidLength(document.FrmBuy.carta_nome.value,3))
		error(document.FrmBuy.carta_nome,"Bitte geben Sie den Namen des Innhabers der Kreditkarte ein.");
	if (!ValidLength(document.FrmBuy.carta_numero.value,3))
		error(document.FrmBuy.carta_numero,"Bitte geben Sie die Kreditkartennummer ein.");
	if (!ValidLength(document.FrmBuy.carta_scadenza.value,3))
		error(document.FrmBuy.carta_scadenza,"Bitte geben Sie die Fälligkeit der Kreditkarte ein.");

	if (get_conferma == "NEIN")
		error(document.FrmBuy.conferma,"Damit die Buchung abgeschlossen werden kann,\nmüssen Sie uns die Erlaubniss geben den Gesamtbetrag zu beheben.");
	if (document.FrmBuy.privacy.checked == 0)
		error(document.FrmBuy.privacy,"Sie müssen die Bedingungen des Gesetzes über\ndie Behandlung der persönlichen Daten zustimmen.");

	if (errfound == false)
		{
			document.FrmBuy.BtnSend.disabled = true;
			document.FrmBuy.BtnSend.value = 'Ihre Buchung wird gesendet...';
			document.FrmBuy.submit();
		}
}

function sendbuyIT()
{	
	errfound = false;
	var get_conferma = 0;
	for( i = 0; i < document.FrmBuy.conferma.length; i++ )
	{
		if( document.FrmBuy.conferma[i].checked == true )
		get_conferma = document.FrmBuy.conferma[i].value;
	}
	
	if (!ValidLength(document.FrmBuy.nome.value,3))
		error(document.FrmBuy.nome,"La preghiamo di inserire il suo nome.");
	if (!ValidLength(document.FrmBuy.cognome.value,3))
		error(document.FrmBuy.cognome,"La preghiamo di inserire il suo cognome.");
	if (!ValidEmail(document.FrmBuy.email.value))
		error(document.FrmBuy.email, "La preghiamo di inserire il suo indirizzo e-mail.");
	if (!ValidLength(document.FrmBuy.tel.value,3))
		error(document.FrmBuy.tel,"La preghiamo di inserire il suo numero telefonico.");

	if (!ValidLength(document.FrmBuy.carta_nome.value,3))
		error(document.FrmBuy.carta_nome,"La preghiamo di inserire il nome\ndel titolare della carta di credito.");
	if (!ValidLength(document.FrmBuy.carta_numero.value,3))
		error(document.FrmBuy.carta_numero,"La preghiamo di inserire il numero della carta di credito.");
	if (!ValidLength(document.FrmBuy.carta_scadenza.value,3))
		error(document.FrmBuy.carta_scadenza,"La preghiamo di inserire la data di scadenza\ndella carta di credito.");

	if (get_conferma == "NO")
		error(document.FrmBuy.conferma,"Per poter confermare la sua prenotazione, è necessaro acconsentirci\ndi prelevare l\'importo totale dalla sua carta di credito.");
	if (document.FrmBuy.privacy.checked == 0)
		error(document.FrmBuy.privacy,"Per proseguire è neccessario acconsentire il trattamento dei suoi dati personali.");

	if (errfound == false)
		{
			document.FrmBuy.BtnSend.disabled = true;
			document.FrmBuy.BtnSend.value = 'Invio della prenotazione in corso...';
			document.FrmBuy.submit();
		}
}

function sendbuyEN()
{	
	errfound = false;
	var get_conferma = 0;
	for( i = 0; i < document.FrmBuy.conferma.length; i++ )
	{
		if( document.FrmBuy.conferma[i].checked == true )
		get_conferma = document.FrmBuy.conferma[i].value;
	}
	
	if (!ValidLength(document.FrmBuy.nome.value,3))
		error(document.FrmBuy.nome,"Please enter your name.");
	if (!ValidLength(document.FrmBuy.cognome.value,3))
		error(document.FrmBuy.cognome,"Please enter your surname.");
	if (!ValidEmail(document.FrmBuy.email.value))
		error(document.FrmBuy.email, "Please enter your e-mail address.");
	if (!ValidLength(document.FrmBuy.tel.value,3))
		error(document.FrmBuy.tel,"Please enter your phone number.");

	if (!ValidLength(document.FrmBuy.carta_nome.value,3))
		error(document.FrmBuy.carta_nome,"Please enter the name of the credit card holder.");
	if (!ValidLength(document.FrmBuy.carta_numero.value,3))
		error(document.FrmBuy.carta_numero,"Please enter the number of the credit card.");
	if (!ValidLength(document.FrmBuy.carta_scadenza.value,3))
		error(document.FrmBuy.carta_scadenza,"Please enter the date of your credit card.");

	if (get_conferma == "NO")
		error(document.FrmBuy.conferma,"To confirm your booking, we need your authorization to withdraw the total amount from your credit card.");
	if (document.FrmBuy.privacy.checked == 0)
		error(document.FrmBuy.privacy,"To continue you must agree the privacy statement.");

	if (errfound == false)
		{
			document.FrmBuy.BtnSend.disabled = true;
			document.FrmBuy.BtnSend.value = 'Sending you booking...';
			document.FrmBuy.submit();
		}
}



function tg1(){
        myLightWindow.activateWindow({ href: '../video/saslong.html', 
		title: 'TG1', caption: '', type: 'external', width: 460, height: 371 });
}

function orf(){
        myLightWindow.activateWindow({ href: '../video/orf/orf.html', 
		title: 'ORF', caption: '', type: 'external', width: 593, height: 361 });
}

function banner_de(){
        myLightWindow.activateWindow({ href: 'banner.htm', 
		title: 'Saslong Specials', caption: '', type: 'external', width: 819, height: 497 });
}
