	var countnum='0';
		function checkzahl(feld){
		  var chkZ = true;
		  for (i = 0; i < feld.length; ++i){
		    if ((feld.charAt(i) < '0') || (feld.charAt(i) > '9')){
				chkZ = false;
			}
		  }
		  return chkZ;
		}
		
		function testimage(feld){
			var chkZ = true;
			if((feld.value.indexOf(".jpg") == -1) && (feld.value.indexOf(".gif") == -1) && (feld.value.indexOf(".png") == -1)){
				chkZ = false;
			}
			return chkZ;
		}
function countlength(feld){
	if(feld.value.length<4){
		alert('the year should have 4 character');
		feld.focus();
	}
}
function checkbirthdate(){
	var Objektname = new Date(document.mosForm.gjahr.value, document.mosForm.gmonat.value, document.mosForm.gtag.value);
	var jetzt = new Date();
	var dtime = Objektname.getTime();
	var d2time = jetzt.getTime();
	var y=(d2time-dtime);
	var Zeit = new Date();
	Zeit.setTime(y + 14 * 24 * 60 * 60 * 1000);
	var alter = Zeit.getFullYear() - 1970;
	if(alter<18){
		return false;
	}else{
		return true;
	}
}


function postForm(field) {
	
	if(field=='email'){
		inputfield = document.getElementById('email1');
	}else{
		inputfield = document.getElementById('pzn');
	}
	var mygetrequest = null;
	try{
		mygetrequest = new XMLHttpRequest();
	}catch (ms){
		try{
			mygetrequest = new ActiveXObject('Msxml2.XMLHTTP');
		}catch (nonms){
			try{
				mygetrequest = new ActiveXObject('Microsoft.XMLHTTP');
			}catch (failed){
				mygetrequest = null;
			}
		}  
	}
	mygetrequest.onreadystatechange=function(){
		if (mygetrequest.readyState==4){
			if (mygetrequest.status==200 || window.location.href.indexOf('http')==-1){
				if(mygetrequest.responseText!=''){
					alert(mygetrequest.responseText);
					inputfield.focus();
				}
			}else{
				alert('An error has occured making the request');
			}
		}
	};
	if(field=='email'){
		mygetrequest.open('GET', 'ajax.php?ff='+encodeURIComponent(inputfield.value), true);
	}else{
		mygetrequest.open('GET', 'ajax.php?ff='+encodeURIComponent('<?php echo $useremail; ?>')+'&pzn='+document.getElementById('pzn').value+'&pznanfrage=ja', true);
	}
	mygetrequest.send(null);
}
function checkzahl(feld){
	var chkZ = true;
	for (i = 0; i < feld.length; ++i){
		if ((feld.charAt(i) < "0") || (feld.charAt(i) > "9")){
			chkZ = false;
		}
	}
	return chkZ;
}


<!-- Original:  Patrick Lewis mod: W. Jansen -->
<!-- Begin

// :::::::: welcher Browser ? ::::::::
if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}


//  ::::::::  PopUp-Texte (in Reihenfolge der Links) ::::::::

//  :::::::: PopUp-Texte bis hier ::::::::

// Indikator für sichtbar / unsichtbar
overdiv="0";

// zeigt die PopUp-Box (in einer Tabelle)
function popLayer(strasse,nr,plz,stadt,apotheker)
{

address1=strasse+','+nr+','+plz+','+stadt;

/*desc = "<table style='border:1px solid #5F5F5F' cellspacing=0 cellpadding=8 border=0><tr><td style='font-size:11px;color:#000000;background-color:#F8F8F8'>\n"
        +"<div id='map_canvas' style='width: 100px; height: 50px'></div>\n</td></tr></table>";*/


	document.getElementById("object1").style.visibility = 'visible';
    document.getElementById("object1").style.left=x+15;
    document.getElementById("object1").style.top=y-5;
	showAddress(address1);
	document.getElementById("adress").innerHTML = '<b>'+apotheker+'</b><br>'+strasse+'&nbsp;'+nr+'<br>'+plz+'&nbsp;'+stadt;
	//alert(address1);
}


