
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}

function alertMe()
{
	//alert ("EXISTING COOKIES: WEBTRENDS_ID= "+getCookie("WEBTRENDS_ID")+"HOST="+getCookie("host"));
}

function trackMe()
{
if ((getCookie("host") == (self.location.host)))
	{
		//alert ("Condition 1  host="+escape(self.location.host)+"  cookieHost="+getCookie("host"));
	}

else 
	{
	//alert ("Condition 2  host="+escape(self.location.host)+"  cookieHost="+getCookie("host"));

	var visit_flag = 1;
	var d = new Date();
	var uniquestamp = (d.getDate()+""+d.getMonth() +1+""+d.getFullYear()+""+d.getHours()+""+d.getMinutes()+""+d.getSeconds());

	document.cookie = "visit_flag="+visit_flag;
	document.cookie = "host="+escape(self.location.host);
	document.cookie = "WEBTRENDS_ID="+uniquestamp;
	}	
}



