function IsCorrect() {
        if (document.RFQ.company.value=='') {
          alert('You haven\'t filled in Company!');
            return;
        } else if(document.RFQ.realname.value=='') {
            alert('You haven\'t filled in Your Name!');  
            return;
        } else if(document.RFQ.number.value=='') {
            alert('You haven\'t filled in a contact number!');  
            return;
        } else if(document.RFQ.email.value=='') {
            alert('You haven\'t filled in an Email address!');  
            return;
        } else if(document.RFQ.bAddress.value=='') {
            alert('You haven\'t filled in your billing address!');  
            return;
        } else if(document.RFQ.bCity.value=='') {
            alert('You haven\'t filled in your city in the billing address!');  
            return;
        } else if(document.RFQ.bState.value=='') {
            alert('You haven\'t filled in your state in the billing address!');  
            return;
        } else if(document.RFQ.bZip.value=='') {
            alert('You haven\'t filled in your zip code in the billing address!');  
            return;
        } else if(document.RFQ.shipping.value=='0') {
            alert('You haven\'t selected a shipping method!');  
            return;
        } else if(document.RFQ.shipping.value=='2') {
            if(document.RFQ.billingAddress.value=='1'){
              if(document.RFQ.sAddress.value=='') {
                alert('You haven\'t filled in your shipping address!');  
                return;
              } else if(document.RFQ.sCity.value=='') {
                alert('You haven\'t filled in your city in the shipping address!');  
                return;
              } else if(document.RFQ.sState.value=='') {
                alert('You haven\'t filled in your state in the shipping address!');  
                return;
              } else if(document.RFQ.sZip.value=='') {
                alert('You haven\'t filled in your zip code in the shipping address!');  
                return;
              }
            }
        }
	document.getElementById('divMain').style.display= 'none';
	document.getElementById('divParts').style.display= 'block';
	
	
  }
function ShowEnd(){
	if(document.RFQ.orderList.value=='') {
            alert('Please enter quantity and part number and click Add Item!');  
            return;
        } else if(document.RFQ.quantity.value!='' || document.RFQ.partNumber.value!='' || document.RFQ.description.value!='') {
            alert('Please click Add Item to add the item to the list!');  
            return;
        }
	
        document.RFQ.custInfo.value = document.RFQ.subject.value +"\n\n";
	document.RFQ.custInfo.value += "Contact Information\n";
        document.RFQ.custInfo.value += "   Company Name: " + document.RFQ.company.value +"\n";
        document.RFQ.custInfo.value += "   Your Name: " + document.RFQ.realname.value +"\n";
        document.RFQ.custInfo.value += "   Contact Number: " + document.RFQ.number.value +"\n";
        document.RFQ.custInfo.value += "   Your Email Address: " + document.RFQ.email.value +"\n";
        document.RFQ.custInfo.value += "   Billing Address: " + document.RFQ.bAddress.value +" ";
        document.RFQ.custInfo.value += document.RFQ.bCity.value +", ";
        document.RFQ.custInfo.value += document.RFQ.bState.value +" ";
        document.RFQ.custInfo.value += document.RFQ.bZip.value +"\n";
        document.RFQ.custInfo.value += "   Shipping Option: " + document.RFQ.shippingType.value +"\n";
        
        if(document.RFQ.shipping.value=='2'){
          if(document.RFQ.billingAddress.value=='1'){
            document.RFQ.custInfo.value += "   Shipping Address: " + document.RFQ.sAddress.value +" ";
            document.RFQ.custInfo.value += document.RFQ.sCity.value +", ";
            document.RFQ.custInfo.value += document.RFQ.sState.value +" ";
            document.RFQ.custInfo.value += document.RFQ.sZip.value +"\n";
          }
          else {document.RFQ.custInfo.value += "   Shipping Address is the same as billing address.\n "}
        }  
        
        document.RFQ.custInfo.value += "\nItems to quote: \n" + document.RFQ.orderList.value;
        
        if(document.RFQ.extraInfo.value!=''){
          document.RFQ.custInfo.value += "\nSpecial Requests: " + document.RFQ.extraInfo.value +"\n";
        }
        
            var date = new Date();
            var d  = date.getDate();
            var day = (d < 10) ? '0' + d : d;
            var m = date.getMonth() + 1;
            var month = (m < 10) ? '0' + m : m;
            var yy = date.getYear();
            var year = (yy < 1000) ? yy + 1900 : yy;
              document.RFQ.custInfo.value += "\n\nCurrent Date: " + month + "/" + day + "/" + year;
	      document.RFQ.date.value = "Current Date: " + month + "/" + day + "/" + year;
              
            var a_p = "";
            var d = new Date();
            var curr_hour = d.getHours();
            if (curr_hour < 12) {a_p = "AM";}
            else {a_p = "PM";}
            if (curr_hour == 0) {curr_hour = 12;}
            if (curr_hour > 12) {curr_hour = curr_hour - 12;}
            var curr_min = d.getMinutes();
              document.RFQ.custInfo.value += "\nCurrent Time: " + curr_hour + ":" + curr_min + " " + a_p +"\n\n\n";
	      document.RFQ.date.value += "\nCurrent Time: " + curr_hour + ":" + curr_min + " " + a_p;
      
        document.getElementById('divMain').style.display= 'none';
        document.getElementById('divParts').style.display= 'none';
        document.getElementById('divDisplayInfo').style.display= 'block';
        document.getElementById('divSubmit').style.display= 'block';
}
function BackToContactInfo(){
        document.getElementById('divMain').style.display= 'block';
        document.getElementById('divParts').style.display= 'none';
        
        if(document.RFQ.shipping.value=='2'){document.getElementById('divShipping').style.display= 'block';}
        if(document.RFQ.billingAddress.value=='1'){document.getElementById('divBillingAddress').style.display= 'block';}
        
        document.getElementById('divDisplayInfo').style.display= 'none';
        document.getElementById('divSubmit').style.display= 'none';
}
function BackToItems(){
        document.getElementById('divMain').style.display= 'none';
        document.getElementById('divParts').style.display= 'block';
	document.getElementById('divItemsToQuote').style.display= 'block';
        document.getElementById('divDisplayInfo').style.display= 'none';
        document.getElementById('divSubmit').style.display= 'none';
}
function ShippingMenu(num){
            if(num=='2'){
                document.getElementById('divShipping').style.display = 'block';
                document.RFQ.shippingType.value = "UPS/Fedex/Motor Frieght"
                }
            else{
                document.getElementById('divShipping').style.display = 'none';
                document.getElementById('divBillingAddress').style.display = 'none';
                document.RFQ.shippingType.value = "Will Call"
		document.RFQ.billingAddress.value = '0';
            }
            
            
        }
function BillingMenu(num){
            if(num=='1'){
                document.getElementById('divBillingAddress').style.display = 'block';
		document.RFQ.sameShipping.value = '';
            }
            else{
                document.getElementById('divBillingAddress').style.display = 'none';
		document.RFQ.sameShipping.value = "Same as Billing Address";
            }
        }
function addInfo(info) {
	document.RFQ.addressInfo.value += info +"\n";
    }
function noenter() {
  return !(window.event && window.event.keyCode == 13);
  }
function showSubMenu(id)
  {
    theList = document.getElementById(id);
    theList.style.display = 'block';
  }

function hideSubMenu(id)
  {
    theList = document.getElementById(id);
    theList.style.display = 'none';
  }

function menuMouseOver(listItem)
  {
    listItem.style.backgroundColor = '#0066cc'
  }

function menuMouseOut(listItem)
  {
    listItem.style.backgroundColor = '#193D8F'
  }
