//Field Check
function checkFields() {
var emptyString = /^\s*$/;
missinginfo = "";
if ( (document.frm_newsltr.firstname.value == "")  || (emptyString.test(document.frm_newsltr.firstname.value))  ) {
missinginfo += "\n     -  First Name";
}

if ( (document.frm_newsltr.lastname.value == "")  || (emptyString.test(document.frm_newsltr.lastname.value))  ) {
missinginfo += "\n     -  Last Name";
}

if ((document.frm_newsltr.email.value != document.frm_newsltr.email_again.value) ||
(document.frm_newsltr.email.value == "") || 
(document.frm_newsltr.email.value.indexOf('@') == -1) || 
(document.frm_newsltr.email.value.indexOf('.') == -1) ||
(emptyString.test(document.frm_newsltr.email.value)) ||
(document.frm_newsltr.email_again.value == "") || 
(document.frm_newsltr.email_again.value.indexOf('@') == -1) || 
(document.frm_newsltr.email_again.value.indexOf('.') == -1) ||
(emptyString.test(document.frm_newsltr.email_again.value)) ) {
missinginfo += "\n     -  Email Address / Confirmation";
}

if ( (document.frm_newsltr.company_name.value == "")  || (emptyString.test(document.frm_newsltr.company_name.value))  ) {
missinginfo += "\n     -  Company";
}

if ( (document.frm_newsltr.address.value == "")  || (emptyString.test(document.frm_newsltr.address.value))  ) {
missinginfo += "\n     -  Address";
}

if ( (document.frm_newsltr.city.value == "")  || (emptyString.test(document.frm_newsltr.city.value))  ) {
missinginfo += "\n     -  City";
}

if ( (document.frm_newsltr.state.value == "")  || (emptyString.test(document.frm_newsltr.state.value))  ) {
missinginfo += "\n     -  State";
}

if ( (document.frm_newsltr.zip.value == "")  || (emptyString.test(document.frm_newsltr.zip.value))  ) {
missinginfo += "\n     -  Zip/Postal Code";
}

if ( (document.frm_newsltr.country.value == "")  || (emptyString.test(document.frm_newsltr.country.value))  ) {
missinginfo += "\n     -  Country";
}

if ( (document.frm_newsltr.phone.value == "")  || (emptyString.test(document.frm_newsltr.phone.value))  ) {
missinginfo += "\n     -  Phone";
}

if ( (document.frm_newsltr.description.value == "")  || (emptyString.test(document.frm_newsltr.description.value))  ) {
missinginfo += "\n     -  What Best Describes You?";
}

if ( (document.frm_newsltr.referral.value == "")  || (emptyString.test(document.frm_newsltr.referral.value))  ) {
missinginfo += "\n     -  How Did You Hear About Us?";
}

if (document.frm_newsltr.iagree.checked == false )
{
missinginfo += "\n     -  Please Agree to the Terms";
}

if (missinginfo != "") {
missinginfo ="_____________________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

//Hidden Text Boxes
function show_Otherdiv01(v){
var d=document.getElementById('Otherdiv01'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}
function show_Otherdiv02(v){
var d=document.getElementById('Otherdiv02'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}
function show_Otherdiv03(v){
var d=document.getElementById('Otherdiv03'), k;
k=v=='Other'?['block',false]:['none',true];
d.getElementsByTagName('textarea')[0].disabled=k[1];
d.style.display=k[0];
}

//Hidden Text Boxes
//<![CDATA[
function toggleDivs(c) {
if(c=="n") {
document.getElementById("purchasefrom1").style.display="none";
}
if(c=="y") {
document.getElementById("purchasefrom1").style.display="block";
}	
}
//]]> 

