// chkAnmeldung
function chkSuche_einfach()
{
	var branche   = document.Suche_einfach.branche.value.length;
	var stichwort = document.Suche_einfach.stichwort.value.length;

	// beides leer
	if(branche<1 && stichwort<1)
	{
		alert("Bitte geben Sie etwas bei Branche und/oder Firma ein!");
		document.Suche_einfach.branche.focus();
		return false;
	}
	// branche leer stichwort kleiner als 3 Zeichen ODER beides ausgefüllt, Stichwort aber zu kurz
	if( (branche<1 && stichwort<3) || (branche>0 && stichwort>0 && stichwort<3) )
	{
		alert("Das Stichwort für die Firma sollte mind. 3 Zeichen lang sein!");
		document.Suche_einfach.stichwort.focus();
		return false;
	}
	// branche kleiner als 3 zeichen, stichwort leer ODER beides ausgefüllt, Branche aber zu kurz
	if( (branche<3 && stichwort<1) || (branche>0 && stichwort>0 && branche<3) )
	{
		alert("Das Stichwort für die Branche sollte mind. 3 Zeichen lang sein!");
		document.Suche_einfach.branche.focus();
		return false;
	}
}

function chkAnmeldung()
{
	if(document.Anmeldung.fname1.value == "")
	{
		alert("Bitte geben Sie einen Firmenname an!");
		document.Anmeldung.fname1.focus();
		return false;
	}
	if(document.Anmeldung.strasse.value == "")
	{
		alert("Bitte geben Sie die Strasse an!");
		document.Anmeldung.strasse.focus();
		return false;
	}
	if(document.Anmeldung.hn.value == "")
	{
		alert("Bitte geben Sie die Hausnummer an!");
		document.Anmeldung.hn.focus();
		return false;
	}
	if(document.Anmeldung.vw1.value == "")
	{
		alert("Bitte geben Sie die Telefonvorwahl an!");
		document.Anmeldung.vw1.focus();
		return false;
	}
	if(document.Anmeldung.tel1.value == "")
	{
		alert("Bitte geben Sie die Rufnummer an!");
		document.Anmeldung.tel1.focus();
		return false;
	}
	if(document.Anmeldung.branche.value == "")
	{
		alert("Bitte geben Sie mindestens eine Branche an!");
		document.Anmeldung.branche.focus();
		return false;
	}
}
//# chkAnmeldung

function chkPortaldatenform(theForm)
{
	if(theForm.fname1.value=="" || theForm.fname1.value.length<3)
	{
		alert("Bitte geben Sie einen Firmenname an!");
		theForm.fname1.focus();
		return false;
	}
	
	if(theForm.strasse.value=="")
	{
		alert("Bitte geben Sie die Strasse an!");
		theForm.strasse.focus();
		return false;
	}
	if(theForm.hn.value=="")
	{
		alert("Bitte geben Sie die Hausnummer an!");
		theForm.hn.focus();
		return false;
	}
	if(theForm.vw1.value=="")
	{
		alert("Bitte geben Sie die Telefonvorwahl an!");
		theForm.vw1.focus();
		return false;
	}
	if(theForm.tel1.value=="")
	{
		alert("Bitte geben Sie die Rufnummer an!");
		theForm.tel1.focus();
		return false;
	}
	if(theForm.email.value!="")
	{
		if(checkMail(theForm.email.value)==false)
		{
			alert("Die angegebene E-Mailadresse ist ungültig!");
			theForm.email.focus();
			return false;
		}
	}

	if(theForm.branchen.value=="")
	{
		alert("Bitte geben Sie mindestens eine Branche an!");
		theForm.branchen.focus();
		return false;
	}
}

function checkMail(email)
{
	var emailNorm = /^([_a-zA-Z0-9-]+)(\.[_a-zA-Z0-9-]+)*@(([a-zA-Z0-9-]{3,})+\.)+([a-zA-Z]{2,4})$/;
	if((emailNorm.test(email)) == false)
	{
		// alert("Ungültige E-Mail-Adresse.");
		return (false);
	}
	return (true);
}

