function navi_hi (nav,num,page) {
	nav.style.background='transparent url(/_common/img/navi_hi_'+page+'.gif) repeat-x';
    if (document.getElementById('list'+num)) {
    document.getElementById('list'+num).style.display='block';
    }
	document.getElementById('link'+num).style.color='#fff';
}

function navi_lo (nav,num,color) {
	nav.style.background='';
    if (document.getElementById('list'+num)) {
    document.getElementById('list'+num).style.display='none';
    }
    document.getElementById('link'+num).style.color='#'+color; 
}


function setInnerHTML(layer,inhalt) {
    document.getElementById(layer).innerHTML = inhalt;
}


//===================
// Selectmenue Weiterleitung
//===================
function goToUrl(listname) {
    if (document.getElementById) {
    location.href=document.getElementById(listname).value;
    }
    else {
    alert('Ihr Browser unterstuetzt kein document.getElementById.');
    }
}

function setEmptyField(field,ignorestring) {
    if (document.getElementById(field).value==ignorestring) {
    document.getElementById(field).value='';
    document.getElementById(field).focus();
    }
}

function checkKontakt(){	
var fehlerhaft;
if (document.kontakt.email.value=="" || (document.kontakt.email.value.indexOf('@')==-1) || (document.kontakt.email.value.indexOf('.')==-1) || document.kontakt.namen.value=="" || document.kontakt.frage.value=="") {
	fehlerhaft = "Bitte alle Formularfelder ausfüllen. Achte auf eine korrekte eMail.\n"
	alert(fehlerhaft);
	return false;
	}
}

function setValueField() {
    if (document.getElementById('user').value=='') {
    document.getElementById('user').value='E-Mail';
    }
    if (document.getElementById('loginpasswd').value=='') {
    document.getElementById('loginpasswd').value='Passwort';
    }
}

function noSpam() {
    var a = document.getElementsByTagName("a");
    for (var i = a.length-1; i >= 0; i--) {
      if (a[i].className.search(/\bemail\b/) != -1) {
        var email = a[i].firstChild.data + "@" + a[i].lastChild.data;
        a[i].innerHTML = email;
        a[i].href = "mailto:" + email;
      }
    }
}
window.onload=noSpam;

function checkSearchString() {
    searchstring=document.getElementById("search").value;
    if ((searchstring.length<3) || (searchstring=='Suche')) {
    alert('Bitte Suchbegriff mit mindestens 3 Buchstaben eingeben.');
    return false;
    }
    else {
    return true;
    }
}
function startSearch() {
    if (checkSearchString()===true) {
    document.sf.submit();
    }
}

function checkSearchStringShop() {
    searchstring=document.getElementById("searchbt").value;
    if ((searchstring.length<2) && (searchstring!='Produktsuche')) {
    alert('Bitte Produkt Suchbegriff mit mindestens 2 Buchstaben eingeben.');
    return false;
    }
    else {
    return true;
    }
}

function startSearchShop() {
    if (checkSearchStringShop()===true) {
    document.shop.submit();
    }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}


function hideLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','none','DIV');
}


function showLayer (setDiv) {
	MM_changeProp(setDiv,'','style.display','block','DIV');
}


function XXXwriteTeaserHome (path,link) {
	document.write('<a href="'+link+'" class="right"><img src="'+path+'" width="79" height="32" alt="" /></a>');
}

function writeMore(link) {
	document.write('<a class="arrowbig" href="'+link+'">mehr</a>');
}

function bannerCheck () { 
    bannertop728='';
    bannertop468='';
    bannersky120='';
    bannersky166='';
    bannerflash400='';
    bannercontent300='';  
    if (document.getElementById('bannerkrebotop').getElementsByTagName('img')[0]) { 
    bannertop728=document.getElementById('bannerkrebotop').getElementsByTagName('img')[0].src;
    }
    if (document.getElementById('bannerkrebotop').getElementsByTagName('img')[1]) { 
    bannertop468=document.getElementById('bannerkrebotop').getElementsByTagName('img')[1].src;
    }
    if (document.getElementById('bannersky').getElementsByTagName('img')[0]) {
    bannersky120=document.getElementById('bannersky').getElementsByTagName('img')[0].src;
    }
    if (document.getElementById('bannersky160').getElementsByTagName('img')[0]) {
    bannersky166=document.getElementById('bannersky160').getElementsByTagName('img')[0].src;
    }
    if (document.getElementById('bannerflash').getElementsByTagName('img')[0]) {
    bannerflash400=document.getElementById('bannerflash').getElementsByTagName('img')[0].src;
    }
    if (document.getElementById('bannercontent').getElementsByTagName('img')[0]) {
    bannercontent300=document.getElementById('bannercontent').getElementsByTagName('img')[0].src;
    }
    // wird ein 1x1 Pixel von Krebo geliefert?
    if ((bannertop728!='')&&(bannertop468!='')) {
        showLayer('bannertop'); 
    }
    if (bannersky120!='') {
        document.getElementById('bannersky').style.left='830px';
        document.getElementById('bannercontent').style.left='1000px'; 
    }
    if (bannersky166!='') {
        document.getElementById('bannersky160').style.left='830px';
        document.getElementById('bannercontent').style.left='1000px'; 
    }
    if (bannerflash400!='') {
    document.getElementById('bannercontent').style.top='9px';
    }
}

// oeffnet Popup wird für popup-Modul benötigt
function openPopup(URL,popname,W,H,scroll,rezisable,X,Y) {
	var URL,popname,W,H,scroll,rezisable,X,Y;
	if (!popname) { popname='popup'; }
	if (!W) { W=520; }
	if (!H) { H=460; }
	if (!scroll) { scroll=0; }
	if (!rezisable) { rezisable=0; }
	if (!X) { X=screen.width/2-(W/2); }
	if (!Y) { Y=screen.height/2-(H/2)-20; }
	properties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+rezisable+",";
	properties += "width="+W+",height="+H+",left="+X+",top="+Y;
	popwin=window.open(URL,popname,properties);
	popwin.focus();
}



