function validateComment()
		{

		var errorempty=0;
		var isPass = true;
		var re = new RegExp("<a[^>]*>(.*)</a>");
        var jsre = new RegExp("<script[^>]*>(.*)</script>");
		
		var atFound = -1; // set default NO @
		var dotFound = -1;// set default NO .
		var charFound = false; //set default have special characters
		checkStr=document.form1.T_SenderEmail.value;
		splitString = checkStr.split("");   //split string into array and check it
        
       document.getElementById("errorsender").style.display = 'none';
       document.getElementById("invalidemailformat").style.display = 'none';
       document.getElementById("errorComment").style.display = 'none';
       document.getElementById("errorInput").style.display = 'none';
       
		if(document.form1.T_Sender.value=="")
		{
		    document.getElementById("errorsender").style.display = 'inline';
		    document.form1.T_Sender.focus();
		    errorempty=1;
		    return false;
		}
	
	 if(document.form1.T_SenderEmail.value!="")
	{	
	    for (var i = 0; i < checkStr.length+1; i++) 
        {
   	         if (splitString[i] == "\"" | splitString[i] == "'")  //have special characters '\' and '''
	         {
   	              document.getElementById("invalidemailformat").style.display = 'inline';
                  document.form1.T_SenderEmail.focus();
                   errorempty=1;
                   return false;
              }
             if (splitString[i] < " " | splitString[i] > " ")  //dont have special characters
	         { charFound = true; }    
             if (splitString[i] == "@")  //if split string and then have symbol @
	         { atFound = i; }            //assign @ found to i, means check got how many
             if (splitString[i] == ".")  //if split string and then have symbol @
	         { dotFound = i; }           //assign @ found to i, means check got how many
         }

	        if (charFound == true) 
	        {
               if (atFound > -1) {
                if (dotFound > -1)
                 {
                    if (dotFound < atFound) 
	                {
                       document.getElementById("invalidemailformat").style.display = 'inline';
                       document.form1.T_SenderEmail.focus();
                       errorempty=1;
                       return false;
                     } 
	                else 
	                {
	                    if ((dotFound-atFound) == 1 | dotFound == (checkStr.length-1) | atFound == 0)
	                    {
                         document.getElementById("invalidemailformat").style.display = 'inline';
                         document.form1.T_SenderEmail.focus();
                         errorempty=1;
                         return false;
                        }
                    }
                }  //end dotFound
	        else 
	        {
              document.getElementById("invalidemailformat").style.display = 'inline';
              document.form1.T_SenderEmail.focus();
              errorempty=1;
              return false;
            }
           } //end atFound
           else 
           {
              document.getElementById("invalidemailformat").style.display = 'inline';
              document.form1.T_SenderEmail.focus();
              errorempty=1;
              return false;
            }
          }
    }
    
   	if(document.form1.TA_Comment.value=="")
		{
		document.getElementById("errorComment").style.display = 'inline';
		document.form1.TA_Comment.focus();
		errorempty=1;
		return false;
		}
    
      
      
     if(document.form1.TA_Comment.value!="")
     {
          // Check Link
          if (document.form1.TA_Comment.value.match(re))
          {
                isPass = false;
                errorempty=1;
                document.getElementById("errorInput").style.display = 'inline';
                document.form1.TA_Comment.focus();
          } 

		// Check jsscript
		
	      if (document.form1.TA_Comment.value.match(jsre)) 
	      {

	        isPass = false;
	        errorempty=1;
	        document.getElementById("errorInput").style.display = 'inline';
            document.form1.TA_Comment.focus();
	      } 

	}
	 if(errorempty=="0")
		{
	   // document.form1.action="../includes/update_comment.asp?mode=ADDCOMMENT";
		document.form1.submit();
		}
}


function ValidateLogin() {
	document.getElementById("errorUserid").style.display = 'none';
	document.getElementById("errorUserPass").style.display = 'none';
	
	if (window.document.loginform.T_UserID.value == "") {
		document.getElementById("errorUserid").style.display = 'inline';
		document.loginform.T_UserID.focus();
		return false;
	}
	else if (window.document.loginform.T_Password.value == "") {
		document.getElementById("errorUserPass").style.display = 'inline';
		document.getElementById("errorUserid").style.display = 'none';
		document.loginform.T_Password.focus();
		return false;
	}
	else
		window.document.loginform.submit();
}



