function validateContact(){
	if (document.getElementById('txtName').value == ''){
		alert('Please enter name.');
		document.getElementById('txtName').focus(); 
		return false;		
	}else if (document.getElementById('txtEmail').value == ''){
		alert('Please enter an email address.');
		document.getElementById('txtEmail').focus(); 
		return false;	
	}else if(!isValidEmail(document.getElementById('txtEmail').value)){
		alert("Invalid Email Address Should be user@domain.com");
		document.getElementById('txtEmail').focus(); 
		return false;	
	}else if (document.getElementById('txtCaptcha').value == ''){
		alert("Please Enter Image Text");
		document.getElementById('txtCaptcha').focus(); 
		return false;	
	}else{
		return true;
	}
}
	
function validateRefer(){
	var chkFrnd	
	for (var i=1;i<=7;i++)
	{
		if (document.getElementById('txtReferEmail'+i).value == ''){		
			chkFrnd=0;
		}else{
			chkFrnd=1;
			break;
		}
	}
	
	if (chkFrnd==0){
		alert('Please enter atleast one email of your friend.');
		return false;		
	}

	if (chkFrnd==1){
		if(!isValidEmail(document.getElementById('txtReferEmail'+i).value)){
		alert("Invalid Email Address Should be user@domain.com");
		document.getElementById('txtReferEmail'+i).focus(); 
		return false;	
		}
	}


	for (var j=1;j<=7;j++)
	{
		if (document.getElementById('txtReferEmail'+j).value != ''){		
			if(!isValidEmail(document.getElementById('txtReferEmail'+j).value)){
				alert("Invalid Email Address Should be user@domain.com");
				document.getElementById('txtReferEmail'+j).focus(); 
				return false;
				break;
			}
		}
	}
	
	if (document.getElementById('txtReferName').value == ''){
		alert('Please enter your name.');
		document.getElementById('txtReferName').focus(); 
		return false;		
	}else if (document.getElementById('txtReferEmail').value == ''){
		alert('Please enter an email address.');
		document.getElementById('txtReferEmail').focus(); 
		return false;	
	}else if(!isValidEmail(document.getElementById('txtReferEmail').value)){
		alert("Invalid Email Address Should be user@domain.com");
		document.getElementById('txtReferEmail').focus(); 
		return false;	
	}else if (document.getElementById('txtReferCaptcha').value == ''){
		alert("Please Enter Image Text");
		document.getElementById('txtReferCaptcha').focus(); 
		return false;	
	}else{
		return true;
	}
}

function validateFeed(){
	if (document.getElementById('txtFeedComment').value == ''){
		alert('Please enter your comment.');
		document.getElementById('txtFeedComment').focus(); 
		return false;		
	}else if (document.getElementById('txtFeedCaptcha').value == ''){
		alert("Please Enter Image Text");
		document.getElementById('txtFeedCaptcha').focus(); 
		return false;	
	}else{
		return true;
	}
}


function isValidEmail(str) {
	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}

