/* 
(c)2006 www.parallaxis.de  
  Funktionsbibliothek
*/

function chkNameGW()
		{
		if((document.Anfrage.Vorname.value == "") 
			|| (document.Anfrage.Nachname.value == "")
			|| (document.Anfrage.Stadt.value == ""))
		  {
		    alert("Bitte geben Sie Ihren Namen, Vornamen und Ihre Stadt ein!");
		    document.Anfrage.Vorname.focus();
		    return false;
		  }
		else
		  return true;
		}
		
		function chkFormGW()
		{
		  var valid
		  valid = true;
		  if(!chkNameGW())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
			}
		  if(!chkEmail())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
			   }
			}
			

//	oeffnet einen Link im Fenster des aufrufenden Fensters
function fOpenerLink(url) {
        opener.location = url;
        }
		

//	Funktion des Browser-Zurueck-Buttons 
function fBack()
{ 
history.back(1);
} 

// Popup

var PopupFenster= null;

function fPopup(seite,breite,hoehe) {
    if(PopupFenster != null) {
      if(!PopupFenster.closed) {
        PopupFenster.close();
      }
    }
    PopupFenster =open(seite, 'Popup', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+breite+',height='+hoehe+',screenY=130,screenX=110');
}


//	Formular Plausibilitaetsabfrage DE
function chkForm()
		{
		  var valid
		  valid = true;
		  if(!chkName())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
					//Abfrage ob Email, Fax oder Postversand
		  for (i=0;i<=2;i++)
		    {
		      if (document.Anfrage.antwort[i].checked==1)
			var Eingabe = document.Anfrage.antwort[i].value;
		    }
		  switch(Eingabe)
		    {
		      case "per Email":
			if(!chkEmail())		//Email-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Fax":
			if(!chkFax())		//Fax-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Post":
			if(!chkAdresse())	//Post-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		    }
		  return valid;
		}


	function chkName()
		{
		if((document.Anfrage.Vorname.value == "") || (document.Anfrage.Nachname.value == ""))
		  {
		    alert("Bitte geben Sie Ihren Namen und Vornamen ein!");
		    document.Anfrage.Vorname.focus();
		    return false;
		  }
		else
		  return true;
		}
		

	

	function chkEmail()
		{
		var adress = document.Anfrage.Email.value;
		if ((adress =="")
			|| (adress.indexOf ('@') == -1)
			|| (adress.indexOf ('.') == -1))
		 {
		  alert("Bitte geben Sie Ihre Email-Adresse ein!");
		  document.Anfrage.Email.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}


		



// Variable Zoomfunktion Parallaxis - Manuel Bieh, 03.09.2004
function fZoom(imageName,scroll,bildunterschrift) { 
if (fZoom.arguments.length>2){
  if (scroll == 'yes'){
    newWindow = window.open("","newWindow","width="+599+",height="+500+",scrollbars=yes");
  }else{
    newWindow = window.open("","newWindow","width="+599+",height="+500+",scrollbars=no,resizable=yes");
  }
}else{
  if (scroll == 'no'){
    newWindow = window.open("","newWindow","width="+599+",height="+500+",scrollbars=no resizable=no");
  }else{
    newWindow = window.open("","newWindow","width="+599+",height="+500+",scrollbars=yes,resizable=no");
  }
}

newWindow.document.open();
newWindow.document.writeln('<html><head><title>Hotel Reschenscheideck - Reschenpass</title>');
newWindow.document.writeln('<link rel=stylesheet type="text/css" href="parallaxis.css"></head>');
newWindow.document.writeln('<body topmargin="0" id="popup" marginheight="0" leftmargin="0" marginleft="0" onload="window.resizeTo(document.bild.width,document.bild.height+30);" onBlur="self.close()">');
newWindow.document.writeln('<p align="center"><a href="javascript:self.close()"><img alt="Bitte warten, das Foto wird geladen!" longdesc="Bitte warten, das Foto wird geladen!" src="'+imageName+'" name="bild" align="absmiddle" border=0></a>'); 
if (fZoom.arguments.length>2){
newWindow.document.writeln('<b>'+ bildunterschrift+'</b>')}
newWindow.document.write('</p></body></html>');
newWindow.document.close();
newWindow.focus(); 

if(navigator.appName == "Microsoft Internet Explorer") {
var bildhoehe = newWindow.document.bild.height;
var bildbreite = newWindow.document.bild.width;
{if (bildhoehe>700) { newWindow.resizeTo(bildbreite+27,700);}
 else {
  if (fZoom.arguments.length>2) { newWindow.resizeTo(bildbreite,bildhoehe+50); }
  else { newWindow.resizeTo(bildbreite,bildhoehe+29) }}}}
}


//	Macromedia Swapimage-Funktionen
function MM_swapImgRestore() { //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) { //v3.0
  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); 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];}
}


