var emailexp = /^[a-z_0-9][a-z_0-9\.\-\!\'&]+@[a-z_0-9\.\-\!]+\.[a-z]{1,4}$/i;

function validate()
{
		if(document.getElementById("PostComment.ascx_tbName").value == "")
		 {
			alert("Please enter your Name");
			document.getElementById("PostComment.ascx_tbName").focus();
			return false;
		 }
		 
		if(document.getElementById("PostComment.ascx_email").value == "") 
		 {	
			alert("Please enter your Email");
			document.getElementById("PostComment.ascx_email").focus();
			return false;
                 }
		 else
		{
			if(isValid(emailexp,document.getElementById("PostComment.ascx_email").value) == false)
			{
			  alert("Please enter a valid Email");
			  document.getElementById("PostComment.ascx_email").focus();
			  return false;		
			}
			
		 
		}
		
		
		if(document.getElementById("PostComment.ascx_tbComment").value == "")
		{	
			alert("Please enter your Comments");
			document.getElementById("PostComment.ascx_tbComment").focus();
			return false;
		}
		
		if(document.getElementById("PostComment.ascx:captcha").value== "")
		{	
			alert("Please enter the code");
			document.getElementById("PostComment.ascx:captcha").focus();
			return false;
		}
			
}

function isValid(pattern, value)
{
    	
	   if( !pattern.test(value) )
		{
	          return false;
		}
	

    return true;
}


function SetFocus()
{
window.location.href='#PostComment.ascx_tbName'
document.getElementById("PostComment.ascx_tbName").focus();
return false;
}