/** * */ var server_js = 'http://'+location.host; function initMenu(n) { for (i=0;i < n.childNodes.length;i++) { if (n.childNodes[i].nodeName.toLowerCase()!="li") continue; if (n.childNodes[i].firstChild.nodeName.toLowerCase()!="a") continue; n.childNodes[i].firstChild.onmouseover = handleListMenu; if (n.id!="navigation") { if (n.childNodes[i].firstChild && n.childNodes[i].firstChild.nextSibling && n.childNodes[i].firstChild.nextSibling.nodeName.toLowerCase()=="ul") { n.childNodes[i].firstChild.className="haschildren"; } } n.childNodes[i].firstChild.onfocus= handleListMenu; n.childNodes[i].firstChild.onmouseout = starthideTimer; } } /** * */ absoluteTop = -1; absoluteLeft = -1; function getPos(obj) { absoluteTop = obj.offsetTop; absoluteLeft = obj.offsetLeft; while(obj.offsetParent!=null) { obj = obj.offsetParent; absoluteTop += obj.offsetTop; absoluteLeft += obj.offsetLeft;} } htimer =-1; /** * */ function starthideTimer() {htimer = window.setTimeout("hideListMenu(2);hideListMenu(1);",500);} /** * */ function stophideTimer() { if (htimer) window.clearTimeout(htimer); } /** * */ function hideListMenu(level) { for (i2=document.getElementsByTagName('ul').length-1; i2 > 0; i2--) if (document.getElementsByTagName('ul')[i2].className=="submenu"+String(level)) document.getElementsByTagName('ul')[i2].style.display="none"; if (level==1) { fixout();} } function handleListMenu(e) { if (self.ddmenu) ddmenu.style.display="none"; stophideTimer(); obj = (! e) ? window.event.srcElement : e.target; //alert(obj.parentNode.parentNode.className); if (obj.parentNode.parentNode.className=="submenu1") level=2; else if (obj.parentNode.parentNode.className=="submenu2") level=3; else level=1; if (level==3) return; if (level==1) hideListMenu(2); hideListMenu(level); if ((navigator.appVersion.indexOf('MSIE 5')>-1 || navigator.appVersion.indexOf('MSIE 6')>-1) && window.event.clientX < 334) fixover(); //(if (obj.parentNode.parentNode.className=="submenu1") { hideListMenu(2); } else { hideListMenu(1); } if (obj.nodeName.toLowerCase()!="a") return; if (! obj.nextSibling || obj.nextSibling.nodeName.toLowerCase()!="ul") return; getPos(obj); with (obj.nextSibling) { style.width = "auto"; className="submenu"+level; if (level==1) { style.left = absoluteLeft + ((previousSibling.id=="firstmenu") ? 0 : -1) +"px"; style.top = absoluteTop + obj.offsetHeight +"px"; } else { style.left = obj.offsetWidth-1 +"px"; style.top= obj.offsetTop + ((document.all) ? -1:-2) +"px"; } style.display="block"; } ow = obj.nextSibling.offsetWidth; if (ow < 10) ow = getOW(obj.nextSibling); if (document.all || level==2) {obj.nextSibling.style.width = ow + "px";} // obj.nextSibling.onmouseout = starthideTimer; // obj.nextSibling.onmouseover = stophideTimer; initMenu(obj.nextSibling); } /** * */ function getOW(pobj) { r = 0; for (i=0;i < pobj.childNodes.length;i++) { if (pobj.childNodes[i].nodeName.toLowerCase()!="li") continue; if (pobj.childNodes[i].offsetWidth > r) r = pobj.childNodes[i].offsetWidth; } return r; } /** * */ function initInput(obj) { obj.defaultvalue=obj.value; obj.onfocus = function() { if (obj.defaultvalue==obj.value) obj.value="";}; obj.onblur = function() { if (obj.value=="") obj.value=obj.defaultvalue;}; } /** * */ initlists=false; window.onload = function () { initMenu(document.getElementById('navigation')); initInput(document.getElementById('sinput')); if (initlists) getLists(0); }; /** * */ fixactive=-1; function fixover() { if (! document.all) return; if (fixactive==1) return; for (i=0;i < document.getElementsByTagName('select').length; i++) { document.getElementsByTagName('select')[i].style.display="none"; document.getElementsByTagName('select')[i].insertAdjacentHTML("afterEnd",''); } fixactive=1; } /** * */ function fixout() { if (! (navigator.appVersion.indexOf('MSIE 5')>-1 || navigator.appVersion.indexOf('MSIE 6')>-1)) return; if (fixactive==-1) return; for (i=0;i < document.getElementsByTagName('select').length; i++) { document.getElementsByTagName('select')[i].style.display="inline"; document.getElementsByTagName('select')[i].nextSibling.outerHTML=""; } fixactive=-1; } /** * */ function showPic(obj) { zw=window.open(obj.href,"zw","left="+(screen.availWidth / 2 - 350)+",top="+(screen.availHeight / 2 - 260)+",width=720,height=540,scrollbars=yes"); return false; } /** * */ req=Array(); function sendReq(handler,url,para) { obj = document.createElement("script"); obj.id = "req"+req.length; obj.setAttribute("defer","defer"); obj.src = url+"?req="+req.length+"&"+para; obj.handler = handler; req[req.length] = window.setTimeout("onReqTimeout("+req.length+")",3000); document.body.appendChild(obj); } /** * */ function clearReq(id) { isdisabled=false; //custom if (! req[id]) return; window.clearTimeout(req[id]); req[id]=-1; // document.getElementById('req'+id).src=""; // window.setTimeout("document.body.removeChild(document.getElementById('req"+id+"'));",1000); } /** * */ function onReqComplete(id,res) { clearReq(id); document.getElementById("req"+id).handler(res); } /** * */ function onReqTimeout(id) { clearReq(id); document.getElementById('req'+id).handler = function (x) {void(0);}; } /** * */ levels=-1; isdisabled = false; function resetLists(startlevel) { // Alle Listen zuruecksetzen bis zu einem bestimmten Level. for (i = startlevel+1; i <= levels ;i++) { // alert("level"+i+"("+levels+")"); document.getElementById("level"+i).selectedIndex=0; if (document.getElementById("level"+i).options[0]) { document.getElementById("level"+i).options[0].text=" "; document.getElementById("level"+i).options[0].value="-1"; } document.getElementById("level"+i).options.length=1; } } /** * */ function fillLists(items) { if (parseInt(items[0]) > 5) { return; } // Bitte Waehlen Option listobj = document.getElementById("level"+(parseInt(items[0])+1)); // listobj.options[0].value = items[items.length-2]; // Alle Option newitem = new Option(val2,items[items.length-2],false,false); //alert(items[items.length-2]+'-'+val1+'-'+val2+'--'+listobj.options[0].value); listobj.options[listobj.options.length] = newitem; // Line Option newitem = new Option("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -",items[items.length-2],false,false); listobj.options[listobj.options.length] = newitem; // Mit Werten bestuecken. for (i=1;i<=items.length-2;i+=2) { if (items[i] != '' &&(items[(i+1)] != '')) { newitem = new Option(items[(i+1)],items[i],false,false); listobj.options[listobj.options.length] = newitem; } } listobj.selectedIndex=0; if (items.length > 1) { listobj.options[0].text = val1; // listobj.focus(); } else { // listobj.options[0].text = " "; listobj.options.length=1; } } /** * */ function getLists(listlevel,lang) { if (isdisabled) { return; } resetLists(listlevel); if (listlevel > 0) { if (document.getElementById("level"+listlevel).options[document.getElementById("level"+listlevel).selectedIndex].value == -1) { return; } document.getElementById("level"+(listlevel+1)).options[0].text="..."; } para = "listlevel="+listlevel+"&level0="+document.getElementById("marketid").value; for (i=1; i < levels ;i++) { para += "&level"+i+"="+document.getElementById("level"+i).options[document.getElementById("level"+i).selectedIndex].value; } if (document.getElementById("language").value == "de") { sendReq(fillLists, server_js + "/custom/ate_js_refresh_tmp_de.php",para); } else if (document.getElementById("language").value == "en") { sendReq(fillLists, server_js + "/custom/ate_js_refresh_tmp_en.php",para); } else if (document.getElementById("language").value == "cn") { sendReq(fillLists, server_js + "/custom/ate_js_refresh_tmp_cn.php",para); } isdisabled=true; } /** * */ formerr = false; function checkField(obj) { if (obj.className.indexOf("req") > -1 && obj.value=="") { formerr=true; obj.className+=" err"; obj.previousSibling.className+=" err"; } else if (obj.className.indexOf("req") > -1) { obj.className="req"; obj.previousSibling.className=""; } } /** * */ function checkForm() { formerr=false; for (i=0; i < document.getElementsByTagName("input").length; i++) checkField(document.getElementsByTagName("input")[i]); for (i=0; i < document.getElementsByTagName("textarea").length; i++) checkField(document.getElementsByTagName("textarea")[i]); document.getElementById("errmsg").style.display = (formerr) ? "block" : "none"; // Pruefen der E-Mailadresse auf korrekte Syntax. email_retval = EMail(document.getElementById("i12").value); document.getElementById("errmsg_email").style.display = (!email_retval) ? "block" : "none"; if (!email_retval) { formerr = true; } // Es sind Fehler aufgetreten, scrollen zum Seitenhead. if (formerr) { window.scrollTo(0,0); } return (! formerr); } /** * */ function goTo(url) { if (document.getElementById("level0").selectedIndex < 1) { return; } top.location.href = document.getElementById("level0").options[document.getElementById("level0").selectedIndex].value; } /** * */ var catalogue_flag = 0; var quotation_flag = 0; function ate_showCatalogue() { if (catalogue_flag == 0) { document.getElementById("katalogliste").style.display = 'block'; document.getElementById("catalogue_img").src = '../img/layout/linkpf_down.gif'; catalogue_flag = 1; } else { document.getElementById("katalogliste").style.display = 'none'; document.getElementById("catalogue_img").src = '../img/layout/linkpf.html'; catalogue_flag = 0; } } /** * */ function ate_showQuotation() { if (quotation_flag == 0) { document.getElementById("angebotsanfrage").style.display = 'block'; document.getElementById("quotation_img").src = '../img/layout/linkpf_down.gif'; quotation_flag = 1; } else { document.getElementById("angebotsanfrage").style.display = 'none'; document.getElementById("quotation_img").src = '../img/layout/linkpf.html'; quotation_flag = 0; } } /** * */ function EMail(s) { var a = false; var res = false; if(typeof(RegExp) == 'function') { var b = new RegExp('abc'); if(b.test('abc') == true){a = true;} } if(a == true) { reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+ '(\\@)([a-zA-Z0-9\\-\\.]+)'+ '(\\.)([a-zA-Z]{2,4})$'); res = (reg.test(s)); } else { res = (s.search('@') >= 1 && s.lastIndexOf('.') > s.search('@') && s.lastIndexOf('.') >= s.length-5) } return(res); }