//  versteckt die PopUp-Box
function hideLayer(){
/*if (overdiv == "0") {
        if(navigator.family =="nn4") {eval(document.object1.top="-500");}
        else if(navigator.family =="ie4"){object1.innerHTML="";}
        else if(navigator.family =="gecko") {document.getElementById("object1").style.top="-500";}
        }*/
	if (overdiv == "0") {
        document.getElementById("object1").style.visibility = "hidden";
    }
		
}

function showdivtext(){
	if(document.getElementById('h1text')){
		
		if(document.getElementById('h1text').style.display!=""){
			document.getElementById('h1text').style.display = "";
			document.getElementById('h2text').style.display = "none";
			//document.getElementById('desctext1').style.visibility = "visible";
			//document.getElementById('desclink').style.visibility = "hidden";
			
		}else{
			document.getElementById('h2text').style.display = "";
			document.getElementById('h1text').style.display = "none";
			
			//document.getElementById('desctext').style.visibility = "hidden";
			//document.getElementById('desctext1').style.visibility = "hidden";
			//document.getElementById('desclink').style.visibility = "visible";
			
		}
	}
}

//  überwacht Maus-Position / plaziert die Box dementsprechend

var isNav = (navigator.appName.indexOf("Netscape") !=-1);

function handlerMM(e){

// entweder feste x/y-Position für die Info-Box
// x = 300; // Infobox x-Position bei 300 von links
// y = 0;   // Infobox y-Position bei 0 (oben)
// oder Plazierung neben Mauszeiger


x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;

}

if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
//  End -->

function changepage(pzn,form1,id){
	//alert('index.php?area=login&pznid='+pzn+'&num='+document.forms[form1].elements[id].options[document.forms[form1].elements[id].selectedIndex].value);
	location.href='index.php?area=login&pznid='+pzn+'&num='+document.forms[form1].elements[id].options[document.forms[form1].elements[id].selectedIndex].value;
}





  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17049616-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



  
  
  function getQueryVariable(variable) {
											var query = window.location.search.substring(1);
											
											if(query.indexOf("&")){
											var vars = query.split("&");
											if(vars.length>0){
											for (var i=0;i<vars.length;i++) {
												var pair = vars[i].split("=");
												if (pair[0] == variable) {
													return pair[1];
												}
											}
											}
											}
										}
										function showtitle(utype,action){
											
											if(getQueryVariable("task") == "registration"){
											if((action == "click") || ((action == "load") && (getQueryVariable("type") == "apotheke"))){
											if((utype == "a") || (utype == "b")){
												if(utype == "b"){
													document.getElementById("apo1").style.visibility = "hidden";
													document.getElementById("apo2").style.visibility = "hidden";
													document.getElementById("bankareareg").style.visibility = "hidden";
													//document.getElementById("bankareareg").style.top = "600px";
													document.getElementById("erstkunden").style.visibility = "hidden";
													document.getElementById("submitreg").style.top = "375px";
													document.getElementById("apotext").style.visibility = "hidden";
													
												}else{
													document.getElementById("apo1").style.visibility = "visible";
													document.mosForm.apothekenname.value="";
													document.mosForm.strasse.value="";
													document.mosForm.plz.value="";
													document.mosForm.stadt1.value="";
													document.mosForm.telefon.value="";
													document.getElementById("apo2").style.visibility = "visible";
													document.getElementById("erstkunden").style.visibility = "visible";
													document.getElementById("bankareareg").style.visibility = "visible";
													document.getElementById("bankareareg").style.top = "375px";
													document.getElementById("submitreg").style.top = "565px";
													document.getElementById("apotext").style.visibility = "visible";
												}
											}
											}
											}
										}
  
  
var nachricht=" +++ Dieser Service ist für Patienten, Kunden und Apotheken kostenlos!";
var text;
var verzoegerung=100;
var timerId;
function ticker(nachricht,id) {
	if(document.getElementById(id)){
		text=nachricht;
		document.getElementById(id).innerHTML=text;
		nachricht=nachricht.substring (1, nachricht.length) + nachricht.substring (0, 1);
		timerId=setTimeout("ticker('"+nachricht+"','"+id+"')", verzoegerung);
	}
} 

