function initScripts(){
	commonInits();
}

function initScriptsStartseite(){
	//init onmouseout-EventHandler for Portalnavigation
	$('portaldirektlinks-oekb-aufklappwrap').observe('mouseleave',mouseOutPortalNavigationOeKB);
	$('portalnavigation-startseite-wrap').observe('mouseleave',resetPortalstartseiteNavigation);
	commonInits();
}


function commonInits(){
	//preload Images
	ImagePreloaderWrap();
	//init onmouseout-EventHandler for Portalnavigation
	$('portaldirektlinks-aufklappwrap').observe('mouseleave',mouseOutPortalNavigation);	
	$('merkliste').observe('mouseleave',mouseLeaveEventFunction);
	$('merkliste').observe('mouseenter',clearMerklisteTimer);
	disableAllAnchors();
	initMerklisteMitLang();
	
	
	try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
	
}


function sitemapInits(){
	//preload Images
	ImagePreloaderWrap();
	disableAllAnchors();	
}



/*################################*/
/*### SPRACHSPEZIFISCHE INHALTE ##*/
/*#################################*/


/* COOKIE F�R DIE SPRACHE. WIRD NICHT BENUTZT. STATTDESSEN WIRD IM METHODENAUFRUF DIE SPRACHE MITGEGEBEN
/*
langcookiejar = new CookieJar({  
			expires: 31536000,   // 1 year 
			path: '/'  
		}); 

langcookiejar.put("oekblang", "de");
currentlang = langcookiejar.get("oekblang");

*/

/* ARRAYS MIT DEN LOCALIZATIONS */

var lang = new Array("de","en");
lang["de"] = new Array("sitemap", "suche", "downloadcenter", "kontakt", "merkliste");
lang["en"] = new Array("sitemap", "suche", "downloadcenter", "kontakt", "merkliste");


lang["de"]["sitemap"] = new Array("EINBLENDEN", "AUSBLENDEN");
lang["en"]["sitemap"] = new Array("SHOW", "HIDE");

lang["de"]["suche"] = new Array("ERWEITERTE SUCHE EINBLENDEN", "ERWEITERTE SUCHE AUSBLENDEN");
lang["en"]["suche"] = new Array("SHOW ADVANCED SEARCH", "HIDE ADVANCED SEARCH");

lang["de"]["downloadcenter"] = new Array("ERWEITERTEN FILTER EINBLENDEN", "ERWEITERTEN FILTER AUSBLENDEN");
lang["en"]["downloadcenter"] = new Array("SHOW ADVANCED FILTER", "HIDE ADVANCED FILTER");

lang["de"]["kontakt"] = new Array("Erweiterte Kontaktdaten einblenden", "Erweiterte Kontaktdaten ausblenden");
lang["en"]["kontakt"] = new Array("Show contact details", "Hide contact details");

lang["de"]["merkliste"] = new Array("Ihre pers&ouml;nliche Merkliste ist leer. Klicken Sie auf das Plus vor dem Seitentitel um eine Seite auf die Merkliste zu setzen.", "alle Eintr&auml;ge entfernen", "Eintrag entfernen", "HILFE ZUR MERKLISTE EINBLENDEN", "HILFE ZUR MERKLISTE AUSBLENDEN");
lang["en"]["merkliste"] = new Array("Your Quicklink list is empty. You can add items by clicking on the plus icon next to the page link", "remove all entries", "remove entry", "SHOW QUICKLINK LIST HELP", "HIDE QUICKLINK LIST HELP");





/*print function*/
function printPage(){
	window.print();
}

/*dummy function*/
function doSomething(){
	
}

//## Portalnavigation ##
function togglePortalNavigation(node){
	var displaynode = node;
	new Effect.toggle(displaynode, 'blind', {duration:0.3} );
}

function openPortalNavigation(node){
	//portalNavigationNode = getNodeByClass(getNextSibling(node), 'portaldirektlinks-aufklappwrap');
	portalNavigationNode = document.getElementById('portaldirektlinks-aufklappwrap');
	togglePortalNavigation(portalNavigationNode);
}

function openPortalNavigationOeKB(node){
	//portalNavigationNode = getNodeByClass(getNextSibling(node), 'portaldirektlinks-aufklappwrap');
	portalNavigationNode = document.getElementById('portaldirektlinks-oekb-aufklappwrap');
	togglePortalNavigation(portalNavigationNode);
}

function mouseOutPortalNavigation(){
	//$('sharepoint-element-top').innerHTML = '<b>Leaving</b><br>' + $('sharepoint-element-top').innerHTML;
	if ( document.getElementById('portaldirektlinks-aufklappwrap').style.display != "none"){
		togglePortalNavigation( document.getElementById('portaldirektlinks-aufklappwrap') );
	}	
}

