function contactform()
{
if(document.form.contactname.value=='')
{
alert('Please enter Name')
document.form.contactname.focus()
return false;
}
if(document.form.contactemail.value=='')
{
alert('Please enter Email')
document.form.contactemail.focus()
return false;
}
else if(document.form.contactemail.value.indexOf("@")=="-1"||document.form.contactemail.value.indexOf(".")=="-1")
{
alert("Please enter correct Email");
document.form.contactemail.focus();
return false;
}
if(document.form.message.value=='')
{
alert('Please enter Message')
document.form.message.focus()
return false;
}
}
function clear_output(){
  document.area.output_sq_feet.value = '';
}

function calculate_area(){
  var t_length = parseFloat(document.area.input_length.value);
  var t_width = parseFloat(document.area.input_width.value);

  if ((t_length <= 0) || (isNaN(t_length))) {t_length = 1;}
  if ((t_width <= 0) || (isNaN(t_width))) {t_width = 1;}

  document.area.input_length.value = t_length;
  document.area.input_width.value = t_width;

  if (document.area.input_feet.checked){
    document.area.output_sq_feet.value = t_length * t_width;
  } else{
    document.area.output_sq_meters.value = t_length * t_width;
  }
}

  if(window.attachEvent)
    window.attachEvent("onload",setListeners);
  
  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "" && event.srcElement.style.backgroundColor != "262A31"){
      event.srcElement.style.backgroundColor = "#262A31"; /* color of choice for AutoFill */
//      document.all['googleblurb'].style.display = "block";
    }
  }

function killAutofill(){
is = document.getElementsByTagName("INPUT");
for(i=0;i<is.length;i++)
is[i].style.backgroundColor = "";
ss = document.getElementsByTagName("SELECT");
for(i=0;i<ss.length;i++)
ss[i].style.backgroundColor = "";
}
window.onload=killAutofill;



function math()
{
var standard=24;
var premier=32;
var result1=0;
var result2=0;
var height=0;
var width=0;

height=document.getElementById('height').value;
width=document.getElementById('width').value;
premier=document.getElementById('paper1').value;
standard=document.getElementById('paper2').value;

if (height>0 & width>0 ) {
result2=(height*width*premier/1000000).toFixed(2);
result3=(height*width/1000000).toFixed(1);
var pound='\xa3';
document.getElementById('premier_paper').value=( pound +result2);
if (result3<=1) {document.getElementById('wall_size').value=result3+' '+'square meter';}
else document.getElementById('wall_size').value=result3+' '+'square meters';


}}