function getElementCoords(eo){
	if(eo){
		var coords = {x: 0, y: 0};
		do {
			if(eo.currentStyle){
				if(eo.currentStyle.position!='relative'){
					coords.x += eo.offsetLeft;
					coords.y += eo.offsetTop;
				}
			} else {
				coords.x += eo.offsetLeft;
				coords.y += eo.offsetTop;
			}
			eo = eo.offsetParent;
		} while(eo);
		return coords;
	} else {
		return null;
	}
	
}

function divhidden(id,option){
	//alert(document.getElementById(id).style.visibility);
	
	if(document.getElementById(id)){
		if(option == "visible"){
			document.getElementById(id).style.visibility = "visible";
		}else{
			document.getElementById(id).style.visibility = "hidden";
			document.getElementById(id).innerHTML="";
		}
	}
	/*else{
		document.getElementById(id).style.visibility = "visible";
	}*/
}

function poscss(){
	/*var topsuchtext = document.getElementById('suchtext').offsetTop;
	var leftsuchtext = document.getElementById('suchtext').offsetLeft;
	var topstadt = results1.offsetTop;
	var leftstadt = document.all.results1.offsetLeft;*/
	//alert(document.all.suchtext.offsetTop);
	suchtextpos = getElementCoords(document.getElementById('suchtext'));
	//stadtpos = getElementCoords(document.getElementById('homeshow'));	
	var myStyle = document.createElement("style");
	myStyle.setAttribute( "type", "text/css" );
	document.getElementsByTagName("head")[0].appendChild(myStyle);
	var styles = document.styleSheets.length;  
	myStyle = document.styleSheets[styles-1];
	if(suchtextpos != null){
		if((document.styleSheets[0].cssRules)){
			if(suchtextpos.y>300){
				myStyle.insertRule("#results{position:absolute;width:260px;top:"+(suchtextpos.y+46)+"px; left:"+suchtextpos.x+"px;background:#FFFFFF; border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default}", 0);  
				//myStyle.insertRule("#div11{position:absolute;top:"+(stadtpos.y+66)+"px; left:"+stadtpos.x+"px; background:#FFFFFF;border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default}", 0);  
			}else{
				myStyle.insertRule("#results{position:absolute;width:260px;top:"+(suchtextpos.y+26)+"px; left:"+suchtextpos.x+"px;background:#FFFFFF; border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default}", 0);  
				//myStyle.insertRule("#div11{position:absolute;top:"+(stadtpos.y+46)+"px; left:"+stadtpos.x+"px; background:#FFFFFF;border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default}", 0);  
			}
		} else {
			if ( document.styleSheets[0].rules ) {
				myStyle.addRule("#results", "position:absolute;width:260px;top:"+(suchtextpos.y+22)+"px; left:"+suchtextpos.x+"px; background:#FFFFFF;border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default"); 
				//myStyle.addRule("#div11", "position:absolute;top:"+(stadtpos.y+22)+"px; left:"+stadtpos.x+"px; background:#FFFFFF;border:solid 1px #DEDEDE; display:none;max-height:20em;overflow:auto;overflow-x:hidden;cursor:default"); 
			}
		}
	}
	
}

  
  
  var aaaa=0;
  /*function loadspacer(){	
		//alert(aaaa);
	  if(document.getElementById('spacer1')){
		var spacer2 = getElementCoords(document.getElementById('spacer1'));
		//alert(spacer2.x);
		document.getElementById("warenkorbansicht").style.left=(spacer2.x-200)+'px';
		
		document.getElementById("warenkorbansicht").style.top=spacer2.y;
		document.getElementById("warentabelle").style.left=(spacer2.x-200)+'px';
		document.getElementById("warentabelle").style.top=spacer2.y;
		alert(document.getElementById("warenkorbansicht").style.left);
		alert(document.getElementById("warentabelle").style.left);
		
	 }
	 if(aaaa==0){
		setTimeout('loadspacer()',60);
		aaaa = 1;
	}
 }*/
 
 
 var map1 = null;
    var geocoder1 = null;

    function initialize1() {
      if (GBrowserIsCompatible()) {
        map1 = new GMap2(document.getElementById("map_canvas1"));
        map1.setCenter(new GLatLng(37.4419, -122.1419), 13);
		map1.addControl(new GSmallMapControl());
		map1.addControl(new GMapTypeControl()); 
        geocoder1 = new GClientGeocoder();
		//alert(geocoder1);
      }
    }

    function showAddress1(address,apotheker) {
		if(document.getElementById("tabellemap").style.visibility != 'visible'){
			document.getElementById("tabellemap").style.visibility = 'visible';
		}
      if (geocoder1) {
        geocoder1.getLatLng(
          address,
          function(point1) {
            if (point1) {
             // alert(address + " not found");
            //} else {
				map1.setCenter(point1, 5);
				
				var icon = new GIcon();
				icon.image = "http://www.google.com/intl/en_us/mapfiles/ms/icons/red-dot.png";
				icon.iconSize = new GSize(30, 30);
				icon.iconAnchor = new GPoint(14,32);
				icon.infoWindowAnchor = new GPoint(31, 8);
				var marker1 = new GMarker(point1,icon);
				GEvent.addListener(marker1, 'click', function() {marker1.openInfoWindowHtml('<b>'+apotheker+'</b><br>'+address);});
				//GEvent.addListener(marker1, "click", function() {marker1.setImage("http://www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png");});
				GEvent.addListener(marker1, "mouseout", function() {marker1.setImage("http://www.google.com/intl/en_us/mapfiles/ms/icons/red-dot.png");});
				/*GEvent.addListener(marker1, "click", function() {marker1.setImage("http://www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png");});
				GEvent.addListener(marker1, "mouseout", function() {marker1.setImage("http://www.google.com/intl/en_us/mapfiles/ms/icons/red-dot.png");});*/
				map1.addOverlay(marker1,icon);
              //marker1.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
	var marker2;
	function showAddress2(address,apotheker) {
		if(document.getElementById("tabellemap").style.visibility != 'visible'){
			document.getElementById("tabellemap").style.visibility = 'visible';
		}
      if (geocoder1) {
        geocoder1.getLatLng(
          address,
          function(point1) {
            if (point1) {
             // alert(address + " not found");
            //} else {
              map1.setCenter(point1, 13);
			  var icon = new GIcon();
				icon.image = "http://www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png";
				icon.iconSize = new GSize(30, 30);
				icon.iconAnchor = new GPoint(14,32);
				icon.infoWindowAnchor = new GPoint(31, 8);
              marker2 = new GMarker(point1,icon);
			  map1.removeOverlay(marker2);
			  marker2.closeInfoWindow();
			  GEvent.addListener(marker2, 'click', function() {marker2.openInfoWindowHtml('<b>'+apotheker+'</b><br>'+address);});
              map1.addOverlay(marker2,icon);
			  marker2.openInfoWindowHtml('<b>'+apotheker+'</b><br>'+address);
			  //marker2.setIcon("http://www.google.com/mapfiles/dd-start.png");
			  
            }
          }
        );
      }
    }
	function showAddress3(address) {
		if(document.getElementById("tabellemap").style.visibility != 'visible'){
			document.getElementById("tabellemap").style.visibility = 'visible';
		}
      if (geocoder1) {
        geocoder1.getLatLng(
          address,
          function(point1) {
            if (point1) {
           //   alert(address + " not found");
            //} else {
			var icon = new GIcon();
				icon.image = "http://www.google.com/intl/en_us/mapfiles/ms/icons/red-dot.png";
				icon.iconSize = new GSize(30, 30);
				icon.iconAnchor = new GPoint(14,32);
				icon.infoWindowAnchor = new GPoint(31, 8);
              map1.setCenter(point1, 13);
              var marker1 = new GMarker(point1,icon);
			  GEvent.addListener(marker1, 'click', function() {marker1.openInfoWindowHtml(address)});
              map1.removeOverlay(marker1);
              marker1.closeInfoWindow();
            }
          }
        );
      }
    }

