


/*! Copyright 2009,2010 the Rubicon Project.  All Rights Reserved.  No permission is granted to use, copy or extend this code */





oz_partner = "demo";







if(typeof oz_page_profiled=="undefined"){oz_page_profiled=false;}if(typeof oz_subframes_allowed=="undefined"){oz_subframes_allowed=false;}if(typeof oz_source=="undefined"){oz_source=document;}var oz_scripts_loaded=new Object();function OthersOnlineSensor(){this.config={delayAfterLoad:2*1000,sensor_sample:100,pixel_sample:25,domain_specific_parsing:false,use_local_storage:false,subframes_allowed:false,host:"http://gamma.oo-core.com",statichost:"http://gamma.oo-core.com"};
this.default_context={oz_partner:"othersonline.com",oz_session_id:null,oz_partner_user_id:null,oz_partner_channel:null,oz_partner_tracking_channel:null};this.context=null;this.page_parser=null;this.timeout=1500;this.init=function(A){try{if(A){this.context=this.mergeProperties(A,this.default_context);
}else{this.context=this.default_context;}if(this.context.oz_host){this.config.host=this.context.oz_host;}if(this.context.oz_statichost){this.config.statichost=this.context.oz_statichost;}if(this.context.oz_delay){this.config.delayAfterLoad=this.context.oz_delay;}if(this.context.oz_subframes_allowed){this.config.subframes_allowed=this.context.oz_subframes_allowed;
}}catch(B){}};this.scriptsLoaded=new Object();this.addScript=function(B,C){var A;if(oz_scripts_loaded[B]){return ;}oz_scripts_loaded[B]=true;A=document.createElement("script");if(C){A.setAttribute("id",C);}A.setAttribute("type","text/javascript");B=B.replace(/\s/g,"+");A.setAttribute("src",B);document.getElementsByTagName("head").item(0).appendChild(A);
};this.trim=function(A){return A.replace(/^\s+|\s+$/g,"");};this.start=function(){try{var A=this;if(window.addEventListener){window.addEventListener("load",function(D){A.onPageLoad();},false);}else{window.attachEvent("onload",function(D){A.onPageLoad();});if(typeof window.attachEvent=="function"){var B=window.onload;
window.onload=function(D){if(B){B(D);}A.onPageLoad();};}else{window.attachEvent("onload",function(D){A.onPageLoad();});}}}catch(C){}};this.format_phrases=function(B){var E="";var A;var D=40;for(var C=0;C<B.length&&C<D;C++){A=B[C];E+=A.word+":"+A.count;if(C<B.length){E+=",";}}return E;};this.mergeProperties=function(B,A){if(typeof (B)=="undefined"||!B){return A;
}if(typeof (A)=="undefined"||!A){return new Object();}for(var C in A){if(typeof B[C]=="undefined"){B[C]=A[C];}}return B;};this.cookiesEnabled=function(){try{var B=(navigator.cookieEnabled)?true:false;if(typeof navigator.cookieEnabled=="undefined"&&!B){document.cookie="testcookie";B=(document.cookie.indexOf("testcookie")!=-1)?true:false;
}return(B);}catch(A){}};this.isContentPage=function(){return((this.oz_source!=document)||this.config.subframes_allowed||(window==top));};this.shouldSamplePage=function(){if(this.isContentPage()){return(Math.floor(Math.random()*100)<this.config.sensor_sample);}return false;};this.shouldPixelPage=function(){return(Math.floor(Math.random()*100)<this.config.pixel_sample);
};this.getTopPhrases=function(){if(this.page_parser==null){return null;}return this.page_parser.getTopPhrasesFromDocument(this.oz_source);};this.getUserProfile=function(){if(!this.isContentPage()||this.page_parser==null){return null;}return this.page_parser.getProfileFromDocument(this.oz_source);};this.getPartnerUserProfile=function(){return this.context.oz_profile;
};this.getPixels=function(){return oz_sensor_pixels;};this.getPixelsForPage=function(){var C=this.getPixels();if(C){for(var A=0;A<C.length;A++){var B=C[A].uri;setTimeout(function(){new Image().src=B;},250);}}};this.profileUserForPage=function(){if(oz_page_profiled){return ;}try{if(this.oz_source.location.protocol.indexOf("http:")<0){return ;
}if(typeof PageParser!="function"){if(this.config.domain_specific_parsing){this.addScript(this.config.statichost+"/partner/scripts/"+this.context.oz_partner+"/page_parser.js?d="+this.oz_source.location.host);}else{this.addScript(this.config.statichost+"/partner/scripts/"+this.context.oz_partner+"/page_parser.js");
}var G=this;setTimeout(function(){G.profileUserForPage();},500);return ;}if(this.page_parser==null){this.page_parser=new PageParser();this.page_parser.doc=this.oz_source;this.page_parser.init();}var I;if(this.shouldSamplePage()){oz_page_profiled=true;I=this.getTopPhrases();if(I){var B;B=this.config.host+"/oz/sensor";
B+="?p="+this.context.oz_partner;if(this.context.oz_session_id){B+="&fps="+this.context.oz_session_id;}if(this.context.oz_partner_user_id){B+="&afu="+this.context.oz_partner_user_id;}if(this.context.oz_user_token){B+="&lid="+this.context.oz_user_token;}if(this.context.oz_partner_channel){B+="&pc="+this.context.oz_partner_channel;
}if(this.context.oz_partner_tracking_channel){B+="&ptc="+this.context.oz_partner_tracking_channel;}if(this.cookiesEnabled()){B+="&cd=false";}if(I.duration){B+="&xt="+I.duration;}B+="&k="+this.format_phrases(I.summary).replace(/\s+/g,"+");try{var H;H=this.page_parser.selectSERPStats(window.location.href);
if((H)&&(H.queryTerms)){B+="&q="+H.queryTerms+":"+H.adCount;}else{H=this.page_parser.selectSERPStats(this.oz_source.referrer);if((H)&&(H.queryTerms)){B+="&q="+H.queryTerms+":1";}}}catch(E){}try{var F;if(this.oz_source.referrer){F=this.oz_source.referrer.split("/")[2];}if(F&&(F!=this.oz_source.location.host)){B+="&rd="+F;
}if(this.oz_source.title){B+="&t="+this.oz_source.title.replace(/\s+/g,"+");}}catch(E){}new Image().src=B;}}var D=this.getUserProfile();if(D){var C=false;var B;B=this.config.host+"/oz/feeds/"+this.context.oz_partner+"/profile";B+="?p="+this.context.oz_partner;if(this.context.oz_session_id){B+="&fps="+this.context.oz_session_id;
}if(this.context.oz_partner_user_id){B+="&afu="+this.context.oz_partner_user_id;}if(this.context.oz_partner_channel){B+="&pc="+this.context.oz_partner_channel;}if(this.context.oz_partner_tracking_channel){B+="&ptc="+this.context.oz_partner_tracking_channel;}for(var A in D){if(!D.hasOwnProperty(A)){continue;
}C=true;if(typeof A!="function"){B+="&"+A+"="+D[A];}}if(C){new Image().src=B;}}var D=this.getPartnerUserProfile();if(D){var C=false;var B;B=this.config.host+"/oz/feeds/"+this.context.oz_partner+"/profile";B+="?p="+this.context.oz_partner;B+="&oz_source=partner";if(this.context.oz_session_id){B+="&fps="+this.context.oz_session_id;
}if(this.context.oz_partner_user_id){B+="&afu="+this.context.oz_partner_user_id;}if(this.context.oz_partner_channel){B+="&pc="+this.context.oz_partner_channel;}if(this.context.oz_partner_tracking_channel){B+="&ptc="+this.context.oz_partner_tracking_channel;}for(var A in D){if(!D.hasOwnProperty(A)){continue;
}C=true;if(typeof A!="function"){B+="&"+A+"="+D[A];}}if(C){new Image().src=B;}}}catch(E){}};this.onPageLoad=function(){if(this.pageLoadHandled){return ;}this.pageLoadHandled=true;if(this.oz_source.location.protocol.indexOf("http:")<0){return ;}var A=this;setTimeout(function(){A.profileUserForPage();},this.config.delayAfterLoad);
try{var A=this;setTimeout(function(){A.getPixelsForPage();},this.config.delayAfterLoad);if(window!=top){if(Math.floor(Math.random()*100)<1){var B;var C;B=this.config.host+"/empty.gif?p="+this.context.oz_partner+"&frames=nested";if(this.context.oz_partner_channel){B+="&pc="+this.context.oz_partner_channel;
}if(this.context.oz_partner_tracking_channel){B+="&ptc="+this.context.oz_partner_tracking_channel;}try{if(this.oz_source.referrer){C=this.oz_source.referrer.split("/")[2];}if(C&&(C!=this.oz_source.location.host)){B+="&rd="+C;}}catch(D){}new Image().src=B;}}}catch(D){}};}function oz_sensor(E){try{var D=new OthersOnlineSensor();
var C=new Object();var G=["oz_partner","oz_session_id","oz_partner_user_id","oz_host","oz_statichost","oz_delay","oz_sensor_filter","oz_profile","oz_partner_channel","oz_subframes_allowed"];var A;if(oz_source){D.oz_source=oz_source;}for(var B=0;B<G.length;B++){A=G[B];if(window[A]){C[A]=window[A];}}D.init(C);
oz_sensor_partner_hook(D);D.start();if(E||D.autorun){D.onPageLoad();}return D;}catch(F){}}var oz_sensor_pixels=[];function oz_sensor_partner_hook(A){return A;}function oz_parseUri(E){var D=oz_parseUri.options;var A=D.parser[D.strictMode?"strict":"loose"].exec(E);var C={};var B=14;while(B--){C[D.key[B]]=A[B]||"";
}C[D.q.name]={};C[D.key[12]].replace(D.q.parser,function(G,F,H){if(F){C[D.q.name][F]=H;}});return C;}oz_parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};



/*
	*/

function oz_sensor_partner_hook(sensor)
{
	sensor.config.sensor_sample = 100;
	sensor.config.host = "http://tap.rubiconproject.com";
	
}

/*
*/



oz_sensor();

