// JavaScript Document
function custom_shelter(){

if (document.form1.shelter[4].checked == true){	

c_shelter.innerHTML = "<table><tr><td><p class='style23'>Dimensions: <span class='style24'>*</span> </p></td><td><FONT class='style14'> H <INPUT name=Height class='style14' id='height'  size=10></FONT><FONT class='style14'>  x W <INPUT name=Width class='style14' id='width'  size=10></FONT><FONT class='style14'>  x D <INPUT name=Depth class='style14' id='depth'  size=10></FONT></td></tr><tr><td><p class='style23'>Shape: <span class='style24'>*</span> </p></td><td><select name='shape' class='style14' id='shape'><option value='Rectangle' selected>Standard Rectangle</option><option value='Custom'>Custom</option></select></td></tr><tr><td><p class='style23'>Door Hinge Side:<span class='style24'>*</span></p></td><td><select name='door_hinge' class='style14' id='door_hinge'><option selected>Select</option><option value='Left'>Left</option><option value='Right'>Right</option>   </select></td></tr></table>"

}
else
c_shelter.innerHTML = ""
}

function chk(){
if (document.form1.shelter[4].checked == true){	
var height =document.form1.Height.value  
if (height == ""){
  alert("Please Enter The Shelter Height")
  document.form1.Height.select()
  document.form1.Height.focus()
  return false
  }
var width =document.form1.width.value  
if (width == ""){
  alert("Please Enter The Shelter Width")
  document.form1.width.select()
  document.form1.width.focus()
  return false
  }
  var depth =document.form1.depth.value  
if (depth == ""){
  alert("Please Enter The Shelter Depth")
  document.form1.depth.select()
  document.form1.depth.focus()
  return false
  }

  var door_hinge =document.form1.door_hinge.value  
if (door_hinge == ""){
  alert("Please Select the Door Hinge Side")
  document.form1.door_hinge.focus()
  return false
  }
}
if (document.form1.company.value ==""){
alert("Please Enter the Company Name")
document.form1.company.focus();
return false;
}
if (document.form1.first_name.value ==""){
alert("Please Enter you Name")
document.form1.first_name.focus();
return false;
}

if (document.form1.last_name.value ==""){
alert("Please Enter you Last Name")
document.form1.last_name.focus();
return false;
}

if (document.form1.address.value ==""){
alert("Please Enter your Mailing Address")
document.form1.address.focus();
return false;
}
if (document.form1.city.value ==""){
alert("Please Enter your City")
document.form1.city.focus();
return false;
}
if (document.form1.state.value ==""){
alert("Please Enter your State")
document.form1.state.focus();
return false;
}
var zipValue =document.form1.zip.value  
if (zipValue == ""){
  alert("Please Enter Zip code")
  document.form1.zip.focus()
  return false
  }

   
   var phone =document.form1.phone.value  
if (phone == ""){
  alert("Please Enter your contact number")
  document.form1.phone.focus()
  return false
  }
   
   var emailValue = document.form1.email.value



if (emailValue == ""){
        alert("You Should Enter your Email-ID for future contact")
      document.form1.email.focus()
      return false
     }
 
else
    {
      var mailId =false
      for (i=0; i<emailValue.length; ++i){
             if (emailValue.substring(i,i+1) == "@"){
                                           mailId = true
                                           break
                                      } 
          }
       if (mailId==false){
          alert("Please enter a valid Email-Id ")
          document.form1.email.focus()
          document.form1.email.select()
          return false
        }
     }   

 
   
  

if (document.form1.comments.value ==""){
quess = confirm("You are about to send this information without any comments??","yes","no")
if (quess == false){
document.form1.comments.focus();
return false;
}

}
document.form1.submit();
}