/*
	CHROMELESS WINDOWS v.31.0 [ 4.50K ]
	(c) Gabriel Suchowolski,2000 | www.microbians.com
	Licensed under GNU LGPL (www.gnu.org)
*/
function chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO){
	var c=(document.all&&navigator.userAgent.indexOf("Win")!=-1)?1:0
	var w=window.screen.width; var h=window.screen.height
	var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W); W+=2*c
	var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H); H+=23*c
	var X=X||Math.ceil((w-W)/2)
	var Y=Y||Math.ceil((h-H)/2)
	var s=",width="+W+",height="+H
	if(c){
		var cTIT='\n'+
		'<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no">\n'+
		'<script>\n'+
		'var iclod=new Image();iclod.src="'+cD+'";var iclou=new Image();iclou.src="'+cU+'";var icloo=new Image();icloo.src="'+cO+'";var iload=new Image();iload.src="'+cL+'";\n'+
		'document.onselectstart=new Function("return false;");document.ondragstart=new Function("mWIN();return false;");document.oncontextmenu=new Function("return false;");document.onmousemove=mWIN\n'+
		'b=-1;\n'+
		'function wLoa(){if(top.loaded)bloa.style.visibility="hidden";else setTimeout("wLoa()",500)}\n'+
		'function sRes(){bclo.style.pixelLeft=document.body.clientWidth-18;bloa.style.pixelLeft=document.body.clientWidth-38}\n'+
		'function mWIN(){\n'+
		'if(b==0){document.body.bgColor="'+wBG+'";parent.bM.document.body.bgColor="'+wB+'";parent.bT.document.body.bgColor="'+wB+'";parent.bB.document.body.bgColor="'+wB+'";parent.bL.document.body.bgColor="'+wB+'";parent.bR.document.body.bgColor="'+wB+'";b=-1}\n'+
		'if(b==2){px=event.screenX-ofx-1;py=event.screenY-ofy-1;top.window.moveTo(px,py);}\n'+
		'if(b==1){document.body.bgColor="'+wBGs+'";parent.bM.document.body.bgColor="'+wBs+'";parent.bT.document.body.bgColor="'+wBs+'";parent.bB.document.body.bgColor="'+wBs+'";parent.bL.document.body.bgColor="'+wBs+'";parent.bR.document.body.bgColor="'+wBs+'";ofx=event.x;ofy=event.y;b=2}\n'+
		'}</script></head>\n'+
		'<body onresize="sRes()" bgcolor='+wBG+'>\n'+
		'<div style="position:absolute;left:0px;top:4px">'+tH+'</div>\n'+
		'<img id=bmov style="position:absolute;left:-50px;top:-50px" onmousedown="b=1;mWIN()" onmouseup="b=0;mWIN()" border=0 src="" width=150% height=500>\n'+
		'<img id=bclo style="position:absolute;top:4px;left:'+(W-20)+'px;" src="'+cU+'" border=0 width=11 height=11 onmouseover="this.src=icloo.src" onmouseout="this.src=iclou.src" onmouseup="this.src=iclou.src" onmousedown="this.src=iclod.src" onclick="top.window.close()">\n'+
		'<img id=bloa style="position:absolute;top:4px;left:'+(W-40)+'px;" src="'+cL+'" border=0 width=11 height=11>\n'+
		'<script>wLoa()</script>\n'+
		'</body>\n'+
		'</html>'
		cTIT=cTIT.replace(/\//g,"\\\/").replace(/\"/g,"\\\"").replace(/\n/g,"\\n")
		var cFRM='<TITLE>'+tW+'</TITLE>\n'+
		'<script>\n'+
		'top.loaded=false\n'+
		'function mTIT(){\n'+
		'	if(frames.length>6){\n'+
		'		fT.document.bgColor="'+wBG+'";fT.document.write("'+cTIT+'");fT.document.close()\n'+
		'		bM.document.bgColor="'+wB+'";bL.document.bgColor="'+wB+'";bR.document.bgColor="'+wB+'";bB.document.bgColor="'+wB+'";bT.document.bgColor="'+wB+'"\n'+
		'	} else setTimeout("mTIT()",20)\n'+
		'}\n'+
		'mTIT()\n'+
		'</script>\n'+
		'<frameset onselectstart="return false" onload="top.loaded=true" border=0 framespacing=0 frameborder=0 cols="1,100%,1">\n'+
		'	<frame name=bL src="about:blank" scrolling=no noresize>\n'+
		'	<frameset border=0 framespacing=0 frameborder=0 rows="1,20,1,100%,1">\n'+
		'		<frame name=bT src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=fT src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=bM src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=main src="'+u+'" '+fSO+'>\n'+
		'		<frame name=bB src="about:blank" scrolling=no noresize>\n'+
		'	</frameset>\n'+
		'<frame name=bR src="about:blank" scrolling=no noresize>\n'+
		'</frameset>\n'+
		'</HTML>'
		var CWIN=window.open("",n,"fullscreen=1"+s)
		CWIN.moveTo(5000,0)
		CWIN.resizeTo(W,H)
		CWIN.document.write(cFRM)
		CWIN.document.close()
		CWIN.moveTo(X,Y)
	} else {
		var CWIN=window.open(u,n,wNS+s,true)
		CWIN.moveTo(X,Y)
	}
	CWIN.focus()
	CWIN.setURL=function(u) { if (this && !this.closed) { if (this.frames.main) this.frames.main.location.href=u; else this.location.href=u } }
	CWIN.closeIT=function() { if (this && !this.closed) this.close() }
	return CWIN
}                                                                               
                                                                               
