window.defaultStatus="Gewerbezentrale.de - F�r Industrie, Handel und Gewerbe";


function SwitchImg()
{
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
}

function RestoreImg()
{
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
}

//<a href=".html" onMouseOut="RestoreImg()" onMouseOver="SwitchImg('document.link1','document.link1','link_on.jpg')"><img src="link_off.jpg" name="link1" width="11" height="11" alt="" border="0"></a>

//aufruf: onsubmit="return check_mail('formular_name', 'E-Mail feldname', 'input1;;;fehlermeldung1###input2;;;fehlermeldung2###...###inputn;;;fehlermeldungn')"
function check_mail(formular, emailfeld, mailfeld)
{
		var inputs = mailfeld.split("###");
		var fehler;
		var rt = true; 
		var re = new RegExp ("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$");
		var laenge = inputs.length;
		for (n=0; n<laenge; n++)
		{
     		fehler = inputs[n].split(";;;");
			if (document[formular][fehler[0]].value == "")
    		{
    		   alert(fehler[1]);
    		   return false;		   
    		}
		}
		if (re.test(document[formular][emailfeld].value) == false)
		{
		   alert('Bitte geben Sie eine g�ltige E-mail Adresse\nin der Form IhrName@IhreDomain.de ein.')
		   document[formular][emailfeld].value = "";
		   document[formular][emailfeld].focus();
		   return false;
		}
		return rt;
}

function schnellsucheCheck()
{
 		 if (document.schnellsuche.text.value == "" && document.schnellsuche.ort.value == "")
		 {
			return false;
		 }
		 else
		 {
		  	 return true;
		 }
}

// routenplaner Eingabe Check
function mapCheck()
{
	var plzValue = document.route.szip.value;
	if (document.route.sstreet.value == "Strasse") 
	{
		document.route.sstreet.value = '';
	}
	if (document.route.scity.value == "-Ort-") 
	{
		document.route.scity.value = "";
	}
	if (document.route.szip.value == "" || document.route.szip.value == "PLZ" || isNaN(document.route.szip.value) == true) 
	{
		alert ("Bitte geben Sie eine Start PLZ ein.");
		document.route.szip.value == "";
		document.route.szip.focus();
		return false;
	}
	
	else 
	{
		var plz = document.route.szip.value.length;
		if (document.route.szip.value != "" && plz < 5)
		{
			var eingabe = confirm('Die Eingabe einer nicht vollst�ndigen PLZ kann zu unerwarteten Ergebnissen f�hren.\n\nTrotzdem fortfahren?');
			if (eingabe == true)
			{
				document.route.szip.value = plzValue;
				return true;
			}
			else
			{
				return false;
			}
		}
		return true;
	}
}
var bookmarkurl="http://www.gewerbe-suche.de"
var bookmarktitle="Gewerbezentrale"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

// tooltip >
wmtt = null;

document.onmousemove = updateWMTT;

function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
}

function hideWMTT() {
	wmtt.style.display = "none";
}

// Bild 2 Popup
function picPopup(id, breite, hoehe)
{
	var vonOben = screen.height/2-(hoehe/2+50);
	var vonLinks = screen.width/2-(breite/2+50);
	breite += 50;
	hoehe += 50;
	win = window.open('picpopup.php?id=' + id, '', 'top=' + vonOben + ', left=' + vonLinks + ', width=' + breite + ', height=' + hoehe + '');
}
/* PopUp für pressemitteilungen */

function winOpen(id, width, height)
{
		 width=width+40;
		 height=height+40;
		 window.open('referenzen.php?id=' + id + '', '', 'width='+ width +',height='+ height +',scrollbars=yes');
}