/* 
(c)2002-2006 www.parallaxis.de  
  Funktionsbibliothek
*/


//	Funktion des Browser-Zurueck-Buttons 
function fBack()
{ 
history.back(1);
} 



// Zoom-Funktion mit Parametern ----------------------------------------
// Der Parameter bildunterschrift kann weggelassen werden
function fZoom(imageName,scroll,bildunterschrift) { 
if (fZoom.arguments.length>2){
  if (scroll == 'yes'){
    newWindow = window.open("","newWindow","width="+599+",height="+400+",scrollbars=yes");
  }else{
    newWindow = window.open("","newWindow","width="+599+",height="+400+",scrollbars=no,resizable=yes");
  }
}else{
  if (scroll == 'no'){
    newWindow = window.open("","newWindow","width="+599+",height="+400+",scrollbars=no resizable=no");
  }else{
    newWindow = window.open("","newWindow","width="+599+",height="+400+",scrollbars=yes,resizable=no");
  }
}

newWindow.document.open();
newWindow.document.writeln('<html><head><title>Hotel Tenz</title>');
newWindow.document.writeln('<link rel=stylesheet type="text/css" href="style.css"></head>');
newWindow.document.writeln('<body topmargin="0" marginheight="0" leftmargin="0" marginleft="0" onload="window.resizeTo(document.bild.width+24,document.bild.height+30);" onBlur="self.close()">');
newWindow.document.writeln('<p align="center"><a href="javascript:self.close()"><img src=\"'+imageName+'\" name="bild" align="absmiddle" border=0></a>'); 
if (fZoom.arguments.length>2){
newWindow.document.writeln('<b>'+ bildunterschrift+'</b>')}
newWindow.document.write('</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>600) { newWindow.resizeTo(bildbreite+27,600);}
 else {
  if (fZoom.arguments.length>2) { newWindow.resizeTo(bildbreite,bildhoehe+50); }
  else { newWindow.resizeTo(bildbreite,bildhoehe+29) }}}}
}




// Zoom-Anfahrtskizze mit Druckfunktion
function fZoom_Karte(imageName,imageWidth,imageHeight)
{
newWindow = window.open("","newWindow","width="+(16+imageWidth)+",height="+(150+imageHeight)+",scrollbars=yes resizable=yes");

newWindow.document.open();
newWindow.document.write('<html><head><title>Hotel Tenz - Anfahrt</title><link rel="stylesheet" href="../Library/standart.css"></head>');
newWindow.document.write('<body bgcolor="#FFFAD4" leftmargin="8" topmargin="8" marginheight="8" marginwidth="8">');
newWindow.document.write('<p align="center"><img src=\"'+imageName+'\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\" border=0></a>');
if (fZoom_Karte.arguments.length>3) {
  newWindow.document.write('<br><br><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#333333">'+ bildunterschrift+'</font>')
  }

newWindow.document.write('<table border="0" cellspacing="0" cellpadding="0" width="450"><tr><td colspan="2" valign="bottom"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Hotel      Tenz</b></font></td></tr><tr><td width="225" valign="top"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Familie March<br>I-39040 Montan<br>Kalditsch 3<br>S&uuml;dtirol - Italien</font></td><td width="225" valign="top"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Tel. +39 0471 819 782<br>Fax +39 0471 819 728<br>Internet&nbsp; <a href="http://www.hotel-tenz.com/" target="_blank">www.hotel-tenz.com</a><br>E-Mail&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:info@hotel-tenz.com">info@hotel-tenz.com</a></font></td></tr></table>');

newWindow.document.write('<br><br><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#333333"><a href="javascript:window.close()">Fenster schlie&szlig;en</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:window.print()">Karte drucken</a></p></font></body></html>');

newWindow.document.close(); 
newWindow.focus(); 
}



//	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 chkName1()
		{
		if((document.Anfrage2.Vorname.value == "")
			|| (document.Anfrage2.Nachname.value == "") 
			|| (document.Anfrage2.Strasse.value == "") 
			|| (document.Anfrage2.PLZ.value == "")
			|| (document.Anfrage2.Ort.value == "")
			|| (document.Anfrage2.Land.value == ""))			
		  {
		  alert("Bitte geben Sie Ihren Namen und Ihre komplette Adresse ein!");
		  document.Anfrage2.Strasse.focus();
		  return false;
		  }
		else
		  return true;
		}
		
	function chkAdresse()
		{
		if((document.Anfrage.Strasse.value == "") 
			|| (document.Anfrage.PLZ.value == "")
			|| (document.Anfrage.Ort.value == "")
			|| (document.Anfrage.Land.value == ""))
		  {
		  alert("Bitte geben Sie Ihre komplette Adresse ein!");
		  document.Anfrage.Strasse.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;
		}

		function chkEmail2()
		{
		var adress = document.Anfrage1.Email.value;
		if ((adress =="")
			|| (adress.indexOf ('@') == -1)
			|| (adress.indexOf ('.') == -1))
		 {
		  alert("Bitte geben Sie Ihre Email-Adresse ein!");
		  document.Anfrage1.Email.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}
		
	function chkFax()
		{
		if(document.Anfrage.Telefax.value == "")
		 {
		  alert("Bitte geben Sie Ihre Fax-Nummer ein!");
		  document.Anfrage.Telefax.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}


function chkEmail1()
{
return chkEmail2();
}


//	Formularabfrage englische Version ----------------------------------------------
function chkFormuk()
		{
		  var valid
		  valid = true;
		  if(!chkNameuk())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
					//Abfrage ob Email, Fax oder Postversand
		  for (i=0;i<=2;i++)
		    {
		      if (document.Anfrage.BestaetigungPer[i].checked==1)
			var Eingabe = document.Anfrage.BestaetigungPer[i].value;
		    }
		  switch(Eingabe)
		    {
		      case "Email":
			if(!chkEmailuk())		//Email-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "Fax":
			if(!chkFaxuk())		//Fax-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "Post":
			if(!chkAdresseuk())	//Post-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		    }
		  return valid;
		}


	function chkNameuk()
		{
		if(document.Anfrage.Name.value == "")
		  {
		    alert("Please enter your name!");
		    document.Anfrage.Name.focus();
		    return false;
		  }
		else
		  return true;
		}

	function chkAdresseuk()
		{
		if((document.Anfrage.Strasse.value == "") 
			|| (document.Anfrage.PLZ.value == "")
			|| (document.Anfrage.Ort.value == "")
			|| (document.Anfrage.Land.value == ""))
		  {
		  alert("Please enter your full adress!");
		  document.Anfrage.Strasse.focus();
		  return false;
		  }
		else
		  return true;
		}

	function chkEmailuk()
		{
		var adress = document.Anfrage.Email.value;
		if ((adress =="")
			|| (adress.indexOf ('@') == -1)
			|| (adress.indexOf ('.') == -1))
		 {
		  alert("Please enter your email!");
		  document.Anfrage.Email.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}

	function chkFaxuk()
		{
		if(document.Anfrage.Telefax.value == "")
		 {
		  alert("Please enter your fax number!");
		  document.Anfrage.Telefax.focus();
		  return false;
		  exit;
		 }
		else
		  return true;
		}


