function js_init() { if (document.commande) { ChangeStatut(document.commande); updatePrice(); poll(); } } function updatePrice() { var price_array = document.commande.offer.options[document.commande.offer.selectedIndex].value.split(','); var money = document.getElementById('currency').value if (money == 'EUR') { change='1.6693'; } else { change='1'; } percent = 1; if(document.commande.month[0].checked) {mois='1';percent = '1';pay_infos='Frais mensuels'; showLayer('price_infos');} if(document.commande.month[1].checked) {mois='3';percent = '0.96';pay_infos='Frais trimestriels'; showLayer('price_infos');} if(document.commande.month[2].checked) {mois='6';percent = '0.90';pay_infos='Frais semestriels'; showLayer('price_infos');} if(document.commande.month[3].checked) {mois='12';percent = '0.83333';pay_infos='Frais annuels'; showLayer('price_infos');} if (price_array[0]=='13') { showLayer('onDemand'); base_price = Math.round((1.2*Math.sqrt(document.commande.Quota.value*26)+1.2*Math.sqrt(document.commande.mysqlDBs.value*130)+document.commande.stats.value*15)*100/change*percent/12)/100; full_price = Math.round((1.2*Math.sqrt(document.commande.Quota.value*26)+1.2*Math.sqrt(document.commande.mysqlDBs.value*130)+document.commande.stats.value*15)*100/change/12)/100; price = Math.round(parseFloat(base_price*mois)*100)/100; reduction = Math.round((full_price*mois-base_price*mois)*100)/100; } else { hideLayer('onDemand'); document.commande.Quota.value=''; document.commande.mysqlDBs.value=''; document.commande.stats.value=''; price = Math.round(parseFloat(price_array[1]*percent*mois/change)); full_price = Math.round(parseFloat(price_array[1]*12/change)); reduction = full_price-price*12/mois; } document.getElementById('price_infos').innerHTML = pay_infos + ' : ' + money + ' ' + price + ' (hors coût du nom de domaine)' + '
Vous économisez ainsi : ' + money + ' ' + reduction; } function ChangeStatut(formulaire) { if(document.getElementById('agree').checked == true) { document.getElementById('validation').disabled = false; } if(document.getElementById('agree').checked == false) { document.getElementById('validation').disabled = true; } } function verifForm(formulaire) { if(document.getElementById('agree').checked == false) { alert('Vous devez accepter nos conditions de vente pour pouvoir commander'); } if(document.getElementById('contact_tech').value == '') { alert('Vous devez renseigner le champ contact technique'); } if (document.getElementById('contact_tech').value != '' && document.getElementById('agree').checked == true) { formulaire.submit(); } } function showLayer(zeDiv) { if (document.getElementById) { // this is the way the standards work var style2 = document.getElementById(zeDiv).style; style2.display = "block"; } else if (document.all) { // this is the way old msie versions work var style2 = document.all[zeDiv].style; style2.display = "block"; } else if (document.layers) { // this is the way nn4 works var style2 = document.layers[zeDiv].style; style2.display = "block"; } } function hideLayer(zeDiv) { if (document.getElementById) { // this is the way the standards work var style2 = document.getElementById(zeDiv).style; style2.display = "none"; } else if (document.all) { // this is the way old msie versions work var style2 = document.all[zeDiv].style; style2.display = "none"; } else if (document.layers) { // this is the way nn4 works var style2 = document.layers[zeDiv ].style; style2.display = "none"; } }