// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function simplePrl()
{ 
  var args = simplePrl.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore(i) { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var newwin;
function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	
	//if(javascript_version > 1.0)
	//{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 //		setTimeout('newwin.focus();',250);
 //	}
}

/*
function changeDescription(fotonumber,language){
  if (language=="it"){
    document.getElementById("40").innerHTML=fotodescription_it[fotonumber];
  }else if(language=="en"){
    document.getElementById("40").innerHTML=fotodescription_en[fotonumber];
  }else if(language=="de"){
    document.getElementById("40").innerHTML=fotodescription_de[fotonumber];
  }
} 
*/  


/*function click() {
if ((event.button==2) || (e.which==2)) {
alert(' Sorry, unavailable option.');
}
}
document.onmousedown=click

function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Spiacenti, il tasto destro del mouse e' disabilitato"); 
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right; */


function apri(pagina){
   var newwin = window.open(pagina,"newwin",'fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + screen.width + ',height=' + screen.height);
   newwin.moveTo(0,0);newwin.focus();close.window();
   var oldwin = window.close(pagina);
}

function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
// funzioni controllo presenza email

function content(email){

			if(email.length<1){
			alert("Die E-mail Adresse muß angegeben werden !");
			return false;
			}
			else if(email.length==1){
			alert("Bitte E-mail Adresse prüfen !");
			return false;
			}
			else if(email.indexOf("@")==-1){
			alert("Bitte E-mail Adresse prüfen !");
			return false;
			}
			else if(email.indexOf(".")==-1){
			alert("Bitte E-mail Adresse prüfen !");
			return false;
			}
			else if (!document.progplanform.accettazione.checked) {
		 	alert("Bitte bestätigen Sie noch, dass Sie unsere Bedingungen für Datenschutz.");
			return false;
		 	}
			else{
			email = email.toLowerCase()
			return true;
			}			
}
function contenuto(email){

		    if(email.length<1){
			alert("Attenzione, indirizzo E mail e' obbligatorio !");
			return false;
			}
			else if(email.length==1){
			alert("L'indirizzo E-mail non e' corretto  !");
			return false;
			}
			else if(email.indexOf("@")==-1){
			alert("L'indirizzo E-mail non e' corretto !");
			return false;
			}
			else if(email.indexOf(".")==-1){
			alert("L'indirizzo E-mail non e' corretto !");
			return false;
			}
		    else if (!document.progplanform.accettazione.checked) {
		 	alert("È indispensabile la Sua accettazione delle condizioni per il trattamento dei dati personali.");
			return false;
		 	}
			else{
			email = email.toLowerCase()
			return true;
			}			
}
function newwin(bildurl, b ,h)
{
var eigenschaft,sbreite,shoehe,fenster,b,h;

// stellt die Bildschirmabmessungen fest
// find window size
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);

if(ns6||ns4) {
sbreite = innerWidth;
shoehe = innerHeight;
}
else if(ie4) {
sbreite = document.body.clientWidth;
shoehe = document.body.clientHeight;
}

x = (sbreite-b)/2;
y = (shoehe-h)/2;

eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+b+",height="+h+",menubar=no,toolbar=no,resizable=yes";

fenster=window.open("","",eigenschaften);
fenster.focus();
fenster.document.open();
with (fenster) {
  document.write('<html><head>');
  document.write('<title>Niederhäusererhof Pfalzen Ferienhof Agriturismo Holiday Farm Dolomites Italy</title></head>');
  // bei Focusverlust schliessen, close if window looses focus
  document.write('<body onblur="window.close()" ');
  document.write('marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">');
  document.write('<center>');
  document.write('<A HREF="#" onClick="window.close();return false">'); 	
  document.write('<img src="'+ bildurl +'"border="0" alt="close window">');
  document.write('</A>'); 	
  document.write('</center>');
  document.write('</body></html>');
  fenster.document.close();
}


}

function newhtml(datei,w2,h2)
{
 F1=window.open(datei,"Html","width=" + w2 + ", height=" + h2);

 F1.focus()
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; h=(v=='visible')?args[i+1]:'1'; z=(v=='visible')?"#FF9933":"#000000"}
    obj.visibility=v;
	obj.height=h+'px';
	if ((obj=MM_findObj(args[i]+"x"))!=null) {
	  if(obj.style){
	    obj=obj.style;
		obj.color=z;
	  }
	}
	}
}

function MM_openwin(MM_file)
{
   MM_config=""
   MM_config+="top=160,";
   MM_config+="left=250,";
   MM_config+="toolbar=no,";
   MM_config+="location=no,"
   MM_config+="directories=no,";
   MM_config+="status=no,";
   MM_config+="menubar=no,"; //Not on Apple Mac for obvious reasons
   MM_config+="scrollbars=no,";
   MM_config+="resizable=no,"; //Mac windows are always resizable
   MM_config+="copyhistory=no,";
   MM_config+="width=760,";
   MM_config+="height=505";
   var MM_win=open(MM_file,"",MM_config);
   MM_win.focus();
}
