// Feedback form validation
function Feedback() {

	firstName = document.fbForm.txtFirstname
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}
	lastName = document.fbForm.txtlastname
	if (lastName.value == "" || !isNaN(lastName.value))
	{
		alert("Please enter your last name");
		lastName.focus()
		return false		
	}
	mailid = document.fbForm.txtemail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}

	age = document.fbForm.cmbAgeRange
	if (age.options[age.selectedIndex].value == "")
	{
		alert("Please select your age group");
	age.focus()
	return false		
	}	

	sportsAct = document.fbForm.txtsports
	if (sportsAct.value != "" && !isNaN(sportsAct.value))
	{
		alert("Please enter Sports Activities");
		sportsAct.focus()
		return false		
	}

	comments = document.fbForm.txtComments
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.fbForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.fbForm.uword.focus();
	return false;
	}
	return jcap();	
}
 
 
 
 
			//here you place the ids of every element you want.
			var ids=new Array('q1', 'q2', 'q3')
			
			
			function hideallids(){
				//loop through the array and hide each element by id
				for (var i=0;i< ids.length;i++){
					hidediv(ids[i])
				}		  
			}			
			function hidediv(id) {
				//safe function to hide an element with a specified id
				if (document.getElementById) { // DOM3 = IE5, NS6
					
					document.getElementById(id).style.display = 'none';
				}
				else {
					if (document.layers) { // Netscape 4
						document.id.display = 'none';
					}
					else { // IE 4
						document.all.id.style.display = 'none';
					}
				}
			}			
			function showdiv(id) {
				hideallids()
				
				//safe function to show an element with a specified id
				if (document.getElementById) { // DOM3 = IE5, NS6
					document.getElementById(id).style.display = 'block';
				}
				else {
					if (document.layers) { // Netscape 4
						document.id.display = 'block';
					}
					else { // IE 4
						document.all.id.style.display = 'block';
					}
				}
			}
		 
 
 
 
 

