ordNum=Math.random()*1000000000000000000;var Advertisement=function(){var id;var site;var zone;var size;var tile;var keyValuePairs;var allowInterstitials;var divId;var MAX_KEY_LENGTH=5;var ADSERVER_URL="ad.doubleclick.net";var IFRAME_ID="ad-iframe-id";this.getSite=function(){return site;};this.setSite=function(new_site){if(typeof new_site=="string"){site=new_site;return site;}else{return false;}};this.getZone=function(){return zone;};this.setZone=function(new_zone){if(typeof new_zone=="string"){zone=new_zone;return zone;}else{return false;}};this.getTile=function(){return tile;};this.setTile=function(new_tile){if(typeof new_tile=="number"){tile=new_tile;return tile;}else{return false;}};this.getSize=function(){return size;};this.setSize=function(new_size){if(typeof new_size=="object"){if(typeof new_size.width=="object"&&typeof new_size.height=="object"&&typeof new_size.width.length=="number"&&typeof new_size.height.length=="number"){if(new_size.width.length==new_size.height.length){var allNums=true;for(var i=0;(i<new_size.width.length&&allNums);i++){if(typeof new_size.width[i]!="number"||typeof new_size.height[i]!="number"){allNums=false;}}
if(allNums){size.width=new_size.width;size.height=new_size.height;return size;}else{return false;}}else{return false;}}else{return false;}}else{return false;}};this.getKeyValuePairs=function(){return keyValuePairs;};this.setKeyvaluePairs=function(new_keyvalues){if(typeof new_keyvalues=="object"){if(new_keyvalues.length>=1){for(var i=0;i<new_keyvalues.length;i++){if(new_keyvalues[i].length==2){if((typeof new_keyvalues[i][0]=="string"||typeof new_keyvalues[i][0]=="number")&&(typeof new_keyvalues[i][1]=="string")||typeof new_keyvalues[i][1]){if(new_keyvalues[i][0].length<=MAX_KEY_LENGTH){keyValuePairs.push(new_keyvalues[i]);}}else{return false;}}else{return false;}}}else{return false;}}else{return false;}};this.getAllowInterstitial=function(){return allowInterstitials;};this.setAllowInterstitial=function(new_val){if(typeof new_val=="boolean"){allowInterstitials=new_val;return allowInterstitials;}else{return null;}};this.getId=function(){return id;};this.setId=function(new_id){if(typeof new_id=="number"){id=new_id;return new_id;}else{return false;}};this.getContainingDivId=function(){return divId;};this.setContainingDivId=function(new_id){if(typeof new_id=="string"){divId=new_id;return divId;}else{return false;}};this.getContainingDiv=function(){return document.getElementById(divId);};this.toString=function(){return"Advertisement - "+id;};this.equals=function(otherAd){if(typeof otherAd.isAdvertisement=="undefined"){return null;}
if(site!=otherAd.getSite()){return false;}
if(zone!=otherAd.getZone()){return false;}
var same=true;var otherElement=otherAd.getSize();if(size.width.length==otherElement.width.length){for(var i=0;(i<otherElement.width.length&&same==true);i++){same=(size.width[i]==otherElement.width[i])&&(size.height[i]==otherElement.height[i]);}}else{same=false;}
if(!same){return false;}
return true;};this.writeToConsole=function(){if(typeof window.console=="object"){console.log("-------------------- Advertisement --------------------");console.log("Id: "+id);console.log("Site: "+site);console.log("Zone: "+zone);console.log("Size: "+this.getSizeAsString());console.log("Tile: "+tile);console.log("Keywords: "+this.getKeyValuePairsAsString());console.log("Allow Interstitials?: "+allowInterstitials);console.log("-------------------------------------------------------");}};this.getSizeAsString=function(){var str="";var size=this.getSize();for(var i=0;i<size.width.length;i++){str+=size.width[i]+"x"+size.height[i]+",";}
return str.substring(0,str.length-1);};this.getKeyValuePairsAsString=function(){var str="";var keyValuePairs=this.getKeyValuePairs();for(var i=0;i<keyValuePairs.length;i++){str+=keyValuePairs[i][0]+"="+encodeURIComponent(keyValuePairs[i][1])+";";}
return str.substring(0,str.length-1);};this.write=function(){var ad_call,protocol,interstitial,ord;protocol=window.location.protocol=="https:"?"https:":"http:";interstitial=tile>1?"":allowInterstitials?"dcopt=ist;":"";ord=ordNum;ad_call=site+zone+";"+"dcove=d;comp=;"+interstitial+"tile="+tile+";sz="+this.getSizeAsString()+";"+this.getKeyValuePairsAsString()+";ord="+ord+"?";document.write('<scr'+'ipt type="text/javas'+'cript" src="'+protocol+'//'+ADSERVER_URL+'/adj/'+ad_call+'"></scr'+'ipt>');if((!document.images&&navigator.userAgent.indexOf('Mozilla/2.')>=0)||navigator.userAgent.indexOf('WebTV')>=0){document.write('<a href="'+protocol+'//'+ADSERVER_URL+'/jump/'+ad_call+'" target="_blank">');document.write('<img src="'+protocol+'//'+ADSERVER_URL+'/ad/'+ad_call+'" border="0"></a>');}};this.refresh=function(){var obj=this.getContainingDiv();if(obj.hasChildNodes()){while(obj.childNodes.length>=1){obj.removeChild(obj.firstChild);}}
this.write();};this.isAdvertisement=true;var a=arguments[0];if(typeof a=="undefined"){return null;}
if(typeof a.id=="number"){id=a.id;}else{return null;}
if(typeof a.divId=="string"){divId=a.divId;}else{return null;}
if(typeof a.site=="string"){site=a.site;}else{return null;}
if(typeof a.tile=="number"){tile=a.tile;}
zone=typeof a.zone=="string"?a.zone:"";var size={};if(typeof a.size=="object"){if(typeof a.size.width=="object"&&typeof a.size.height=="object"&&typeof a.size.width.length=="number"&&typeof a.size.height.length=="number"){if(a.size.width.length==a.size.height.length){size.width=a.size.width;size.height=a.size.height;}else{return null;}}else{return null;}}else{return null;}
keyValuePairs=new Array();if(typeof a.keyValuePairs=="object"){if(a.keyValuePairs.length>=1){for(var i=0;i<a.keyValuePairs.length;i++){if(a.keyValuePairs[i].length==2){if((typeof a.keyValuePairs[i][0]=="string"||typeof a.keyValuePairs[i][0]=="number")&&(typeof a.keyValuePairs[i][1]=="string")||typeof a.keyValuePairs[i][1]){if(a.keyValuePairs[i][0].length<=MAX_KEY_LENGTH){keyValuePairs.push(a.keyValuePairs[i]);}}}}}}
allowInterstitials=typeof a.allowInterstitials=="boolean"?a.allowInterstitials:false;};var AdvertisementList=function(){var ads,uniqueAds;this.add=function(ad){if(typeof ad.isAdvertisement=="undefined"){return false;}
ads.push(ad);var tempAd=ad;var found=false;for(var j=0;(j<uniqueAds.length&&found==false);j++){if(tempAd.equals(uniqueAds[j])){uniqueAds[j].count++;found=true;}}
if(!found){tempAd.count=1;uniqueAds.push(tempAd);}}
this.removeAll=function(){ads=new Array();}
this.count=function(){return ads.length;}
this.getUniqueAds=function(){return uniqueAds;}
this.contains=function(ad){if(typeof ad.isAdvertisement=="undefined"){return null;}
var found=false;for(var i=0;(i<uniqueAds.length&&found==false);i++){if(ad.equals(uniqueAds[i])){found=true;}}
return found;}
this.numberOf=function(ad){if(typeof ad.isAdvertisement=="undefined"){return null;}
for(var i=0;i<uniqueAds.length;i++){if(uniqueAds[i].equals(ad)){return uniqueAds[i].count;}}
return 0;}
this.toString=function(){return"AdvertisementList ("+ads.length+" ad(s), "+uniqueAds.length+" unique ad(s))";}
this.writeToConsole=function(){if(typeof window.console=="undefined")
{return;}
for(var i=0;i<ads.length;i++){ads[i].writeToConsole();}}
ads=new Array();uniqueAds=new Array();}
var RDMAdUtility=function(){var getZoneFromURL=function(){var z=new Array();var d=window.location.host;var p=window.location.pathname;var a=d.split(".");if(this.isOffsite==true){z.push(a[a.length-2]);}else{var subdomain="";if(a.length<=2){subdomain="www";}else{a=a.slice(0,a.length-2);subdomain=a.join(".");}
z.push(subdomain);}
var k=0;var a=p.split("/");for(var i=0;i<a.length&&k<=2;i++){if(a[i]!=""){if(a[i].indexOf(".")==-1){z.push(a[k]=a[i]);}
k++;}}
if(typeof ignorePathLevel=="number"){z.splice(ignorePathLevel,1);}
if(zoneSuffix!=""){z.push(zoneSuffix);}
for(var i=0;i<DEFAULT_INDEX_PAGES.length;i++){if(p.indexOf(DEFAULT_INDEX_PAGES[i])!=-1){z.push("index");break;}}
return"/"+z.join("/").toLowerCase();};var ads,args,ignorePathLevel,site,zone,sponsorshipId,allowInterstitials,isOffsite,zoneSuffix,keyValuePairs,currentNonStandardAds;var DEFAULT_SITE_ID="rogers.testsite";var MAX_KEY_LENGTH=5;var DEV_ENVIRONMENTS=["dev","qa","stage"];var DEFAULT_INDEX_PAGES=["index.jsp","index.html","index.htm","default.jsp","default.html","default.htm","index.php","default.php","index.asp","default.asp","index.aspx","default.aspx","index.page","default.page"];var NON_STANDARD_TILE_START=7;var OMNITURE_EVENT_NUMBER=46;var ZONE_NAME_MAX_LENGTH=64;this.insertAd=function(sourceElementId,options){if(typeof sourceElementId!="string"||typeof options!="object"){return false;}
var ad;if(typeof options.type=="number"){ad=new Advertisement({site:site,zone:zone,size:this._AD_SIZES[options.type],keyValuePairs:keyValuePairs,allowInterstitials:allowInterstitials,divId:sourceElementId,id:ads.count()+1});var numberOf=ads.numberOf(ad);if(options.type==this._AD_LEADERBOARD_MASTER&&numberOf==0){ad.setTile(1);}else
if(options.type==this._AD_BIGBOX_COMPANION&&numberOf==0){ad.setTile(2);}else
if(options.type==this._AD_BIGBUTTON&&numberOf==0){ad.setTile(4);}else
if(options.type==this._AD_MULTIAD&&numberOf==0){ad.setTile(3);}else
if(options.type==this._AD_BIGBUTTON&&numberOf==1){ad.setTile(5);}else
if(options.type==this._AD_SPONSORSHIP_BUTTON&&numberOf==0){ad.setTile(6);}else{ad.setTile(currentNonStandardAds+NON_STANDARD_TILE_START);currentNonStandardAds++;}
ads.add(ad);ad.write();return ad;}else{ad=new Advertisement({site:options.site,zone:options.zone,size:options.size,keyValuePairs:options.keyValuePairs,allowInterstitials:options.allowInterstitials,divId:sourceElementId,id:ads.count()+1});ad.setTile(currentNonStandardAds+NON_STANDARD_TILE_START);currentNonStandardAds++;ads.add(ad);ad.write();return ad;}};this.getOmnitureProductString=function(){var str;var uniqueAds=ads.getUniqueAds();str="";for(var i=0;i<uniqueAds.length;i++){var ad=uniqueAds[i];var size=ad.getSizeAsString();size=size.replace(/,/g,"|");size=size.replace(/\:/g,"/");size=size.replace(/^728x90$/,"Leaderboard");size=size.replace(/^300x250\|301x250$/,"Big Box (Companion)");size=size.replace(/^301x250\|300x250$/,"Big Box (Companion)");size=size.replace(/^300x60$/,"Big Button");size=size.replace(/^300x250\|160x600\|300x600$/,"Multi-Ad");size=size.replace(/^300x250\|300x600\|160x600$/,"Multi-Ad");size=size.replace(/^160x600\|300x250\|300x600$/,"Multi-Ad");size=size.replace(/^160x600\|300x600\|300x250$/,"Multi-Ad");size=size.replace(/^300x600\|160x600\|300x250$/,"Multi-Ad");size=size.replace(/^300x600\|300x250\|160x600$/,"Multi-Ad");size=size.replace(/^150x50$/,"Sponsorship Button");size=size.replace(/^460x240$/,"Contest Listing");size=size.replace(/^760x270$/,"Radio Gateway");size=size.replace(/^160x600$/,"Skyscrapper");str+=";"+ad.getSite()+":"+ad.getZone()+":"+size+";;;event"+OMNITURE_EVENT_NUMBER+"="+ad.count+",";}
str=str.substring(0,str.length-1);return str;}
this.getSite=function(){return site;};this.setSite=function(new_site){if(typeof new_site=="string"){site=new_site;return site;}else{return false;}};this.getZone=function(){return zone;};this.setZone=function(new_zone){if(typeof new_zone=="string"){zone=new_zone;return zone;}else{return false;}};this.getKeyValuePairs=function(){return keyValuePairs;};this.setKeyValuePairs=function(new_keyvalues){if(typeof new_keyvalues=="object"){if(new_keyvalues.length>=1){for(var i=0;i<new_keyvalues.length;i++){if(new_keyvalues[i].length==2){if((typeof new_keyvalues[i][0]=="string"||typeof new_keyvalues[i][0]=="number")&&(typeof new_keyvalues[i][1]=="string")||typeof new_keyvalues[i][1]){if(new_keyvalues[i][0].length<=MAX_KEY_LENGTH){keyValuePairs.push(new_keyvalues[i]);}}else{return false;}}else{return false;}
return keyValuePairs;}}else{return false;}}else{return false;}};this.getAllowInterstitial=function(){return allowInterstitials;};this.setAllowInterstitial=function(new_allow){if(typeof new_allow=="Boolean"){allowInterstitials=new_allow;return allowInterstitials;}else{return null;}};this.getSponsorshipId=function(){return sponsorshipId;};this.setSponsorshipId=function(new_id){if(typeof new_id=="string"){sponsorshipId=new_id;if(keyValuePairs.length==0||sponsorshipId==""){keyValuePairs.push(["spons",sponsorshipId]);return sponsorshipId;}else{var found=false;for(var i=0;(i<keyValuePairs.length&&!found);i++){if(keyValuePairs[i][0]=="spons"){keyValuePairs[i][1]=sponsorshipId;found=true;}}
return(found?sponsorshipId:found);}}else{return false;}};this.getOffsite=function(){return isOffsite;};this.setOffsite=function(new_val){if(typeof new_val=="boolean"){isOffsite=new_val;zone=getZoneFromURL();return isOffsite;}else{return null;}};this.getZoneSuffix=function(){return zoneSuffix;};this.setZoneSuffix=function(new_suffix){if(typeof new_suffix=="string"){zoneSuffix=new_suffix;zone=getZoneFromURL();return zoneSuffix;}else{return false;}};this.getAds=function(){return ads;};this._AD_LEADERBOARD=0;this._AD_BIGBOX=1;this._AD_SKYSCRAPPER=2;this._AD_MULTIAD=3;this._AD_BIGBUTTON=4;this._AD_ADVERTORIAL=5;this._AD_SPONSORSHIP_BUTTON=6;this._AD_LEADERBOARD_MASTER=7;this._AD_BIGBOX_COMPANION=8;this._AD_CONTEST_LISTING=9;this._AD_RADIO_GATEWAY=10;this._AD_SIZES=new Array();this._AD_SIZES[this._AD_LEADERBOARD]={width:[728],height:[90]};this._AD_SIZES[this._AD_BIGBOX]={width:[300],height:[250]};this._AD_SIZES[this._AD_SKYSCRAPPER]={width:[160],height:[600]};this._AD_SIZES[this._AD_MULTIAD]={width:[300,160,300],height:[250,600,600]};this._AD_SIZES[this._AD_BIGBUTTON]={width:[300],height:[60]};this._AD_SIZES[this._AD_SPONSORSHIP_BUTTON]={width:[150],height:[50]};this._AD_SIZES[this._AD_BIGBOX_COMPANION]={width:[300,301],height:[250,250]};this._AD_SIZES[this._AD_LEADERBOARD_MASTER]={width:[728],height:[90]};this._AD_SIZES[this._AD_CONTEST_LISTING]={width:[460],height:[240]};this._AD_SIZES[this._AD_RADIO_GATEWAY]={width:[760],height:[270]};args=arguments[0];if(typeof args=="undefined"){return null;}
site=typeof args.site!="string"?DEFAULT_SITE_ID:args.site;sponsorshipId=typeof args.sponsorshipId!="string"?"":args.sponsorshipId;allowInterstitials=typeof args.allowInterstitials!="boolean"?false:allowInterstitials=args.allowInterstitials;isOffsite=typeof args.isOffsite!="boolean"?false:args.isOffsite;zoneSuffix=typeof args.zoneSuffix!="string"?"":args.zoneSuffix;ignorePathLevel=typeof args.ignorePathLevel!="number"?"":args.ignorePathLevel;keyValuePairs=new Array();currentNonStandardAds=0;if(sponsorshipId!=""){keyValuePairs.push(["spons",sponsorshipId]);}
if(allowInterstitials){keyValuePairs.push(["mtype","rich"]);}
if(typeof args.keyValuePairs=="object"){if(args.keyValuePairs.length>=1){for(var i=0;i<args.keyValuePairs.length;i++){if(args.keyValuePairs[i].length==2){if((typeof args.keyValuePairs[i][0]=="string"||typeof args.keyValuePairs[i][0]=="number")&&(typeof args.keyValuePairs[i][1]=="string")||typeof args.keyValuePairs[i][1]){if(args.keyValuePairs[i][0].length<=MAX_KEY_LENGTH){keyValuePairs.push(args.keyValuePairs[i]);}}}}}}
zone=typeof args.zone!="string"?getZoneFromURL():"/"+args.zone;if(zone.length>ZONE_NAME_MAX_LENGTH){zone=zone.substring(0,ZONE_NAME_MAX_LENGTH+1);}
ads=new AdvertisementList();}