/* 
(c)2001 www.parallaxis.de  
  Funktionsbibliothek
*/

//	Email Plausibilitaetsabfrage
function chkForm()
		{
		  var valid
		  valid = true;
		  if(!chkName())  	//Namen generell ueberpruefen
		    {
		    valid = false;
		    return valid;
		    exit;
		    }

		  if(!chkAdresse())  	
		    {
		    valid = false;
		    return valid;
		    exit;
		    }
			
		  if(!chkEmail())  	
		    {
		    valid = false;
		    return valid;
		    exit;
		    }

		}
                    


	function chkName()
		{
		if(document.Anfrage.Name.value == "")
		  {
		    alert("Bitte geben Sie Ihren Namen ein!");
		    document.Anfrage.Name.focus();
		    return false;
		  }
		else
		  return true;
		}

	function chkAdresse()
		{
		if((document.Anfrage.Strasse.value == "") || (document.Anfrage.Ort.value == ""))
		  {
		  alert("Bitte geben Sie Ihre komplette Adresse ein!");
		  document.Anfrage.Strasse.focus();
		  return false;
		  }
		else
		  return true;
		}

         function chktelfon()
		{
		if(document.Anfrage.Telefon.value == "")
		 {
		  alert("Bitte geben Sie Ihre Telefon-Nummer ein!");
		  document.Anfrage.Telefon.focus();
		  return false;
		  exit;
		 }
		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 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 fCheckEmail(adress)
	{
	if ((adress =="")
		|| (adress.indexOf ('@') == -1)
		|| (adress.indexOf ('.') == -1))
		return false;
	return true;
	}

//	Funktion des Browser-Zurueck-Buttons 
function fBack()
{ 
parent.Content.history.back(1);
} 

function fKopf()
{ 
top.kopfzeile.document.location.href="kopf.html";
} 

function fKopf2()
{ 
top.kopfzeile.document.location.href="kopf2.html";
} 

function fZoom(imageName,imageWidth,imageHeight,bildunterschrift) 
{ 

if (fZoom.arguments.length>3){
  if (imageWidth>800){
    newWindow = window.open("","newWindow","width="+(800)+",height="+(imageHeight)+",scrollbars=yes");
  }else{
    newWindow = window.open("","newWindow","width="+(imageWidth)+",height="+(imageHeight)+",scrollbars=no,resizable=no");
  }
}else{
  if (imageWidth>800){
    newWindow = window.open("","newWindow","width="+(800)+",height="+(imageHeight)+",scrollbars=yes");
  }else{
    newWindow = window.open("","newWindow","width="+(imageWidth)+",height="+(imageHeight)+",scrollbars=no,resizable=no");
  }
}


//newWindow=window.open("","newWindow","width="+(20+imageWidth)+",height="+(+fensterheigth)+", scrollbars=no");
newWindow.document.open();
newWindow.document.write('<html><head><title>Steinbildhauerei Grabmale Gottsknecht</title>');
newWindow.document.write('<link rel=stylesheet ype="text/css" href="../Library/parallaxis.css"></head>');
newWindow.document.write('<body bgcolor="#111015" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" background="" 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('<br><br><b>'+ bildunterschrift+'</b>')
}
newWindow.document.write('</body></html>');

newWindow.document.close(); 
newWindow.focus(); 
}


// Zoom-Funktion 640*480 vordefiniert Querformat-Bilder
function hZoom(imageName,bildunterschrift) 
{ 
newWindow = window.open("","newWindow","width="+(640)+",height="+(480)+",scrollbars=no");
newWindow.document.open();
newWindow.document.write('<html><head><title>Grabmale Gottsknecht</title>');
newWindow.document.write('</head>');
newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onBlur="self.close()">')
newWindow.document.write('<p align="center"><a href="javascript:self.close()"><img src=\"../Zoom/'+imageName+'.JPG\"  width="640" height="480"  align="absmiddle" border=0></a>');
if (hZoom.arguments.length>3)
  {
  newWindow.document.write('<font face="Arial, Helvetica, sans-serif" size="2" color="#4E8537"><br><br><b>'+ bildunterschrift+'</b></font></p></body></html>')
  }
newWindow.document.close(); 
newWindow.focus(); 
}


// Zoom-Funktion 480*640 vordefiniert Hochformat-Bilder
function vZoom(imageName,bildunterschrift) 
{ 
//alert('vZoom');
newWindow = window.open("","newWindow","width="+(480)+",height="+(640)+",scrollbars=no");
//newWindow=window.open("","newWindow","width="+(500)+",height="+(641)+", scrollbars=no");
newWindow.document.open();
newWindow.document.write('<html><head><title>Grabmale Gottsknecht</title>');
newWindow.document.write('</head>');
//newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="10" marginheight="10" marginwidth="0" background="../images/streifen_hg.gif" onBlur="self.close()">');
newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onBlur="self.close()">')
newWindow.document.write('<p align="center"><a href="javascript:self.close()"><img src=\"../Zoom/'+imageName+'.JPG\"  width="480" height="640"  align="absmiddle" border=0></a>');
if (vZoom.arguments.length>3)
  {
  newWindow.document.write('<font face="Arial, Helvetica, sans-serif" size="2" color="#4E8537"><br><br><b>'+ bildunterschrift+'</b></font></p></body></html>')
  }
newWindow.document.close(); 
newWindow.focus(); 
}

//	Zoom-Funktion mit Parametern und scrollbar
function fZoomscroll(imageName,imageWidth,imageHeight,bildunterschrift) 
{ 
//alert('fZoom');
newWindow = window.open("","newWindow","width="+(imageWidth)+",height="+(imageHeight)+",scrollbars=yes");
//newWindow=window.open("","newWindow","width="+(20+imageWidth)+",height="+(1+fensterheigth)+", scrollbars=no");
newWindow.document.open();
newWindow.document.write('<html><head><title>Grabmale Gottsknecht</title>');
newWindow.document.write('</head>');
//newWindow.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="10" marginheight="10" marginwidth="0" background="../images/streifen_hg.gif" onBlur="self.close()">');
newWindow.document.write('<body bgcolor="#FFFFFF" 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 (fZoomscroll.arguments.length>3)
  {
  newWindow.document.write('<font face="Arial, Helvetica, sans-serif" size="2" color="#4E8537"><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_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

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];}
}


function start(url) {
        opener.location = url;
        }

function zu() {
      window.close()
        }


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_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

