var winPopup = null;
objInput = document.getElementsByName("query")[0];
if (objInput) {
	
}

function onFocusHandler() {
	//if (!winPopup) return;
	//if (!winPopup.closed) winPopup.close();
	//winPopup = null;
}


function doGlobalOpen(url, name, width, height, typ){
	width = (width ? width : 480);
	height = (height ? height : (screen.height < 700 ? 540 : 600 ));
	if ( url.indexOf("http://") == 0 || url.indexOf("https://") == 0 ) url = url;
	else {
		if ( url.toLowerCase().indexOf("readform") > -1 || url.toLowerCase().indexOf("openform") > -1 || url.toLowerCase().indexOf("openview")  > -1)
		url = window.base + url;
		else url = window.base + url +".html";
	}//else
	var t ="Privatkunden";
	if(window.typ=="VNM") t="Marktpartner";
	if(window.typ=="VNG") t="Geschaeftskunden";
	url=url.replace("<!Type>",t);
	url=url.replace("VID/","VIDO/");
	winPopup = window.open(url,name,"width=" + width + ",height=" + height + ",screenX=0,screenY=0,left=100,top=50,dependent=yes,status=no,copyhistory=no,scrollbars=yes,toolbar=no,location=no");
	if (typ==false) {
		var winPopupLoc=winPopup;
		winPopupLoc.focus();
		winPopup=null;
	}else {
		winPopup.focus();
	}
	return false;
}

function doQuickFinder(f) {
	if(f.value!="#")
		window.location.href=window.base+f.value;
}

function doSearch() {
	if (window.query==null) return;
	var querys=window.query.value;
	querys=doUnicodeURL(querys);
	if(querys!=""){
		var url="search.html?ReadForm&query="+querys;
		document.location = window.base + url;
		//doGlobalOpen(url,"Suchergebnis",false,false, false);
	}
}

//unicode Url, benutzt für Suche
function doUnicodeURL(s){
     if(s==null) {
     	s="";
     	return s
     }else if (s=="") return s;
     /*while(s.indexOf(" ")!=-1) s=s.replace(" ","+");
     while(s.indexOf(String.fromCharCode(228))!=-1) s=s.replace(String.fromCharCode(228),"%E4");//ae
     while(s.indexOf(String.fromCharCode(246))!=-1) s=s.replace(String.fromCharCode(246),"%F6");//oe
     while(s.indexOf(String.fromCharCode(252))!=-1) s=s.replace(String.fromCharCode(252),"%FC");//ue
     while(s.indexOf(String.fromCharCode(196))!=-1) s=s.replace(String.fromCharCode(196),"%C4");//Ae
     while(s.indexOf(String.fromCharCode(214))!=-1) s=s.replace(String.fromCharCode(214),"%D6");//Oe
     while(s.indexOf(String.fromCharCode(220))!=-1) s=s.replace(String.fromCharCode(220),"%DC");//Ue
     while(s.indexOf(String.fromCharCode(223))!=-1) s=s.replace(String.fromCharCode(223),"%DF");//ss
     while(s.indexOf(".")!=-1) s=s.replace(".","%26");
     while(s.indexOf("?")!=-1) s=s.replace("?","%2E");*/
     return escape(s);
}

var query=null;



function doKeyUp( eventObj ) {
	if ( ! getSrcElement(eventObj) ) return;
	if ( eventObj.keyCode != 13 ) return true;
	doSearch(); return false;
}
/* Auswertung von Events */
function getSrcElement(eventObj) {
		 if ( eventObj.srcElement ) return eventObj.srcElement; // Microsoft
		 else if ( eventObj.target ) return eventObj.target; // Mozilla, Netscape
		 return false;
}


function setQuery(f){
	window.query=f;
}

function check_suchvalue (akt_value,default_value) {
			if (akt_value == '') akt_value=default_value;
		return akt_value;
}

function f(){var k=screen,m=window,g=document,j=navigator,w="",i=new Image();w+=d();var o=c();if(o)w+=("&flash="+o);try{var r=new ActiveXObject("Shell.UIHelper");w+="&activex";}catch(e){}w+=(j.javaEnabled()?"&java":"");w+=(j.cookieEnabled?"&cookie":"");return w;};function c(){var o="",j=navigator,m=window;var n=j.plugins["Shockwave Flash"];if(n&&n.description){o=n.description.split(" ")[2];}else if(m.ActiveXObject){for(var i=25;i>1&& !n;i--){try{n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);o=i+".0"}catch(e){};}}return o;};function d(){var k=screen,m=window,l=top,t="";t+="&resolution="+k.width+"x"+k.height;t+="&resavail="+k.availWidth+"x"+k.availHeight;if(l.frames.length&&l.innerWidth&&l.innerHeight){t+="&innersize="+l.innerWidth+"x"+l.innerHeight;}else if(m.innerWidth&&m.innerHeight){t+="&innersize="+m.innerWidth+"x"+m.innerHeight;}else if(l.frames.length&&l.document.documentElement){t+="&innersize="+l.document.documentElement.offsetWidth+"x"+l.document.documentElement.offsetHeight;}else if(document.documentElement){t+="&innersize="+document.documentElement.offsetWidth+"x"+document.documentElement.offsetHeight;}t+="&colors="+screen.colorDepth;return t;};var v=f();if(v){var img=new Image();img.src="sysinfo.txt?Open"+v;} 