// JavaScript Document
// based on http://www.willmartinez.com/blog/?p=39
// and thanks to http://www.randycullom.com/chatterbox/archives/2008/10/google_analytic.html
function gaData() {
	this.yum= "__utmz";
	this.getCookie= function() {
		c= this.yum;
		if (document.cookie.length>0)
		  {
		  c_start=document.cookie.indexOf(c+ "=");
		  if (c_start!=-1)
			{
			c_start=c_start + c.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 "";
		}
	this.getVariable= function(n) {
		 s= "|";
		 l= this.getCookie();
		 if (!n || n=="") return "-";
		 var i,i2,i3,c="-";
		 i=l.indexOf(n);
		 i3=n.indexOf("=")+1;
		 if (i > -1) {
		  i2=l.indexOf(s,i); if (i2 < 0) { i2=l.length; }
		  c=l.substring((i+i3),i2);
		 }
		 return c;
		} 
	this.getNumbers= function (n) {
		l= this.getCookie();
		return l.split("\.")[n];
	}
	
	this.domainHash= this.getNumbers(0);
	this.timestamp= this.getNumbers(1);
	this.visits= this.getNumbers(2);
	this.numSources= this.getNumbers(3);
	this.source= this.getVariable("utmcsr=");
	this.campaign= this.getVariable("utmccn="); 
	this.medium= this.getVariable("utmcmd="); 
	this.keyword= this.getVariable("utmctr=");
}