// Formular Plausibilitaetsabfrage IT
 function chkForm_IT()
		{
		  var valid
		  valid = true;
		  if(!chkName_IT())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
					//Abfrage ob Email, Fax oder Postversand
		   for (i=0;i<=2;i++)
		    {
		      if (document.Anfrage.antwort[i].checked==1)
			var Eingabe = document.Anfrage.antwort[i].value;
		    }
		  switch(Eingabe)
		    {
		      case "per Email":
			if(!chkEmail_IT())		//Email-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Fax":
			if(!chkFax_IT())		//Fax-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Post":
			if(!chkAdresse_IT())	//Post-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		    }
		  return valid;
		}


	function chkName_IT()
		{
		if((document.Anfrage.Vorname.value == "") || (document.Anfrage.Nachname.value == ""))
		  {
		    alert("Indichi per favore suo nome e cognome!");
		    document.Anfrage.Vorname.focus();
		    return false;
		  }
		else
		  return true;
		}
		
function chkEmail_IT()
		{
		var adress = document.Anfrage.Email.value;
		if ((adress =="")
			|| (adress.indexOf ('@') == -1)
			|| (adress.indexOf ('.') == -1))
		 {
		  alert("Indichi per favore suo indirizzo E-Mail!");
		  document.Anfrage.Email.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}


function chkForm_NL()
		{
		  var valid
		  valid = true;
		  if(!chkName_NL())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
					//Abfrage ob Email, Fax oder Postversand
		  for (i=0;i<=2;i++)
		    {
		      if (document.Anfrage.antwort[i].checked==1)
			var Eingabe = document.Anfrage.antwort[i].value;
		    }
		  switch(Eingabe)
		    {
		      case "per Email":
			if(!chkEmail_NL())		//Email-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Fax":
			if(!chkFax_NL())		//Fax-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "per Post":
			if(!chkAdresse_NL())	//Post-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		    }
		  return valid;
		}


	function chkName_NL()
		{
		if((document.Anfrage.Vorname.value == "") || (document.Anfrage.Nachname.value == ""))
		  {
		    alert("Voer uw naam, voornaam en woonplaats in.");
		    document.Anfrage.Vorname.focus();
		    return false;
		  }
		else
		  return true;
		}
		

	

	function chkEmail_NL()
		{
		var adress = document.Anfrage.Email.value;
		if ((adress =="")
			|| (adress.indexOf ('@') == -1)
			|| (adress.indexOf ('.') == -1))
		 {
		  alert("Bitte geben Sie Ihre Email-Adresse ein!");
		  document.Anfrage.Email.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}		


/********Expressanfrage*********/
function chkExpress()
		{
		 var valid
		  valid = true;
		  if(!chkNameExp())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
		  if(!EmailExp())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
		    //alert ('Vielen Dank für Ihre Anfrage. Sie erhalten in Kürze unser Angebot.')
			}
			

	
	function chkNameExp()
		{
		if(document.Expressanfrage.Name.value == "")
		  {
		    alert("Bitte geben Sie Ihren Namen ein!");
		    document.Expressanfrage.Name.focus();
		    return false;
		  }
		else
		  return true;
		}
		
					
	function EmailExp() 
	{
	var adress = document.Expressanfrage.Kontakt.value;
	if ((adress =="")
		|| (adress.indexOf ('@') == -1)
		|| (adress.indexOf ('.') == -1))
	 {
	  alert("Bitte geben Sie Ihre Email-Adresse ein!");
	  document.Expressanfrage.Kontakt.focus();
	  return false;
	  exit;
	 }
	else
	  return true;
	}