function ValidateBlogComment(strCommentApproval) 
{

	var isPass = true;
	var re = new RegExp("<a[^>]*>(.*)</a>");
    var jsre = new RegExp("<script[^>]*>(.*)</script>");
    var errorempty=0;
    
    var atFound = -1; // set default NO @
	var dotFound = -1;// set default NO .
	var charFound = false; //set default have special characters
	checkStr=document.blogcommentform.T_SenderEmail.value;
	splitString = checkStr.split("");   //split string into array and check it
    
	document.getElementById("T_SenderErr").style.display = 'none';
	document.getElementById("TA_CommentErr").style.display = 'none';
	document.getElementById("errorInput").style.display = 'none';
	document.getElementById("invalidemail").style.display = 'none';
	
	if (document.getElementById("T_Sender").value == "") 
	{
		 document.getElementById("T_SenderErr").style.display = 'inline';
		 document.blogcommentform.T_Sender.focus();
		 errorempty=1;
		 return false;
	}
	
	if(document.blogcommentform.T_SenderEmail.value!="")
	{	
	    for (var i = 0; i < checkStr.length+1; i++) 
        {
   	         if (splitString[i] == "\"" | splitString[i] == "'")  //have special characters '\' and '''
	         {
   	              document.getElementById("invalidemail").style.display = 'inline';
                  document.blogcommentform.T_SenderEmail.focus();
                   errorempty=1;
                   return false;
              }
             if (splitString[i] < " " | splitString[i] > " ")  //dont have special characters
	         { charFound = true; }    
             if (splitString[i] == "@")  //if split string and then have symbol @
	         { atFound = i; }            //assign @ found to i, means check got how many
             if (splitString[i] == ".")  //if split string and then have symbol @
	         { dotFound = i; }           //assign @ found to i, means check got how many
         }

	        if (charFound == true) 
	        {
               if (atFound > -1) {
                if (dotFound > -1)
                 {
                    if (dotFound < atFound) 
	                {
                       document.getElementById("invalidemail").style.display = 'inline';
                       document.blogcommentform.T_SenderEmail.focus();
                       errorempty=1;
                       return false;
                     } 
	                else 
	                {
	                    if ((dotFound-atFound) == 1 | dotFound == (checkStr.length-1) | atFound == 0)
	                    {
                         document.getElementById("invalidemail").style.display = 'inline';
                         document.blogcommentform.T_SenderEmail.focus();
                         errorempty=1;
                         return false;
                        }
                    }
                }  //end dotFound
	        else 
	        {
              document.getElementById("invalidemail").style.display = 'inline';
              document.blogcommentform.T_SenderEmail.focus();
              errorempty=1;
              return false;
            }
           } //end atFound
           else 
           {
              document.getElementById("invalidemail").style.display = 'inline';
              document.blogcommentform.T_SenderEmail.focus();
              errorempty=1;
              return false;
            }
          }
    }
	
	if (document.getElementById("TA_Comment").value == "") 
	{
		 document.getElementById("TA_CommentErr").style.display = 'inline';
		 document.blogcommentform.TA_Comment.focus();
		 errorempty=1;
		 return false;
	}
	
	if(document.getElementById("TA_Comment").value!="")
     {

          if (document.getElementById("TA_Comment").value.match(re))
          {
                isPass = false;
                errorempty=1;
                document.getElementById("errorInput").style.display = 'inline';
                document.getElementById("TA_Comment").focus();
                return false;
          } 

	      if (document.getElementById("TA_Comment").value.match(jsre)) 
	      {

	        isPass = false;
	        errorempty=1;
	        document.getElementById("errorInput").style.display = 'inline';
            document.getElementById("TA_Comment").focus();
            return false;
	      } 

	}
	
	 if(errorempty=="0")
	 {
	    document.blogcommentform.action="../includes/update_comment.asp?mode=ADDBLOGCOMMENT&cmtAp="+strCommentApproval
		//alert(document.blogcommentform.action);
		document.blogcommentform.submit();
    }
    
}