
var weg_img=0;  
var weg_ktr=0;
function weg_ex()
{

 if (weg_img==1 ) { weg_img=0; document.images['anfahrt'].src=img3_on.src; return;}
 if (weg_img==0 ) { weg_img=1; document.images['anfahrt'].src=img3_off.src; }

}


function popup_for_image(a,gr_title)
{
pic=new Image();
pic.src=a;
h=pic.height;
w=pic.width;

    t=(screen.height-h)/2;
    l=(screen.width-w)/2;

if (pic.width <= 0 || pic.height <= 0){
  setTimeout("popup_for_image('" + a + "','" + gr_title + "');", 500);
}
else
{
var fenster2 = window.open('','','width='+w+',height='+h+',top='+t+',left='  +l+',location=no, statusbar=no, directories=no, resizable=no, menubar=no, toolbar=no, scrollbars=no');fenster2.focus();
//if (gr_title="") gr_title="Bild";
fenster2.document.open();
fenster2.document.write("<html><head><title>"+gr_title+"</title></head><body leftmargin=0 topmargin=0 margindwidth=0 marginheight=0>");
fenster2.document.write("<img src="+a+">");
if (gr_title && gr_title != "undefined") fenster2.document.write("<div style='bottom:0;left:0;font-family:verdana, sans-serif;font-size:12px;font-weight:bold;position:absolute;width:100%;color:#00BAEF;background-color:#000;filter: alpha(opacity=60);opacity: 0.6;text-align:center;padding:10px'>"+gr_title+"</div>");
fenster2.document.write("</body></html>");
fenster2.document.close();
fenster2.focus();
}

}
 
 


function popup_for_content(a,gr_title)
{
pic=new Image();
pic.src=a;
h=pic.height;
w=pic.width;

    t=(screen.height-h)/2;
    l=(screen.width-w)/2;
if (pic.width <= 0 || pic.height <= 0){
  setTimeout("popup_for_content('" + a + "');", 500);
}
else
{
if (gr_title="") gr_title="Bild";
var fenster2 = window.open('','','width='+w+',height='+h+',top='+t+',left='  +l+',location=no, statusbar=no, directories=no, resizable=no, menubar=no, toolbar=no, scrollbars=no');fenster2.focus();
var gr_url= "images1/weltkarte.jpg"; 
fenster2.document.open();

fenster2.document.write("<html><head><title>"+gr_title+"</title></head><body leftmargin=0 topmargin=0 margindwidth=0 marginheight=0>");
fenster2.document.write("<div><map name='Landkarte'><area shape='rect' coords='217,42,308,166' href='images1/welt.htm' onClick='' alt='Europa'></map></div>");
fenster2.document.write("<img border='0' src="+a+" usemap='#Landkarte' >");
fenster2.document.write("</body></html>");
fenster2.document.close();
fenster2.focus();
}
}
 



<!--
// PRELOADING IMAGES
if (document.images) {

 img1_on =new Image(); img1_on.src ="picp/h.gif"; 
 img1_off=new Image(); img1_off.src="picp/h2.gif"; 
 img2_on =new Image(); img2_on.src ="picp/h.gif"; 
 img2_off=new Image(); img2_off.src="picp/h2.gif"; 
 img3_on =new Image(); img3_on.src ="images1/anfahrtsskizze-bene-1.jpg";
 img3_off =new Image(); img3_off.src ="images1/anfahrtsskizze-bene-2.jpg";

}

function movr(k) {
 if (document.images) 
  eval('document.img'+k+'.src=img'+k+'_on.src');
//  document.img1.src = img1_on.src ;  //alert('document.img'+k+'.src=img'+k+'_on.src');

}

function mout(k) {
 if (document.images) 
  eval('document.img'+k+'.src=img'+k+'_off.src');


}

function handleOver() {

 if (document.images) 
  document.imgName.src=img_on.src;
}

function handleOut() {
 if (document.images) 
  document.imgName.src=img_off.src;
}

$(document).ready(function(){

	$("form").submit( function() {
	  return formValidating(document.kontakt);
	 } );


$("img.popup").css("cursor","pointer");
	$("img.popup").click(function(){
	var file=this.src;
	var i=file.lastIndexOf(".");
	file=file.substr(0,i)+"_g."+file.substr(i+1);
	popup_for_image(file,this.alt);
	});
});

function checkEmail (strng) {
var ret=true;
if (strng == "") {
   ret = false;
}
    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       ret = false;
    }
    else {
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          ret = false;
       }
    }
return ret;    
}




var strKlassenName = "novalidate";
var u1sercolor="#00baef";
var strPattern = eval("/"+strKlassenName+"/");
function formValidating(objForm){
	  var blnSend = true;
		  for(var i=0; i<objForm.elements.length; i++){

			var objElement = objForm.elements[i];
				if (objElement.type=="text" || objElement.type=="password" || objElement.type=="textarea" ){
				var gr_match1=objElement.value;
				var illegalChars1= /[\(\)\<\>\\\"\[\]]/
				if (gr_match1.match(illegalChars1))  {objElement.style.backgroundColor = u1sercolor; blnSend = false;} else objElement.style.backgroundColor = "";
				}

				if (objElement.type=="text" || objElement.type=="password" )
						if(objElement.className.search(strPattern) == -1){
								
								
								if(objElement.value.length < 1 ) {
								objElement.style.backgroundColor = u1sercolor; blnSend = false;
								} else if(objElement.value.length >= 3) {
								objElement.style.backgroundColor = "";
								}
								if (objElement.name.search("b9") >=0){ /*nom email*/
								var valid=objElement.value;
								if (checkEmail(objElement.value)==true) objElement.style.backgroundColor = ""; else {objElement.style.backgroundColor = u1sercolor; blnSend = false;}
								}
		
							var gr_match=objElement.value;
							var illegalChars= /[\(\)\<\>\\\"\[\]]/
							if (gr_match.match(illegalChars))  {objElement.style.backgroundColor = u1sercolor; blnSend = false;} else if (blnSend == true) objElement.style.backgroundColor = "";
		
				}
				if (objElement.type=="checkbox" )
				if(objElement.className.search(strPattern) == -1){
				  if(objElement.checked == false) {
					objElement.parentNode.style.backgroundColor = u1sercolor; blnSend = false;
				  } else if(objElement.checked == true) {
					objElement.parentNode.style.backgroundColor = "";
				  }
				}

				if (objElement.type=="radio" )
				if(objElement.className.search(strPattern) == -1){
					var boolRadio = false; 
					for(var z=0; z<objForm.elements[objElement.name].length; z++){
						if (objForm.elements[objElement.name][z].checked) {boolRadio = true; }
					}
				  if(boolRadio == false) {
					objElement.parentNode.style.backgroundColor = u1sercolor; blnSend = false;
				  } else if(boolRadio == true) {
					objElement.parentNode.style.backgroundColor = "";
				  }
				}
		  }
	  return blnSend;
}


