/* 
(c)2002 www.parallaxis.de  
  Funktionsbibliothek
*/


//	Funktion des Browser-Zurueck-Buttons 
function fBack()
{ 
history.back(1);
} 



//	Formulartest deutsche Version---------------------------------------------
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.BestaetigungPer[i].checked==1)
			var Eingabe = document.Anfrage.BestaetigungPer[i].value;
		    }
		  switch(Eingabe)
		    {
		      case "Email":
			if(!chkEmail())		//Email-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "Fax":
			if(!chkFax())		//Fax-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		      case "Post":
			if(!chkAdresse())	//Post-Anfrage
			  {
			  valid = false;
			  return valid;
			  }
			break;
		    }
		  return valid;
		}


	function chkName()
		{
		if(document.Anfrage.Name.value == "")
		  {
		    alert("Bitte geben Sie Ihren Namen und Vornamen ein!");
		    document.Anfrage.Name.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 korrekte Email-Adresse ein!");
		  document.Anfrage.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;
		}



//	Zoom-Funktion mit Parametern
function fZoom(imageName,imageWidth,imageHeight,bildunterschrift) 
{ 
newWindow = window.open("","newWindow","width="+(imageWidth)+",height="+(imageHeight)+",scrollbars=no");
//newWindow=window.open("","newWindow","width="+(20+imageWidth)+",height="+(1+fensterheigth)+", scrollbars=no");
newWindow.document.open();
newWindow.document.write('<html><head><title>Muirenhof - Ferienwohungen & Zimmer - Serfaus &Ouml;sterreich</title>');
newWindow.document.write('</head>');
//newWindow.document.write('<body bgcolor="white" leftmargin="0" topmargin="10" marginheight="10" marginwidth="0" background="../images/streifen_hg.gif" onBlur="self.close()">');
newWindow.document.write('<body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onBlur="self.close()">')
newWindow.document.write('<p align="center"><a href="javascript:self.close()"><img src=\"'+imageName+'\"  align="absmiddle" border=0></a>');
if (fZoom.arguments.length>3)
  {
  newWindow.document.write('<font face="Arial, Helvetica, sans-serif" size="2" color="#1D5A2D"><br><br><b>'+ bildunterschrift+'</b></font></p></body></html>')
  }
newWindow.document.close(); 
newWindow.focus(); 
}


//	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];}
}


//	Zoom-Funktion für Magazinseiten
function fScroll(imageName,bildunterschrift) 
{ 
newWindow = window.open("","newWindow","width=600,height=500,scrollbars=yes,resizable=yes");
newWindow.document.open();
newWindow.document.write('<html><head><title>Muirenhof - Ferienwohungen & Zimmer - Serfaus &Ouml;sterreich</title>');
newWindow.document.write('</head>');
newWindow.document.write('<body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onBlur="self.close()">')
newWindow.document.write('<p align="center"><a href="javascript:self.close()"><img src=\"'+imageName+'\"  align="absmiddle" border=0></a>');
if (fScroll.arguments.length>1)
  {
  newWindow.document.write('<font face="Arial, Helvetica, sans-serif" size="2" color="#1D5A2D"><br><br><b>'+ bildunterschrift+'</b></font></p></body></html>')
  }
newWindow.document.close(); 
newWindow.focus(); 
} 