function werbungladen () 
{
	document.getElementById("kopfwerbung").innerHTML="<iframe src=\"/kopfwerbung.html?1204543584\" width=\"728\" height=\"90\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowtransparency=\"true\"><\/iframe>";
	document.getElementById("werbungrechts").innerHTML="<iframe src=\"/werbungrechts.html?1204543584\" width=\"160\" height=\"600\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowtransparency=\"true\"><\/iframe>";
	
//	if(document.getElementById("werbungunten"))
//		document.getElementById("werbungunten").innerHTML='<script type="text/javascript" src="http://www.zitate.de/scripts/zitat_des_tages.js"></script>'; //alt: Amazon "<iframe src=\"/werbungunten.html?1204543584\" width=\"730\" height=\"90\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowtransparency=\"true\"><\/iframe>";
}	

function formreset()
{
	document.suche.company.value = 'Name';
	document.suche.pCode.value = 'PLZ';
	document.suche.city.value = 'Ort';
//	document.suche.info.value = 'Schlagwort';
	document.suche.volltext.value = 'Volltext';
}

function dublettenloeschung(name, id)
{
	antwort=confirm('Wollen Sie den Datensatz '+name+' wirklich löschen?');
	if (antwort)
		self.location.href="dublettenloeschung.php?id1="+id;
}

/* Javascript für das Adminmenue in IE */
if(window.navigator.systemLanguage && !window.navigator.language) 
{
	function hoverIE() 
	{
		var LI = document.getElementById("Navigation").firstChild;
		
		do 
		{
			if (sucheUL(LI.firstChild)) 
			{
				LI.onmouseover=einblenden; 
				LI.onmouseout=ausblenden;
			}
			LI = LI.nextSibling;
		}
		while(LI);
	}
	
	function sucheUL(UL) 
	{
		do 
		{
			if(UL) UL = UL.nextSibling;
			if(UL && UL.nodeName == "UL") return UL;
		}
		while(UL);
		
		return false;
	}
	
	function einblenden() 
	{
		var UL = sucheUL(this.firstChild);
		UL.style.display = "block"; 
	}
	
	function ausblenden() 
	{
		sucheUL(this.firstChild).style.display = "none";
	}
	
	window.onload=hoverIE;
}

function maps_init(div, lat, lng)
{
	//Erstellt eine neue Instanz der Klasse GMap2, die die eigentliche Karte darstellt
	var map = new GMap2(document.getElementById(div));
	
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl()); 
	
	var position = new GLatLng(lat, lng);
	map.setCenter(position, 15);
	
	
	var marker = new GMarker(new GPoint(lat,lng));
	GEvent.addListener(marker, "click", function(){});
	
	//Anzeigen der Karte
	map.addOverlay(new GMarker(position));
}

function loadLoginMaske(id)
{
	document.getElementsByTagName('body')[0].scroll = 'no';
	document.getElementsByTagName('body')[0].style.overflow = 'hidden';
	document.getElementById(id).style.display = 'block';
	document.getElementById(id+'Login').style.display = 'block';
}

function destructLoginMaske(id)
{
	document.getElementsByTagName('body')[0].scroll = 'auto';
	document.getElementsByTagName('body')[0].style.overflow = 'auto';
	document.getElementById(id).style.display = 'none';
	document.getElementById(id+'Login').style.display = 'none';
}
//Google Maps Variablen

var geocoder;
var map;

function codeAddress(adress) {
    var address = adress;
    //var address = 'Waldstr. 8, 30163 Hannover';
    if (geocoder) {
      geocoder.geocode( { 'address': address}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
          map.setCenter(results[0].geometry.location);
          var marker = new google.maps.Marker({
              map: map, 
              position: results[0].geometry.location
          });
        } else {
          alert("Geocode was not successful for the following reason: " + status);
        }
      });
    }
  }

  function initialize(adress) {
    var latlng;
    var myOptions;

    geocoder = new google.maps.Geocoder();
    latlng = new google.maps.LatLng(-34.397, 150.644);
    myOptions = {
      zoom: 16,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map"), myOptions);
    codeAddress(adress);
  }
  
  function actualizeData(adressID){
	  location.href = '?mode=scan&id=' + adressID;
  }

//var gAdress;
//var gDiv;
//var gGeoCoder;

//function maps_init_v3(adress, div) {
//	gAdress = adress;
//	gDiv = div;
//
//	gGeoCoder = new google.maps.Geocoder();
//	calcMap();
//  }
//function calcMap() {
//	gGeoCoder.geocode( { 'address': gAdress}, function(results, status) {
//		var res = new Array();
//		var latLng;
//		var myOptions;
//		var map;
//		var marker;
//		
//		res[0] 	= results[0].geometry.location.Pa;
//		res[1] 	= results[0].geometry.location.Qa;
//		
//		latLng 	= new google.maps.LatLng(res[0], res[1]);
//		myOptions = {
//			zoom: 15,
//			center: latLng,
//			mapTypeId: google.maps.MapTypeId.ROADMAP
//		}
//		
//		map 	= new google.maps.Map(gDiv, myOptions);
//		marker 	= new google.maps.Marker({
//	        position: 	latLng, 
//	        map: 		map, 
//	    });
//	});
//}
