function validateAllRequired(form) { // validates registerUnifiedForm.php
	var myForm = document.foobar;
	// Email
	if ( myForm.email.value.length < 6) {
		alert("You MUST submit a valid email address.");
		myForm.email.focus();
		return false;
		// needs better validation
	}
	// Password
	if ( myForm.password.value.length < 1) {
		alert("You MUST enter a password.");
		myForm.password.focus();
		return false;
	}
	// Confirm Password
	if ( myForm.confirmPassword.value.length < 1) {
		alert("You MUST enter a confirming password.");
		myForm.confirmPassword.focus();
		return false;
	}

	// start of organization
	if ( myForm.organization.value.length < 1) {
		alert("You MUST enter a publishable organization, or business, or other name.");
		myForm.organization.focus();
		return false;
	}
	// end of organization
/*
	// start of address
	if ( myForm.address.value.length < 1) {
		alert("You MUST enter an address.");
		myForm.address.focus();
		return false;
	}
	// end of address
// start of firstname
	if ( myForm.firstname.value.length < 2) {
		alert("You MUST enter a first name.");
		myForm.firstname.focus();
		return false;
	}
	// end of firstname
	// start of lastname
	if ( myForm.lastname.value.length < 2) {
		alert("You MUST enter a last name.");
		myForm.lastname.focus();
		return false;
	}
	// end of lastname
*/
	// Category - uses newer April 2003 textbox for category variable
	// start of category
	if( myForm.category.value == '*') {
			alert("You MUST choose a category.");
			myForm.category.focus();
			return false;
	}
	// end of category

	// Description
	if ( myForm.description.value.length <= 9 ) {
		alert("Make your description 10 characters or longer.");
		myForm.description.focus();
		return false;
	}
return true;
}
function forceCategoryAndDescription(form) {
	var myForm = document.foobar;
	// Category - uses newer April 2003 textbox for category variable
	// start of category
	if ( myForm.category.value.length < 1) {
		alert("You MUST choose a category.");
		myForm.category.focus();
		return false;
	}
	// end of category
	// Description
	if ( myForm.description.value.length <= 9 ) {
		alert("Make your description 10 characters or longer.");
		myForm.description.focus();
		return false;
	}
return true;
}
// browser detection - load css file
function loadCSSFile() {
  	/* this script determines the user browser and loads an appropriate external cascading style sheet.
	   If the browser is an Internet Explorer browser then an IE compatible external css file is loaded.
	   If the browser is a Netscape browser then a Netscape compatible external css file is loaded.
	   If the browser is an Opera browser then an an Internet Explorer compatible external css file is loaded.
	   If the browser is anything else no css file is loaded.
	   You can add more browser types by adding another case and a related css file. Based on an analysis 
	   of website traffic most surfers use recent browser versions. You can add specific versioning if you want
	   but the traffic that will use it will be negligible.
	   Richard Creech info@dreamriver.com http://www.dreamriver.com
	*/
	var cssFileName = "";
	var browser = navigator.appName;
	switch(browser) {
		case "Microsoft Internet Explorer":
			cssFileName = "yellow.css";
			//cssFileName = "netscape.css";
			break;
		case "Netscape":
			cssFileName = "netscape.css";
			break;
		case "Opera":
			cssFileName = "yellow.css";		
			break;	
		default:
			/* if there is no switch(browser) match then no css file is loaded */
	}
	document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + cssFileName + "\">");
  }
