sfHover = function() {
  var sfEls = document.getElementById("nav").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
      }
      sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
      }
  }
 
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
function fixPNG(myImage) // correctly handle PNG transparency in Win IE 5.5 or higher.

    {
     if (window.ie55up)
        {
         var imgID = (myImage.id) ? "id='" + img.id + "' " : ""
         var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
         var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
         var imgStyle = "display:inline-block;" + myImage.style.cssText
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
         strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
         myImage.outerHTML = strNewHTML
        }
    }
capteurBasis=new Image();
capteurBasis.src="icons/capteur.png";
capteurActiv=new Image();
capteurActiv.src="icons/capteurOver.png";
capteurDruck=new Image();
capteurDruck.src="icons/capteurOnClick.png";


function bild(b)
{
	document.b1.src=b;
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

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_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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 MenueAuf(){
document.getElementById("unter1").style.visibility = "visible";
}
function MenueZu(){
document.getElementById("unter1").style.visibility = "hidden";
}
function sichtbar(){
document.getElementById("haupt1").style.visibility = "visible";
}
function unsichtbar(){
document.getElementById("haupt1").style.visibility = "hidden";
}

function printPage() { 
	print(document); 
}

function check_inquiry(formular){
	ok=true;
	if (formular.name1.value==""){
		alert("Bitte geben Sie Ihren Namen ein.");
		formular.name1.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie die E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			alert("Bitte überprüfen Sie die E-Mail Adresse.");
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
	



//////////////////////////////////////////////////////////////////
// qTip - CSS Tool Tips - by Craig Erskine
// http://qrayg.com | http://solardreamstudios.com
//
// Inspired by code from Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
//////////////////////////////////////////////////////////////////



var qTipTag = "a"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = -80; //This is qTip's X offset//
var qTipY = -30; //This is qTip's Y offset//



//There's No need to edit anything below this line//
tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle;
	var anchors = document.getElementsByTagName (qTipTag);

	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		sTitle = a.getAttribute("title");
		if(sTitle) {
			a.setAttribute("tiptitle", sTitle);
			a.removeAttribute("title");
			a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			a.onmouseout = function() {tooltip.hide()};
		}
	}
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

window.onload = function () {
	tooltip.init ();
}
function decode_utf8(utftext) {
	var plaintext = ""; var i=0; var c=c1=c2=0;
	while(i<utftext.length){
		c = utftext.charCodeAt(i);
		if (c<128) {
			plaintext += String.fromCharCode(c);
			i++;
		} else if((c>191) && (c<224)) {
			c2 = utftext.charCodeAt(i+1);
			plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
			i+=2;
		} else {
			c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
			plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
			i+=3;
		}
	}
	return plaintext;
}
function encode_utf82(rohtext) {
             // dient der Normalisierung des Zeilenumbruchs
             rohtext = rohtext.replace(/\r\n/g,"\n");
             var utftext = "";
             for(var n=0; n<rohtext.length; n++)
                 {
                 // ermitteln des Unicodes des  aktuellen Zeichens
                 var c=rohtext.charCodeAt(n);
                // alle Zeichen von 0-127 => 1byte
                 if (c<128)
                     utftext += String.fromCharCode(c);
                 // alle Zeichen von 127 bis 2047 => 2byte
                 else if((c>127) && (c<2048)) {
                     utftext += String.fromCharCode((c>>6)|192);
                     utftext += String.fromCharCode((c&63)|128);}
                 // alle Zeichen von 2048 bis 66536 => 3byte
                 else {
                     utftext += String.fromCharCode((c>>12)|224);
                     utftext += String.fromCharCode(((c>>6)&63)|128);
                     utftext += String.fromCharCode((c&63)|128);}
                 }
	return utftext;
}
function encode_utf8(rohtext) {
	 // dient der Normalisierung des Zeilenumbruchs
	rohtext = rohtext.replace(/\r\n/g,"\n");
	 var utftext = "";
	 for(var n=0; n<rohtext.length; n++)
		{
		 // ermitteln des Unicodes des  aktuellen Zeichens
		 var c=rohtext.charCodeAt(n);
		 // alle Zeichen von 0-127 => 1byte
		if (c<128)
			 utftext += String.fromCharCode(c);
		 // alle Zeichen von 127 bis 2047 => 2byte
		 else if((c>127) && (c<2048)) {
			 utftext += String.fromCharCode((c>>6)|192);
			 utftext += String.fromCharCode((c&63)|128);}
		 // alle Zeichen von 2048 bis 66536 => 3byte
		else {
			 utftext += String.fromCharCode((c>>12)|224);
			 utftext += String.fromCharCode(((c>>6)&63)|128);
			 utftext += String.fromCharCode((c&63)|128);}
		}
	 return utftext;
 }
function check_km(formular){
	ok=true;
	if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.nachricht.value==""){
		alert("Bitte geben Sie Ihre Nachricht ein.");
		formular.nachricht.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
function check_presse(formular){
	ok=true;
	if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.medienbetrieb.value==""){
		alert("Bitte geben Sie den Medienbetrieb an.");
		formular.medienbetrieb.focus();
		ok=false;
	}else if (formular.redaktion.value==""){
		alert("Bitte geben Sie die Redaktion an.");
		formular.redaktion.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.telefon.value==""){
		alert("Bitte geben Sie Ihre Telefonnummer ein.");
		formular.telefon.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
function check_kontaktform(formular){
	ok=true;
	if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.nachricht.value==""){
		alert("Bitte geben Sie Ihre Nachricht ein.");
		formular.nachricht.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}

function check_kk2(formular){
	ok=true;
	info="Bitte waehlen Sie die Anrede";
	info = encode_utf8(info);
	info = decode_utf8(info);
	if (formular.anrede.value==""){
		alert(info);
		formular.anrede.focus();
		ok=false;
	}else if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.telefon.value==""){
		alert("Bitte geben Sie Ihre Telefonnummer ein.");
		formular.telefon.focus();
		ok=false;
	}else if (formular.tag.value==""){
		alert("Bitte geben Sie Ihr Geburtsdatum ein.");
		formular.tag.focus();
		ok=false;
	}else if (formular.monat.value==""){
		alert("Bitte geben Sie Ihr Geburtsdatum ein.");
		formular.monat.focus();
		ok=false;
	}else if (formular.jahr.value==""){
		alert("Bitte geben Sie Ihr Geburtsdatum ein.");
		formular.jahr.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
function check_kk(formular){
	ok=true;
	info="Bitte geben Sie die Anrede an";
	if (formular.anrede.value==""){
		alert(info);
		formular.anrede.focus();
		ok=false;
	}else if (formular.pw.value==""){
		alert("Bitte geben Sie ein Passwort ein.");
		formular.pw.focus();
		ok=false;
	}else if (formular.pw2.value==""){
		alert("Bitte wiederholen Sie das Passwort.");
		formular.pw2.focus();
		ok=false;
	}else if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.telefon.value==""){
		alert("Bitte geben Sie Ihre Telefonnummer ein.");
		formular.telefon.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
function check_nl(formular){
	ok=true;
	info="Bitte geben Sie die Anrede an";
	if (formular.anrede.value==""){
		alert(info);
		formular.anrede.focus();
		ok=false;
	}else if (formular.vorname.value==""){
		alert("Bitte geben Sie Ihren Vornamen ein.");
		formular.vorname.focus();
		ok=false;
	}else if (formular.nachname.value==""){
		alert("Bitte geben Sie Ihren Nachnamen ein.");
		formular.nachname.focus();
		ok=false;
	}else if (formular.strasse.value==""){
		alert("Bitte geben Sie die Strasse ein.");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte geben Sie die Postleitzahl ein.");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte geben Sie den Ort ein.");
		formular.ort.focus();
		ok=false;
	}else if (formular.email.value==""){
		alert("Bitte geben Sie Ihre E-Mail Adresse ein.");
		formular.email.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}

function check_angebot(formular){
	ok=true;
	if (formular.strasse.value==""){
		alert("Bitte eintragen");
		formular.strasse.focus();
		ok=false;
	}else if (formular.plz.value==""){
		alert("Bitte eintragen");
		formular.plz.focus();
		ok=false;
	}else if (formular.ort.value==""){
		alert("Bitte eintragen");
		formular.ort.focus();
		ok=false;
	}else if (formular.verkaufsflaeche.value==""){
		alert("Bitte eintragen");
		formular.verkaufsflaeche.focus();
		ok=false;
	}else if (formular.nebenflaeche.value==""){
		alert("Bitte eintragen");
		formular.nebenflaeche.focus();
		ok=false;
	}else if (formular.schaufensterflaeche.value==""){
		alert("Bitte eintragen");
		formular.schaufensterflaeche.focus();
		ok=false;
	}else if (formular.mietpreis.value==""){
		alert("Bitte eintragen");
		formular.mietpreis.focus();
		ok=false;
	}else if (formular.nachbarn.value==""){
		alert("Bitte eintragen");
		formular.nachbarn.focus();
		ok=false;
	}else if (formular.anb_name.value==""){
		alert("Bitte eintragen");
		formular.anb_name.focus();
		ok=false;
	}else if (formular.anb_strasse.value==""){
		alert("Bitte eintragen");
		formular.anb_strasse.focus();
		ok=false;
	}else if (formular.anb_plz.value==""){
		alert("Bitte eintragen");
		formular.anb_plz.focus();
		ok=false;
	}else if (formular.anb_ort.value==""){
		alert("Bitte eintragen");
		formular.anb_ort.focus();
		ok=false;
	}else if (formular.anb_tel.value==""){
		alert("Bitte eintragen");
		formular.anb_tel.focus();
		ok=false;
	}else if (formular.email.value!=""){
		email_txt=formular.email.value;
		anz=email_txt.indexOf("@");
		anz2=email_txt.indexOf(".");
		if (anz < 0 || anz2 < 0){
			info = "Bitte kontrollieren Sie die E-Mail Adresse.";
			info = decode_utf8(info);
			alert(info);
			formular.email.focus();
			ok=false;
		}
	}else if (formular.fussgaengerzone.value!="" ){
		alert("Bitte anklicken");
		formular.fussgaengerzone.focus();
		ok=false;
	}else if (formular.einkaufszentrum.value==""){
		alert("Bitte anklicken");
		formular.einkaufszentrum.focus();
		ok=false;
	}else if (formular.fachmarktzentrum.value==""){
		alert("Bitte anklicken");
		formular.fachmarktzentrum.focus();
		ok=false;
	}
	
	if (ok==true){
		return true;
		
	} else {
		return false;
	}
}
function check_del(formular){
	text = "Soll der Kunde wirklich entfernt werden?";
	//text = encode_utf8(text);
	eingabe = confirm(text);	
	if (eingabe == true){
		formular.del.value = "1";
		return true;
	} else {
		return false;
	}
}
function check_del_exp(formular){
	text = "Soll der Datensatz wirklich entfernt werden?";
	eingabe = confirm(text);	
	if (eingabe == true){
		formular.del.value = "1";
		return true;
	} else {
		return false;
	}
}
function check_del_jobs(formular){
	text = "Soll das Angebot wirklich entfernt werden?";
	//text = encode_utf8(text);
	eingabe = confirm(text);	
	if (eingabe == true){
		formular.del.value = "1";
		return true;
	} else {
		return false;
	}
}