/*************************************************************************************		THIS ENTIRE COPYRIGHT NOTICE MUST REMAIN IF ANY PART OF THIS CODE IS USEDScript name: e-CHO form builderAuthor: Colin BellVersion: 1.2Release date: 06/08/2004Features:------------An object orientated javascript formbuilder with dynamic validation1]  Allows the building of common forms through javascript.2]  Fully controllable validation.Bug Reports:-------------Email all bug reports to bugs@gatewest.co.uk with the Subject "Formbuilder bugs"Updates:----------1] New version supports Java version2] Form would submit when user pushes enterCheck back at http://www.gatewest.co.uk for updatesCopyright:----------You may use this code (the code contained within this page "fbuilder.js") and modify, improve or enhance it as long as you let me know by sendingan email to colinb@gatewest.co.uk with the URL of the site that will using the codeand or the modified code explaining what you have done and why. Suitableamends will be featured in updates and credit given.If this code or any part of it is to be used for commericial purposes, includingredistrubution, you will subject to a license fee of £10-00 (Sterling pound) per URL.A cheque should be sent to the below address.Official registered charities are exempt from payment.	GateWest New Media	First Floor	Aztec Centre	Aztec West	Almondsbury	Bristol BS32 4TD	Tel: +44 (0)1454 203720	email: enquiries@gatewest.co.uk	This fee will be waived if a link to GateWest is placed on the page in question.Please email me if you are uncertain.					Copyright 2001 GateWest New Media. All rights reserved.**************************************************************************************/function mQuestion(question, answer, type, elements, formcheck, specialcheck, whatStyle){this.dName = "Question " + vItemNo++ ; this.dQuestion = question;this.dAnswer = answer;this.dType = type;this.dTime = 0;this.dCheck = formcheck;if (type == "dropbox"){this.dNag = "Please select an option from the list below";}else if (type == "textarea"){this.dNag = "Please type your answer in the text area below";}else if (type == "selectdrop"){this.dNag = "Please select an option from the list below";}else if (type == "checkbox"){this.dNag = "Please check one of the options below";}else if (type == "text"){this.dNag = "Please type your answer in the text box below";}else if (type == "countrydropbox"){this.dNag = "Please select your country from the list below";}else{this.dNag = "Please answer the question below";}this.dElements = elements;this.dspecialCheck = specialcheck;this.dFormStyle = whatStyle;vqFurns[vqFurns.length]=this;}function pAnswer(whichQuestion, whatAnswer, whichIndex){var isComplete = true;document.GENERATE.submitbutton.value = "Submit";	vqFurns[whichQuestion].dAnswer = whatAnswer;		//if they completed the question we let them know		if (vqFurns[whichQuestion].dAnswer != ""){				hideLayer('nag'+ whichQuestion);				//writeLayer('qname'+ whichQuestion,null, vqFurns[whichQuestion].dQuestion + " - completed")		}				isComplete = doChecks(whichQuestion);				for(var whichQuestion=0;whichQuestion<vqFurns.length;whichQuestion++ ){		//do a form check to make sure they answered all the questions		if (vqFurns[whichQuestion].dCheck == "true"){			if (vqFurns[whichQuestion].dAnswer == ""){				isComplete = false;				}		}			}//if (isComplete != false){document.GENERATE.submit.disabled = false;}}	//whichIndex.options[whichIndex.selectedIndex].value = 3;	function doChecks(whichQuestion){	//check email	if (vqFurns[whichQuestion].dspecialCheck == "email"){			doCheck = emailCheck(vqFurns[whichQuestion].dAnswer);			if (doCheck != true){				vqFurns[whichQuestion].dNag = doCheck				writeLayer('nag'+ whichQuestion,null, vqFurns[whichQuestion].dNag )				showLayer('nag'+ whichQuestion);				return(false);			}			else{				return(true);			}	}		//check numbers	else if (vqFurns[whichQuestion].dspecialCheck == "numbers"){			doCheck = validateNumeric(vqFurns[whichQuestion].dAnswer);			if (doCheck != true){				vqFurns[whichQuestion].dNag = doCheck				writeLayer('nag'+ whichQuestion,null, vqFurns[whichQuestion].dNag )				showLayer('nag'+ whichQuestion);				return(false);			}			else{				return(true);			}	}		//check letter	else if (vqFurns[whichQuestion].dspecialCheck == "letters"){			doCheck = lettersOnly(vqFurns[whichQuestion].dAnswer);			if (doCheck != true){				vqFurns[whichQuestion].dNag = doCheck				writeLayer('nag'+ whichQuestion,null, vqFurns[whichQuestion].dNag )				showLayer('nag'+ whichQuestion);				return(false);			}			else{				return(true);			}	}}function pComplete(whichForm){	for(var whichQuestion=0;whichQuestion<vqFurns.length;whichQuestion++ ){		//do a form check to make sure they answered all the questions		// switch off all nags		hideLayer('nag'+ whichQuestion);		if (vqFurns[whichQuestion].dCheck == "true"){			//check special fields			if(doChecks(whichQuestion) == false){				document.GENERATE.submitbutton.value = "Please check the form and try again";				return(false);				}						if (vqFurns[whichQuestion].dAnswer == ""){				showLayer('nag'+ whichQuestion);				document.GENERATE.submitbutton.value = "Please check the form and try again";				return(false);				}		}		}// if the form is succesfully completed we deactivate// the submit button to stop people hitting it twicedocument.GENERATE.submitbutton.disabled = true;document.GENERATE.submitbutton.value = "Please Wait...";return(true);}function callQuestions() {var questionData = "";var whatAnswer;questionData +='<FORM NAME="GENERATE" onSubmit="Javascript:return pComplete(document.GENERATE.form)" ACTION="'+ submitLocation +'" target="_self" enctype="application/x-www-form-urlencoded" method="get">\r';//start big tablequestionData +='<TABLE WIDTH="400">\r';for(var whichQuestion=0;whichQuestion<vqFurns.length;whichQuestion++ ){	if (vqFurns[whichQuestion].dCheck == "true"){nagIcon = "<font class='nag'>*</font>&nbsp;"}	if (vqFurns[whichQuestion].dCheck != "true") {nagIcon = "";}		if (isMinNS4){$nagStyle = 'style="position:relative; visibility: hidden;"';} 		else {$nagStyle = 'style="visibility: hidden;"';}	questionData += '<TR><TD class="nag"><DIV '+ $nagStyle +' ID="nag'+ whichQuestion +'">' + vqFurns[whichQuestion].dNag + '</DIV></TD>\r';	questionData +='<TR><TD class="' + vqFurns[whichQuestion].dFormStyle + '"><DIV style="visibility: visible;" ID="qname'+ whichQuestion +'">' + nagIcon + vqFurns[whichQuestion].dQuestion + '</DIV></TD>\r';	questionData +='<TR><TD>\r';	if (vqFurns[whichQuestion].dType == "checkbox"){questionData += pCheckBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "text"){questionData += pTextBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "Email"){questionData += pEmailBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "textarea"){questionData += pTextAreaBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "bigtextarea"){questionData += pBigTextAreaBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "dropbox"){questionData += pDropBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "countrydropbox"){questionData += pCountryDropBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "selectdrop"){questionData += pSelectBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "radiobox"){questionData += pRadioBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "checkbox"){questionData += pCheckBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "monthdropbox"){questionData += pMonthDropBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "daydropbox"){questionData += pDayDropBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "datedropbox"){questionData += pMonthDropBox(whichQuestion);questionData += "&nbsp;";questionData += pDayDropBox(whichQuestion);questionData += "&nbsp;";questionData += pYearDropBox(whichQuestion, vqFurns[whichQuestion].dElements);}	else if (vqFurns[whichQuestion].dType == "careerdropbox"){questionData += pCareerDropBox(whichQuestion);}	else if (vqFurns[whichQuestion].dType == "textonly"){questionData += "";}questionData +='</TD></TR>\r';}//if form2mail is being used check for a recipientif(formRecipientEmail){	questionData +='<TR><TD><INPUT TYPE="HIDDEN" NAME="recipient" class="answerbox" VALUE="'+ formRecipientEmail +'">\r';	questionData +='<input type=hidden name="subject" value="'+ formSubject +'">\r';	questionData +='<input type=hidden name="env_report" value="REMOTE_HOST, REMOTE_ADDR, REMOTE_USER, HTTP_USER_AGENT">\r';	questionData +='<input type=hidden name="required" value="email">\r';	questionData +='<input type=hidden name="redirect" value="'+ formRedirect +'">\r';	questionData +='<input type=hidden name="emailreply">\r';	questionData +='</TD></TR>\r';	}//draw the submit buttonquestionData +='<TR><TD><BR><INPUT TYPE="submit" NAME="submitbutton" class="body" VALUE="Please fill in the form"></TD></TR>\r';//end big tablequestionData +='<TR><TD></TD>\r';questionData += '</TR></TABLE>';questionData += '</FORM>';document.open;document.write(questionData);document.close;//win = window.open("","Preview","scrollbars=1,menubar=1,status=1,width=420,height=380")//win.document.write(questionData);//win.document.close();}// creates a radio boxfunction pRadioBox(whichItem, whatElements){var checkData = "";elementArray = whatElements.split(",");checkData += '<TABLE><TR>\r';for(var i=0;i<elementArray.length;i++ ){	if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<TD class="answers"><input type="radio" value="'+ elementArray[i] +'" name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" onClick="Javascript:parent.selectm(this.value, this.name, this.form.name);" class="answerbox" checked>'+ elementArray[i] +'&nbsp;</TD>';}	else {checkData += '<TD class="answers"><input type="radio" value="'+ elementArray[i] +'" name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" onClick="Javascript:parent.selectm(this.value, this.name, this.form.name);" class="answerbox">'+ elementArray[i] +'&nbsp;</TD>';}}checkData += '</TR></TABLE>\r';return checkData;}// creates a check boxfunction pCheckBox(whichItem, whatElements){var checkData = "";elementArray = whatElements.split(",");checkData += '<TABLE><TR>\r';for(var i=0;i<elementArray.length;i++ ){	if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<TD class="answers"><input type="checkbox" value="'+ elementArray[i] +'" name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" onClick="Javascript:parent.selectm(this.value, this.name, this.form.name);" class="answerbox" checked>'+ elementArray[i] +'&nbsp;</TD>';}	else {checkData += '<TD class="answers"><input type="checkbox" value="'+ elementArray[i] +'" name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" onClick="Javascript:parent.selectm(this.value, this.name, this.form.name);" class="answerbox">'+ elementArray[i] +'&nbsp;</TD>';}}checkData += '</TR></TABLE>\r';return checkData;}// creates a text boxfunction pTextBox(whichItem){var checkData = "";checkData += '<TABLE><TR><TD class="answers"><input type="text" value="'+ vqFurns[whichItem].dAnswer +'" name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" class="answerbox" size="25"></TD></TR>\r';checkData += '</TABLE>\r';return checkData;}// creates a text boxfunction pEmailBox(whichItem){var checkData = "";checkData += '<TABLE><TR><TD class="answers"><input type="text" value="'+ vqFurns[whichItem].dAnswer +'" name="Email" onchange="pAnswer('+whichItem+', this.value);" class="answerbox"></TD></TR>\r';checkData += '</TABLE>\r';return checkData;}// creates a textarea boxfunction pTextAreaBox(whichItem){if (is_mac){var colWidth = "30";}else{var colWidth = "15";}var checkData = "";checkData += '<TABLE><TR><TD class="answers"><textarea name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" class="answerbox" cols="'+ colWidth +'" rows="5">'+ vqFurns[whichItem].dAnswer +'</textarea></TD></TR>\r';checkData += '</TABLE>\r';return checkData;}// creates a big textarea boxfunction pBigTextAreaBox(whichItem){if (is_mac){var colWidth = "60";}else{var colWidth = "30";}var checkData = "";checkData += '<TABLE><TR><TD class="answers"><textarea name="Question'+ whichItem +'" onchange="pAnswer('+whichItem+', this.value);" class="answerbox" cols="'+ colWidth +'" rows="5">'+ vqFurns[whichItem].dAnswer +'</textarea></TD></TR>\r';checkData += '</TABLE>\r';return checkData;}// creates a drop select boxfunction pSelectBox(whichItem, whatElements){var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value);" class="answerbox" rows="'+ elementArray.length +'" multiple>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a drop boxfunction pDropBox(whichItem, whatElements){var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">-------------</option>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a countries drop boxfunction pCountryDropBox(whichItem){whatElements = "Afghanistan,Albania,Algeria,American Samoa,Andorra,Angola,Anguilla,Antarctica,Antigua and Barbuda,Argentina,Armenia,Aruba,Australia,Austria,Azerbaijan,Bahamas,Bahrain,Bangladesh,Barbados,Belarus,Belgium,Belize,Benin,Bermuda,Bhutan,Bolivia,Bosnia and Herzegowina,Botswana,Bouvet Island,Brazil,British Indian Ocean Territory,Brunei Darussalam,Bulgaria,Burkina Faso,Burundi,Cambodia,Cameroon,Canada,Canada (British Columbia),Cape Verde,Cayman Islands,Central African Republic,Chad,Chile,China,Christmas Island,Cocos (Keeling) Islands,Colombia,Comoros,Congo,Congo (The Democratic Rep),Cook Islands,Costa Rica,Cote D'ivoire,Croatia (Lcl Name: Hrvatska),Cuba,Cyprus,Czech Republic,Denmark,Djibouti,Dominica,Dominican Republic,East Timor,Ecuador,Egypt,El Salvador,Equatorial Guinea,Eritrea,Estonia,Ethiopia,Falkland Islands (Malvinas),Faroe Islands,Fiji,Finland,France,France (Metropolitan),French Guiana,French Polynesia,French Southern Territories,Gabon,Gambia,Georgia,Germany,Ghana,Gibraltar,Greece,Greenland,Grenada,Guadeloupe,Guam,Guatemala,Guinea,Guinea-Bissau,Guyana,Haiti,Heard and Mc Donald Islands,Holy See (Vatican City State),Honduras,Hong Kong,Hungary,Iceland,India,Indonesia,Iran (Islamic Republic Of),Iraq,Ireland,Israel,Italy,Jamaica,Japan,Jordan,Kazakhstan,Kenya,Kiribati,Korea (Democratic),Korea (Republic Of),Kuwait,Kyrgyzstan,Latvia,Lebanon,Lesotho,Liberia,Libyan Arab,Liechtenstein,Lithuania,Luxembourg,Macau,Madagascar,Malawi,Malaysia,Maldives,Mali,Malta,Marshall Islands,Martinique,Mauritania,Mauritius,Mayotte,Mexico,Moldova (Republic Of),Monaco,Mongolia,Montserrat,Morocco,Mozambique,Myanmar,Namibia,Nauru,Nepal,Netherlands,Netherlands Antilles,New Caledonia,New Zealand,Nicaragua,Niger,Nigeria,Niue,Norfolk Island,Northern Mariana Islands,Norway,Oman,Pakistan,Palau,Panama,Papua New Guinea,Paraguay,Peru,Philippines,Pitcairn,Poland,Portugal,Puerto Rico,Qatar,Reunion,Romania,Russian Federation,Rwanda,Saint Kitts and Nevis,Saint Lucia,Samoa,San Marino,Sao Tome and Principe,Saudi Arabia,Senegal,Seychelles,Sierra Leone,Singapore,Slovakia (Slovak Republic),Slovenia,Solomon Islands,Somalia,South Africa,Spain,Sri Lanka,St. Helena,St. Pierre and Miquelon,Sudan,Suriname,Swaziland,Sweden,Switzerland,Syrian Arab Republic,Taiwan (Prov Of China),Tajikistan,Tanzania (United RepOf),Thailand,Togo,Tokelau,Tonga,Trinidad and Tobago,Tunisia,Turkey,Turkmenistan,Turks and Caicos Islands,Tuvalu,Uganda,Ukraine,United Arab Emirates,United Kingdom,Uruguay,Uzbekistan,Vanuatu,Venezuela,Vietnam,Virgin Islands (British),Virgin Islands (U.S.),Wallis and Futuna Islands,Western Sahara,Yemen,Yugoslavia,Zambia,Zimbabwe";var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">Select your country</option>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a month drop boxfunction pMonthDropBox(whichItem){whatElements = "January,February,March,April,May,June,July,August,September,October,November,December";var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">Month</option>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a year drop boxfunction pYearDropBox(whichItem,whatElements){if(whatElements){elementArray = whatElements.split(",");whatStart=elementArray[1];whatEnd = elementArray[0];}else {	whatStart = 2002; // the year from which to start counting back	whatEnd = 1930; // the year from which to end counting back	}var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">Year</option>\r';for(var i=whatEnd;i<whatStart;i++ ){		if (i == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ i +'" class="answerbox" selected>'+ i +'</option>\r';}		else {checkData += '<option value="'+ i +'" class="answerbox">'+ i +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a day drop boxfunction pDayDropBox(whichItem){whatElements = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31";var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">Day</option>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a career drop boxfunction pCareerDropBox(whichItem){whatElements = "Accounting/Finance,Computer related (Internet),Computer related (other),Consulting,Customer service/support,Education/training,Engineering,Executive/senior management,General administrative/supervisory,Government/Military,Homemaker,Manufacturing/production/operations,Professional (medical/lega/etc.),Research and development,Retired,Sales/marketing/advertising,Self-employed/owner,Student,Tradesman/craftsman,Unemployed/Between Jobs,Other";var checkData = "";elementArray = whatElements.split(",");checkData += '<select name="Question'+ whichItem + '" size="1" onchange="pAnswer('+whichItem+', this.value, this);" class="answerbox">\r';checkData += '<option value="'+ elementArray[i] +'" class="answerbox">Choose your field</option>\r';for(var i=0;i<elementArray.length;i++ ){		if (elementArray[i] == vqFurns[whichItem].dAnswer){checkData += '<option value="'+ elementArray[i] +'" class="answerbox" selected>'+ elementArray[i] +'</option>\r';}		else {checkData += '<option value="'+ elementArray[i] +'" class="answerbox">'+ elementArray[i] +'</option>\r';}}checkData += '</select>\r';return checkData;}// creates a plain text areafunction pTextOnly(whichItem){var checkData = vqFurns[whichItem].dQuestion+'\r';return checkData;}// switches checkboxs with the same name on and offfunction selectm(myValue, myName, myForm){theForm = eval("document."+myForm);myObject = eval("document."+ myForm +"." + myName);len= theForm.elements.length;var i=0;for( i=0 ; i<len ; i++) {if (theForm.elements[i].name==myName) {		if (theForm.elements[i].value==myValue) {			theForm.elements[i].checked=true;		}		if (theForm.elements[i].value!=myValue) {			theForm.elements[i].checked=false;		}	}	}}function writeLayer(id,nestref,text) {	if (isMinNS4) {		var layer = (nestref)? eval('document.'+nestref+'.document.'+id+'.document') : document.layers[id].document		layer.open()		layer.write(text)		layer.close()        }	else if (isMinIE4) document.all[id].innerHTML = text}function hideLayer(layer) {if (is_nav6){  	layer = eval('document.getElementById("'+ layer + '")');    layer.style.visibility = "hidden";    }  if (isMinNS4){  	layer = eval("document.layers."+ layer);    layer.visibility = "hide";    }  if (isMinIE4){  	layer = eval("document.all."+ layer);    layer.style.visibility = "hidden";    }}function showLayer(layer) {	if (is_nav6){  	layer = eval('document.getElementById("'+ layer + '")');    layer.style.visibility = "visible";    }  if (isMinNS4){  	layer = eval("document.layers."+ layer);    layer.visibility = "show";    }  if (isMinIE4){   	layer = eval("document.all."+ layer);    layer.style.visibility = "visible";    }}function lettersOnly(Str){	if(Str.indexOf("#") != -1){return("Please remove the \"#\"");}	if(Str.indexOf("@") != -1){return("Please remove the \"@\"");}	if(Str.indexOf("!") != -1){return("Please remove the \"!\"");}	if(Str.indexOf("£") != -1){return("Please remove the \"£\"");}	if(Str.indexOf("$") != -1){return("Please remove the \"$\"");}	if(Str.indexOf("%") != -1){return("Please remove the \"%\"");}	if(Str.indexOf("&") != -1){return("Please remove the \"&\"");}	if(Str.indexOf("(") != -1){return("Please remove the \"(\"");}	if(Str.indexOf(")") != -1){return("Please remove the \")\"");}	if(Str.indexOf("+") != -1){return("Please remove the \"+\"");}	if(Str.indexOf("=") != -1){return("Please remove the \"=\"");}	if(Str.indexOf("?") != -1){return("Please remove the \"?\"");}	if(Str.indexOf("<") != -1){return("Please remove the \"<\"");}	if(Str.indexOf(">") != -1){return("Please remove the \">\"");}	if(Str.indexOf("|") != -1){return("Please remove the \"|\"");}	if(Str.indexOf("{") != -1){return("Please remove the \"{\"");}	if(Str.indexOf("}") != -1){return("Please remove the \"}\"");}	if(Str.indexOf("[") != -1){return("Please remove the \"[\"");}	if(Str.indexOf("]") != -1){return("Please remove the \"]\"");}		if(Str.indexOf("1") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("2") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("3") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("4") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("5") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("6") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("7") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("8") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("9") != -1){return("No numbers are allowed in this field");}	if(Str.indexOf("0") != -1){return("No numbers are allowed in this field");}			return(true);}function emailCheck(emailStr) {var errMessage;var emailPat=/^(.+)@(.+)$/var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"var validChars="\[^\\s" + specialChars + "\]"var quotedUser="(\"[^\"]*\")"var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/var atom=validChars + '+'var word="(" + atom + "|" + quotedUser + ")"var userPat=new RegExp("^" + word + "(\\." + word + ")*$")var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")var matchArray=emailStr.match(emailPat)if (matchArray==null) {  /* Too many/few @'s or something; basically, this address doesn't     even fit the general mould of a valid e-mail address. */	errMessage = "Email address seems incorrect (check @ and .'s)";	return errMessage;}var user=matchArray[1]var domain=matchArray[2]// See if "user" is valid if (user.match(userPat)==null) {    // user is not valid    errMessage = "The username doesn't seem to be valid."    return errMessage;}// if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid.var IPArray=domain.match(ipDomainPat)if (IPArray!=null) {    // this is an IP address	  for (var i=1;i<=4;i++) {	    if (IPArray[i]>255) {	        errMessage = "Destination IP address is invalid!";		return errMessage;	    }    }    return errMessage;}// Domain is symbolic namevar domainArray=domain.match(domainPat)if (domainArray==null) {	errMessage = "The domain name doesn't seem to be valid."    return errMessage;}/* Now we need to break up the domain to get a count of how many atoms   it consists of. */var atomPat=new RegExp(atom,"g")var domArr=domain.match(atomPat)var len=domArr.lengthif (domArr[domArr.length-1].length<2 ||     domArr[domArr.length-1].length>3) {   // the address must end in a two letter or three letter word.   errMessage = "The address must end in a three-letter domain, or two letter country.";   return errMessage;}// Make sure there's a host name preceding the domain.if (len<2) {   errMessage = "This address is missing a hostname!";   return errMessage;}// If we've gotten this far, everything's valid!return true;}function  validateNumeric(strValue) {/******************************************************************************DESCRIPTION: Validates that a string contains only valid numbers.PARAMETERS:   strValue - String to be tested for validityRETURNS:   True if valid, otherwise false.******************************************************************************/  var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;  //check for numeric characters  var test = objRegExp.test(strValue);    //if the string had length	if(strValue.length > 0){		if(test == false){return("This field may only contain numbers");}		else{return(true);}		}	else{		return("Please type your answer in the text box below");	}}	