function openIT(u,W,H,X,Y,n,scrl,title) {
	var cD  ='images/close_dwn.gif'
	var cU  ='images/close_up.gif'
	var cO  ='images/close_ovr.gif'
	var cL  ='images/clock.gif'
	var tH  ='<font face=arial size=1>&nbsp;&nbsp;'+title+'</font>'
	var tW  ='&nbsp;&nbsp;'+title+'&nbsp;'
	var wB  ='#000000'	// Randfarbe
	var wBs ='#666666'	// Randfarbe gedrückt (beim verschieben)
	var wBG ='#EEEEEE'	// Hintergrundfarbe Titel
	var wBGs='#CCCCCC'	// Hintergrundfarbe Titel gedrückt
	var fSO ='scrolling='+scrl+' noresize'
	if (scrl == 'auto'){var scrlNS	= '1';}	else{var scrlNS	= '0';}
	var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0'+scrlNS+',resizable=1'
	return chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO)
}
//# chromless

// refresh
function JBNHVJCK_go()
{
	var ref = document.referrer; // wenn aktiviert, dann ist refesh beim Durchblättern der Dummyseiten deaktiviert
	var coo = document.cookie;	// lesen des Cookie
	sum = /(stadtportal)/g;
	if(sum.test(ref)==false && coo!=1)
	{
		coo = 1;
		tmp = 1;
		document.cookie = coo; // schreiben des Cookie
		var his = history.length;
		for (var i=0; i<(JBNHVJCK_go.arguments.length - 1); i+=2)
		eval(JBNHVJCK_go.arguments[i]+".loc"+"ation='"+JBNHVJCK_go.arguments[i+1]+"'");document.JBNHVJCK_back= false;
	}
	if(coo==1 && tmp!=1)
	{
		coo = 0;
		document.cookie = coo; // schreiben des Cookie
	}
}
//# JBNHVJCK


// popup für Verwaltung, damit nicht chromeless benutzt werden muß
function openF(datei,breite,hoehe,fname)
{
	var fname2;
	if (fname=="") { fname2='verw'; } else { fname2=fname; }
	var datei;
	var posX=(screen.width/2)-(breite/2);
	var posY=(screen.height/2)-(hoehe/2);
	window.open(''+datei+'',''+fname2+'','toolbar=no,directories=no,status=yes,scrollbars=yes,resize=no,resizable=yes,menubar=no,width=' + breite + ',height=' + hoehe + ',screenX=' + posX + ',screenY=' + posY + ',left=' + posX + ',top=' + posY + '');
}

function oc(cwidth,cheight,oC_name) {
	oC_name = "i";
	var posX=(screen.width/2)-(cwidth/2);
	var posY=(screen.height/2)-(cheight/2);
	window.open('',oC_name,'toolbar=no,directories=no,status=yes,scrollbars=yes,resize=no,resizable=yes,menubar=no,width=' + cwidth + ',height=' + cheight + ',screenX=' + posX + ',screenY=' + posY + ',left=' + posX + ',top=' + posY + '');
}