function mouseOutPortalNavigationOeKB(){
	//$('sharepoint-element-top').innerHTML = '<b>Leaving</b><br>' + $('sharepoint-element-top').innerHTML;
	if ( document.getElementById('portaldirektlinks-oekb-aufklappwrap').style.display != "none"){
		togglePortalNavigation( document.getElementById('portaldirektlinks-oekb-aufklappwrap') );
	}	
}



//## Image Preloading ##
function ImagePreloaderWrap(){
	//MM_preloadImages('fileadmin/img/linkbox-top-closed.gif');
}

/*Disable ToTopAnchor to avoid a Jump without scrolling - if Javascript is deactivated the Anchor remains in the Dom Tree and toTop is  still functional*/
function disableAllAnchors(){
	$('topAnchorId').remove();
}

//## Back to Top Button ##
function backToTop(thisElement){
	scrollToElement("page_margins");
}







/*Sitefeature Scripts*/
function showSitefeatureTitle(node, targetnodeID){
	displaynode = document.getElementById(targetnodeID);
	if (displaynode.style.display == "none"){
		displaynode.style.display = "block";
	}else{
		displaynode.style.display = "none";
	}
}






/*Portalnavigation Startseite*/
function openSecondLevel(node){
 	var obj=getElementsByClassNameOeKB('portalnavigation-startseite-level1-link');
  	for(i=0;i<obj.length;i++)
	  {
			var knoten = obj[i].firstChild;
			obj[i].style.backgroundImage = 'none';
			obj[i].style.backgroundColor = 'transparent';
			obj[i].style.color = '#585855';
	  }
	node.style.backgroundImage = 'url(/oekbstyles/oekbimg/portalnavigationstartseite/icon.gif)';
	node.style.backgroundColor = '#E9E9E4';
	node.style.color = '#333231';
	document.getElementById('portalnavigation-startseite-wrap').style.width = '395px';
}


function resetPortalstartseiteNavigation(){
	 var obj=getElementsByClassNameOeKB('portalnavigation-startseite-level1-link');
	  for(i=0;i<obj.length;i++)
	  {
			var knoten = obj[i].firstChild;
			obj[i].style.backgroundImage = 'url(/oekbstyles/oekbimg/portalnavigationstartseite/icon.gif)';
			obj[i].style.backgroundColor = 'transparent';
			obj[i].style.color = '#585855';
	  }
	  document.getElementById('portalnavigation-startseite-wrap').style.width = '205px';
}




/* ####################### */
/* SITEMAP Toggle Function */
/* ####################### */

function toggleSitemapBox(node, section, currentlang){
	
	var ausblendenLink = $(node).down(1).down();  // div class => .sitemap_toggler a 
	var title = $(node).down(0);  //div class =>  .sitemap_section_title
	var header = node;	    //div class =>  .sitemap_header
	
	
	/*
	var ausblendenLink = node;  // div class => .sitemap_toggler a 
	var title = $(node).up().previous();  //div class =>  .sitemap_section_title
	var header = $(title).up();	    //div class =>  .sitemap_header
	
	*/
	
		//alert($(sitemapSection).next());	
	myEffect = new Effect.toggle( $(header).next(), 'slide', {duration:0.3, beforeStart:updateDataBefore, afterFinish: updateDataAfter} );
	

	
	
	function updateDataBefore()
	{ 
	
		if (ausblendenLink.innerHTML == lang[currentlang]["sitemap"][0]) {
				
					$(ausblendenLink).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/toggle_up.gif)'
				  
				});
					
					
					
					
			 if(section == 'unternehmen')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#7F7D7C',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/unternehmen/bg-stretch-current.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
			 else if(section == 'anleihen')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#990000',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/anleihen/bg-stretch-current.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
			 else if(section == 'exportservice')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#CC0000',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/exportservice/bg-stretch-current.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
			 else if(section == 'kapitalmarkt')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#006600',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/kapitalmarkt/bg-stretch-current.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
			 else if(section == 'informationservices')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#003366',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/informationservices/bg-stretch-current.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
			 else if(section == 'energiemarkt')
			 {
					
				$(header).setStyle({
				
				 borderLeftColor: '#669900',
					borderLeftStyle: 'solid',
					borderLeftWidth: '1px',
					
					borderBottom: 'none'
					
					});
				
				
				
				$(title).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/energiemarkt/bg-stretch-current_green.gif)',
				  paddingLeft: '9px'
				  
				  });
				
			 }
		
		
}
		
	
	
	}
	
	
	
	
	function updateDataAfter()
	{ 
	 
	 
		 if (ausblendenLink.innerHTML == lang[currentlang]["sitemap"][0]) {
				
				
				ausblendenLink.innerHTML = lang[currentlang]["sitemap"][1];
				/*$(sitemapSection).setStyle ({display:block});*/
			
				
				
			}else{
				
				$(ausblendenLink).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/sitemap/toggle_down.gif)'
				  
				});
				
				
				$(title).setStyle({
				  backgroundImage: 'none',
				  paddingLeft: '10px'
				  
				
				});
				
				
				
				
				
		
				
					$(header).setStyle({
					
					 borderLeft: 'none',
					 
					 borderBottomColor: '#DFDFDA',
						borderBottomStyle: 'solid',
						borderBottomWidth: '5px'
						});
					
	
					
					
				ausblendenLink.innerHTML = lang[currentlang]["sitemap"][0];
			
					
			}
													  
	
	}
		
	
	 
}

