
function stripAlphaChars(pstrSource) 
{ 
var m_strOut = new String(pstrSource); 
    m_strOut = m_strOut.replace(/[^0-9]/g, ''); 
			// alert(m_strOut);
    return m_strOut; 
}
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
function IsNumeric(sText)
// from http://www.tedspence.com/index.php?entry=entry080626-093659
{
	var ValidChars = "0123456789";
				// alert(sText);
	for (i = 0; i < sText.length; i++) {
		if (ValidChars.indexOf(sText.charAt(i)) == -1) {
			return false;
		}
	}
	return true;
	}
 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
function chkentries() {
   f=document.req_info;
   var badCount = 0;
   var goodchars = 0;
   var msg = "";

// Inquiry Type 
    if ((f.inquiry_type.selectedIndex < 1) || (f.inquiry_type.selectedIndex > 2)){
      badCount = badCount + 1;
	  msg = msg + "\nIndicate your Inquiry Type.";
	}

// First Name
 	if (f.first_name.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter your First Name.";
	}
	// Last Name
 	if (f.last_name.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter your Last Name.";
	}
	
// Company Name
	if (f.company.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter the name of your Company.";
	}
	
// Title
	if (f.title.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter your Title.";
	}
	
// Industry	
    if ((f.industry.selectedIndex < 1) || (f.industry.selectedIndex > 4)){
      badCount = badCount + 1;
	  msg = msg + "\nIndicate your Industry.";
	}
	
// Lead Source
    if ((f.lead_source.selectedIndex < 1) || (f.lead_source.selectedIndex > 14)){
      badCount = badCount + 1;
	  msg = msg + "\nIndicate the Lead Source.";
	}
		
// Phone
	if (f.phone.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter the Phone number where you can be reached during the Day.";
	} else {
		tmp = f.phone.value;
		if (!IsNumeric(stripAlphaChars(tmp))) {
			msg = msg + "\nEnter a valid Phone Number.";
		}
	}
	
//E-mail
    if (f.email.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter your E-mail address.";
	}

//
	if (f.email.value != "") {
   		inputVal = f.email.value;
   		inputStr = inputVal.toString()
    
   		for (var i = 0; i < inputStr.length; i++) { 
      		var oneChar = inputStr.charAt(i) 
      		if (oneChar == "." || oneChar == "@") { 
         		goodchars = goodchars + 1;
      		}  
   		}
		if (goodchars <2) {
   			badCount = badCount + 1;
			msg = msg + "\nEnter a valid E-mail address.";
		}
	}
//Website
   // if (f.URL.value == "") {
//		badCount = badCount + 1;
//		msg = msg + "\nEnter your Company's Website Address.";
//	}

//Street
    if (f.street.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter your Street Address.";
	}
	
// City
	if (f.city.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter the City where your company is located.";
	}

// State
	if ((f.state.value == "None Selected") || (f.state.value == "")){
		badCount = badCount + 1;
	    msg = msg + "\nEnter the State where your company is located.";
	}
	
// Zip
	if (f.zip.value == "") {
		badCount = badCount + 1;
		msg = msg + "\nEnter the Zip Code.";
	} else {
		tmp = f.zip.value;
		if (!IsNumeric(stripAlphaChars(tmp))) {
			msg = msg + "\nEnter a valid Zip/Postal Code.";
		}
	}

	
	
	if (badCount == 0) {
    	return true;
    } else {
    	alert (msg);
      	return false;
    }

} 
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&