/**********************************************
    DolbySyndicatedContentAnalytics
    
**********************************************/

//DolbyAnalytics object
//This provides non-cookie posts to GA

//document.write('<img id="gaimage" src="http://www.dolby.com/images/spacer.gif" width="1" height="1" alt="gaimage" style="display:block;"/>');

function DolbyAnalytics(){
    this.var_utmac='UA-8013375-1'; //ga urchin code
    this.var_utmhn='dolby.com'; //domain
    this.var_utmn=0;//random request number
    this.var_cookie=rand(10000000,99999999);//random cookie number
    this.var_random=0; //number under 2147483647
    this.var_today=0; //today
    this.var_referer=document.referrer; //referer url
    this.var_uservar='-'; //enter your own user defined variable
    this.var_utmp=''; //URL to track

    this.trackURL = function(u){
        this.var_utmn=rand(1000000000,9999999999);//random request number
        this.var_random=rand(1000000000,2147483647); //number under 2147483647
        this.var_today=time(); //today
        this.var_utmp = u;
		document.getElementById("gaimage").src = 'http://www.google-analytics.com/__utm.gif?utmwv=1&utmn='+this.var_utmn+'&utmsr=-&utmsc=-&utmul=-&utmje=0&utmfl=-&utmdt=-&utmhn='+this.var_utmhn+'&utmr='+this.var_referer+'&utmp='+this.var_utmp+'&utmac='+this.var_utmac+'&utmcc=__utma%3D'+this.var_cookie+'.'+this.var_random+'.'+this.var_today+'.'+this.var_today+'.'+this.var_today+'.2%3B%2B__utmb%3D'+this.var_cookie+'%3B%2B__utmc%3D'+this.var_cookie+'%3B%2B__utmz%3D'+this.var_cookie+'.'+this.var_today+'.2.2.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D'+this.var_cookie+'.'+this.var_uservar+'%3B';
    }
}

function rand( min, max ) {
   var argc = arguments.length;
    if (argc == 0) {
        min = 0;
        max = 2147483647;
    } else if (argc == 1) {
        throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
    }
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function time() {
    return Math.round(new Date().getTime()/1000);
}

var dolbyga = new DolbyAnalytics();

