function checkWholeForm(theForm) {

    var why = "";

	why += checkFName(theForm.first_name.value);

	why += checkLName(theForm.last_name.value);

	why += checkCountry(theForm["00N30000000ko1r"].value);

	why += checkPhone(theForm.phone.value);

	why += checkEmail(theForm.email.value);

	why += checkURL(theForm.URL.value);

    if (why != "") {

       alert(why);

       return false;

    }

  theForm.description.value = 'Comments:\n' + theForm.comments.value;

  return true;

}



function checkSplitTopForm(theForm) {

    var why = "";

	why += checkFName(theForm.first_name.value);

	why += checkLName(theForm.last_name.value);

	why += checkPhone(theForm.phone.value);

	why += checkEmail(theForm.email.value);

	why += checkURL(theForm.URL.value);

    if (why != "") {

       alert(why);

       return false;

    }

  theForm.description.value = 'Comments:\n' + theForm.comments.value + '\n\n' + 'How did you hear about us?:\n' + theForm.hearAbout.value;

  return true;

}





function checkKeywordForm(theForm) {

  var why = "";

	why += checkFName(theForm.first_name.value);

	why += checkLName(theForm.last_name.value);

	why += checkCountry(theForm["00N30000000ko1r"].value);

	why += checkPhone(theForm.phone.value);

	why += checkEmail(theForm.email.value);

	why += checkURL(theForm.URL.value);

	why += checkKeyword(theForm.kw1.value);

  if (why != "") {

    alert(why);

    return false;

  }

  if (theForm.description) {

    var description = "";

    if (theForm.prodservsell.value.length > 0)  description += "Please list all the products and services you sell:\n" + theForm.prodservsell.value + "\n\n";

    if (theForm.prodservpromo.value.length > 0) description += "Products and services you would most like to promote:\n" + theForm.prodservpromo.value + "\n\n";

    if (theForm.competitors.value.length > 0)   description += "Who are your competing or similar web sites:\n" + theForm.competitors.value + "\n\n";

    if (theForm.comments.value.length > 0)      description += "Additional comments:\n" + theForm.comments.value + "\n\n";

    theForm.description.value = description;

  }

  theForm.description.value = 'Comments:\n' + theForm.comments.value + '\n\n' + 'How did you hear about us?:\n' + theForm.hearAbout.value;

  return true;

}



// first name



function checkFName (strng) {

	var error = "";

	if (strng == "") {

		error = "Please enter a first name.\n";

	}

	var illegalChars = /\W/; // allow letters, numbers, and underscores

    if (illegalChars.test(strng)) {

		error = "The first name contains illegal characters.\n";

    } 

	return error;

}  



// last name



function checkLName (strng) {

	var error = "";

	if (strng == "") {

		error = "Please enter a last name.\n";

	}

    var illegalChars = /\W/; // allow letters, numbers, and underscores

    if (illegalChars.test(strng)) {

		error = "The last name contains illegal characters.\n";

    } 

	return error;

}



// Country



function checkCountry (strng) {

	var error = "";

	if (strng == "") {

		error = "Please select a country or region.\n";

	}

	return error;

}    



// phone



function checkPhone (strng) {

	var error = "";

	var stripped = strng;

	if (stripped == "") {

		error = "Please enter a phone number.\n";

	} else if (!(stripped.length >= 10)) {

		error += "The phone number is the wrong length. Make sure you included an area code.\n";

    } else if (isNaN(parseInt(stripped))) {

       error = "The phone number contains illegal characters.\n";

    }

return error;

}



// email



function checkEmail (strng) {

	var error="";

	var emailFilter=/^.+@.+\..{2,3}$/;

	if (strng == "") {

		error = "Please enter an email address.\n";

	} else if (!(emailFilter.test(strng))) { 

       error = "Please enter a valid  email address.\n";

    }

    else {

//test email for illegal characters

       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/

         if (strng.match(illegalChars)) {

          error = "The email address contains illegal characters.\n";

       }

    }

	return error;    

}



//URL



function checkURL (strng) {

	var error="";

	if (strng == "") {

		error = "Please enter a valid website (URL) address.\n";

    }

	return error;    

}



//KEYWORD



function checkKeyword (strng) {

	var error="";

	if (strng == "") {

		error = "Please enter at least one keyword - a term that you would like to rank for.\n";

    }

	return error;    

}



// budget



function checkBudget (strng) {

	var error = "";

	if (strng == "") {

		error = "How much are you willing to invest monthly to achieve a top ranking in the major search engines?\n";

	}

	return error;

} 





function combineAnswers(theForm){

	theForm.description.value = theForm.descript.value + "\n\n" +

										 "Have you ever worked with an SEO company before?\n" +

										 theForm.q1.value + "\n\n" +

										 "How well do you understand SEO?\n" +

										 theForm.q2.value + "\n\n" +

										 "Have you purchased links before? If so, how would you rate that experience?\n" +

										 theForm.q3.value + "\n\n" +

										 "What are the long term goals for your website?\n" +

										 theForm.q4.value + "\n\n" +

										 "What percentage of your total revenue have you allocated for advertising?\n" +

										 theForm.q5.value + "\n\n" +

										 "What expectations do you have for this website?\n" +

										 theForm.q6.value + "\n\n" +

										 "What do you feel your site is lacking?\n" +

										 theForm.q7.value + "\n\n" +

										 "Is this your primary source of income?\n" +

										 theForm.q8.value + "\n\n" +

										 "Have you had an extensive keyword report done?\n" +

										 theForm.q9.value + "\n\n" +

										 "How well do you utilize web analytics? (conversion ratios, etc.)\n" +

										 theForm.q10.value;

	return true;



}



//Sample Report View for 



function sampleView(url){

	

	if (navigator.appName == 'Microsoft Internet Explorer' && (navigator.platform.substring(0,3) == 'Win')) {

		hComp=57;

	}

	else if (navigator.appName == 'Netscape' && navigator.platform.substring(0,3) == 'Win') {

		hComp=59;;

	}

	else if (navigator.platform == 'MacPPC' && navigator.appName == 'Netscape'){

		// extra 18 px for net on mac (don't know why?? but works)

		hComp=49;

	}

	else {

		hComp=31;		

	}

	

	winH        = screen.height - hComp;

	

	windowName  = 'article_submission_view';

	

	winFeatures = "left=0,top=0,width=800,height=" + winH + ",scrollbars=yes";

	

	full        = window.open(url,windowName,winFeatures);

	

	full.focus();

}