// JavaScript Document

viewPdf = function(p){
	urlLink = "viewPDF.php?pdfUrl=" + p;
	window.open(urlLink, "newWindow", "width=400, height=300, resizable=yes, toolbar=no, location=no, status=yes, menubar=no, scrollbars=no");
}

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 checkForm(){
	if(document.Anfrage.Vorname.value == "")  {
	   alert("[Vorname] bitte ausfüllen");
	   document.Anfrage.Vorname.focus();
	   return false;
	}
	if(document.Anfrage.Nachname.value == "")  {
	   alert("[Nachname] bitte ausfüllen");
	   document.Anfrage.Nachname.focus();
	   return false;
	}
	/*
	if(document.Anfrage.Email.value == "")  {
	   alert("[Email] bitte ausfüllen");
	   document.Anfrage.Email.focus();
	   return false;
	}else{
		return checkMail(document.Anfrage.Nachname.value)
	}
	*/
}

function checkMail(s)
{
	 var a = false;
	 var res = false;
	 if(typeof(RegExp) == 'function'){
	  var b = new RegExp('abc');
	  if(b.test('abc') == true){a = true;}
	 }
	
	 if(a == true){
	  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
					   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
					   '(\\.)([a-zA-Z]{2,4})$');
	  res = (reg.test(s));
	 }
	 else{
	  res = (s.search('@') >= 1 &&
			 s.lastIndexOf('.') > s.search('@') &&
			 s.lastIndexOf('.') >= s.length-5)
	 }
	 return(res);
} 