/*  SUCHE TOGGLER F�R DIE ERWEITERTE SUCHE */

function toggleSucheBox(currentlang) {
	
	myEffect = new Effect.toggle( $$('.suche_erweitert_wrapper')[0], 'blind', {duration:0.3} );
	
	
	
	var icon = $$('.suche_toggler')[0].down();
	
	if ( $$('.suche_erweitert_wrapper')[0].style.display != "none"){
				
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/suche/toggler_down.gif)'
				  
				});
				
				$(icon).innerHTML = lang[currentlang]["suche"][0];
				
			}else{
				
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/suche/toggler_up.gif)'
				});
				
				$(icon).innerHTML =  lang[currentlang]["suche"][1];
				
			}	
}


/* TOGGLE FUNCTION F�R DIE FAQ SEITEN */

function toggleFAQBox(node){
	
	var antwortBox = $(node).next();
	
	myEffect = new Effect.toggle( antwortBox, 'slide', {duration:0.3} );
	
	var icon = $(node);
	if ( antwortBox.style.display != "none"){
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_down.gif)'
				});
				//alert("DOWN");
			}else{
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_up.gif)'
				});
				//	alert("UP");	
			}
}


/*  DOWNLOADCENTER TOGGLER F�R DIE ERWEITERTE FILTERUNG */



function toggleDownloadBox(node){
	
	var antwortBox = $(node).next();
	
	myEffect = new Effect.toggle( antwortBox, 'slide', {duration:0.3} );
	
	var icon = $(node);
	if ( antwortBox.style.display != "none"){
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_down.gif)'
				  
				});
				//alert("DOWN");
			}else{
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_up.gif)'
				});
				//	alert("UP");
				
			}

}


function toggleDownloadCenterBox(currentlang) {
	
	myEffect = new Effect.toggle( $('downloadcenter_erweitert_wrapper'), 'blind', {duration:0.3} );
	
	
	
	var icon = $('downloadcenter_toggler').down();
	
	if ( $('downloadcenter_erweitert_wrapper').style.display != "none"){
				
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/suche/toggler_down.gif)'
				  
				});
				
				$(icon).innerHTML =  lang[currentlang]["downloadcenter"][0];
				
			}else{
				
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/suche/toggler_up.gif)'
				});
				
				$(icon).innerHTML = lang[currentlang]["downloadcenter"][1];
				
			}
	
}

/* TOGGLE FUNCTION F�R DIE GLOSSAR SEITEN */

function toggleGlossarBox(node){
	
	var antwortBox = $(node).next();
	
	myEffect = new Effect.toggle( antwortBox, 'slide', {duration:0.3} );
	
	var icon = $(node);
	if ( antwortBox.style.display != "none"){
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_down.gif)'
				});
				//alert("DOWN");
			}else{
				$(icon).setStyle({
				  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_up.gif)'
				});
				//	alert("UP");	
			}
}


/* TOGGLE FUNCTION F�R DIE Kontakt SEITEN */

function toggleKontaktBox(node, currentlang){
	
	var antwortBox = $(node).previous().previous().down();
	
	myEffect = new Effect.toggle( antwortBox, 'blind', {duration:0.3, afterFinish:toggleIconAndFont} );
	
	
	
	function toggleIconAndFont(){
		var icon = $(node);
		if ( antwortBox.style.display == "none"){
			$(icon).setStyle({
			  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_down.gif)'
			  
			});
			$(icon).innerHTML = lang[currentlang]["kontakt"][0];
			//alert("DOWN");
		}else{
			$(icon).setStyle({
			  backgroundImage: 'url(/oekbstyles/oekbimg/faq/arrow_up.gif)'
			});
			//	alert("UP");
			$(icon).innerHTML = lang[currentlang]["kontakt"][1];
		}
		
	}
	
	

}



