daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.            
  2. function changebtu()
  3. {
  4. document.getElementById('btu').value=document.getElementById('output_btu').value;
  5. document.getElementById('Total-Area').value=myresult;
  6.  
  7.  
  8. }
  9.            
  10. function clear_output(){
  11.   //document.area.output_sq_feet.value = '';
  12.   document.area.output_sq_meters.value = '';
  13. }
  14.  
  15. function calculate_area(){
  16.    
  17.     //alert('test');
  18.   var t_length = parseFloat(document.area.input_length.value);
  19.   var t_width = parseFloat(document.area.input_width.value);
  20.  
  21.   if ((t_length <= 0) || (isNaN(t_length))) {t_length = 1;}
  22.   if ((t_width <= 0) || (isNaN(t_width))) {t_width = 1;}
  23.  
  24.   document.area.input_length.value = t_length;
  25.   document.area.input_width.value = t_width;
  26.  
  27. //  document.area.output_sq_meters.value = t_length * t_width;
  28.   myresult = t_length * t_width;
  29.   myresult=myresult.toFixed(2);
  30.   document.getElementById('m2').innerHTML = '<b  class="font11 col2">Total Area: ' + myresult +  ' sq.ft' + ' </b>';
  31.  
  32.  
  33.   document.getElementById('totalarea_meta').value=myresult;
  34.  
  35.  
  36.   if (myresult < 100) {
  37.      res = 4000;
  38.   }
  39.   if ((myresult >= 100) && (myresult < 150)) {
  40.      res = 5000;
  41.   }
  42.   if ((myresult >= 150) && (myresult < 250)) {
  43.      res = 6000;
  44.   }
  45.   if ((myresult >= 250) && (myresult < 300)) {
  46.      res = 7000;
  47.   }
  48.   if ((myresult >= 300) && (myresult < 350)) {
  49.      res = 8000;
  50.   }
  51.   if ((myresult >= 350) && (myresult < 400)) {
  52.      res = 9000;
  53.   }
  54.   if ((myresult >= 400) && (myresult < 450)) {
  55.      res = 10000;
  56.   }
  57.   if ((myresult >= 450) && (myresult < 550)) {
  58.      res = 12000;
  59.   }
  60.   if ((myresult >= 550) && (myresult < 700)) {
  61.      res = 14000;
  62.   }
  63.   if ((myresult >= 700) && (myresult < 1000)) {
  64.      res = 18000;
  65.   }
  66.   if ((myresult >= 1000) && (myresult < 1200)) {
  67.      res = 21000;
  68.   }
  69.   if ((myresult >= 1200) && (myresult < 1400)) {
  70.      res = 23000;
  71.   }
  72.   if ((myresult >= 1400) && (myresult < 1500)) {
  73.      res = 24000;
  74.   }
  75.   if ((myresult >= 1500) && (myresult < 2000)) {
  76.      res = 30000;
  77.   }
  78.   if ((myresult >= 2000) && (myresult < 2500)) {
  79.      res = 34000;
  80.   }
  81.   if (myresult > 2500) {
  82.      res = 0;
  83.   }
  84.   extra = 0;
  85.  
  86.   if (document.area.rad1.checked || document.area.rad2.checked || document.area.rad3.checked || document.area.rad4.checked) {
  87.     if (res == 0) {
  88.         extra = 0;
  89.     }
  90.     else if (res == 34000) {
  91.         extra = 3000;
  92.     }
  93.     else if (res == 36000) {
  94.         extra = 12000;
  95.     }
  96.     else {
  97.        extra = 6000;
  98.     }
  99.   }
  100.  
  101.   btu = res + extra;
  102.  
  103.   if (btu > 0 && btu <= 643000) {
  104.      document.area.output_btu.value = btu;
  105.      document.getElementById('div_help').innerHTML = '';
  106.   }
  107.   else {
  108.      doIt=confirm("PLEASE NOTE:\n\nYour Room / Office size exceeds 1286m2.\n\nWe will need a bit more information from you in order to quote you. \n\nPlease click on OK below to direct you to the Enquiry page so you can let us know your exact requirements.\n\nWe will then contact you right back.");
  109.      if (doIt) {
  110.          window.document.location.href='http://dwl.toucanapps.com/contact/';
  111.      }
  112.      
  113.      document.area.output_btu.value = 'Pls contact us'
  114.      document.getElementById('div_help').innerHTML = 'No problem. Let us help! <a href="Contactus.html">Contact us and tell us more about your requirements..</a>';  
  115.   }
  116. }
  117. // -->
RAW Paste Data
Top