/*
 * Function to circumvent the ActiveX-restrictions in Microsoft Internet-Explorer
 * 
 * @param file the filename of the swf to embed
 * @param id the id of the swf in the page
 * @param width the width of the swf
 * @param height the height of the swf
 * example: embedFlash("intro.swf","myMovie",994,427,"#FFFFFF","7,0,0,0","movieId=myMovie","transparent","/myPath");
 */
function embedFlash(file,id,width,height,bgcolor,ieVersion,flashVars,wmode,base) {
	var embedString = "";
	var objectString = "";
	if(!bgcolor) bgcolor = "#FFFFFF";
	if(!ieVersion) ieVersion = "7,0,0,0";
	if(flashVars && flashVars != "") {
		embedString += 'FlashVars="'+flashVars+'" ';
		objectString += '<param name="FlashVars" value="'+flashVars+'" />';
	}
	if(wmode && wmode != "") {
		embedString += 'wmode="'+wmode+'" ';
		objectString += '<param name="wmode" value="'+wmode+'" />';
	}
	if(base && base != "") {
		embedString += 'base="'+base+'" ';
		objectString += '<param name="base" value="'+ base+'" />';
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ieVersion+'" width="'+width+'" height="'+height+'" id="'+id+'">');
	document.write('<param name=movie value="'+file+'">');
	document.write('<param name=quality value="high">');
	document.write('<param name=bgcolor value="'+bgcolor+'">');
	document.write('<param name="swliveconnect" value="true">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="always" />');
	document.write(objectString);
	document.write('<embed src="'+file+'" '+embedString+'quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true" id="'+id+'" name="'+id+'">');
	document.write('</embed></object>');
}
/*embed java applets
example:
embedApplet("/applets/fuehrerschein_tuev/tuevbar/","tuevbar.jar","tuevbar.TuevBar.class",380,110,"","_cx","10054","_cy","2910","","");
*/
function embedApplet(codebase,archive,code,width,height,mayscript,paramname1,paramname2,paramname3,paramvalue1,paramvalue2,paramvalue3) {
	document.write('<applet codebase="'+codebase+'" width="'+width+'" height="'+height+'" archive="'+archive+'" code="'+code+'" '+mayscript+'>');
	
	if(paramname1 && paramname1 != "") {
		document.write('<param name="'+paramname1+'" value="'+paramvalue1+'" />');
	}
	if(paramname2 && paramname2 != "") {
		document.write('<param name="'+paramname2+'" value="'+paramvalue2+'" />');
	}
	if(paramname3 && paramname3 != "") {
		document.write('<param name="'+paramname3+'" value="'+paramvalue3+'" />');
	}
	document.write('</applet>');
}

