<!--
function Registration_CheckForm() {

		var thisobj=document.parentForm;
		var allElemCtr;
		var requiredElem=new Array('Registration_Email','Registration_Password');
		var requiredElemCtr=0;
		var validChar=new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_');
		var required;
		var thiselement;
		var fieldName;
		var fieldType;
		var fieldValue;
		var errMsg='';

		//go through all the form elements	
		for (allElemCtr=0;allElemCtr<thisobj.length;allElemCtr++) {

			thiselement=thisobj.elements[allElemCtr];
			fieldName=thiselement.name;
			fieldType=thiselement.type;
			fieldValue=thiselement.value;

			//ignore input type=submit or other buttons
			if (fieldType!="submit") {

				//check if field is included in the optional fields array
				if (requiredElem.length!=0) {
					for (requiredElemCtr=0; requiredElemCtr<requiredElem.length; requiredElemCtr++) {
						
						//alert(fieldName.indexOf(requiredElem[requiredElemCtr]));
						if (fieldName.indexOf(requiredElem[requiredElemCtr])==0) {
							required=true;
							break;
						}
						else { required=false; }
					}
				}
				else {required=true;}

				//dont test form value if it is an optional field
				if (required) {
					if ((fieldType=="textarea" || fieldType=="text" || fieldType=="password") && fieldValue=="") {
						errMsg=fieldName.toUpperCase()+' field is required!'
						break;
					}
					//alert(fieldName + "="+ fieldValue);

					if (fieldName=="Registration_Password"&&fieldValue.length!=0) {
						for (thisInputCharPos=0;thisInputCharPos<fieldValue.length;thisInputCharPos++) {

							var thisInputChar=fieldValue.charAt(thisInputCharPos);
							//alert(thisInputChar);
							for (thisValidCharPos=0;thisValidCharPos<validChar.length;thisValidCharPos++) {

								var found=false;
								if (thisInputChar==validChar[thisValidCharPos]) {
									found=true;
									break;
								}
								//alert(thisInputChar + ' = ' + validChar[thisValidCharPos] + ' == ' + found);
							}
							if (!found) {
								errMsg='INVALID CHARACTER FOUND\nIN THE '+ fieldName.toUpperCase() +' FIELD!\n\n Valid characters are:\n1. 0 to 9\n2. a to z\n3. A to Z\n4. Underscore ';
								thiselement=thisobj.Registration_Password;
								break;
							}
						} // ------------------- END FOR LOOP
					}
				}
			}
		}		//for statement

		//---------------------------------------------------------------------------- EMAIL ADDRESS
		if (errMsg=='') {
			thiselement = thisobj.Registration_Email;
			if (!checkEmail(thiselement.value)) {
				errMsg='Invalid Email Address!'
			}
		}

		//---------------------------------------------------------------------------- COUNTRY
		var thisCountry='';
		thisCountry=thisobj.Registration_Address_CountryID.options[thisobj.Registration_Address_CountryID.selectedIndex].value;
		if (errMsg=='' && thisCountry==0) {
			if ((thisobj.Registration_Address_CountryName_New.value=='') || (thisobj.Registration_Address_CountryName_New.value=='If the country is not in the list, click here to add a new one')) {
				errMsg='Please select a country or add a new one!';
				thiselement=thisobj.Registration_Address_CountryID;
			}
		}

		//---------------------------------------------------------------------------- AGE
		var thisAge='';
		thisAge=thisobj.Registration_Age.options[thisobj.Registration_Age.selectedIndex].value;
		if (errMsg=='' && thisAge==0) {
			errMsg='Please select your age!';
			thiselement=thisobj.Registration_Age;
		}

		//---------------------------------------------------------------------------- USER TYPE
		var thisUserType='';
		thisUserType=thisobj.Registration_UserType.options[thisobj.Registration_UserType.selectedIndex].value;
		if (errMsg=='' && thisUserType=='#') {
			errMsg='Please select a user type!';
			thiselement=thisobj.Registration_UserType;
		}

		//---------------------------------------------------------------------------- WEBSITE
		var sWebsite = thisobj.Registration_Website.value;
		if ((sWebsite!='') && (sWebsite.indexOf('http://')!=0)) {
			thisobj.Registration_Website.value = 'http://' + thisobj.Registration_Website.value;
		}

		//---------------------------------------------------------------------------- HOW DID YOU ...
		var sOTHERS = thisobj.How_Did_You_Find_Out_OTHERS.value;
		if (sOTHERS!="")
			thisobj.How_Did_You_Find_Out[thisobj.How_Did_You_Find_Out.length-1].checked=true;
		else
			thisobj.How_Did_You_Find_Out[thisobj.How_Did_You_Find_Out.length-1].checked=false;
		//errMsg="asd";
		

		if (errMsg!=''){
			alert('ERROR:\n----------------\n'+errMsg);
			thiselement.focus();
			//thiselement.select();
			return false;
		}
		else {
			return true;
		}
	}
//-->


