AdCruOb=new function(){function urlencode(str){return escape(str).replace(/\+/g,'%2B').replace(/%20/g,'+').replace(/\*/g,'%2A').replace(/\//g,'%2F').replace(/@/g,'%40');}
function appendToHead(elementToAppend){document.getElementsByTagName('head')[0].appendChild(elementToAppend);}
function scriptElementWithSrc(scriptUrl){var newScript=document.createElement('script');newScript.type="text/javascript";newScript.src=scriptUrl;return newScript;}
function scriptElementWithText(scriptText){var newScript=document.createElement('script');newScript.type="text/javascript";newScript.text=scriptText;return newScript;}
function truncate(longString,maxLength){if(longString.length>maxLength){return longString.substring(0,maxLength-3)+"...";}else{return longString;}}
function addLinksToTweet(tweet){var tweetProcessor={link:function(tweet){return tweet.replace(/\b(((https*\:\/\/)|www\.).+?)(([!?,.\)]+)?(\s|$))/g,function(unusedH,url,schema,unusedD,suffix){var impliedSchema=schema.match(/w/)?"http://":"";return'<a href="'+impliedSchema+url+'">'+url+"</a>"+suffix;})},at:function(tweet){return tweet.replace(/\B\@([a-zA-Z0-9_]{1,20})/g,function(unusedC,username){return'@<a href="http://twitter.com/'+username+'">'+username+"</a>";})},list:function(tweet){return tweet.replace(/\B\@([a-zA-Z0-9_]{1,20}\/\w+)/g,function(unusedC,list){return'@<a href="http://twitter.com/'+list+'">'+list+"</a>";})},hash:function(tweet){return tweet.replace(/\B\#(\w+)/gi,function(unusedC,hashTag){return'<a href="http://twitter.com/search?q=%23'+hashTag+'">#'+hashTag+"</a>";})},markupTweet:function(tweet){return this.hash(this.at(this.list(this.link(tweet))))}};return tweetProcessor.markupTweet(tweet);}
if(typeof adcru_twitter_username=="undefined"){adcru_twitter_username="";}
if(typeof adcru_external_id!="undefined"){var external_id=adcru_external_id.substring(0,64);}else{var external_id="";}
var STYLESHEET_URL='http://api.adcru.com/css/ad_widget.css';var PARAMS={"version":20100102,"format":"json","site":window.location.href,"app_id":adcru_app_id,"external_id":external_id,"twitter_username":adcru_twitter_username,"json_prefix":"AdCruOb.serverResponse(","json_suffix":");"};var AD_URL_BASE="http://api.adcru.com/offer_request/?";var ROOT_DIV_ID="adcruData";var MIN_LANDSCAPE_ASPECT_RATIO=3;var renderTime=0;function reportEvent(requestId,mouseover){var date=new Date();var currentTime=date.getTime();var elapsedTime=Math.ceil(currentTime-renderTime);if(elapsedTime<=0){elapsedTime=1;}
var url="http://api.adcru.com/ad_event/?request_id="+urlencode(requestId)+"&visibility_time="+elapsedTime+"&mouseover="+(mouseover?1:0);var eventElement=scriptElementWithSrc(url);appendToHead(eventElement);}
function requestStylesheet(stylesheet_url){var stylesheet=document.createElement("link");stylesheet.rel="stylesheet";stylesheet.type="text/css";stylesheet.href=stylesheet_url;stylesheet.media="all";document.lastChild.firstChild.appendChild(stylesheet);}
function adRequestUrl(){var paramPairs=[];for(var paramKey in PARAMS){paramPairs.push(urlencode(paramKey)+"="+urlencode(PARAMS[paramKey]))}
var queryString=paramPairs.join("&");return AD_URL_BASE+queryString;}
function requestAds(){var adsElement=scriptElementWithSrc(adRequestUrl());appendToHead(adsElement);}
function stripPx(dimensionStr){if(/px$/.test(dimensionStr)){return dimensionStr.substr(0,dimensionStr.length-2);}else{return dimensionStr;}}
this.render1p=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return 15;}
this.renderJavascript=function(response_data){if(typeof response_data.unit_name=="undefined"){js='function adcru_refresh_total() { }';}else{js='function adcru_refresh_total() {   all_are_checked = true;   checkboxes = document.getElementsByName("adcru_ticket");   var sum = 0;   for (var i = 0; i < checkboxes.length; i++) {     var adcruTicketId = document.getElementsByName( checkboxes[i].value )[0];     if (checkboxes[i].checked == true) {       sum += parseInt(adcruTicketId.value);     }     if(!checkboxes[i].checked) {       all_are_checked = false;     }   }   (document.getElementById("adcruNumTokens")).firstChild.data = "" + sum;   (document.getElementById("ui1-adcruSelectAll")).checked = all_are_checked; }';}
js+='function adcru_select_all(should_be_selected) {   checkboxes = document.getElementsByName("adcru_ticket");   for (var i = 0; i < checkboxes.length; i++) {     checkboxes[i].checked = should_be_selected;   } } function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } ';return js;}
this.renderHeader=function(response_data,callToAction){html=' <form id="adcruForm" method="post" action="http://api.adcru.com/offer_submit/">   <div id="ui1-adcruTopBar">     <input type="hidden" name="request_id" value="'+response_data.request_id+'" />     <div id="ui1-adcruCallToAction">'+callToAction+'</div>     <input type="checkbox" id="ui1-adcruSelectAll" onClick="adcru_select_all(this.checked); adcru_refresh_total(); return true;" />     <label for="ui1-adcruSelectAll"><span id="ui1-adcruSelectAllPrompt">Select All</span></label>   </div>   <div id="ui1-adcruScrollingTable">     <table id="ui1-adcruScrollingTableTable" cellpadding="0"> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){ad_description=ad.description;if(ad_description.length>140){ad_description=ad_description.substring(0,137)+"...";}
html=' <tr><td colspan=2 class="ui1-adcruOfferRow">   <table width="100%" cellpadding="0" border="0">     <tr>       <td class="ui1-adcruOfferCheckboxAndImageContainer">         <input id="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'" class="ui1-adcruScrollingTableCheckbox" type="checkbox" name="adcru_ticket" onClick="adcru_refresh_total(); return true;" value="'+ad.ticket_id+'">         <input type="hidden" name="'+ad.ticket_id+'" value="'+ad.units+'"/>         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'"><img class="ui1-adcruScrollingTableImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/></label>       </td>       <td class="ui1-imageToTextSpacer"></td>       <td class="ui1-adcruOfferText">         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'">             <span class="ui1-adcruOfferHeadline">                 <span class="ui1-adcruOfferUser">'+ad.display_name+'</span>';if(typeof ad.units!="undefined"&&typeof ad.unitName!="undefined"){html+='<br/>'+ad.units+' '+ad.unitName;}
html+='             </span>             <br/>             <span class="ui1-adcruOfferDetail">'+ad_description+'</span>         </label>       </td>     </tr>   </table> </td></tr> ';return html;}
this.renderFooter=function(response_data){html=' </table> </div> <div id="ui1-adcruBottomBar" >     <div id="ui1-adcruBottomBarContents">         <table>             <tr>';if(typeof response_data.unit_name!="undefined"){html+='                 <td>                     You will receive <span id="adcruNumTokens">0</span> '+response_data.unit_name+'.                 </td>                 ';}
html+='                 <td>                    <div                             onclick="adcruSubmitForm(\'adcruForm\')"                     >                         <img class="ui1-adcruFollowUsButton" src="http://twitter-badges.s3.amazonaws.com/follow_us-b.png" alt="Follow us on Twitter" id="adcruFollowButton" />                     </div>                 </td>             </tr>         </table>     </div> </div> </form> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height-76;document.getElementById("ui1-adcruScrollingTable").style.height=scrollingTableHeight+"px";}}
this.render1l=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return Math.floor(width/200.0);}
this.renderJavascript=function(response_data){js=" function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); }     ";return js;}
this.renderHeader=function(response_data,callToAction){html=' <div id="ui1l-adcruContainer">     <table id="ui1l-adcruContainerTable" cellpadding="0">         <tr> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){var ad_description=truncate(ad.description,100);html=' <td width="'+(100.0/numAdsToRender)+'%">     <div     >         <table>             <tr>                 <td valign="top" align="left">                     <div class="ui1l-adcruImageContainer">                         <img class="ui1l-adcruImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/>                     </div>                 </td>                 <td class="ui1l-adcruOfferTextContainer" valign="top" align="left">                     <span class="ui1l-adcruOfferHeadline">                         <span class="ui1l-adcruOfferUser">'+ad.display_name+'</span>                     </span>                     <br/>                     <span class="ui1l-adcruDescription">'+ad_description+'</span>                 </td>             </tr>             <tr>                 <td colspan="2" align="left">                     <form id="adcruForm'+ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+response_data.request_id+'" />                         <input type="hidden" name="adcru_ticket" value="'+ad.ticket_id+'"/>                         <div                                 onclick="adcruSubmitForm(\'adcruForm'+ad.ticket_id+'\')"                         >                             <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+ad.ticket_id+'" alt="Follow me on Twitter" />                         </div>                     </form>                 </td>             </tr>         </table>     </div> </td> ';return html;}
this.renderFooter=function(response_data){html='         </tr>     </table> </div> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height;document.getElementById("ui1l-adcruContainer").style.height=scrollingTableHeight+"px";}}
this.render2p=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return 15;}
this.renderJavascript=function(response_data){if(typeof response_data.unit_name=="undefined"){js='function adcru_refresh_total() { }';}else{js='function adcru_refresh_total() {   all_are_checked = true;   checkboxes = document.getElementsByName("adcru_ticket");   var sum = 0;   for (var i = 0; i < checkboxes.length; i++) {     var adcruTicketId = document.getElementsByName( checkboxes[i].value )[0];     if (checkboxes[i].checked == true) {       sum += parseInt(adcruTicketId.value);     }     if(!checkboxes[i].checked) {       all_are_checked = false;     }   }   (document.getElementById("adcruNumTokens")).firstChild.data = "" + sum;   (document.getElementById("ui1-adcruSelectAll")).checked = all_are_checked; }';}
js+='function adcru_select_all(should_be_selected) {   checkboxes = document.getElementsByName("adcru_ticket");   for (var i = 0; i < checkboxes.length; i++) {     checkboxes[i].checked = should_be_selected;   } } function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } ';js+=" function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_us-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_us-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_us-c.png';}
html=' <form id="adcruForm" method="post" action="http://api.adcru.com/offer_submit/">   <div id="ui1-adcruTopBar">     <input type="hidden" name="request_id" value="'+response_data.request_id+'" />     <div id="ui1-adcruCallToAction">'+callToAction+'</div>     <input type="checkbox" id="ui1-adcruSelectAll" onClick="adcru_select_all(this.checked); adcru_refresh_total(); return true;" />     <label for="ui1-adcruSelectAll"><span id="ui1-adcruSelectAllPrompt">Select All</span></label>   </div>   <div id="ui1-adcruScrollingTable">     <table id="ui1-adcruScrollingTableTable" cellpadding="0"> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){ad_description=ad.description;if(ad_description.length>140){ad_description=ad_description.substring(0,137)+"...";}
html=' <tr><td colspan=2 class="ui1-adcruOfferRow">   <table width="100%" cellpadding="0" border="0">     <tr>       <td class="ui1-adcruOfferCheckboxAndImageContainer">         <input id="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'" class="ui1-adcruScrollingTableCheckbox" type="checkbox" name="adcru_ticket" onClick="adcru_refresh_total(); return true;" value="'+ad.ticket_id+'">         <input type="hidden" name="'+ad.ticket_id+'" value="'+ad.units+'"/>         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'"><img class="ui1-adcruScrollingTableImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/></label>       </td>       <td class="ui1-imageToTextSpacer"></td>       <td class="ui1-adcruOfferText">         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'">             <span class="ui1-adcruOfferHeadline">                 <span class="ui1-adcruOfferUser">'+ad.display_name+'</span>';if(typeof ad.units!="undefined"&&typeof ad.unitName!="undefined"){html+='<br/>'+ad.units+' '+ad.unitName;}
html+='             </span>             <br/>             <span class="ui1-adcruOfferDetail">'+ad_description+'</span>         </label>       </td>     </tr>   </table> </td></tr> ';return html;}
this.renderFooter=function(response_data){html=' </table> </div> <div id="ui1-adcruBottomBar" >     <div id="ui1-adcruBottomBarContents">         <table>             <tr>';if(typeof response_data.unit_name!="undefined"){html+='                 <td>                     You will receive <span id="adcruNumTokens">0</span> '+response_data.unit_name+'.                 </td>                 ';}
html+='                 <td>                    <div                             onclick="adcruSubmitForm(\'adcruForm\')"                                 onmouseover = "adcruRollover(\'adcruFollowButton\')"                                 onmouseout = "adcruRollout(\'adcruFollowButton\')"                     >                         <img class="ui1-adcruFollowUsButton" src="http://twitter-badges.s3.amazonaws.com/follow_us-b.png" alt="Follow us on Twitter" id="adcruFollowButton" />                     </div>                 </td>             </tr>         </table>     </div> </div> </form> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height-76;document.getElementById("ui1-adcruScrollingTable").style.height=scrollingTableHeight+"px";}}
this.render2l=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return Math.floor(width/200.0);}
this.renderJavascript=function(response_data){js=" function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); }     ";js+=" function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_me-c.png';}
html=' <div id="ui1l-adcruContainer">     <table id="ui1l-adcruContainerTable" cellpadding="0">         <tr> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){var ad_description=truncate(ad.description,100);html=' <td width="'+(100.0/numAdsToRender)+'%">     <div     >         <table>             <tr>                 <td valign="top" align="left">                     <div class="ui1l-adcruImageContainer">                         <img class="ui1l-adcruImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/>                     </div>                 </td>                 <td class="ui1l-adcruOfferTextContainer" valign="top" align="left">                     <span class="ui1l-adcruOfferHeadline">                         <span class="ui1l-adcruOfferUser">'+ad.display_name+'</span>                     </span>                     <br/>                     <span class="ui1l-adcruDescription">'+ad_description+'</span>                 </td>             </tr>             <tr>                 <td colspan="2" align="left">                     <form id="adcruForm'+ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+response_data.request_id+'" />                         <input type="hidden" name="adcru_ticket" value="'+ad.ticket_id+'"/>                         <div                                 onclick="adcruSubmitForm(\'adcruForm'+ad.ticket_id+'\')"                                     onmouseover = "adcruRollover(\'adcruFollowButton'+ad.ticket_id+'\')"                                     onmouseout = "adcruRollout(\'adcruFollowButton'+ad.ticket_id+'\')"                         >                             <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+ad.ticket_id+'" alt="Follow me on Twitter" />                         </div>                     </form>                 </td>             </tr>         </table>     </div> </td> ';return html;}
this.renderFooter=function(response_data){html='         </tr>     </table> </div> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height;document.getElementById("ui1l-adcruContainer").style.height=scrollingTableHeight+"px";}}
this.render3p=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return 15;}
this.renderJavascript=function(response_data){if(typeof response_data.unit_name=="undefined"){js='function adcru_refresh_total() { }';}else{js='function adcru_refresh_total() {   all_are_checked = true;   checkboxes = document.getElementsByName("adcru_ticket");   var sum = 0;   for (var i = 0; i < checkboxes.length; i++) {     var adcruTicketId = document.getElementsByName( checkboxes[i].value )[0];     if (checkboxes[i].checked == true) {       sum += parseInt(adcruTicketId.value);     }     if(!checkboxes[i].checked) {       all_are_checked = false;     }   }   (document.getElementById("adcruNumTokens")).firstChild.data = "" + sum;   (document.getElementById("ui1-adcruSelectAll")).checked = all_are_checked; }';}
js+='function adcru_select_all(should_be_selected) {   checkboxes = document.getElementsByName("adcru_ticket");   for (var i = 0; i < checkboxes.length; i++) {     checkboxes[i].checked = should_be_selected;   } } function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } ';js+=" function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_us-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_us-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_us-c.png';}
html=' <form id="adcruForm" method="post" action="http://api.adcru.com/offer_submit/">   <div id="ui1-adcruTopBar">     <input type="hidden" name="request_id" value="'+response_data.request_id+'" />     <div id="ui1-adcruCallToAction">'+callToAction+'</div>     <input type="checkbox" id="ui1-adcruSelectAll" onClick="adcru_select_all(this.checked); adcru_refresh_total(); return true;" />     <label for="ui1-adcruSelectAll"><span id="ui1-adcruSelectAllPrompt">Select All</span></label>   </div>   <div id="ui1-adcruScrollingTable">     <table id="ui1-adcruScrollingTableTable" cellpadding="0"> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){ad_description=ad.description;if(ad_description.length>140){ad_description=ad_description.substring(0,137)+"...";}
html=' <tr><td colspan=2 class="ui1-adcruOfferRow">   <table width="100%" cellpadding="0" border="0">     <tr>       <td class="ui1-adcruOfferCheckboxAndImageContainer">         <input id="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'" class="ui1-adcruScrollingTableCheckbox" type="checkbox" name="adcru_ticket" onClick="adcru_refresh_total(); return true;" value="'+ad.ticket_id+'">         <input type="hidden" name="'+ad.ticket_id+'" value="'+ad.units+'"/>         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'"><img class="ui1-adcruScrollingTableImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/></label>       </td>       <td class="ui1-imageToTextSpacer"></td>       <td class="ui1-adcruOfferText">         <label for="ui1-adcruScrollingTableCheckbox'+ad.ticket_id+'">             <span class="ui1-adcruOfferHeadline">                 <span class="ui1-adcruOfferUser">'+ad.display_name+'</span>';if(typeof ad.units!="undefined"&&typeof ad.unitName!="undefined"){html+='<br/>'+ad.units+' '+ad.unitName;}
html+='             </span>             <br/>             <span class="ui1-adcruOfferDetail">'+ad_description+'</span>         </label>       </td>     </tr>   </table> </td></tr> ';return html;}
this.renderFooter=function(response_data){html=' </table> </div> <div id="ui1-adcruBottomBar"     onclick="adcruSubmitForm(\'adcruForm\')"         onmouseover = "adcruRollover(\'adcruFollowButton\')"         onmouseout = "adcruRollout(\'adcruFollowButton\')" >     <div id="ui1-adcruBottomBarContents">         <table>             <tr>';if(typeof response_data.unit_name!="undefined"){html+='                 <td>                     You will receive <span id="adcruNumTokens">0</span> '+response_data.unit_name+'.                 </td>                 ';}
html+='                 <td>                    <div                     >                         <img class="ui1-adcruFollowUsButton" src="http://twitter-badges.s3.amazonaws.com/follow_us-b.png" alt="Follow us on Twitter" id="adcruFollowButton" />                     </div>                 </td>             </tr>         </table>     </div> </div> </form> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height-76;document.getElementById("ui1-adcruScrollingTable").style.height=scrollingTableHeight+"px";}}
this.render3l=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return Math.floor(width/200.0);}
this.renderJavascript=function(response_data){js=" function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); }     ";js+=" function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_me-c.png';}
html=' <div id="ui1l-adcruContainer">     <table id="ui1l-adcruContainerTable" cellpadding="0">         <tr> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){var ad_description=truncate(ad.description,100);html=' <td width="'+(100.0/numAdsToRender)+'%">     <div         onclick="adcruSubmitForm(\'adcruForm'+ad.ticket_id+'\')"             onmouseover = "adcruRollover(\'adcruFollowButton'+ad.ticket_id+'\')"             onmouseout = "adcruRollout(\'adcruFollowButton'+ad.ticket_id+'\')"     >         <table>             <tr>                 <td valign="top" align="left">                     <div class="ui1l-adcruImageContainer">                         <img class="ui1l-adcruImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/>                     </div>                 </td>                 <td class="ui1l-adcruOfferTextContainer" valign="top" align="left">                     <span class="ui1l-adcruOfferHeadline">                         <span class="ui1l-adcruOfferUser">'+ad.display_name+'</span>                     </span>                     <br/>                     <span class="ui1l-adcruDescription">'+ad_description+'</span>                 </td>             </tr>             <tr>                 <td colspan="2" align="left">                     <form id="adcruForm'+ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+response_data.request_id+'" />                         <input type="hidden" name="adcru_ticket" value="'+ad.ticket_id+'"/>                         <div                         >                             <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+ad.ticket_id+'" alt="Follow me on Twitter" />                         </div>                     </form>                 </td>             </tr>         </table>     </div> </td> ';return html;}
this.renderFooter=function(response_data){html='         </tr>     </table> </div> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height;document.getElementById("ui1l-adcruContainer").style.height=scrollingTableHeight+"px";}}
this.render4p=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return Math.floor(height/100.0);}
this.renderJavascript=function(response_data){js=" function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_me-c.png';}
html=' <div id="ui1l-adcruContainer">     <table id="ui1l-adcruContainerTable" cellpadding="0"> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){ad_description=ad.description;if(ad_description.length>140){ad_description=ad_description.substring(0,137)+"...";}
html=' <tr>     <td>         <div             onclick="adcruSubmitForm(\'adcruForm'+ad.ticket_id+'\')"             onmouseover = "adcruRollover(\'adcruFollowButton'+ad.ticket_id+'\')"             onmouseout = "adcruRollout(\'adcruFollowButton'+ad.ticket_id+'\')"         >             <table cellpadding="5">                 <tr>                     <td valign="top" rowspan="2" align="left">                         <div class="ui1l-adcruImageContainer">                             <img class="ui1l-adcruImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/>                         </div>                     </td>                     <td class="ui1l-adcruOfferTextContainer" valign="top" align="left">                         <span class="ui1l-adcruOfferHeadline">                             <span class="ui1l-adcruOfferUser">'+ad.display_name+'</span>                         </span>                         <br/>                         <span class="ui1l-adcruDescription">'+ad_description+'</span>                     </td>                 </tr>                 <tr>                     <td align="left">                         <form id="adcruForm'+ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/" style="margin: 0; padding: 0;">                             <input type="hidden" name="request_id" value="'+response_data.request_id+'" />                             <input type="hidden" name="adcru_ticket" value="'+ad.ticket_id+'"/>                             <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+ad.ticket_id+'" alt="Follow me on Twitter" />                         </form>                     </td>                 </tr>             </table>         </div>     </td> </tr> ';return html;}
this.renderFooter=function(response_data){html='     </table> </div> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height;document.getElementById("ui1l-adcruContainer").style.height=scrollingTableHeight+"px";}}
this.render4l=new function(){this.requiresJQuery=function(){return false;}
this.maximumRenderableAds=function(height,width){return Math.floor(width/200.0);}
this.renderJavascript=function(response_data){js=" function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); }     ";js+=" function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-c.png';     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = 'http://twitter-badges.s3.amazonaws.com/follow_me-b.png';     } } ";return js;}
this.renderHeader=function(response_data,callToAction){if(document.images){rolloverButtonImage=new Image();rolloverButtonImage.src='http://twitter-badges.s3.amazonaws.com/follow_me-c.png';}
html=' <div id="ui1l-adcruContainer">     <table id="ui1l-adcruContainerTable" cellpadding="0">         <tr> ';return html;}
this.renderAd=function(response_data,ad,numAdsToRender){var ad_description=truncate(ad.description,100);html=' <td width="'+(100.0/numAdsToRender)+'%">     <div         onclick="adcruSubmitForm(\'adcruForm'+ad.ticket_id+'\')"             onmouseover = "adcruRollover(\'adcruFollowButton'+ad.ticket_id+'\')"             onmouseout = "adcruRollout(\'adcruFollowButton'+ad.ticket_id+'\')"     >         <table>             <tr>                 <td valign="top" align="left">                     <div class="ui1l-adcruImageContainer">                         <img class="ui1l-adcruImage" src="'+ad.profile_image_url+'" alt="'+ad.username+'"/>                     </div>                 </td>                 <td class="ui1l-adcruOfferTextContainer" valign="top" align="left">                     <span class="ui1l-adcruOfferHeadline">                         <span class="ui1l-adcruOfferUser">'+ad.display_name+'</span>                     </span>                     <br/>                     <span class="ui1l-adcruDescription">'+ad_description+'</span>                 </td>             </tr>             <tr>                 <td colspan="2" align="left">                     <form id="adcruForm'+ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+response_data.request_id+'" />                         <input type="hidden" name="adcru_ticket" value="'+ad.ticket_id+'"/>                         <div                         >                             <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+ad.ticket_id+'" alt="Follow me on Twitter" />                         </div>                     </form>                 </td>             </tr>         </table>     </div> </td> ';return html;}
this.renderFooter=function(response_data){html='         </tr>     </table> </div> ';return html;}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px";target_div.style.WebkitBorderRadius="5px";scrollingTableHeight=height;document.getElementById("ui1l-adcruContainer").style.height=scrollingTableHeight+"px";}}
this.render5p=new function(){var loadedAdvertisers=[];var currentAdvertiser=-1;var adHeight;adcruAutorotate=true;this.requiresJQuery=function(){return true;}
this.maximumRenderableAds=function(height,width){return 15;}
this.renderJavascript=function(response_data){js=' function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = "http://twitter-badges.s3.amazonaws.com/follow_me-c.png";     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = "http://twitter-badges.s3.amazonaws.com/follow_me-b.png";     } } function stopRotation() {     adcruAutorotate = false; } function resumeRotation() {     adcruAutorotate = true; } ';return js;}
this.renderHeader=function(response_data,callToAction){if(adcru_twitter_username!=""){var userPrompt="for @"+adcru_twitter_username;}else{var userPrompt="Twitter users";}
return' <div id="ui5-adcruContainer" onmouseover="stopRotation();" onmouseout="resumeRotation();">     <div id="ui5-adcruTopBar">         <div id="ui1-adcruCallToAction">Suggested '+userPrompt+'</div>     </div>     <div id="ui5-adcruAdvertiserContainer"> ';}
this.renderAd=function(response_data,ad,numAdsToRender){var twitterUrl="http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+urlencode(ad.username)+"&callback=?";$adcru.getJSON(twitterUrl,function(data){var advertiserData={"profile":data[0].user,"ad":ad,"tweets":data};advertiserDidLoad(advertiserData,response_data.request_id);loadedAdvertisers.push(advertiserData);if(loadedAdvertisers.length==1){refreshAdvertiserDisplay();setInterval(refreshAdvertiserDisplay,10000);}});return'<div id="ui5-adcruAdvertiser-'+ad.ticket_id+'" class="ui5-adcruAdvertiserDetails"></div>';}
this.renderFooter=function(response_data){return'    </div> </div> ';}
var advertiserDidLoad=function(advertiserData,requestId){var profileMarkup='<div     id="ui5-adcruAdvertiserProfile-'+advertiserData.ad.ticket_id+'"     class="ui5-adcruAdvertiserProfile"     onclick="adcruSubmitForm(\'adcruForm'+advertiserData.ad.ticket_id+'\')"     onmouseover="adcruRollover(\'adcruFollowButton'+advertiserData.ad.ticket_id+'\')"     onmouseout="adcruRollout(\'adcruFollowButton'+advertiserData.ad.ticket_id+'\')" >     <table>         <tr>             <td rowspan="2" valign="top">                 <img src="'+advertiserData.profile.profile_image_url+'" alt="Profile image" class="ui5-adcruAdvertiserImage">             </td>             <td align="left">                 <span class="ui5-adcruAdvertiserName">'+advertiserData.profile.name+'</span>             </td>             <td rowspan="2">                 &nbsp;             </td>             <td rowspan="2" valign="top">                 <span class="ui5-adcruAdvertiserGraphCount">'+advertiserData.profile.followers_count+'<br/>followers</span>             </td>         </tr>         <tr>             <td valign="top" align="left">                 <span class="ui5-adcruAdvertiserDescription">'+truncate(advertiserData.profile.description,100)+'</span>             </td>         </tr>         <tr>             <td align="center" colspan="4">                 <div class="ui5-adcruFollowMeButton ui5p-adcruFollowMeButton">                     <form id="adcruForm'+advertiserData.ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+requestId+'" />                         <input type="hidden" name="adcru_ticket" value="'+advertiserData.ad.ticket_id+'"/>                         <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+advertiserData.ad.ticket_id+'" alt="Follow me on Twitter" />                     </form>                 </div>             </td>         </tr>     </table> </div> ';var tweetsMarkup='<div id="ui5-adcruAdvertiserTweetsTableContainer-'+advertiserData.ad.ticket_id+'" class="ui5-adcruAdvertiserTweetsTableContainer">     <table class="ui5-adcruAdvertiserTweetsTable ui5p-adcruAdvertiserTweetsTable"> ';var tweetCount=advertiserData.tweets.length;for(var tweetIndex=0;tweetIndex<tweetCount;tweetIndex++){var tweet=advertiserData.tweets[tweetIndex];if(tweet.in_reply_to_status_id==null){tweetsMarkup+='        <tr>             <td>                 <div class="ui5-adcruAdvertiserTweet">'+addLinksToTweet(tweet.text)+'</div>             </td>         </tr> ';}}
tweetsMarkup+='    </table> </div> ';$adcru("#ui5-adcruAdvertiser-"+advertiserData.ad.ticket_id).html(profileMarkup+tweetsMarkup).fadeOut(0);}
var refreshAdvertiserDisplay=function(){if(loadedAdvertisers.length==0||!adcruAutorotate){return;}
displayNewAdvertiser=function(){currentAdvertiser=(currentAdvertiser+1)%loadedAdvertisers.length;var advertiserToDisplay=loadedAdvertisers[currentAdvertiser];$adcru("#ui5-adcruAdvertiser-"+advertiserToDisplay.ad.ticket_id).fadeIn();var topBarHeight=$adcru("#ui5-adcruTopBar").outerHeight(true);var profileHeight=$adcru("#ui5-adcruAdvertiserProfile-"+advertiserToDisplay.ad.ticket_id).outerHeight(true);var tweetsContainerHeight=adHeight-profileHeight-topBarHeight;$adcru("#ui5-adcruAdvertiserTweetsTableContainer-"+advertiserToDisplay.ad.ticket_id).height(tweetsContainerHeight);}
if(currentAdvertiser!=-1){var advertiserToHide=loadedAdvertisers[currentAdvertiser];$adcru("#ui5-adcruAdvertiser-"+advertiserToHide.ad.ticket_id).fadeOut("fast",displayNewAdvertiser);}else{displayNewAdvertiser();}}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px 5px 0 0";target_div.style.WebkitBorderRadius="5px 5px 0 0";adHeight=height;}}
this.render5l=new function(){var loadedAdvertisers=[];var currentAdvertiser=-1;var adHeight;var adWidth;adcruAutorotate=true;this.requiresJQuery=function(){return true;}
this.maximumRenderableAds=function(height,width){return 15;}
this.renderJavascript=function(response_data){js=' function adcruSubmitForm(divId) {     formDiv = document.getElementById(divId);     formDiv.submit(); } function adcruRollover(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = "http://twitter-badges.s3.amazonaws.com/follow_me-c.png";     } } function adcruRollout(followButtonId) {     if(document.images) {         document.getElementById(followButtonId).src = "http://twitter-badges.s3.amazonaws.com/follow_me-b.png";     } } function stopRotation() {     adcruAutorotate = false; } function resumeRotation() {     adcruAutorotate = true; } ';return js;}
this.renderHeader=function(response_data,callToAction){if(adcru_twitter_username!=""){var userPrompt="for @"+adcru_twitter_username;}else{var userPrompt="Twitter users";}
return' <div id="ui5-adcruContainer" onmouseover="stopRotation();" onmouseout="resumeRotation();">     <div id="ui5-adcruAdvertiserContainer"> ';}
this.renderAd=function(response_data,ad,numAdsToRender){var twitterUrl="http://api.twitter.com/1/statuses/user_timeline.json?screen_name="+urlencode(ad.username)+"&callback=?";$adcru.getJSON(twitterUrl,function(data){var advertiserData={"profile":data[0].user,"ad":ad,"tweets":data};advertiserDidLoad(advertiserData,response_data.request_id);loadedAdvertisers.push(advertiserData);if(loadedAdvertisers.length==1){refreshAdvertiserDisplay();setInterval(refreshAdvertiserDisplay,10000);}});return'<div id="ui5-adcruAdvertiser-'+ad.ticket_id+'" class="ui5-adcruAdvertiserDetails"></div>';}
this.renderFooter=function(response_data){return'    </div> </div> ';}
var advertiserDidLoad=function(advertiserData,requestId){var profileMarkup='<div     id="ui5-adcruAdvertiserProfile-'+advertiserData.ad.ticket_id+'"     class="ui5-adcruAdvertiserProfile ui5l-adcruAdvertiserProfile"     onclick="adcruSubmitForm(\'adcruForm'+advertiserData.ad.ticket_id+'\')"     onmouseover="adcruRollover(\'adcruFollowButton'+advertiserData.ad.ticket_id+'\')"     onmouseout="adcruRollout(\'adcruFollowButton'+advertiserData.ad.ticket_id+'\')" >     <table cellpadding="0" cellspacing="0">         <tr>             <td rowspan="2" valign="top">                 <img src="'+advertiserData.profile.profile_image_url+'" alt="Profile image" class="ui5-adcruAdvertiserImage">             </td>             <td align="left">                 <span class="ui5-adcruAdvertiserName">'+advertiserData.profile.name+'</span>             </td>         </tr>         <tr>             <td valign="top">                 <span class="ui5-adcruAdvertiserGraphCount">'+advertiserData.profile.followers_count+' followers</span>             </td>         </tr>         <tr>             <td align="left" colspan="2">                 <div class="ui5-adcruFollowMeButton ui5l-adcruFollowMeButton">                     <form id="adcruForm'+advertiserData.ad.ticket_id+'" method="post" action="http://api.adcru.com/offer_submit/">                         <input type="hidden" name="request_id" value="'+requestId+'" />                         <input type="hidden" name="adcru_ticket" value="'+advertiserData.ad.ticket_id+'"/>                         <img src="http://twitter-badges.s3.amazonaws.com/follow_me-b.png" id="adcruFollowButton'+advertiserData.ad.ticket_id+'" alt="Follow me on Twitter" />                     </form>                 </div>             </td>         </tr>     </table> </div> ';var tweetsMarkup='<div id="ui5-adcruAdvertiserTweetsTableContainer-'+advertiserData.ad.ticket_id+'" class="ui5-adcruAdvertiserTweetsTableContainer">     <table class="ui5-adcruAdvertiserTweetsTable ui5l-adcruAdvertiserTweetsTable"> ';var tweetCount=advertiserData.tweets.length;for(var tweetIndex=0;tweetIndex<tweetCount;tweetIndex++){var tweet=advertiserData.tweets[tweetIndex];if(tweet.in_reply_to_status_id==null){tweetsMarkup+='        <tr>             <td>                 <div class="ui5-adcruAdvertiserTweet">'+addLinksToTweet(tweet.text)+'</div>             </td>         </tr> ';}}
tweetsMarkup+='    </table> </div> ';var landscapeMarkup='<div>     <div style="float: left">             '+profileMarkup+'     </div>     <div style="float: right">             '+tweetsMarkup+'     </div>     <div style="clear: both">     </div> </div> ';$adcru("#ui5-adcruAdvertiser-"+advertiserData.ad.ticket_id).html(landscapeMarkup).fadeOut(0);}
var refreshAdvertiserDisplay=function(){if(loadedAdvertisers.length==0||!adcruAutorotate){return;}
displayNewAdvertiser=function(){currentAdvertiser=(currentAdvertiser+1)%loadedAdvertisers.length;var advertiserToDisplay=loadedAdvertisers[currentAdvertiser];$adcru("#ui5-adcruAdvertiser-"+advertiserToDisplay.ad.ticket_id).fadeIn();$adcru("#ui5-adcruAdvertiserTweetsTableContainer-"+advertiserToDisplay.ad.ticket_id).height(adHeight);var profileElement=$adcru("#ui5-adcruAdvertiserProfile-"+advertiserToDisplay.ad.ticket_id);var maxProfileWidth=adWidth*0.5;var currentProfileWidth=profileElement.outerWidth(true);var profileWidth=Math.min(currentProfileWidth,maxProfileWidth);profileElement.width(profileWidth);profileElement.outerHeight(adHeight);var fudgePadding=20;var tweetsContainerWidth=adWidth-profileWidth-fudgePadding;$adcru("#ui5-adcruAdvertiserTweetsTableContainer-"+advertiserToDisplay.ad.ticket_id).width(tweetsContainerWidth);}
if(currentAdvertiser!=-1){var advertiserToHide=loadedAdvertisers[currentAdvertiser];$adcru("#ui5-adcruAdvertiser-"+advertiserToHide.ad.ticket_id).fadeOut("fast",displayNewAdvertiser);}else{displayNewAdvertiser();}}
this.styleTargetDiv=function(target_div,bg_color,text_color,height,width){if(bg_color==""){bg_color='#ccc';}
target_div.style.backgroundColor=bg_color;target_div.style.color=text_color;target_div.style.height=height+"px";target_div.style.width=width+"px";target_div.style.fontFamily="Helvetica";target_div.style.border="1px solid #888";target_div.style.MozBorderRadius="5px 0 0 5px";target_div.style.WebkitBorderRadius="5px 0 0 5px";adHeight=height;adWidth=width;}}
this.render=function(targetDiv,responseData){var uiStrategy=responseData.ui_strategy;if(typeof uiStrategy!="number"){uiStrategy=1;}
var height=stripPx(adcru_height);var width=stripPx(adcru_width);var aspectRatio=width/height;var isLandscape=aspectRatio>=MIN_LANDSCAPE_ASPECT_RATIO;var orientationSuffix=isLandscape?"l":"p";var renderer=eval("this.render"+uiStrategy+orientationSuffix+";");finishRendering=function(){var renderedScript=renderer.renderJavascript(responseData);var renderedScriptElement=scriptElementWithText(renderedScript);appendToHead(renderedScriptElement);if(typeof adcru_call_to_action!="undefined"){var callToAction=adcru_call_to_action;}else{var callToAction="Suggested Twitter Users";}
var renderedHtml=renderer.renderHeader(responseData,callToAction);var maximumRenderableAds=renderer.maximumRenderableAds(height,width);var numAdsToRender=Math.min(maximumRenderableAds,responseData.ads.length);for(var adIndex in responseData.ads){if(adIndex<maximumRenderableAds){renderedHtml+=renderer.renderAd(responseData,responseData.ads[adIndex],numAdsToRender);}}
renderedHtml+=renderer.renderFooter(responseData);targetDiv.innerHTML=renderedHtml;var bgColor="";if(typeof adcru_bgcolor!="undefined"){bgColor=adcru_bgcolor;}
var textColor="";if(typeof adcru_text_color!="undefined"){textColor=adcru_text_color;}
renderer.styleTargetDiv(targetDiv,bgColor,textColor,height,width);targetDiv.style.display='block';targetDiv.style.visibility='visible';var renderDate=new Date();renderTime=renderDate.getTime();var interval=1000;function reportEventAtInterval(){reportEvent(responseData.request_id,false);interval*=3;setTimeout(reportEventAtInterval,interval);}
reportEvent(responseData.request_id,false);setTimeout(reportEventAtInterval,interval);var suppressMouseovers=false;function allowMouseovers(){suppressMouseovers=false;}
function reportMouseover(){if(!suppressMouseovers){reportEvent(responseData.request_id,true)
suppressMouseovers=true;setTimeout(allowMouseovers,3000);}}
targetDiv.onmouseover=reportMouseover;}
if(renderer.requiresJQuery()){var jQueryScript=scriptElementWithSrc("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");var jQueryScriptDone=false;jQueryScript.onload=jQueryScript.onreadystatechange=function(){if(!jQueryScriptDone&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){jQueryScriptDone=true;$adcru=jQuery.noConflict();finishRendering();}}
appendToHead(jQueryScript);}else{finishRendering();}}
this.init=function(){this.serverResponse=function(data){if(!data||data.status!="0"||data.ads.length===0){if(typeof adcru_no_fill_callback!="undefined"){adcru_no_fill_callback();}}else{var adcru_div=document.getElementById(ROOT_DIV_ID);this.render(adcru_div,data);}}
requestStylesheet(STYLESHEET_URL);document.write("<div id='"+ROOT_DIV_ID+"' style='display: none'></div>");var noScript=document.getElementById('no_script');if(noScript){noScript.style.display='none';}
requestAds();}}
AdCruOb.init();