<!--
/* Copyright 2006 [di] digitale informationssysteme gmbh, Mannheim, www.digi-info.de
*
* AUTHOR:
* goma - Gordon Marshall - marshall(at)digi-info(dot)de
*
* CHANGELOG:
*
* who:              when:               what:
*
* jeho				2006-06-12       	erstellt fuer Meyers
* goma				2006-06-19			zoomIn, zoomOut, shiver hinzugefügt (Layer-Popups auf Startseite)
*
*/


// Browsererkennung
var moz = (document.getElementById && !document.all) ? true : false;
var ie = (document.all && !moz) ? true : false;

// OS
var windows = (navigator.platform.toLowerCase().indexOf("win") != -1) ? true : false;


// falls im frame, z.b. bei brockhaus-suche
if(top.location != self.location) top.location.href = self.location;


// Popup-Fenster öffnen
var newWin = '';
// Popup oeffnen
function openWindow(url,winName,w,h,sb) {
    if (h == 0) h = screen.availHeight - 50;
    newWin = window.open(url, winName, 'width=' + w + ', height=' + h + ', scrollbars=' + sb + ', toolbar=no, location=no, status=no, menubar=no, resizable=no');
    if (newWin.focus) newWin.focus();
    //return false;
}
    
    
function openDownloadshop() {
    var win = null;
    win = window.open("http://downloadshop.bifab.de","namewin","width=940,height=680,toolbars=yes,menubar=yes,scrollbars=yes,history=yes,status=yes,resize=yes")
    if(win.window.focus){win.window.focus();}
}

function datenschutz() {
    var win = null;
    win = window.open("/service/datenschutz_popup.php","datenschutz","width=600,height=600,toolbars=no,menubar=no,scrollbars=yes,history=no,status=no,resize=yes")
    if(win.window.focus){win.window.focus();}
}



function doSearch() {
    var bereich = document.meyerssuche.bereich.value;
   
    switch (bereich) {
        case "mixed": {
            document.meyerssuche.action = "/suche/index.php";
            break;
        }
        case "produkte": {
            document.meyerssuche.action = "/suche/index.php";
            break;
        }
        case "inhalte": {
            document.getElementById('searchQuery.queryString').value = document.meyerssuche.begriff.value;
            document.meyerslexikon.submit();
            return false;
            break;
        }
        case "website": {
            document.htdig.words.value = formular.begriff.value;
            document.htdig.submit();
            return false;
            break;
        }
    }
    return true;
}


// workaround fuer ie label bug; modifiziertes ms-script (goma)
function SelectonfocusIn() {
    if (ie && windows) {
        try {
            var eSrc = window.event.srcElement;
            if (eSrc) eSrc.tmpIndex = eSrc.selectedIndex;
        }
        catch (e) {
            HandleError(e, false);
        }
    }
}



// workaround fuer ie label bug; modifiziertes ms-script (goma)
function Selectonfocus() {
    if (ie && windows) {
        try {
            var eSrc = window.event.srcElement;
            if (eSrc) eSrc.selectedIndex = eSrc.tmpIndex;
        }
        catch (e) {
            HandleError(e, false);
        }       
    }
}


//weitersagen
function weiterempfehlen(url) {
    var win = null;
    win = window.open("/service/weiterempfehlen.php?url="+escape(url),"weiterempfehlen", "width=480,height=500,top=100,left=100,screenx=100,screeny=100,toolbars=no,menubar=no,scrollbars=no,history=no,status=no,resize=no")
    if(win.window.focus){win.window.focus();}
}



// Focus auf Suchfeld
function searchFocus() {
    if (document.getElementById("searchInput") != null && !isDruckversion()) {
        document.getElementById("searchInput").focus();
    }
}
  
  
// checken, ob seite als druckversion aufgerufen wurde
function isDruckversion() { 
    return (document.getElementById("printCss") != null);
}


// Anti-Spam
function diAntiSpam(user, nachat, subj, textlink) {
    document.write ('<a href="mailto:' + user + '@' + nachat);
    if (subj != "") {
        document.write ('?subject=' + subj);
    }
    if (textlink != ""){
        document.write ('">'+ textlink + '</a>');
    }
    else {    
        document.write ('">'+ user + '@' + nachat + '</a>');
    }
}

function hide(zid) {
	var hideString = "zoomOut(" + zid + ")";
	eval ("hidden" + zid + "=setTimeout(\"" + hideString + "\",300)");
}



function zoomIn(zid,doshiver) {
	eval ('if (window.hidden' + zid + ') window.clearTimeout(hidden' + zid + ');');
	for (i=1; i<=4; i++) {
		if (i == zid) {
			document.getElementById("produktbereich" + i).style.display = 'none';
			document.getElementById("produktbereich" + i + "Hover").style.display = 'block';
		}
		else {
			document.getElementById("produktbereich" + i).style.display = 'block';
			document.getElementById("produktbereich" + i + "Hover").style.display = 'none';
		}
	}
	
	
	if (doshiver) {
		shiver(zid,0);
	}
}


function zoomOut(zid) {
	
	document.getElementById("produktbereich" + zid).style.display = 'block';
	document.getElementById("produktbereich" + zid + "Hover").style.display = 'none';
}


function shiver(zid, counter) {
	boxHover = "produktbereich" + zid + "Hover";
	myCounter = counter + 1;
	if (myCounter > 2) {
		window.clearTimeout(shivering);
	}
	else {
		if (counter%2 == 0) {
			myClassName = "shiver";
		}
		else {
			myClassName = "";
		}
		document.getElementById(boxHover).className = myClassName;
		tmp = "shiver(" + zid + ", " + myCounter + ")";
		shivering = window.setTimeout(tmp, 5);
	}
}



// Login Handel
function logHandel()  {
  var doc = document.handel;
  var codes ="1234567890";
  var y = doc.Login.value;
  var x = 0;
  var z = parseInt(y);
  for (i=0;i<y.length;i++)
  { d = y.substring(i,(i+1));
  if (codes.indexOf(d) == -1)
      {x = 1; break;}
  }
  if (doc.Kunde.value != "" && isNaN(y) == false && z >19999 && z < 60000 && x !=1) {
    doc.action = "http://www.bifab.de/handel/handel.html";
    }
  else {
    doc.action = "http://www.bifab.de/handel/handel_log_error.html";
    }
  doc.submit();
  }


//-->

