var utimer; var lobj; var markerlevel; var markerspeed; var markertimer; var markermin; var markermax; markerlevel = 70; markerspeed = 5; markermin = 70; markermax = 85; function markerblink() { var elem = document.getElementsByTagName('div'); for (i = 0; i < elem.length; i++) { var el = elem[i]; if (el.className == 'marker') { if (el.name == 'dontblink') { try { el.style.opacity = 1; } catch(err) { el.style.setAttribute("filter", "alpha(opacity=100);"); } } else { try { el.style.opacity = markerlevel / 100; } catch(err) { el.style.setAttribute("filter", "alpha(opacity=" + markerlevel + ");"); } } } } markerlevel += markerspeed; if (markerlevel > markermax) {markerspeed *= -1;markerlevel = markermax;} if (markerlevel < markermin) {markerspeed *= -1;markerlevel = markermin;} window.clearTimeout(markertimer); markertimer = window.setTimeout(markerblink,100); } //---------------------- var wipelevel; var wipespeed; var wipetimer; var wipemin; var wipemax; wipelevel = 0; wipespeed = 0.1; wipemax = 15; function wipe() { var elem = document.getElementsByTagName('span'); for (i = 0; i < elem.length; i++) { var el = elem[i]; if (el.name == 'wipe') { el.style['paddingLeft'] = (wipemax * Math.sin(wipelevel)) + 'px'; } } wipelevel += wipespeed; if (wipelevel > Math.PI) wipelevel = 0 window.clearTimeout(wipetimer); wipetimer = window.setTimeout(wipe,50); } //---------------------- function cornerBox(attr) { var mainbox = document.createElement('div'); var box = document.createElement('div'); var oarr = document.createElement('div'); var iarr = document.createElement('div'); var concolor = '#E8E8E9'; var borcolor = '#FFF'; with (oarr) { id = 'info' + attr['id']; style['width'] = '0px'; style['height'] = '0px'; style['fontSize'] = '0px'; style['position'] = 'absolute'; if ((attr['arrow'].split(' '))[0] == 'left') { style['left'] = '-20px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['borderColor'] = 'transparent ' + borcolor + ' transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['top'] = '20px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['borderColor'] = 'transparent ' + borcolor + ' transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['bottom'] = '20px'; } } else if ((attr['arrow'].split(' '))[0] == 'right') { style['right'] = '-20px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['borderColor'] = 'transparent transparent transparent ' + borcolor; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['top'] = '20px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['borderColor'] = 'transparent transparent transparent ' + borcolor; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['bottom'] = '20px'; } } if ((attr['arrow'].split(' '))[0] == 'top') { style['top'] = '-20px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = '20px'; style['borderColor'] = 'transparent transparent ' + borcolor + ' transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['right'] = '20px'; style['borderColor'] = 'transparent transparent ' + borcolor + ' transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } } else if ((attr['arrow'].split(' '))[0] == 'bottom') { style['bottom'] = '-20px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = '20px'; style['borderColor'] = borcolor + ' transparent transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['right'] = '20px'; style['borderColor'] = borcolor + ' transparent transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } } } with (iarr) { style['width'] = '0px'; style['height'] = '0px'; style['fontSize'] = '0px'; style['position'] = 'absolute'; if ((attr['arrow'].split(' '))[0] == 'left') { style['left'] = '-14px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['borderColor'] = 'transparent ' + concolor + ' transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['top'] = '20px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['borderColor'] = 'transparent ' + concolor + ' transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['bottom'] = '20px'; } } else if ((attr['arrow'].split(' '))[0] == 'right') { style['right'] = '-14px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['borderColor'] = 'transparent transparent transparent ' + concolor; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['top'] = '20px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['borderColor'] = 'transparent transparent transparent ' + concolor; style['borderStyle'] = 'solid'; style['borderWidth'] = '15px 10px'; style['bottom'] = '20px'; } } if ((attr['arrow'].split(' '))[0] == 'top') { style['top'] = '-14px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = '20px'; style['borderColor'] = 'transparent transparent ' + concolor + ' transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['right'] = '20px'; style['borderColor'] = 'transparent transparent ' + concolor + ' transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } } else if ((attr['arrow'].split(' '))[0] == 'bottom') { style['bottom'] = '-14px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = '20px'; style['borderColor'] = concolor + ' transparent transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['right'] = '20px'; style['borderColor'] = concolor + ' transparent transparent transparent'; style['borderStyle'] = 'solid'; style['borderWidth'] = '10px 15px'; } } } attr['putobj'].appendChild(mainbox); var header = document.createElement('h1'); header.appendChild(document.createTextNode(attr['title'])); if (attr['link'] != 'nolink') { var link = document.createElement('a'); link.appendChild(document.createTextNode('Mehr Informationen')); link.href = attr['link']; } mainbox.appendChild(box); with (box) { className = 'box translight'; style['fontSize'] = '14px'; style['width'] = '200px'; appendChild(header); var stext = attr['text'].split('#BR#'); for (i = 0; i < stext.length; i++) { appendChild(document.createTextNode(stext[i])); if (i < stext.length-1) appendChild(document.createElement('br')); } if (typeof link != 'undefined') appendChild(link); } with (mainbox) { style['position'] = 'absolute'; if ((attr['arrow'].split(' '))[0] == 'left') { style['left'] = (attr['left'] + 40) + 'px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['top'] = (attr['top'] - 22) + 'px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['top'] = (attr['top'] - offsetHeight + 47) + 'px'; } } else if ((attr['arrow'].split(' '))[0] == 'right') { style['left'] = (attr['left'] - offsetWidth - 15) + 'px'; if ((attr['arrow'].split(' '))[1] == 'top') { style['top'] = (attr['top'] - 22) + 'px'; } else if ((attr['arrow'].split(' '))[1] == 'bottom') { style['top'] = (attr['top'] - offsetHeight + 47) + 'px'; } } if ((attr['arrow'].split(' '))[0] == 'top') { style['top'] = (attr['top'] + 40) + 'px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = (attr['left'] - 22) + 'px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['left'] = (attr['left'] - offsetWidth + 47) + 'px'; } } else if ((attr['arrow'].split(' '))[0] == 'bottom') { style['top'] = (attr['top'] - offsetHeight - 15) + 'px'; if ((attr['arrow'].split(' '))[1] == 'left') { style['left'] = (attr['left'] - 22) + 'px'; } else if ((attr['arrow'].split(' '))[1] == 'right') { style['left'] = (attr['left'] - offsetWidth + 47) + 'px'; } } id = attr['id']; style['display'] = 'none'; style['textAlign'] = 'left'; style['zIndex'] = '3'; onmouseover = function(e) { window.clearTimeout(utimer); } onmouseout = function(e) { window.clearTimeout(utimer); var obj = this; utimer = window.setTimeout(function(){ obj.style['display'] = 'none'; },100); } } box.appendChild(oarr); box.appendChild(iarr); oarr.name = attr['arrow']; } //---------------------- function imageviewer() { var obj = document.getElementsByTagName('img'); for (i = 0; i < obj.length; i++) { if (obj[i].name == 'imageviewer') { var a = document.createElement('a'); a.onclick = function(e) { fadeoverlay(true); with(document.getElementById('overlay_content')) { innerHTML = this.innerHTML; firstChild.className = ''; if (this.firstChild.offsetHeight > this.firstChild.offsetWidth) firstChild.style['width'] = '580px'; else firstChild.style['width'] = '600px'; firstChild.style['margin'] = '0px'; firstChild.style['padding'] = '0px'; } } a.href = '#' a.appendChild(obj[i].cloneNode(true)); obj[i].parentNode.replaceChild(a,obj[i]); } } } //---------------------- var overlaylevel; var overlayspeed; var overlaytimer; var overlaymin; var overlaymax; var overlayfadein; overlaylevel = 0; overlayspeed = 20; overlaymin = 0; overlaymax = 100; function fadeoverlay(fadein) { window.clearTimeout(overlaytimer); if (fadein === true) { overlaymouse = false; overlayfadein = true; overlaylevel = 0; overlayspeed = Math.abs(overlayspeed); document.getElementById('overlay').style['display'] = 'block'; } if (fadein === false) { overlayfadein = false; overlayspeed = Math.abs(overlayspeed) * (-1); } overlaylevel += overlayspeed; overlaylevel = Math.max(overlaymin,overlaylevel); overlaylevel = Math.min(overlaymax,overlaylevel); var el = document.getElementById('overlay'); try { el.style.opacity = overlaylevel / 100; } catch(err) { el.style.setAttribute("filter", "alpha(opacity=" + overlaylevel + ");"); } if (overlaylevel < overlaymax && overlaylevel > overlaymin) { overlaytimer = window.setTimeout(fadeoverlay,10); } else { if (!overlayfadein) document.getElementById('overlay').style['display'] = 'none'; } } //---------------------- var cmailinfo; function cmail(me,disable) { if (!disable) { me.disabled = false; return false; } var obj = document.getElementById('E-Mail'); var obj2 = document.getElementById('Branche'); var mailregex = /^[a-z0-9\._-]+@([a-z0-9_-]+\.)+[a-z]{2,6}$/i; var objvalue = obj.value; var objvalue2 = obj2.value.split(' ').join(''); var status = mailregex.test(objvalue) && objvalue2.length > 0; me.disabled = !status; if (!document.getElementById('cmailinfo')) { cmailinfo = document.createElement('span'); with (cmailinfo) { id = 'cmailinfo'; innerHTML = '← Bitte ausfüllen / Please fill this field'; style['display'] = 'none'; style['marginLeft'] = '10px'; } cmailinfo.name = 'wipe'; obj.parentNode.insertBefore(cmailinfo,obj.nextSibling); } else { cmailinfo = document.getElementById('cmailinfo'); } if (!document.getElementById('cmailinfo2')) { cmailinfo2 = document.createElement('span'); with (cmailinfo2) { id = 'cmailinfo2'; innerHTML = '← Bitte ausfüllen / Please fill this field'; style['display'] = 'none'; style['marginLeft'] = '10px'; } cmailinfo2.name = 'wipe'; obj2.parentNode.insertBefore(cmailinfo2,obj2.nextSibling); } else { cmailinfo2 = document.getElementById('cmailinfo2'); } if (mailregex.test(objvalue)) { obj.style['backgroundColor'] = '#fff'; obj.style['borderColor'] = '#aaa'; } else { obj.style['backgroundColor'] = '#ffcccc'; obj.style['borderColor'] = '#dd0000'; cmailinfo.style['display'] = 'inline'; } if (objvalue2.length > 0) { obj2.style['backgroundColor'] = '#fff'; obj2.style['borderColor'] = '#aaa'; } else { obj2.style['backgroundColor'] = '#ffcccc'; obj2.style['borderColor'] = '#dd0000'; cmailinfo2.style['display'] = 'inline'; } obj.onkeyup = function(e) { if (!e) e = window.event; cmail(me,true); if (e.keyCode != 9) cmailinfo.style['display'] = 'none'; } obj2.onkeyup = function(e) { if (!e) e = window.event; cmail(me,true); if (e.keyCode != 9) cmailinfo2.style['display'] = 'none'; } }