/*MERKLISTE DEVELOPMENT*/




/*init the objects necessary for the merkliste*/
function initMerkliste(currentlang){
	jar = new CookieJar();
	
	GLOBAL_PATHLANG = currentlang;
	
	jar.initialize("oekb_merkliste_cookiejar", {  
			expires: 31536000,   // 1 year 
			path: '/'
		})	
		
		
		
	updateMerklisteView(getCurrentLang());
}

function getCurrentLang(){
	return GLOBAL_PATHLANG;
}


/*Controller Functions*/
function updateMerklisteView(currentlang){
	//get the merkliste from the cookie and render it
	var merklistefromcookie = getMerklisteFromCookie();
	//check if merkliste is empty
	if (merklistefromcookie.length == 0){
		//render empty list
		var html  = "<div id=\"merkliste-leer\" style=\"display\:none\;\">";
	    html +=  "<div id=\"merkliste-leer-text\">"+ lang[currentlang]["merkliste"][0] + "</div></div>";
		html += "<ul id=\"merkliste-liste\" style=\"display\:none\;\"> <li><a href=\"javascript:removeAllElements();\" class=\"deleteall\"  >"+ lang[currentlang]["merkliste"][1] + "</a></li></ul>";
   		html +=  "<div class=\"clearboth-cols\">&nbsp;</div>";
		$('merkliste-listenwrap').innerHTML = html;
		new Effect.toggle( $('merkliste-leer'), 'blind', {duration:0.3, afterFinish:attachMerklisteMouseLeave } );
	}else{
		//render populated list
		var html  = "<div id=\"merkliste-leer\" style=\"display\:none\;\">";
	    html +=  "<div id=\"merkliste-leer-text\">"+ lang[currentlang]["merkliste"][0] + "</div></div>";
		html += "<ul id=\"merkliste-liste\">       <li><a href=\"javascript:removeAllElements();\" class=\"deleteall\"  >"+ lang[currentlang]["merkliste"][1] + "</a></li></ul>";
		html +=  "<div class=\"clearboth-cols\">&nbsp;</div>";
		
		$('merkliste-listenwrap').innerHTML = html;
		
		//print the listitems stored in jar-cookie
		for (i=0; i<merklistefromcookie.length; i++){
			new Insertion.Bottom($('merkliste-liste'), "<li id=\""+merklistefromcookie[i].id+"\"><a class=\"seitentitel\" target=\"_blank\" title=\""+merklistefromcookie[i].uri+"\"  alt=\""+merklistefromcookie[i].uri+"\" href=\""+merklistefromcookie[i].uri+"\">"+merklistefromcookie[i].title+"</a><a class=\"eintragloeschen\" href=\"javascript:removeElement('"+merklistefromcookie[i].id+"')\;\">"+ lang[currentlang]["merkliste"][2] + "</a></li>");
		}
	}
}



/* DATA MODEL FUNCTIONS*/

//returns the merklistenarray
function getMerklisteFromCookie(){
	//get the data from the cookie
	var merkliste = jar.get('merklistencookie');
	//if the cookie is empty, create the merkliste-array
	if (merkliste == null){
		merkliste = new Array(); 	
	}		
	return merkliste;
}


function putMerklisteToCookie(merkliste){
	jar.put('merklistencookie', merkliste);  
}

function emptyMerklistenCookie(){
	jar.empty('merklistencookie');
}


function addItemToMerkliste(node, uri, title, unique_id){
	if (isIdUnique(unique_id)){
		var merkliste = getMerklisteFromCookie();
		
		var newitem = new Object();
		newitem["title"] = title;
		newitem["uri"] = uri;
		newitem["id"] = unique_id;
	
		merkliste.unshift(newitem);
		//emtpy before refill
		emptyMerklistenCookie();
		//rewrite entire cookie
		putMerklisteToCookie(merkliste);
		//update HTML
		updateMerklisteView(getCurrentLang());
	}
	//open merkliste
	showMerkListe();
	highlightMerklistenItem(unique_id);
	startCloseMerklisteTimer();
}


function isIdUnique(unique_id){
	var merklistefromcookie = getMerklisteFromCookie();
	//check if id doesn't exist - avoids that a link can be added twice
	returnflag = true;
	for (i=0; i<merklistefromcookie.length; i++){
		if (merklistefromcookie[i].id == unique_id){
			//delete the item
			returnflag = false;
		}
	}
	return returnflag;
}


