function confirmThis() {
	if (trim(document.tform.company.value) == "") {
		alert("Please enter your Company Name.");
		document.tform.company.focus();
		return false;
	} else if (trim(document.tform.address.value) == "") {
		alert("Please enter your Company Address.");
		document.tform.address.focus();
		return false;
	} else if (trim(document.tform.city.value) == "") {
		alert("Please enter your City.");
		document.tform.city.focus();
		return false;
	} else if (document.tform.state.value == "0") {
		alert("Please select your State.");
		document.tform.state.focus();
		return false;
	} else if (!isZip(document.tform.zip.value)) {
		alert("Please enter your Zipcode.");
		document.tform.zip.focus();
		return false;
	} else if (trim(document.tform.county.value) == "") {
		alert("Please enter your county.");
		document.tform.county.focus();
		return false;
	} else if (trim(document.tform.firstname.value) == "") {
		alert("Please enter a contact name for your company.");
		document.tform.firstname.focus();
		return false;
	} else if (trim(document.tform.lastname.value) == "") {
		alert("Please enter a contact name for your company.");
		document.tform.lastname.focus();
		return false;
	} else if (trim(document.tform.phone.value) == "") {
		alert("Please enter your Phone number.");
		document.tform.phone.focus();
		return false;
	} else if (!isEmail(document.tform.email.value)) {
		alert("Please enter and email address.");
		document.tform.email.focus();
		return false;
	} else if (document.tform.email.value != document.tform.email2.value) {
		alert("Your email addresses do not match. Please re-enter.");
		document.tform.email.focus();
		return false;
	} else if (document.tform.password.value != document.tform.password2.value) {
		alert("Your passwords do not match. Please re-enter.");
		document.tform.password.focus();
		return false;
	} else if (trim(document.tform.tin.value.length) != 9) {
		alert("Please enter your nine digit TIN or EIN.");
		document.tform.tin.focus();
		return false;
	} else if (document.tform.siccode.value == 0) {
		alert("Please select your SIC code.");
		document.tform.siccode.focus();
		return false;
	} else if (!document.tform.termsagree.checked) {
		alert("You must agree to our Terms and Conditions.");
		document.tform.terms.focus();
		return false;
	} else if (document.tform.key.value != 'swobr' && document.tform.key.value != 'SWOBR') {
		alert("Please enter the letters in the graphic.");
		document.tform.key.focus();
		return false;
	} else {
		return true;
	}	
}

function trim(strText) { 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);
   return strText;
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function isPhone(string){
var num= removeChars(string);
	if (num.length != 10 )
		return false;
	else
		return true;
}

function removeChars(string) {
    for (var i=0, output='', valid="0123456789"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}

function isZip(string){
	var num= removeChars(string);
	if (num.length <5 || num.length >9)
		return false;
	else
		return true;
}

function isPassword(string) {
	if (string.length < 6 || string.length > 10)
		return false;
	else if (removeChars2(string) != string )
		return false;
	
	else if (checkNum(string).length < 1)
		return false;
	else
		return true;
}
function checkCap(string) {
	for (var i=0, output='', valid="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}
function checkNum(string) {
	for (var i=0, output='', valid="0123456789"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}

function removeChars2(string) {
    for (var i=0, output='', valid="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}

