<%@ Page Language="C#" AutoEventWireup="true" Inherits="Stat.Web.stat" Codebehind="stat.aspx.cs" %>
function writeCookie(name, value, hours){
  var expire = "";
  if(hours != null)  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
function readCookie(name){
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0){ 
    offset = document.cookie.indexOf(search);
    if (offset != -1){ 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
function addCookie(objName,objValue,objHours)  {
    var str = objName + "=" + escape(objValue);
    if(objHours > 0){
     var date = new Date();
     var ms = objHours*3600*1000;
     date.setTime(date.getTime() + ms);
     str += "; expires=" + date.toGMTString();
    }
    document.cookie = str;
}
function readIsRefrensh(name){
    var lastUrl=readCookie(name).toString(10).toLowerCase(); 
    var currentUrl=document.location.toString(10).toLowerCase(); 
    if(lastUrl==currentUrl) {
       return "true";
    }
    else{
       return "false";
   } 
}
function JsLocationUrl(name){ 
   if(readCookie(name)=="true"){
       return "true";
   }  
   else{   
      return "false";
   }
}
function GetReferrer()
{
  var url=escape(document.referrer);  
  
  if(url.length>210)
  {
     return url.substring(0,210);
  }
  else
  {
        return url;
  }  
}