console.log("functions"); function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function getHTTPObject(){ if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { alert("Your browser does not support AJAX."); return null; } } submitImgGray = new Image; submitImgGray.src = "img/button_next_off.png"; submitImg = new Image; submitImg.src = "img/button_next.png"; function disableSubmit() { var submitObj = document.getElementById('next'); submitObj.src = submitImgGray.src; submitObj.disabled = true; } function enableSubmit() { var submitObj = document.getElementById('next'); submitObj.src = submitImg.src; submitObj.disabled = false; } function ssetOutput(){ if(httpObject.readyState == 4){ var diffex = ''; var runtime = ''; var resultset = httpObject.responseText; var winprice = ''; var regexp = new RegExp(","); resArray = resultset.split(regexp); // main var price = resArray[0]; var diff = resArray[1]; var runtime = resArray[2]; var real = resArray[3]; // win var iswin = resArray[4]; var wgross = resArray[5]; var wruntime = resArray[6]; var wreal = resArray[7]; var setupfee = resArray[8]; if (iswin = '1') { winprice = wgross; } var addonprices = document.getElementById('ao').value*runtime; var addonsetups = document.getElementById('aop').value; getprice = price*1+winprice*1+setupfee*1+addonprices*1; document.getElementById('gprice').value = (Math.round(getprice * 100) / 100).toFixed(2); if('' == '3166') { document.getElementById('sum').innerHTML = price; } if('' == '3346') { document.getElementById('sum').innerHTML = price; } document.getElementById('resultsbox').innerHTML = (Math.round(getprice * 100) / 100).toFixed(2); var satz; //runtime 1 3 6 12 switch(runtime) { case '1': satz = 0; break; case '3': satz = 0.03; break; case '6': satz = 0.06; break; case '12': satz = 0.12; break; } if('' != '3346') { var bundleprice = ''; bundlep = ((bundleprice - (bundleprice * satz)) + (addonprices/runtime) + (winprice/runtime)).toFixed(2); //bundlep = ((bundleprice - (bundleprice * satz)) + (addonprices/runtime) + (wgross) ).toFixed(2); document.getElementById('bundleprice').innerHTML = bundlep; } // var bundleprice = ''; // alert(bundleprice); //bundlep = ((bundleprice - (bundleprice * satz)) + (addonprices/runtime)).toFixed(2); /* var bundlep = parseInt($('#bundleprice').text()); bundlep = ((bundlep * 100 / 100) + (addonprices * 100 / 100)).toFixed(2); document.getElementById('bundleprice').innerHTML = bundlep; */ if(runtime > '1') { var nicemonth = " Monate"; document.getElementById('mygood').innerHTML = '
Laufzeitgutschrift '+runtime+'%'; document.getElementById('sparen').innerHTML = '
Sie sparen
'; getreal = real*1+winprice*1; document.getElementById('diffex').innerHTML = (Math.round(diff * 100) / 100).toFixed(2); } else { var nicemonth = " Monat"; document.getElementById('mygood').innerHTML = ""; document.getElementById('sparen').innerHTML = "
"; diffex = " "; } document.getElementById('vlzbox').innerHTML = runtime+nicemonth; } } function sgoajax(bundle,runtime,winid){ httpObject = getHTTPObject(); if (httpObject != null) { httpObject.open("GET", "lib/ajax/result.php?BundleId="+bundle+"&runtime="+runtime+"&winid="+winid, true); httpObject.send(null); httpObject.onreadystatechange = ssetOutput; } } function scount() { var bundle; bundle = ''; var winid; winid = ''; var runtime; runtime = ''; var sel; sel = ''; if(sel!='') { runtime = sel; } if (bundle == '3286') { console.log("treqw7366_jdkj"); } else { sgoajax(bundle,runtime,winid); } } function popAGB() { aw=window.open("http://www.de.inter.net/inter-net/agb","agb","width=970,height=500,scrollbars"); aw.focus; } function popBoni() { aw=window.open("pages/info/bonitaet.html","Bonitaet","width=570,height=400,scrollbars"); aw.focus; } function submitPrint() { form1 = document.getElementById('print'); form1.submit(); return false; } function hidediv() { //enableSubmit(); if (document.getElementById) { document.getElementById('hideshow').style.visibility = 'hidden'; } else { if (document.layers) { document.hideshow.visibility = 'hidden'; } else { document.all.hideshow.style.visibility = 'hidden'; } } } function showdiv() { //disableSubmit(); if (document.getElementById) { document.getElementById('hideshow').style.visibility = 'visible'; } else { if (document.layers) { document.hideshow.visibility = 'visible'; } else { document.all.hideshow.style.visibility = 'visible'; } } }