// override iframe code which causes iframe stacking on banner ads
com.mtvi.util.IFrameReloader.prototype = {
   reload : function() {
      try {
         var date = new Date();
         var now = (date.getMinutes() * 60000) + (date.getSeconds() * 1000);
         var elapsed = now - this.lastLoaded;
         if(elapsed > 5000) {
            var i = document.getElementById(this.id);
            i.src = this.src;
            }
         this.lastLoaded = now;
         }
      catch(e) {
         }
      }
   , write : function() {
      try {
          var iframeStyle = ";margin:0";
          iframeStyle += ";z-index:99";
          iframeStyle += ";border:0";

         var html = '<iframe id="' + this.id + '" src="' + this.src + '" style="' + iframeStyle + '" width="' + this.width + '" height="' + this.height + '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>';
         document.write(html);
         }
      catch(e) {
         }
      }
};

// set the reload time on the ad cycles
//com.mtvi.ads.AdManager.reloadInterval = 150000;
com.mtvi.ads.AdManager.setReloadInterval(150000);

com.mtvi.reporting.Account = {
	name :'viaatomv6',
	dynamicAccountSelection :'true',
	dynamicAccountList :'viaatomv6dev=atom.scenic-d.mtvi.com,atom.scenic-q.mtvi.com',
	trackInlineStats: true
};
com.mtvi.reporting.Controller.initialize();

var _camp = '';
var _campind = document.location.search.indexOf("brand");
if (_campind > -1) {
    var _camp = document.location.search;
    _camp = _camp.substring(_campind+6);
}

// BEGIN 3/18/09
// "IF" logic added to not send the report on games or video pages until the custom
// version of the report in utilities.ftl which has the custom vars in scope - mcy
if (((location.href.indexOf("funny_videos")==-1) && (location.href.indexOf("fun_games")==-1)) || ((location.pathname == "/funny_videos") || (location.pathname == "/funny_videos/") || (location.href.indexOf("nicksbigshow") > -1))) {

	com.mtvi.reporting.Controller.sendCall(
			{
			pageName: com.mtvi.metadata.getDefaultPageName(),	
			channel: com.mtvi.metadata.getDefaultChannel(),
			hier1:	com.mtvi.metadata.getDefaultPageName(),
		    campaign: _camp
			}
		);

}
// END 3/18/09


// QuantCast

_qacct = "p-94wNw88f65Rhk";
_qoptions = {
	labels :"MTVN Games and Entertainment Global Network,MTVN Games and Entertainment Domestic,MTVN Digital Tribes,ComedyCentral plus ComedyTribe,ComedyCentral Network,Atom Site,MTVN Games and Entertainment Global Proper,MTVN Global Digital Network,MTVN Global Digital Proper"
};
quantserve();
