var cookieName = new Array(); cookieName[0] = 'platine'; cookieName[1] = 'farbe'; cookieName[2] = 'endkappe'; cookieName[3] = 'profil'; cookieName[4] = 'clip'; cookieName[5] = 'zuleitung'; cookieName[6] = 'position'; cookieName[7] = 'verdrahtung'; cookieName[8] = 'schalter'; cookieName[9] = 'profil_gruppe'; cookieName[10] = 'profil_short'; cookieName[11] = 'profil_l'; cookieName[12] = 'anzahl'; cookieName[13] = 'form'; cookieName[14] = 'storedLength'; onload=function() { if(document.getElementById('head_nav') != null) document.getElementById('head-nav').style.visibility = 'visible'; if(document.getElementById('info') != null) document.getElementById('info').style.visibility = 'visible'; if(document.getElementById('config') != null) document.getElementById('config').style.visibility = 'visible'; if(document.getElementById('tooltip') != null) document.getElementById('tooltip').style.visibility = 'hidden'; if(document.getElementById('text_tooltip') != null) document.getElementById('text_tooltip').style.visibility = 'hidden'; } function cookieDetect() { var cookieEnabled = (navigator.cookieEnabled) ? true : false; if (typeof navigator.cookieEnabled == 'undefined' && !cookieEnabled) { document.cookie='testcookie'; cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false; } return (cookieEnabled); } if(cookieDetect()) { init(); } else { alert('SORRY NO COKKIE!'); } function init() { uncheckAll(); for(var i = 0; i <= cookieName.length; i++) { eraseCookie(cookieName[i]); } getID(); createCookie(cookieName[13], '0', 0); refreshID(); } function set(str1, str2) { createCookie(cookieName[9],str1, 0); createCookie('profil_short',str2, 0); } /* INNERHTML ------------------------------------------------------------------------------*/ function refreshID() { var value = new Array(); closeMarker(); for(var i = 0; i < cookieName.length; i++) { value[i] = readCookie(cookieName[i]); switch(i) { case 0: if(value[i] == null) value[i] = '0000'; break; case 5: if(value[i] == null) value[i] = '0000'; break; case 6: if(value[i] == null) value[i] = '00'; break; case 8: if(value[i] == 'NAN' || value[i] == null) value[i] = '000'; break; case 10: if(value[i] == null || value[i] == '') value[i] = '0000'; break; case 11: if(value[i] == null) value[i] = '000'; break; case 12: if(value[i] == null || value[i] == '') value[i] = '1'; break; // Anzahl default: if(value[i] == null) value[i] = '00'; } } str1 = value[10] +'-'+ value[3] +'-'+ value[2] +'-'+ value[4] +'-'+ value[0] + '-'+ value[1] +'-'+ value[8] +'-'+ value[5] +'-'+ value[6] +'-' + value[11] + '-' + value[12]; if(document.getElementById('k-id') != null) document.getElementById('k-id').innerHTML = str1; idCookieName = 'k-id'; createCookie(idCookieName, str1, 0); } /* AJAX REQUEST ------------------------------------------------------------------------------*/ function initRequest() { if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); } } function getID() { var params=document.URL.split('?')[1]; if (params != null ) { try {par1=params.split('-')[0];} catch (e) {} try {par2=params.split('-')[1];} catch (e) {} createCookie(cookieName[9], par1, 0); par2=par2.substr(0,4); createCookie(cookieName[10], par2, 0); } else { createCookie(cookieName[9], '1', 0); createCookie(cookieName[10], 'ALKO', 0); par2 = 'ALKO'; } id = par2; } function checkAll() { var platine = readCookie(cookieName[0]); var farbe = readCookie(cookieName[1]); var laenge = readCookie(cookieName[11]); var leitung = readCookie(cookieName[5]); var schalter = readCookie(cookieName[8]); var position = readCookie(cookieName[6]); var kappe = readCookie(cookieName[2]); var profil = readCookie(cookieName[3]); var clip = readCookie(cookieName[4]); var laenge = readCookie(cookieName[14]); var duo = 0; var next_0 = 0; var next_1 = 0; var next_2 = 0; var ready = 0; var kontakt = 0; var rotation = 0; if(platine == "D200") duo = 1; if(platine == "D330") duo = 1; if(platine == 'F111') rapport = 33.33; if(platine == 'R111') rapport = 33.33; if(platine == 'F165') rapport = 50; if(platine == 'R165') rapport = 50; if(platine == 'S165') rapport = 50; if(platine == 'R330') rapport = 100; if(platine == 'R660') rapport = 200; if(platine == 'D200') rapport = 100; if(platine == 'D330') rapport = 100; if(id == 'ILKO') kontakt = 1; if(id == 'FLKO') kontakt = 1; if(id == 'SLAK') kontakt = 1; if(id == 'SLEK') kontakt = 1; if(id == 'ALKO') kontakt = 1; if(id == 'OLKO') kontakt = 1; if(id == 'BLPA') rotation = 1; if(id == 'TRST') rotation = 1; if(id == 'ILEB') rotation = 1; if(id == 'QLPA') rotation = 1; var schalter_abzug = 0; var ready = 1; var go = 0; if(platine == null) { showTool(1); ready = 0; } if(duo == 0 || duo == null) { if(farbe == 0 || farbe == null) { showTool(2); ready = 0; } } if(laenge != null || laenge != 0) { if(id == 'ILEB') { if(kappe == null || kappe == 0) { showTool(4); ready = 0; } if(profil == null || profil == 0) { showTool(5); ready = 0; } if(clip == null || clip == 0) { showTool(6); ready = 0; } if(leitung == null || leitung == 0) { showTool(7); ready = 0; } } if(id == 'ILKO' || id == 'SLAB' || id == 'SLEB' || id == 'SLGA' || id == 'SLAK' || id == 'SLEK' || id == 'SLEE') { if(profil == null || profil == 0) { showTool(5); ready = 0; } if(id == 'ILKO') { if(clip == null || clip == 0) { showTool(6); ready = 0; } } } if(kontakt != 1) { if(leitung == null || leitung == 0) { showTool(7); ready = 0; } if (rotation != 1) { if(position == null) { showTool(9); ready = 0; } } } if(mitschalter == '1') { if(schalter == null && schalter != 'NAN') { showTool(8); ready = 0; } else { if(ready == 1 && schalter != 'NAN') { if(schalter == 'REF') { schalter_abzug = schalter_0; } else if(schalter == 'ABS') { schalter_abzug = schalter_0; } else if(schalter == 'ABW') { schalter_abzug = schalter_1; } else { schalter_abzug = 0; } var possible = laenge*1 - (rapport*1 + spangen*1 + schalter_abzug*1 + endkappe_in*1 + endkappe_out*1); if(possible < 0) { var laenge_neu = 0; possible = Math.abs(possible); if(possible <= rapport) laenge_neu = laenge*1 + possible*1 + (rapport*1 - possible*1); else laenge_neu = laenge*1 + possible*1; alert(unescape('Die Leuchtenlänge ist nicht ausreichend für den Einsatz eines Schalters! Bitte kalkulieren Sie die Leuchtenlänge auf min. '+laenge_neu+' mm ein.')); go = 0; } else { possible = Math.abs(possible); var laenge_tmp = laenge*1-possible*1; if(laenge_tmp < 0) { alert(unescape('Die Platinenlänge wird durch den Einsatz dieses Schalters um '+rapport+' mm gekürzt.')); } go = 1; } } else { if(ready == 1) go = 1; } } if(position == null && schalter != 'NAN' && schalter != 'AWD' && schalter != 'AWT' && rotation != 1) { showTool(9); ready = 0; } } else { if(ready == 1) go = 1; } } return go; } function getLength() { var str = readCookie('storedLength'); var value = readCookie('minmax'); var n=value.split('|'); // Werte splitten if(document.getElementById('laenge') != null && str != null) { var str1 = document.getElementById('laenge').value; if(parseInt(str1) > parseInt(n[1])) { str = n[1]; //Wenn groesser als max. Wert alert('Die angegebe Größe ist über dem verfügbaren Wert ('+parseInt(n[1])+'mm). Sondergrößen bitte auf Anfrage!'); } else if(parseInt(str1) < parseInt(n[0])) { str = n[0]; //Wenn kleiner als max. Wert*/ alert('Die angegebe Größe ist unter dem verfügbaren Wert ('+parseInt(n[0])+'mm). Sondergrößen bitte auf Anfrage!'); } else str = str1; document.getElementById('laenge').value = str; } else { str = n[0]; document.getElementById('laenge').value = str; } toggle(14, str); if(document.getElementById('anzahl') != null) anzahl_str = document.getElementById('anzahl').value; else anzahl_str = 1; toggle(11, str); toggle(12, anzahl_str); } function add(str1, str2) { var str3 = str1+'-'+str2; if(str3 =="") str3 = '1-ALKO' getLength(); if(checkAll() == 1) { var value = new Array(); for(var i = 0; i < cookieName.length; i++) { value[i] = readCookie(cookieName[i]); } location.href='./index.php?group='+ str3 +'&action=add&laenge='+ value[11] +'&platine='+ value[0] +'&farbe='+ value[1] +'&endkappe='+ value[2] +'&profil='+ value[3] +'&clip='+ value[4] +'&zuleitung='+ value[5] +'&ableitung='+ value[6] +'&verdrahtung='+ value[7] +'&schalter='+ value[8] +'&profil_gruppe='+ str1 +'&profil_short='+ str2 +'&anzahl='+ anzahl_str; } } function prev(str1, str2) { var str3 = str2; if(str3 =="") str3 = '1-ALKO' getLength(); if(checkAll() == 1) { var value = new Array(); for(var i = 0; i < cookieName.length; i++) { value[i] = readCookie(cookieName[i]); switch(i) { case 0: if(value[i] == null) value[i] = '0000'; break; case 5: if(value[i] == null) value[i] = '0000'; break; case 6: if(value[i] == null) value[i] = '00'; break; case 8: if(value[i] == 'NAN' || value[i] == null) value[i] = '000'; break; case 10: if(value[i] == null || value[i] == '') value[i] = '0000'; break; case 11: if(value[i] == null) value[i] = '000'; break; case 12: if(value[i] == null || value[i] == '') value[i] = '1'; break; // Anzahl default: if(value[i] == null) value[i] = '00'; } } var id = value[10] +'-'+ value[3] +'-'+ value[2] +'-'+ value[4] +'-'+ value[0] + '-'+ value[1] +'-'+ value[8] +'-'+ value[5] +'-'+ value[6] +'-' + value[11] +'-'+ anzahl_str; window.open("./preview.php?product_id="+ id +"&action=prev", "Vorschau"); } } function calculate(str1, str2) { if(str1 =="") str3 = '1' if(str2 =="") str3 = 'ALKO' getLength(); if(checkAll() == 1) { initRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('output').innerHTML=xmlhttp.responseText; } } var value = new Array(); for(var i = 0; i < cookieName.length; i++) { value[i] = readCookie(cookieName[i]); } xmlhttp.open('GET','calcData.php?laenge='+ value[11] +'&platine='+ value[0] +'&farbe='+ value[1] +'&endkappe='+ value[2] +'&profil='+ value[3] +'&abdeck='+ value[4] +'&zuleitung='+ value[5] +'&ableitung='+ value[6] +'&verdrahtung='+ value[7] +'&schalter='+ value[8] +'&profil_gruppe='+ str1 +'&profil_short='+ str2 +'&anzahl='+ anzahl_str ,true); xmlhttp.send(); } } function closeMarker() { hideTool(1); hideTool(2); hideTool(3); hideTool(4); hideTool(5); hideTool(6); hideTool(7); hideTool(8); hideTool(9); } /* RADIO AND CHECKBOX ------------------------------------------------------------------------------*/ function change_lang(num) { var value = readCookie('lang'); eraseCookie('lang'); createCookie('lang', num, 0); window.location.reload(); } /* RADIO AND CHECKBOX ------------------------------------------------------------------------------*/ function uncheckAll() { var allElems = document.getElementsByTagName('input'); for (i = 0; i < allElems.length; i++) { if (allElems[i].type == 'radio' && allElems[i].name != 'group' && allElems[i].name != 'profiles' && allElems[i].name != 'raster' && allElems[i].type != 'text') { allElems[i].checked = false; } } } function toggle(num, str) { document.getElementById('output').innerHTML = ''; eraseCookie(cookieName[num]); createCookie(cookieName[num], str, 0); var value = readCookie(cookieName[num]); if(str == 'S165') alert('Bei diesem Platinentyp entspricht der Lichtaustrittswinkel 90°'); //alert('LOG: Store '+ cookieName +' with value: ' + value); refreshID(); if(num == 0) { eraseCookie(cookieName[1]); eraseCookie(cookieName[2]); eraseCookie(cookieName[3]); eraseCookie(cookieName[4]); eraseCookie(cookieName[5]); eraseCookie(cookieName[6]); eraseCookie(cookieName[8]); eraseCookie(cookieName[14]); uncheckAll(); } } function showTool(num) { if(document.getElementById('marker'+ num) != null) { document.getElementById('marker'+ num).style.visibility = 'visible'; document.getElementById('marker'+ num).style.display = 'block'; } } function hideTool(num) { if(document.getElementById('marker'+ num) != null) { document.getElementById('marker'+ num).style.visibility = 'hidden'; document.getElementById('marker'+ num).style.display = 'none'; } } function setLength(num) { createCookie('minmax',num, 0); } function getRapport() { if(document.getElementById('text_tooltip') != null) { document.getElementById('text_tooltip').innerHTML = ''; } } function showOnlyColors() { var s ='
warmweiss 3200K |
weiss 6000K |
neutralweiss 4000K |
warmweiss 3200K |
weiss 6000K |
neutralweiss 4000K |
warmweiss 3200K |
weiss 6000K |
neutralweiss 4000K |
Reflexschalter |
Abstandsschalter |
Abstandswechselschalter |
600 mm |
1000 mm |
2000 mm |
600 mm |
1000 mm |
2000 mm |
600 mm |
1000 mm |
2000 mm |
600 mm |
1000 mm |
2000 mm |
Reflexschalter |
Abstandsschalter |
Abstandswechselschalter |
links
rechts
links |
rechts |