var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",MAX_FLASH_VERSION='999999',REGEXP_FOR_LINKS=/link/g,win=window,doc=document,nav=navigator
var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0;}}
else if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7");}
catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always";}
catch(e){if(playerVersion[0]==6){fp6Crash=true;}}
if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX);}
catch(e){}}}
if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}
catch(e){}}}
var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac};}();function createSWF(ban){var el=ban.div;var attObj={data:ban.swf.url,width:ban.swf.width,height:ban.swf.height};var parObj={};if(ban.swf.params&&typeof ban.swf.params===OBJECT){for(var j in ban.swf.params){if(ban.swf.params[j]!=Object.prototype[j]){parObj[j]=ban.swf.params[j];}}}
var objectParams='';var o='<object style="display:block;  margin:0 auto; "'
+'width="'+attObj.width+'" '
+'height="'+attObj.height+'" ';if(ua.ie&&ua.win){o+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';parObj.movie=attObj.data;}
else{o+='data="'+attObj.data+'" '+'type="application/x-shockwave-flash">'}
for(var p in parObj){objectParams+='<param name="'+p+'" value="'+parObj[p]+'" />';}
o+=objectParams;o+='</object>';el.innerHTML=o;}
function pastePlugImage(ban){var targetIfNeeded='';if(ban.plugImage.target){targetIfNeeded='target="'+ban.plugImage.target+'"';}
ban.div.innerHTML='<a style="display:block; height:'+ban.plugImage.height+'px" '+targetIfNeeded+' href="'+ban.plugImage.href+'">'+
'<img src="'+ban.plugImage.src+'" '+
'width="'+ban.plugImage.width+'" '+
'height="'+ban.plugImage.height+'" alt="" style="border:0" /></a>';}
function getElementById(id){el=doc.getElementById(id);return el;}
function createElement(el){return doc.createElement(el);}
function createRunUp(ban){var runUp=ban.runUp;var parentDiv=ban.div;var runUpDiv=createElement('div');runUpDiv.id=parentDiv.id+'_runUp';runUpDiv.style.position='absolute';runUpDiv.style.visibility='hidden';runUpDiv.style.left=runUp.offsetX+'px';runUpDiv.style.top=runUp.offsetY+'px';runUpDiv.style.zIndex=999;parentDiv.style.zIndex=999;if(runUp.showFullScreen){var maxHeigthFunc=function(){runUpDiv.style.height=(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||runUp.swf.height)+'px';}
ajEvent.bind(win,'resize',maxHeigthFunc);ajEvent.bind(win,'scroll',maxHeigthFunc);maxHeigthFunc();parentDiv.style.position='absolute';runUpDiv.style.left='0px';runUpDiv.style.top='0px';parentDiv.style.left='0px';parentDiv.style.top='0px';runUpDiv.style.zIndex=9999;parentDiv.style.zIndex=9999;}
else{parentDiv.style.position='relative';runUpDiv.style.height=runUp.swf.height+'px';}
parentDiv.appendChild(runUpDiv);if(runUp.moveContentAfter){var normalHeight=parentDiv.style.height;parentDiv.style.backgroundColor=ban.background.color;runUpDiv.style.backgroundColor=runUp.background.color;if(!ban.background.image){ban.background.image='none';}
else{ban.background.image='url("'+ban.background.image+'")';}
if(!runUp.background.image){runUp.background.image='none';}
else{runUp.background.image='url("'+runUp.background.image+'")';}
parentDiv.style.backgroundImage=ban.background.image;runUpDiv.style.backgroundImage=runUp.background.image;parentDiv.style.width=runUpDiv.style.width='100%';if(ua.ie&&runUp.showFullScreen){var maxWidthFunc=function(){runUpDiv.style.width=(self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||runUp.swf.width)+'px';}
ajEvent.bind(win,'resize',maxWidthFunc);ajEvent.bind(win,'scroll',maxWidthFunc);maxWidthFunc();}
if(runUp.paddingRight||runUp.paddingLeft){runUpDiv.style.overflow='hidden';var fpadding=function(){runUpDiv.style.width=(document.documentElement.clientWidht||document.body.clientWidth-parseInt(runUp.paddingRight)-parseInt(runUp.paddingLeft))+'px';};ajEvent.bind(win,'resize',fpadding);fpadding();}
parentDiv.style.textAlign=runUpDiv.style.textAlign='center';}
else{runUpDiv.style.width=runUp.swf.width+'px';}
if((runUp.showOnPeriod)&&(!Cookie.get(parentDiv.id))){setTimeout(function(){Cookie.set(parentDiv.id,'1',runUp.rememberShowOnPeriod,runUp.rememberDomain);if(runUp.moveContentAfter){parentDiv.style.height=runUpDiv.style.height;}
runUpDiv.style.visibility='';setTimeout(function(){hideRunUp(parentDiv,runUpDiv,runUp.moveContentAfter,normalHeight);},runUp.showOnPeriod);},runUp.showOnTime);}
else{runUpDiv.style.visibility='hidden';}
if(runUp.showOnMouseOver){ajEvent.bind(parentDiv,'mouseover',function(){runUpDiv.style.visibility='visible';});ajEvent.bind(parentDiv,'mouseout',function(){runUpDiv.style.visibility='hidden';});ajEvent.bind(runUpDiv,'mouseout',function(){runUpDiv.style.visibility='hidden';});}
return runUpDiv;}
function hideRunUp(replaceElemDiv,runUpDiv,moveContentAfter,normalHeight){runUpDiv.style.visibility='hidden';if(moveContentAfter){replaceElemDiv.style.height=normalHeight;}}
function createFixed(fixed){var fixedDiv=createElement('div');fixedDiv.style.width=fixed.swf.width+'px';fixedDiv.style.height=fixed.swf.height+'px';fixedDiv.style.position='absolute';fixedDiv.style.visibility='hidden';setTimeout(function(){doc.body.appendChild(fixedDiv);placeToCenter(fixedDiv);fixedDiv.style.visibility='visible';setTimeout(function(){fixedDiv.style.visibility='hidden'},fixed.showOnPeriod);},fixed.showOnTime);ajEvent.bind(win,'resize',function(){placeToCenter(fixedDiv)});ajEvent.bind(win,'scroll',function(){placeToCenter(fixedDiv)});return fixedDiv;}
function placeToCenter(el){if(win.innerWidth){el.style.left=parseInt(doc.documentElement.clientWidth/2-el.clientWidth/2+win.pageXOffset)+'px';el.style.top=parseInt(win.innerHeight/2-el.clientHeight/2+win.pageYOffset)+'px';}
else{var docDocument=(doc.documentElement&&doc.documentElement.clientWidth)?doc.documentElement:doc.body;if(!docDocument.clientWidth)return;el.style.left=parseInt(docDocument.clientWidth/2-el.clientWidth/2+docDocument.scrollLeft)+'px';el.style.top=parseInt(docDocument.clientHeight/2-el.clientHeight/2+docDocument.scrollTop)+'px';}}
function placeContentToCenter(obj){var fch=obj.firstChild;var dHeight;if(fch.currentStyle){dHeight=fch.currentStyle.height;}
else if(window.getComputedStyle){dHeight=window.getComputedStyle(fch,null).height;}
else{dHeight=0;}
if(dHeight==='100%'){return;}
else if(/%/.test(dHeight)){fch.style.top=parseInt((100-dHeight.replace('%',''))/2)+'%';}
else if(/px/.test(dHeight)){dHeight='-'+parseInt(dHeight.replace('px','')/2)+'px';fch.style.top='50%';fch.style.marginTop=dHeight;}
else{return;}
fch.style.position='relative';}
function createPopup(popup){var windowWithBanner=window.open('',popup.windowName,'width='+popup.windowWidth+',height='+popup.windowHeight);var popupDiv=windowWithBanner.document.getElementById('popupBanner');if(popup.openType=='popunder')windowWithBanner.blur();if(!popupDiv){windowWithBanner.document.open();windowWithBanner.document.write('<html><head><style type="text/css">*{margin:0;padding:0;border:0;}</style></head><body><div id="popupBanner"></div></body></html>');windowWithBanner.document.close();popupDiv=windowWithBanner.document.getElementById('popupBanner')}
return popupDiv;}
function hasPlayerVersion(rv){var pv=ua.pv,v=rv.toString().split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false;}
function init(ban){if(!ua.w3cdom||!ban||!ban.replaceElemId){return;}
ban.div=getElementById(ban.replaceElemId);}
function setDefaultSwf(ban){if(!ban.swf){ban.swf={url:ban.plugImage.href,minVersion:MAX_FLASH_VERSION,width:ban.plugImage.width,height:ban.plugImage.height,href:false};}}
function handleCounters(ban){ban.rnd=Math.round(Math.random()*1000000);var advertSite=ban.advertSite;for(var key in advertSite){var counterURI=advertSite[key];if(key=='imho'){counterURI=addParamToUrl(counterURI,'transactionId='+ban.rnd);}
else{counterURI=addParamToUrl(counterURI,'seed='+ban.rnd);}
var counterImage=new Image();counterImage.src=counterURI;}}
function handleLinks(ban,rnd){ban.redirect=addParamToUrl(ban.redirect,'seed='+rnd);ban.redirect+='&code=!';var transactionId='';if(ban.advertSite.imho&&ban.plugImage){transactionId='transactionId='+rnd;ban.plugImage.href=addParamToUrl(ban.plugImage.href,transactionId);}
if(ban.plugImage){ban.plugImage.href=ban.redirect+escape(ban.plugImage.href);}
if(!ban.swf||!ban.swf.href)return;var hrefs=ban.swf.href;for(var link in hrefs){if(link.match(REGEXP_FOR_LINKS)){ban.swf.url=addParamToUrl(ban.swf.url,link+'='+escape(ban.redirect+escape(addParamToUrl(hrefs[link],transactionId))));}
else{ban.swf.url=addParamToUrl(ban.swf.url,link+'='+escape(addParamToUrl(hrefs[link],transactionId)));}}}
function addParamToUrl(url,param){if(!param)return url;var symbolToConnect='&';if(url.indexOf('?')==-1){symbolToConnect='?';}
url+=symbolToConnect+param;return url;}
function create(ban,flashCallback,plgImgCallback){if(hasPlayerVersion(ban.swf.minVersion)){flashCallback();}
else{plgImgCallback();}}
return{insert:function(ban){init(ban);setDefaultSwf(ban);if(!ban.runUp||!ban.runUp.showFullScreen||!Cookie.get(ban.replaceElemId)){handleCounters(ban);}
handleLinks(ban,ban.rnd);flashCallback=function(){createSWF(ban);}
plgImgCallback=function(){pastePlugImage(ban);}
if(ban.runUp){var runUp=ban.runUp;if(runUp.showFullScreen){runUp.swf.height=runUp.swf.height||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;runUp.swf.width=runUp.swf.width||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;runUp.plugImage.height=runUp.plugImage.height||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;runUp.plugImage.width=runUp.plugImage.width||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;}
setDefaultSwf(runUp);handleLinks(runUp,ban.rnd);runUp.showOnTime=runUp.showOnTime*1000;runUp.showOnPeriod=runUp.showOnPeriod*1000;flashCallback=function(){createSWF(ban);runUp.div=createRunUp(ban);createSWF(runUp);if(runUp.showFullScreen){var obj=runUp.div;setTimeout(function(){placeContentToCenter(obj);placeToCenter(obj);},700);ajEvent.bind(win,'resize',function(){placeToCenter(obj);placeContentToCenter(obj);});ajEvent.bind(win,'scroll',function(){placeToCenter(obj);placeContentToCenter(obj);});}}
plgImgCallback=function(){pastePlugImage(ban);runUp.div=createRunUp(ban);pastePlugImage(runUp);if(runUp.showFullScreen){var obj=runUp.div;setTimeout(function(){placeContentToCenter(obj);placeToCenter(obj);},500);ajEvent.bind(win,'resize',function(){placeToCenter(obj);placeContentToCenter(obj);});ajEvent.bind(win,'scroll',function(){placeToCenter(obj);placeContentToCenter(obj);});}}}
if(ban.fixed){var fixed=ban.fixed;setDefaultSwf(fixed);handleLinks(fixed,ban.rnd);fixed.showOnTime=fixed.showOnTime*1000;fixed.showOnPeriod=fixed.showOnPeriod*1000;flashCallback=function(){createSWF(ban);fixed.div=createFixed(fixed);createSWF(fixed);}
plgImgCallback=function(){pastePlugImage(ban);fixed.div=createFixed(fixed);pastePlugImage(fixed);}}
if(ban.popup){var popup=ban.popup;handleLinks(popup,ban.rnd);flashCallback=function(){ajEvent.one(document.documentElement,'click',function(){popup.div=createPopup(popup);createSWF(popup);})}
plgImgCallback=function(){ajEvent.one(document.documentElement,'click',function(){popup.div=createPopup(popup);pastePlugImage(popup);})}}
if(ban.video){var video=ban.video;video.div=ban.div;handleLinks(video,ban.rnd);flashCallback=function(){if(video.speedTest){var speedTest=video.speedTest;createSWF(ban);var speedTestObj=new SpeedTest();var optionsForTest={onEnd:function(speed){if(parseInt(speedTest.minSpeed)<speed.Kbps){createSWF(video);}},imgUrl:speedTest.testImage.url,size:speedTest.testImage.size};if(speedTest.runCount){optionsForTest.runCount=parseInt(speedTest.runCount);}
speedTestObj.run(optionsForTest);}
else{createSWF(video);}}
plgImgCallback=function(){pastePlugImage(ban);}}
create(ban,flashCallback,plgImgCallback);}};}();var SpeedTest=function(){};SpeedTest.prototype={runCount:3,run:function(options){this.results=[];this.callback=(options&&options.onEnd)?options.onEnd:null;this.size=parseInt(options.size);this.imgUrl=options.imgUrl;if(options.runCount)this.runCount=options.runCount;this.runTrial(0,options);},runTrial:function(i,options){var imgUrl=this.imgUrl+"?r="+Math.random();var me=this;var testImage=new Image();testImage.onload=function(){me.results[i].endTime=(new Date()).getTime();me.results[i].runTime=me.results[i].endTime-me.results[i].startTime;if(i<me.runCount-1)
me.runTrial(i+1);else{if(me.callback)
me.callback(me.getResults());}};this.results[i]={startTime:(new Date()).getTime()};testImage.src=imgUrl;},getResults:function(){var totalRunTime=0;for(var i=0;i<this.runCount;i++){if(!this.results||!this.results[i].endTime)
return null;else
totalRunTime+=this.results[i].runTime;}
var avgRunTime=totalRunTime/this.runCount;return{avgRunTime:avgRunTime,Kbps:(this.size*8/1024/(avgRunTime/1000)),KBps:(this.size/1024/(avgRunTime/1000))};}}
var ajEvent=new function(){this.guid=1;this.bind=(function(){var fixEvent=function(e){e.preventDefault=function(){e.returnValue=false;};e.stopPropagation=function(){e.cancelBubble=true;};e.target=e.srcElement;if(e.type=='keypress'){e.charCode=e.keyCode;}
return e;}
var handleEvent=function(){var e=fixEvent(window.event);var handlers=this.events[event.type];for(var i in handlers){handlers[i].call(this,e);}};if(typeof addEventListener!='undefined')
return function(elem,type,handler){elem.addEventListener(type,handler,false)};else
return function(elem,type,handler){if(!handler.$$guid){handler.$$guid=this.guid++;}
if(!elem.events){elem.events={};}
var handlers=elem.events[type];if(!handlers){handlers=elem.events[type]={};if(elem['on'+type]){handlers[0]=elem['on'+type];}}
elem['on'+type]=handleEvent;handlers[handler.$$guid]=handler;};})();this.unbind=(function(){if(typeof removeEventListener!='undefined'){return function(elem,type,handler){elem.removeEventListener(type,handler,false);};}else
return function(elem,type,handler){if(elem.events&&elem.events[type]){delete elem.events[type][handler.$$guid];}};})();this.one=function(elem,type,handler){var _this=this;var wrapper=function(e){_this.unbind(this,type,wrapper);handler.call(this,e);}
this.bind(elem,type,wrapper);elem=null;};};var Cookie={set:function(name,value,expires,domain){var expiresValue='';if(expires!=='session'){expiresValue='expires='+
(new Date(new Date().getTime()+(expires||365)*86400000)).toGMTString()+'; '}
document.cookie=name+'='+value+'; '+expiresValue+'path=/'+((domain)?'; domain='+domain:'');},get:function(name){var re=new RegExp('\\s*'+name+'=');var cookies=document.cookie.split(';');for(var i=cookies.length;i--;){var c=cookies[i];if(re.test(c)){return c.replace(re,'');}}
return'';}};var Bbody=function(){var cookie_name='rb_locs';var cookie_exp_h=1;var locs_limit=30;function add_rb_locs(rb_locs_str,rb_locs_pos){var pos=rb_locs_str.indexOf(rb_locs_pos.substr(0,9));if(pos>-1){rb_locs_str=rb_locs_str.substr(0,pos)+rb_locs_str.substr(pos+12,rb_locs_str.length);}
rb_locs_str+=rb_locs_pos;return rb_locs_str;}
function check_limit(rb_locs_str){var del_pos=rb_locs_str.length-locs_limit*12
if(del_pos>0){rb_locs_str=rb_locs_str.substr(del_pos,rb_locs_str.length);}
return rb_locs_str;}
return{next:function(rb_locs_pos){if(rb_locs_pos.length!=12){return;}
var rb_locs_str=Cookie.get('rb_locs');rb_locs_str=add_rb_locs(rb_locs_str,rb_locs_pos);rb_locs_str=check_limit(rb_locs_str);Cookie.set(cookie_name,rb_locs_str,cookie_exp_h/24);return rb_locs_str;}}}();