function validateLoginForm(form) {

	var myForm = document.loginForm;

	// Email
	if ( myForm.email.value.length < 6) {
		alert("You MUST submit a valid email address.");
		myForm.email.focus();
		return false;
		// needs better validation
	}

	// Password
	if ( myForm.password.value.length < 1) {
		alert("You MUST enter a password.");
		myForm.password.focus();
		return false;
	}
return true;
}
function validate(form) {

	var myForm = document.foobar;

	// Email
	if ( myForm.email.value.length < 6) {
		alert("You MUST submit a valid email address.");
		myForm.email.focus();
		return false;
		// needs better validation
	}

	// Password
	if ( myForm.password.value.length < 1) {
		alert("You MUST enter a password.");
		myForm.password.focus();
		return false;
	}

	// start of Country
	// this has problems, so it is commented out - look at category processing for correct option handling
	/*
	var mycountryList = myForm.country;
	var mySelectedCountryIndex= mycountryList.selectedIndex;
	if( mycountryList.options[mySelectedCountryIndex].value ) {
		countryItem = mycountryList.options[mySelectedCountryIndex].value;
	}else{ // if it is null then give it a value to satisfy javascript
		countryItem = "*";
	}
	if(countryItem == "*") {
		alert("Choose a country.");
		mycountryList.focus();
		return false;
	}
	if(countryItem == "") {
		alert("Choose a country.");
		mycountryList.focus();
		return false;
	}
	// end of Country
	*/

	// start of Website
	if( myForm.website.value.length >= 1 ) {
		if ( myForm.website.value.substring(0,7) != "http://" ) {
			alert("You must enter a clickable link.\nThe link must begin with 'http://'");
			myForm.website.focus();
			return false;
		}
	}
	// end of Website
	// paste below this line






	// paste above this line
/* 
	HOW TO MAKE DATA REQUIRED
	To require certain data to be entered by the user:
		1. save this file as yellowORIGINAL.js
		2. open yellow.js in your html editor
		3. find the data below: example: locate the // Phone section
		4. copy the phone section from the // start of ... to the // end of ... 
		5. paste the phone section in above where it says "paste below this line"
		6. save this file yellow.js and upload to your web server
		7. test by adding a new record
		8. [OPTIONAL] color code [red] the new fields you require in the file registerForm.php
*/
/*
	// start of firstname
	if ( myForm.firstname.value.length < 2) {
		alert("You MUST enter a first name.");
		myForm.firstname.focus();
		return false;
	}
	// end of firstname

	// start of lastname
	if ( myForm.lastname.value.length < 2) {
		alert("You MUST enter a last name.");
		myForm.lastname.focus();
		return false;
	}
	// end of lastname

	// start of Company
	if ( myForm.organization.value.length < 3) {
		alert("You MUST enter a company name.");
		myForm.organization.focus();
		return false;
	}
	// end of Company

	// start of Phone
	if ( myForm.phone.value.length < 7 ) {
		alert("Your phone number must be at least 7 numbers or longer.\nEnter 7 spaces if not applicable.");
		myForm.phone.focus()
		return false;
		// needs validation for a number value, but allowing hyphens or dots
	}
	// end of Phone
	
	// start of Fax
	if ( myForm.fax.value.length < 7 ) {
		alert("Your fax number must be at least 7 numbers or longer.");
		myForm.fax.focus()
		return false;
	}
	// end of Fax
	
	// start of Street Address
	if ( myForm.address.value.length < 6 ) {
		alert("Your street address appears invalid.\nEnter 6 spaces if not applicable.");
		myForm.address.focus()
		return false;
	}
	// end of Street Address

	// start of City
	if ( myForm.city.value.length < 3 ) {
		alert("The city appears invalid.\nEnter 3 spaces if not applicable.");
		myForm.city.focus()
		return false;
	}
	// end of City

	// start of ZIP or Postal code
	if ( myForm.postalcode.value.length < 5 ) {
		alert("Your ZIP or postal code must contain at least 5 characters.\nEnter 5 spaces if not applicable.");
		myForm.postalcode.focus()
		return false;
	}
	// end of ZIP or Postal Code

	// start of Country
	var mycountryList = myForm.country;
	var mySelectedCountryIndex= mycountryList.selectedIndex;
	countryItem = mycountryList.options[mySelectedCountryIndex].value;
	if(countryItem == "*") {
		alert("Choose a country.");
		mycountryList.focus();
		return false;
	}
	if(countryItem == "") {
		alert("Choose a country.");
		mycountryList.focus();
		return false;
	}
	// end of Country

	// start of Website
	if( myForm.website.value.length > 1) {
		if ( myForm.website.value.substring(0,7) != "http://" ) {
			alert("You must enter a clickable link.\nThe link must begin with 'http://'");
			myForm.website.focus();
			return false;
		}
	}
	// end of Website
*/
	return true
}