/*std.js*/
// popup window definition
	popupWindow = new Array(); 
	popupWindow['small'] = {'width':300,'height':200,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['medium'] = {'width':800,'height':600,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['full'] = {'width':1000,'height':800,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['longish'] = {'width':250,'height':400,'xPos':100,'yPos':100,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['frontendHelp'] = {'width':700,'height':500,'xPos':100,'yPos':100,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['Admin'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};	
	popupWindow['contentAdmin'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};	
	popupWindow['articleAdmin'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['messageBoardAdmin'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['userAdmin'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['editApproval'] = {'width':640,'height':520,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=no,resizable=no'};
	popupWindow['userSelect'] = {'width':640,'height':500,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['formWindow'] = {'width':600,'height':640,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['formWindowFG'] = {'width':600,'height':640,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['myIntranet'] = {'width':640,'height':500,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=no,resizable=yes'};
	popupWindow['adminInfo'] = {'width':500,'height':580,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
	popupWindow['statistic'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['archiv'] = {'width':920,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['faq'] = {'width':905,'height':595,'xPos':20,'yPos':20,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['microsite'] = {'width':804,'height':644,'xPos':100,'yPos':20,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};
	popupWindow['huauRegister'] = {'width':750,'height':750,'xPos':100,'yPos':20,'windowOptions':'dependent=yes,directories=no,hotkeys=no,menubar=no,resizeable=no,scrollbars=yes,status=no,toolbar=no'};

	popupWindow['foreignIntranets'] = {'width':800,'height':500,'xPos':2,'yPos':2,'windowOptions':'dependent=no,scrollbars=yes,resizable=yes,location=yes,menubar=yes,toolbar=yes,status=yes'};
	popupWindow['infoCollateral'] = {'width':550,'height':500,'xPos':100,'yPos':100,'windowOptions':'dependent=yes,scrollbars=no,resizable=no'};

	popupWindow['jobExchangeBackend'] = {'width':885,'height':701,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=yes,resizable=no'};	

// createWindow(): creates a new Window - a subtitution for newWindow
function createWindow(data) {
	var width; var height; var xPos; var yPos; var windowOptions;
	
	if (typeof data['internTitle'] == 'undefined') { data['internTitle']='default'; }
	if (typeof data['width'] == 'undefined') { width=popupWindow[data['type']]['width']; } else { width=data['width']; }
	if (typeof data['height'] == 'undefined') { height=popupWindow[data['type']]['height']; } else { height=data['height']; }
	if (typeof data['xPos'] == 'undefined') { xPos=popupWindow[data['type']]['xPos']; } else { xPos=data['xPos']; }
	if (typeof data['yPos'] == 'undefined') { yPos=popupWindow[data['type']]['yPos']; } else { yPos=data['yPos']; }
	if (typeof data['windowOptions'] == 'undefined') { windowOptions=popupWindow[data['type']]['windowOptions']; } else { windowOptions=data['windowOptions']; }

	if (isNav6) {
		fwidth = width + 8; fheight = height + 27;
	} else if (isNav4) {
		fwidth = width + 8; fheight = height + 15;
	} else {
		fwidth = width + 12; fheight = height + 31;
	}

	var createdWin = open(data['url'],data['internTitle'],'width='+fwidth+',height='+fheight+',screenX='+xPos+',screenY='+yPos+','+windowOptions);

	try {
		createdWin.moveTo(xPos,yPos);	
		createdWin.resizeTo(fwidth,fheight); 
		createdWin.self.focus();
	} catch (ex) {
		//
	}

	if (data['returnCreatedWindow']) {return createdWin;}
}

function setCursor(currentElement,cursorType) {
	if (currentElement) {
		try {
			currentElement.style.cursor = cursorType;
		} catch (ex) {
			//
		}
	}
	document.body.style.cursor = cursorType;
		try {
			if (parent) {parent.document.body.style.cursor = cursorType;}
			if (top) {top.document.body.style.cursor = cursorType;}
			if (opener) {opener.document.body.style.cursor = cursorType;}
			if (top.opener) {top.opener.document.body.style.cursor = cursorType;}
		} catch (ex) {
			//
		}
}

// default webgui select chooser
function go(formObj){
	if (formObj.chooser.options[formObj.chooser.selectedIndex].value != "none") {
		top.startLoading(top);
		location = formObj.chooser.options[formObj.chooser.selectedIndex].value;
	}
}

/* this class is used to detect os, browser and browser version.
Get the information like this:
bp.platform -> OS
bp.browser -> Browser
bp.version -> Browser version
if the detection fails, the return will be some standard values (fallback - std, std, '')
You can set Your own strings for the detection, so You may use less then 21 stylesheets ;-)
*/

function BP() {
	//Set here the strings for the os identification
	var win = 'win'; //Microsoft Windows; default: win
	var mac = 'mac'; //Macintosh; default: mac
	var lin = 'std'; //Linux; default: lin
	
	//Set the information for the browser identification strings
	var ie = 'ie'; //Internet Explorer; default: ie
	var mo = 'mo'; //Mozilla; default: mo
	var ns = 'ns'; //Netscape Navigator <= 4.x; default: ns
	var nn6 = 'mo'; //Netscape 6+; default: nn6
	var opera = 'ie'; //Opera; default: opera
	var konq = 'std'; //KDE Konqueror; default: konq
	var safari = 'safari'; //Apple Safari; default: safari
	
	//set some default variables
	this.browser = 'std';
	this.platform = 'std';
	this.version = '';
	
	//Check for the os used
	if (navigator.platform.indexOf('Mac') > -1) {
		this.platform = mac;
	} else if (navigator.platform.indexOf('Win') > -1) {
		this.platform = win;
	} else if (navigator.platform.indexOf('Linux') > -1) {
		this.platform = lin;
	}
	
	if (navigator.appName.indexOf('Microsoft') > -1) {
		if(navigator.userAgent.indexOf('Opera') > -1) {
			this.browser = opera;
			this.version = getVersion("Opera ");
		} else {
			this.browser = ie;
			this.version = getVersion("MSIE ");
		}
	} else if (navigator.appName.indexOf('Konqueror') > -1) {
		this.browser = konq;
		this.version = getVersion("Konqueror");
		
	}else {
		if (navigator.appVersion.charAt(0) <= 4) {
			this.browser = ns;
			this.version = getVersion("Mozilla/");
			
		} else if (this.platform == mac && navigator.userAgent.indexOf('Safari') > -1) {
			this.browser = safari;
		} else {
			if(navigator.vendor.indexOf('Netscape') > -1) {
				this.browser = nn6;
				this.version = navigator.vendorSub;
			} else {
				this.browser = mo;
				this.version = getVersion("rv:");
			}
		}
	}
	
	return this;
}

//Function to get the exact version of the browser
function getVersion(pattern) {
	var ua = window.navigator.userAgent;
	var patternIndex = ua.indexOf (pattern);
	var version = ua.substring (patternIndex+pattern.length, (ua.indexOf (".", patternIndex+pattern.length ))+3);
	while(isNaN(version) && version.length > 0) {
		version = version.substring(0,version.length-1);
	} 
	return version;
}

var bp = new BP();
//Write the css for special requirements of the browser
//document.write('<LINK HREF="/css/' + bp.platform + '_' + bp.browser + '.css" REL="styleSheet" TYPE="text/css">');
//-----------------------------------------------------


/*
this method opens a pop-up window and supress scrollbars
-> method call: 
   <a href="JavaScript:NewWindow('url','Example name',width,height,xpos,ypos,scrolling)" class="smaller">Link</a>
-> example for method call: 
   <a href="JavaScript:NewWindow('/imprint.html','Imprint',450,610,150,10)" class="smaller">[Imprint]</a>
*/
var isNav4, isNav6, isIE4;
function NewWindow(FileURL,WindowName,WindowWidth,WindowHeight,XPos,YPos,scrolling) {
	if (isNav6) {
		fWindowWidth = WindowWidth +  8; fWindowHeight = WindowHeight + 27;
	} else if (isNav4) {
		fWindowWidth = WindowWidth + 15; fWindowHeight = WindowHeight + 15;
	} else {
		fWindowWidth = WindowWidth + 12; fWindowHeight = WindowHeight + 31;
	}
	Fenster = window.open(FileURL,WindowName,'width='+fWindowWidth+',height='+fWindowHeight+',screenX='+XPos+',screenY='+YPos+',dependent=yes,scrollbars='+scrolling+',resizable=yes');
	Fenster.moveTo(XPos,YPos);
	Fenster.resizeTo(fWindowWidth,fWindowHeight);
}

function newWindow(FileURL,WindowName,WindowWidth,WindowHeight,XPos,YPos,scrolling) {
	if (typeof scrolling=="undefined") {
		scrolling = "yes";
	}
	return NewWindow(FileURL,WindowName,WindowWidth,WindowHeight,XPos,YPos,scrolling);
}


//Method to open a popup-window
function fenster(ziel,WindowWidth,WindowHeight) {
    if (typeof WindowHeight == 'undefined') {
			WindowWidth = 550;
			WindowHeight = 550;
		}
    ergebnis = window.open(ziel,"ergebnis",'width='+WindowWidth+',Height='+WindowWidth+',toolbar=0,toolbar=no,location=no,scrollbars=yes,resizable=yes,copyhistory=no,dependent=yes');
    return;
}

var state = 'none';
function openSearchHelp(id) {
	obj = document.getElementsByTagName('div');
	if (obj[id].style.visibility == 'visible'){
	obj[id].style.visibility = 'hidden';
	}
	else {
	obj[id].style.visibility = 'visible';
	}
}


/*
this method is the standard handler for opening div-layer over flash location application
*/
function openLocationWindow(loadfile,iframewidth,iframeheight) {
	var whichLayer = "divoverflash";
	var whichLink = loadfile;
	//get position of flash-application
	var coords = getPageCoords('div_postop');
	//alert(coords.x + ':' + coords.y) 
	//set layer centered over flash-application
	
	var leftPosition = coords.x-120;
		
	if (document.getElementById)		
	{
	// this is the way the standards work
	var theDiv = document.getElementById(whichLayer).style;
	theDiv.left = leftPosition;		
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var theDiv = document.all[whichLayer].style;
	theDiv.left = leftPosition;
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var theDiv = document.layers[whichLayer].style;
	theDiv.left = leftPosition;
	}		
		
	// make div-layer visible an load extern html-file
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "block":"block";	
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "block":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "block":"block";
	}
	if (iframeheight > 420) { /* Load application Dienstleistungen nach Bundesländer*/
		document.getElementById(whichLayer).innerHTML='<table border="0" cellpadding="0" cellspacing="0"><tr><td><iframe src="'+whichLink+'" width="'+iframewidth+'" height="'+iframeheight+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" name="theiframe" id="theiframe"></iframe></td><td align="left" valign="top"><div id="print" style="right:30px;"><span class="printlink"><a href="#" onclick="iprint(theiframe); return false;">&nbsp;</a></span><span class="closelink"><a href="#" onClick="javascript:closeLocationWindow(); return false;">&nbsp;</a></span></div></td></tr></table>';
	}
	else if (iframeheight <= 420)	{
		document.getElementById(whichLayer).innerHTML='<table border="0" cellpadding="0" cellspacing="0"><tr><td><iframe src="'+whichLink+'" width="'+iframewidth+'" height="'+iframeheight+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" name="theiframe" id="theiframe"></iframe></td><td align="right" valign="top"><div id="print"><span class="printlink"><a href="#" onclick="iprint(theiframe); return false;">&nbsp;</a></span><span class="closelink"><a href="#" onClick="javascript:closeLocationWindow(); return false;">&nbsp;</a></span></div></td></tr></table>';
	}
}

/*
this method is the standard handler which closes the div-layer in the method above
*/
function closeLocationWindow() {
	var whichLayer = "divoverflash";
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
}

/*
this method is the standard print function for div-layers printing the iframe
*/
function iprint(ptarget)
{
	ptarget.focus();
	ptarget.print();
}

/*
this method finds position of id-elements in page
*/
function getPageCoords (elementId) {
	var coords = {x: 0, y: 0};
	var element;
	if (document.all) {
	element = document.all[elementId];
  } else if (document.getElementById) {
	element = document.getElementById(elementId);
  }
	while (element) {
	coords.x += element.offsetLeft;
	coords.y += element.offsetTop;
	element = element.offsetParent;
	}
	return coords;	
}

/*
opera - this method find out height of possible space for content, sets maximum height for content
*/
function setScrollingHeight() {
		if (navigator.userAgent.indexOf("Opera") > 0 || navigator.userAgent.indexOf("Netscape") > 0 || navigator.userAgent.indexOf("Firefox") > 0 || navigator.appName=="Netscape" || navigator.userAgent.indexOf("Konqueror") > 0) {
		var coordstop = getPageCoords("div_postop");
		var coordsbottom = getPageCoords("div_posbottom");
		var completeHeight = coordsbottom.y - coordstop.y;
		var maxHeight = completeHeight-241;
		// this is the way the standards work
		document.getElementById('content').style.height=maxHeight+"px";
	}
}

/*
Show Imagemovie
*/
function embedImageMovie() {
document.write('<object id="WMP" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">');
document.write('<param value="mms://193.30.192.124/TUEV-Video_360x288" name="URL" />');
document.write('<param value="1" name="rate" />');
document.write('<param value="0" name="balance" />');
document.write('<param value="0" name="currentPosition" />');
document.write('<param value="" name="defaultFrame" />');
document.write('<param value="1" name="playCount" />');
document.write('<param value="-1" name="autoStart" />');
document.write('<param value="0" name="currentMarker" />');
document.write('<param value="-1" name="invokeURLs" />');
document.write('<param value="" name="baseURL" />');		
document.write('<param value="50" name="volume" />');
document.write('<param value="0" name="mute" />');
document.write('<param value="full" name="uiMode" />');
document.write('<param value="0" name="stretchToFit" />');
document.write('<param value="0" name="windowlessVideo" />');
document.write('<param value="-1" name="enabled" />');
document.write('<param value="-1" name="enableContextMenu" />');
document.write('<param value="0" name="fullScreen" />');
document.write('<param value="360" name="width" />');
document.write('<param value="288" name="height" />');
document.write('<param value="" name="SAMIStyle" />');
document.write('<param value="" name="SAMILang" />');
document.write('<param value="" name="SAMIFilename" />');
document.write('<param value="" name="captioningID" />');
document.write('</object>');
}

/********************************************************************************
BEGIN -- Import from old system - replaces js-files and js-includes in admin-tool
**********************************************************************************/
var win;
var attributes="width=640,height=440,toolbar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes";
function showWindow(htm) {
win=window.open(htm, "extra", attributes);
win.focus();
}
var win2;
var attributes2="width=370,height=50";
function showWindow2(htm) {
win2=window.open(htm, "extra2", attributes2);
win2.focus();
}

var win=null;
function Bedienungsanleitung(htm){
if (win == null || win.closed){
win=window.open(htm,"Zusatzfenster","width=600,height=450,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,copyhistory=no");
}else {win.location=htm;
win.focus();}
}

function openw(htm){
	if (win == null || win.closed) {
	win=window.open(htm,"Zusatzfenster","width=407,height=301");
	} else{win.location=htm;
	win.focus();
	}
}

function goTank(){
	fff=window.open("/cgi-bin/oil_tank/heizoel.pl","heizoel","width=550,height=600,scrollbars=yes");
}

function Is(){ 
var agent = navigator.userAgent.toLowerCase(); this.nc = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
}
var is = new Is();

function dowrite(){ 
new_window.document.write("<html><frameset cols=\"*,1\" frameborder=\"0\" border=\"0\" framespacing=\"0\" border=\"0\"> <frame name=\"content\" src=\"http://www.fahren-lernen.de/servlet/HomeTestPartner?action=init&partnerid=80001&lang=de\"marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"no\" framespacing=\"0\"> <frame name=\"empty\" src=\"http://www.fahren-lernen.de/partner/empty.html\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"no\" framespacing=\"0\"> </frameset><body></body></html>");
}

 function fullScreen(theURL){ 
return window.open(theURL, 'test', 'width=800,height=600, scrollbars=auto');
}

function starttest(){ 
new_window = fullScreen(""); setTimeout("dowrite()", 500);
}

function openKlassenrad()
{
window.open("/applets/fuehrerschein_tuev/klassenrad/index.html","klassenrad","dependent=yes, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, width=436, HEIGHT=304");
}

function zeige20uhrplus(){
document.land="uhr20plus";
W=window.open("/auto_tuev/hu_au/bundesland_suche/warten.html", "W", "width=780,height=550,toolbar=0,toolbar=no,location=no,scrollbars=yes,resizable=yes,copyhistory=no");
}


function mailcheck(email) {
	var str=email;
	var filter=/^([\w-]+(?:[\.-]\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var testresults;
	
	if (filter.test(str))
			testresults=true;
	else{
		alert("Bitte eine gültige E-Mail-Adresse eingeben!");
		testresults=false;
	}
	return testresults;
}


function mailchecken(email) {
	var str=email;
	var filter=/^([\w-]+(?:[\.-]\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var testresults;
	
	if (filter.test(str))
			testresults=true;
	else{
		alert("Please enter a valid E-Mail!");
		testresults=false;
	}
	return testresults;
}

function checkemail(email){
	var str=email;
	var filter=/^([\w-]+(?:[\.-]\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var testresults;
	
	if (filter.test(str))
			testresults=true;
	else{
		alert("Bitte eine gültige E-Mail-Adresse eingeben!");
		testresults=false;
	}
	return testresults;
}


function setSize() {
}

/****** Geschäftsbericht *****************************************************/
function gessendItD() {
	if (document.gesForm.name.value==""){
		alert("Bitte geben Sie Ihre Name an.");
	} else if (document.gesForm.vorname.value==""){
		alert("Bitte geben Sie Ihre Vorname an.");
	} else if ((document.gesForm.str.value=="")||(document.gesForm.plz.value=="")||(document.gesForm.ort.value=="")){
		alert("Bitte geben Sie Ihre Adresse an.");
	} else {	
		alert('Vielen Dank .\nIhre Bestellung wurde abgeschickt.\n');
		document.gesForm.submit();
	}
}
/****** Annual Report *****************************************************/
function gessendItE() {
	if (document.gesForm.name.value==""){
		alert("Please enter your name.");
	} else if (document.gesForm.vorname.value==""){
		alert("Please enter your first name.");
	} else if ((document.gesForm.str.value=="")||(document.gesForm.plz.value=="")||(document.gesForm.ort.value=="")){
		alert("Please enter your address.");
	} else {	
		alert('Thank you .\nYour order was sent.\n');
		document.gesForm.submit();
	}
}

/****** HU/AU DKGK Box *****************************************************/
function checkformDKGKaltern(linkURL) {
	var zip = window.document.suchformularaltern.zip.value;
	var town = window.document.suchformularaltern.town.value;
	town = escape(town);
	window.document.location.href = linkURL+"?dkgk=1&hits=6&radius=50&zip="+zip+"&town="+town;
	return false;
}
function checkformDKGK() {
	var zip = window.document.suchformular2.zip.value;
	var town = window.document.suchformular2.town.value;
	town = escape(town);
	window.document.location.href = "?op=redirectPage&pageId=1227865600360772290566&dkgk=1&hits=6&radius=50&zip="+zip+"&town="+town;
	return false;
}
function checkformHUAU() {
	var zip = window.document.suchformular.zip.value;
	var town = window.document.suchformular.town.value;
	town = escape(town);
	window.document.location.href= "/?op=redirectPage&pageId=1227865600360772290566&hits=6&radius=50&zip="+zip+"&town="+town;
	return false;
}

function checkformHUAUaltern(linkURL) {
	var zip = window.document.suchformularaltern.zip.value;
	var town = window.document.suchformularaltern.town.value;
	town = escape(town);
	window.document.location.href = linkURL+"?dkgk=1&hits=6&radius=50&zip="+zip+"&town="+town;
	return false;
}
/******************************************************************************
END -- Import from old system - replaces js-files and js-includes in admin-tool
********************************************************************************/

/******************************************************************************
Cookie - methods
********************************************************************************/
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) {
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
		 return getCookieVal (j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0){
			 break;
		}
	}
	return null;
}

function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : "/";
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

function DeleteCookie () {
	var exp = new Date();
	exp.setTime (exp.getTime() - 1000000000); // This cookie is history (changed -1 to make it previous time)
	var cval = GetCookie ('width');
	document.cookie ='DemoName' + "=" + cval + "; expires=" + exp.toGMTString();
	/*alert("The cookie has been deleted.");*/
	//Deactivate Cloaking-->
}

function getURLParam(strParamName){
	var strReturn = "";
	var strHref = window.location.href;
	if ( strHref.indexOf("?") > -1 ){
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
			if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ) {
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}
	return strReturn;
}

function tuevPrint() {
	var myIframe = document.getElementById('dynIFrameMacro');
	if (myIframe) {
		frames[myIframe.name].focus();
		window.print();
	} else {
		self.print();
	}
}


function openLocationRoute(id) {
	if (document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
	} else {
		document.getElementById(id).style.display = 'block';
	}
}

function showExtendedFilter(id,openText,closeText) {
	if (document.getElementById(id).style.display == 'block'){
		document.getElementById(id).style.display = 'none';
		
		document.getElementById('filter_extendedfilter_text').innerHTML = openText;
		
		try {
			document.getElementById('languageId').value = '';
			document.getElementById('searchRoot').value = '';
			document.getElementById('metadata').value = '';
		} catch (ex) {}
	} else {
		document.getElementById(id).style.display = 'block';
		
		document.getElementById('filter_extendedfilter_text').innerHTML = closeText;
	}
}

