function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}


if(window.top==self)
document.cookie = "entry=1"


if(window.top==self) {

    var parentURL = "index.htm"
       
	document.cookie = 'refURL='+document.referrer+''
	document.cookie = 'orgURL='+window.location.href+''
	document.cookie = 'TrefURL='+top.document.referrer+''
    var childURL = window.location.href
    var reframeURL = parentURL + "?" + childURL
    location.href = reframeURL
}

if(window.top!=self)
{

   
    if(get_cookie("entry")==0)
    {
    	
	document.cookie = 'refURL='+document.referrer+''
	document.cookie = 'orgURL='+document.location+''
    }
   
 
   document.cookie = "entry=0"
}


