﻿// JScript File


function showdivrating()
     {
     document.getElementById('ctl00_ContentPlaceHolder1_grate').style.display="Block";
     }
      function showdivval()
    {
     document.getElementById('ctl00_ContentPlaceHolder1_grate').style.display="None";
    
    }
    function printwin()
    {
    window.print();
    
      
    }
    function savecommand()
    {
  document.execCommand("SaveAs"); 
    
    }
    
   
    function getdivcommentstory()
    {
    document.getElementById('ctl00_ContentPlaceHolder1_divshow').style.display="Block"
    }
    function hidedivstory()
    {
    document.getElementById('ctl00_ContentPlaceHolder1_divshow').style.display="None"
    
    }
     
 // JScript File
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) 

{
	
	return LTrim(RTrim(value));
	
}
function isEmail(email)
			{
			if (document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.value.indexOf("@") != "-1" && document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.value.indexOf(".") != "-1" )
			return true;
			else 
			return false;
			}
			
			
			function comment()
			{
			document.getElementById('ctl00_ContentPlaceHolder1_TextBox1').value=trim(document.getElementById('ctl00_ContentPlaceHolder1_TextBox1').value);
						if(document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox1.value=="")
						{
							alert("Enter Author Name");
							document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox1.focus();
							return false;
						}
						document.getElementById('ctl00_ContentPlaceHolder1_TextBox2').value=trim(document.getElementById('ctl00_ContentPlaceHolder1_TextBox2').value);
						if(document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.value=="")
						{
							alert("Enter Email ID");
							document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.focus();
							return false;
						}
						if (isEmail(document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.value) == false)
				{
				alert("Enter your correct Email ID");
				document.aspnetForm.ctl00_ContentPlaceHolder1_TextBox2.focus();
				return false;
				}
				
						
			}		