var TC_Tools={render:function(e){var k=(e.master)?"tc_tools_aid_"+e.siteID:"tc_tools_uid_"+e.siteID;var b=TC_Tools.getCookie(k);var h="";var m="";var j="";var i="http://"+e.analytics;var c="a_aid="+e.affiliate+"&tool="+e.toolID+"&url="+encodeURIComponent(e.target);var a="border: none; width: "+e.width+"px; height: "+e.height+"px;";if(!b){b=TC_Tools.guid();TC_Tools.setCookie(k,b,30,"/")}if(e.serial){c=c+"&serial="+e.serial}if(e.master){c=c+"&master=1"}c=c+"&uid="+b;h=i+"/impression?"+c;m=i+"/click?"+c;switch(e.type){case"widget":var l="http://widgets."+e.domain;j='<iframe src="'+l+"?"+c+'" style="'+a+'"></iframe>';break;case"image":j='<a href="'+m+'"><img src="'+e.content+'" style="'+a+'" alt="" /></a>';break;case"flash":var f=encodeURIComponent(m);j='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" width="'+e.width+'" height="'+e.height+'"> <param name="movie" value="'+e.content+"?clickTAG="+f+'"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <embed src="'+e.content+"?clickTAG="+f+'" width="'+e.width+'" height="'+e.height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"> </embed> </object>';break;case"html":j=e.content.replace("%click",m);break;case"video":var d=e.assets+"/images/watermarks/"+e.partner+"-"+e.watermark+".png";j='<div style="width: '+e.width+'px;"> <div style="height: '+(e.height-40)+'px; "> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" width="100%" height="100%"> <param name="movie" value="'+e.assets+'/jwplayer-5.6/player.swf"></param> <param name="allowfullscreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <param name="flashvars" value="file='+e.content+"&image="+e.preview+"&logo.file="+d+'"></param> <param name="wmode" value="transparent"></param> <embed src="'+e.assets+'/jwplayer-5.6/player.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="100%" wmode="transparent" flashvars="file='+e.content+"&image="+e.preview+"&logo.file="+d+'"> </embed> </object> </div> <div class="tc-player-footer" style="direction: '+e.direction+'"> <a class="tc-player-link-button" href="'+m+'">'+e.join+'</a> <div class="tc-player-clear"></div> </div> </div>';var g=document.createElement("link");g.setAttribute("rel","stylesheet");g.setAttribute("type","text/css");g.setAttribute("href",e.cdn+"/partners/"+e.partner+"/css/player-"+e.version+".css");document.getElementsByTagName("head")[0].appendChild(g);break}h='<img src="'+h+'" style="width: 1px; height: 1px;"/>';document.write(j+h)},getCookie:function(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if((!d)&&(c!=document.cookie.substring(0,c.length))){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))},setCookie:function(c,e,a,h,d,g){var b=new Date();b.setTime(b.getTime());if(a){a=a*1000*60*60*24}var f=new Date(b.getTime()+(a));document.cookie=c+"="+escape(e)+((a)?";expires="+f.toGMTString():"")+((h)?";path="+h:"")+((d)?";domain="+d:"")+((g)?";secure":"")},guid:function(){var a=function(){return(((1+Math.random())*65536)|0).toString(16).substring(1)};return(a()+a()+a()+a()+a()+a()+a()+a())}};