function removeElement(unique_id){
	var merklistefromcookie = getMerklisteFromCookie();
	
	//find the object 
	for (i=0; i<merklistefromcookie.length; i++){
		if (merklistefromcookie[i].id == unique_id){
			//delete the item
			merklistefromcookie.splice(i, 1);
		}
	}
	//update the cookie
	putMerklisteToCookie(merklistefromcookie);

	new Effect.toggle( $(unique_id), 'slide', {duration:0.3, afterFinish:EintragLoeschen} );
	
	function EintragLoeschen(){
		//$(node).remove();	
		updateMerklisteView(getCurrentLang());
	}
}

function removeAllElements(){
	new Effect.toggle( $('merkliste-liste'), 'slide', {duration:0.5, afterFinish:removeAllElementsNode} );
	function removeAllElementsNode(){
		emptyMerklistenCookie();
		updateMerklisteView(getCurrentLang());
	}
}


/* VIEW Functions */
function toggleMerkListe(){
	new Effect.toggle($('merkliste'), 'blind', {duration:0.2} );
	correctSafariViewBug();
}

function showMerkListe(){
	if ($('merkliste').style.display == "none"){
		new Effect.BlindDown($('merkliste'), {duration:0.2} );
	}
	correctSafariViewBug();
}

function hideMerkListe(){
	new Effect.BlindUp($('merkliste'), {duration:0.2} );
	correctSafariViewBug();
}

function mouseLeaveEventFunction(){
	hideMerkListe();
}

function correctSafariViewBug(){
	if (BrowserDetect.browser == "Safari" && BrowserDetect.version < 500){
			$('sitefeature-titles').setStyle({
			  margin: '-18px 0px 0px 0px'
			});
			allTitles = $('sitefeature-titles').immediateDescendants();	
			for (var i = 0;i<allTitles.length;i++){
				allTitles[i].setStyle({
					margin: '-18px 0px 0px 540px'
				});
			}
		}
}

function highlightMerklistenItem(unique_id){
	new Effect.Highlight($(unique_id), {startcolor:'#ffffff', endcolor:'#E9E9E4', duration:0.7});	
}

function toggleMerklisteHilfetext(currentlang){
	new Effect.toggle( $('merkliste-hilfetext'), 'blind', {duration:0.3} );

		if ( $('merkliste-hilfetext').style.display != "none"){
			
			$('merkliste-togglelink-linktag').setStyle({
			  backgroundImage: 'url(/oekbstyles/oekbimg/sitefeatures/merkliste/merkliste-togglebutton-closed.gif)'
			});
			$('merkliste-togglelink-linktag').innerHTML = lang[currentlang]["merkliste"][3] ;
		}else{
			
			$('merkliste-togglelink-linktag').setStyle({
			  backgroundImage: 'url(/oekbstyles/oekbimg/sitefeatures/merkliste/merkliste-togglebutton-open.gif)'
			});
			$('merkliste-togglelink-linktag').innerHTML =  lang[currentlang]["merkliste"][4] ;
		} 
	correctSafariViewBug();
}

function detachMerklisteMouseLeave() {
   // $('observation').stopObserving('mouseleave',leave);
	$('merkliste').stopObserving('mouseleave',showMerkListe);	
}

function attachMerklisteMouseLeave() {
   // $('observation').stopObserving('mouseleave',leave);
	$('merkliste').observe('mouseleave',showMerkListe);	
}

function showAddToMerklisteTooltip(node){
	new Effect.Appear($(node).previous(0), {duration:0.4, from:0, to:0.8} );
} 

function hideAddToMerklisteTooltip(node){
	new Effect.Fade($(node).previous(0), {duration:0.2, from:0.8, to:0} );
}


//interval
function startCloseMerklisteTimer(){
	//clear old IntervalCalls;
	if(typeof closeMerklisteTimer != "undefined"){
		window.clearInterval(closeMerklisteTimer);
	}
	closeMerklisteTimer = window.setInterval(clearCloseMerklisteTimer, 5000);
}

function clearMerklisteTimer(){
	//clear old IntervalCalls;
	if(typeof closeMerklisteTimer != "undefined"){
		window.clearInterval(closeMerklisteTimer);
	}
}

function clearCloseMerklisteTimer(){
	window.clearInterval(closeMerklisteTimer);
	hideMerkListe();
}

function SubmitEnterOnSearch(myfield,e)
{
	
    var keycode;
    if (window.event) {
                   keycode = window.event.keyCode;
    } 
    else if (e) {
                   keycode = e.which;
    }
    else return true;
    if (keycode == 13){
       document.getElementById("ctl00$portalsuche$ctl00").click();
       return false;
    }
    else
       return true;
}