
var f_cb_medrect1_served=false;var f_need_cb=false;var f_cb_medrect1_real=false;var debug=document.location.search.indexOf('debug=true')>-1?true:false;function yume_backfill_banner(banner_div_id,banner_frame_id,imu_type){var rc=0;var cb_width=document.getElementById(banner_div_id).style.width;var cb_height=document.getElementById(banner_div_id).style.height;var y_c_frame=document.getElementById(banner_frame_id);var cb_w=cb_width.split("px",1);var cb_h=cb_height.split("px",1);var arg1="/html/dynamic_banner_iframe.html?width="+cb_w+"&height="+cb_h+"&imu="+imu_type;try{y_c_frame.contentWindow.document.getElementsByTagName("body")[0].innerHTML="<iframe src=\""+arg1+"\" height='"+cb_height+"' width='"+cb_width+"' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0' style='overflow:hidden'></iframe>";rc=1;}catch(e){}
return rc;}
function yume_serve_cb_frame(banner_div_id,banner_frame_id,frame_src_url){var rc=0;var cb_width=document.getElementById(banner_div_id).style.width;var cb_height=document.getElementById(banner_div_id).style.height;var y_c_frame=document.getElementById(banner_frame_id);try{y_c_frame.contentWindow.document.getElementsByTagName("body")[0].innerHTML="<iframe src=\""+frame_src_url+"\" height='"+cb_height+"' width='"+cb_width+"' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' topmargin='0' leftmargin='0' style='overflow:hidden'></iframe>";rc=1;}catch(e){}
return rc;}
function yume_serve_cb_image(banner_div_id,banner_frame_id,frame_img,frame_link,frame_trackers){var rc=0;var cb_width=document.getElementById(banner_div_id).style.width;var cb_height=document.getElementById(banner_div_id).style.height;var y_c_frame=document.getElementById(banner_frame_id);try{var htmlString=""
if(frame_link!='null'){htmlString="<a href='"+frame_link+"' target='_blank'><img src=\""+frame_img+"\" border='0' width='"+cb_width+"' height='"+cb_height+"'></a>";}else{htmlString="<img src=\""+frame_img+"\" border='0' width='"+cb_width+"' height='"+cb_height+"'>";}
y_c_frame.contentWindow.document.getElementsByTagName("body")[0].innerHTML=htmlString;for(i=0;i<frame_trackers.length;i++){htmlString+="<img width='1' height='1' src=\""+frame_trackers[i]+"\" style='position:absolute;'></img>"}
y_c_frame.contentWindow.document.getElementsByTagName("body")[0].innerHTML=htmlString;rc=1;}catch(e){}
return rc;}
function yume_serve_cb_swf(banner_div_id,banner_frame_id,frame_img,frame_link,frame_trackers){var rc=0;var cb_width=document.getElementById(banner_div_id).style.width;var cb_height=document.getElementById(banner_div_id).style.height;var y_c_frame=document.getElementById(banner_frame_id);try{var htmlString=""
if(frame_img.indexOf(".swf?",0)>0){htmlString="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+cb_width+"' height='"+cb_height+"'> <param name='bgcolor' value='#E3F0EB' />  <param name='movie' value=\""+frame_img+"\"><param name='allowScriptAccess' value='always'> <param name='wmode' value='transparent'> <param name='quality' value='high'><embed src=\""+frame_img+"\" bgcolor='#E3F0EB' quality='high' wmode='transparent' allowScriptAccess='always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+cb_width+"' height='"+cb_height+"'></embed></object>"}else{htmlString="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+cb_width+"' height='"+cb_height+"'> <param name='bgcolor' value='#E3F0EB' />  <param name='movie' value=\""+frame_img+"?clickTAG="+frame_link+"\"><param name='allowScriptAccess' value='always'> <param name='wmode' value='transparent'> <param name='quality' value='high'><embed src=\""+frame_img+"?clickTAG="+frame_link+"\" bgcolor='#E3F0EB' quality='high' wmode='transparent' allowScriptAccess='always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+cb_width+"' height='"+cb_height+"'></embed></object>"}
for(i=0;i<frame_trackers.length;i++){htmlString+="<img width='1' height='1' src=\""+frame_trackers[i]+"\" style='position:absolute;'></img>"}
y_c_frame.contentWindow.document.getElementsByTagName("body")[0].innerHTML=htmlString;rc=1;}catch(e){}
return rc;}
function yume_img_is_swf(img_url){var ix_getElement=img_url.indexOf("/getElement?",0);var ix_extSWF=img_url.indexOf("ext=.swf",0);var rc=0;if(ix_getElement>0&&ix_extSWF>ix_getElement){rc=1;}
return rc;}
function delegate(that,thatMethod){if(arguments.length>2){var _params=[];for(var n=2;n<arguments.length;++n){_params.push(arguments[n]);}
return function(){try{return thatMethod.apply(that,_params);}catch(e){}};}else{return function(){try{return thatMethod.apply(that);}catch(e){}};}}
function obj(){}
obj.prototype.serveImage=function(ref,banner_div_id,banner_frame_id,frame_img,frame_link,frame_trackers){this.pic=new Image();this.pic.src=frame_img;try{if(window.addEventListener){this.pic.addEventListener('onload',delegate(ref,yume_serve_cb_image(banner_div_id,banner_frame_id,frame_img,frame_link,frame_trackers)),false);}else if(window.attachEvent){this.pic.attachEvent('onload',delegate(ref,yume_serve_cb_image(banner_div_id,banner_frame_id,frame_img,frame_link,frame_trackers)));}}catch(e){}}
function yume_flash_callback(command,arg1,arg2,arg3,arg4,arg5){if(debug)alert(command+'  '+arg1+'  '+arg2+'  '+arg3+'  '+arg4+'  '+arg5);if(command=='companionbanner/iframe'||(command=='companionbanner/image'&&yume_img_is_swf(arg1)>0)){if(arg3=="cb1"||arg3=="cb_medrect1"){if(debug)alert(command+arg1+arg3);if(yume_serve_cb_frame("cb_medrect1_div","cb_medrect1_frame",arg1)>0){f_cb_medrect1_served=true;f_cb_medrect1_real=true;}}
if(arg3=="cb1"||arg3=="cb_31rect1"){if(yume_serve_cb_frame("cb_31rect_div","cb_31rect_frame",arg1)>0){f_cb_31rect_served=true;f_cb_31rect_real=true;}}}else if(command=='companionbanner/image'){if(arg3=="cb1"||arg3=="cb_medrect1"){if(arg5=="application/x-shockwave-flash"){if(yume_serve_cb_swf("cb_medrect1_div","cb_medrect1_frame",arg1,arg2,arg4)>0){f_cb_medrect1_served=true;f_cb_medrect1_real=true;}}else{var cb_medrect1_image=new obj.prototype.serveImage(this,"cb_medrect1_div","cb_medrect1_frame",arg1,arg2,arg4);}}
if(arg3=="cb1"||arg3=="cb_31rect1"){if(arg5=="application/x-shockwave-flash"){if(yume_serve_cb_swf("cb_31rect_div","cb_31rect_frame",arg1,arg2,arg4)>0){f_cb_31rect_served=true;f_cb_31rect_real=true;}}else{var cb_medrect1_image=new obj.prototype.serveImage(this,"cb_31rect_div","cb_31rect_frame",arg1,arg2,arg4);}}}else if(command=="yume_leader_start"||command=="yume_preroll_start"||command=="yume_postroll_start"||command=="yume_midroll_start"){f_need_cb=true;if(command=="yume_leader_start"){f_cb_medrect1_real=false;f_cb_medrect1_served=false;}
document.getElementById('cb_medrect1_div').style.display='block';}else if(command=="yume_leader_end"||command=="yume_preroll_end"||command=="yume_postroll_end"||command=="yume_midroll_end"){f_need_cb=false;}else if(command=="yume_ad_end"){f_cb_medrect1_served=false;f_cb_31rect_served=false;}else if((command=="yume_ad_start"&&f_need_cb==true)||(command=="yume_end"&&arg1=="0"&&f_need_cb==true)){if((f_cb_medrect1_served==false)&&(f_cb_medrect1_real==false)){if(yume_backfill_banner("cb_medrect1_div","cb_medrect1_frame","medrect")>0){f_cb_medrect1_served=true;}}}}