
      
      
  ////Methods for blog pages.    
      
        
	function ToggleDivState(ctrl)
        {
			div = eval(ctrl);
            if (div.style.display == "none") 
                div.style.display = "block";
            else
                div.style.display = "none";
        }
        
    function ShowCommentBox(msgID,boolen)
        {
            //// set the ParentMessageID hidden field with the ID of the message being commented
            //document.forms[0].ParentMessageID.value = msgID;
            document.getElementById("ParentMessageID").value = parseInt(msgID);
            // expand the CommentBox div
				ShowCommentBox2(boolen);
        }
        
    function ShowCommentBox2(boolen1)
        {
			if (boolen1 =="False")
			{
				// expand the CommentBox div
				if (confirm("Your message will be displayed after administrator approval!"))
				{
				//seting default values for text field.
				EditText("Author");
				EditText("Email");
				EditText("Comment");
				//document.getElementById("Author").value="Please enter details...";
				//document.getElementById("Email").value="Please enter details...";
				//document.getElementById("Comment").value="Please enter details...";
				//document.forms[0].Author.value = "Please enter details...";
				//document.forms[0].Email.value = "Please enter details...";
				//document.forms[0].Comment.value = "Please enter details...";

				document.getElementById("CommentBox").style.display = "block";
				//CommentBox.style.display = "block";
				// jump to the CommantBox, so that it becomes visible even if the page
				// is very long and the user is currently at the top of it              
				window.location.href = '#CommentBoxAnchor';
				document.getElementById("Author").focus();            
				//document.forms[0].Author.focus();
				}
            }
            else  //For administrator.
            {
				document.getElementById("CommentBox").style.display = "block";
				window.location.href = '#CommentBoxAnchor';
				document.getElementById("Author").select();            
				document.getElementById("Author").focus();            

            }
        }
        //Function removing text from textbox during onClick event attribute added during page load.
    function ClearText(ctrl)
        {
        if (document.forms[0][ctrl].value == "Please enter details...")
			{
				document.forms[0][ctrl].value ="";
				document.forms[0][ctrl].select(); 
				document.forms[0][ctrl].focus();
		    }
        }
    function EditText(ctrl)
        {
            if (document.forms[0][ctrl].value == "")
            {
				document.forms[0][ctrl].value ="Please enter details...";
            }
                   
        }
    function ShowCommentAfterValidaiton()
		{
   			document.getElementById("CommentBox").style.display = "block";
			window.location.href = '#CommentBoxAnchor';
			document.getElementById("Author").select();            
			document.getElementById("Author").focus();            
 
		}
        
