
function encode_utf8(_1){
var _2="";
for(var n=0;n<_1.length;n++){
var c=_1.charCodeAt(n);
if(c<128){
_2+=String.fromCharCode(c);
}else{
if((c>127)&&(c<2048)){
_2+=String.fromCharCode((c>>6)|192);
_2+=String.fromCharCode((c&63)|128);
}else{
_2+=String.fromCharCode((c>>12)|224);
_2+=String.fromCharCode(((c>>6)&63)|128);
_2+=String.fromCharCode((c&63)|128);
}
}
}
return _2;
}
function mooter_encode_url(_5){
if(_5){
_5=encode_utf8(_5);
_5=encodeURIComponent(_5);
_5=_5.substring(0,1023);
}
return _5;
}
function mooter_detect_page_url(){
var w=window;
var _7=w.location;
if(w.location==top.location){
_7=w.location.toString();
}else{
try{
_7=w.top.location.toString();
}
catch(e){
_7=document.referrer;
}
}
_7=mooter_encode_url(_7);
return _7;
}
function get_page_url(){
var _8=mooter_encode_url(window.mooter_page_url);
if(!_8){
_8=mooter_detect_page_url();
}
if(_8){
_8=_8.replace(/%[0-9]?$/,"");
}
return _8;
}
function get_ad_unit_num(){
try{
return inc_ad_unit(top);
}
catch(e){
return inc_ad_unit(window);
}
}
function inc_ad_unit(w){
return (w.mooter_ad_unit_num?++w.mooter_ad_unit_num:w.mooter_ad_unit_num=1);
}
function get_page_view_id(){
try{
return next_page_id(window.top);
}
catch(e){
return next_page_id(window);
}
}
function next_page_id(w){
if(!w.mooter_page_view_id){
w.mooter_page_view_id=next_random_int(1,Math.pow(10,17));
}
return w.mooter_page_view_id;
}
function next_random_int(_b,_c){
return Math.floor(Math.random()*(_c-_b+1)+_b);
}
function src_url(_d,_e){
var _f="http://advantage20.mootermedia.com:80/ads/"+_e+"?";
for(var _10 in _d){
if(_d[_10]){
_f+=_10+"="+_d[_10]+"&";
}
}
return _f.substring(0,_f.length-1);
}
function esc(_11){
return _11?escape(_11):_11;
}
function write_iframe(_12,_13){
if(_12.ad_unit<4){
document.write("<iframe name=\"mooter_ads\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"  width=\""+_12.width+"\" height=\""+_12.height+"\" src=\""+src_url(_12,_13)+"\"></iframe>");
}
}
function timezoneOffset(){
return (new Date().getTimezoneOffset());
}
(function(){
var _14={format:window.mooter_ad_format,partner:window.mooter_partner,page_view_id:get_page_view_id(),ad_unit:get_ad_unit_num(),maxcount:window.mooter_ad_maxcount,section:window.mooter_page_section,cat:window.mooter_page_section,overtureParams:window.mooter_overture_params,extra_params:window.extra_params,channel:window.mooter_channel,keywords:window.mooter_keywords,width:window.mooter_ad_width,height:window.mooter_ad_height,css:esc(window.mooter_ad_css),title_clr:esc(window.mooter_title_clr),desc_clr:esc(window.mooter_desc_clr),sitehost_clr:esc(window.mooter_sitehost_clr),bg_clr:esc(window.mooter_bg_clr),border_clr:esc(window.mooter_border_clr),adblock_border_clr:esc(window.mooter_adblock_border_clr),branding_bg_clr:esc(window.mooter_branding_bg_clr),branding_font_clr:esc(window.mooter_branding_font_clr),title_trim:window.mooter_title_trim,desc_trim:window.mooter_desc_trim,dp:mooter_detect_page_url(),url:get_page_url(),wrapper_url:esc(window.mooter_wrapper_url),tzo:timezoneOffset(),publisher_channel:window.mooter_publisher_channel};
if(window.mooter_ad_format=="js_flat"){
document.getElementById("mooter_js").src=src_url(_14,"js_flat");
}else{
if(window.mooter_ad_format=="html"){
write_iframe(_14,"advert");
}else{
if(window.mooter_ad_format=="xhtml"){
write_iframe(_14,"xhtml");
}else{
_14.width="180";
_14.height="150";
_14.pid="13456307618173559308";
_14.tid="5";
write_iframe(_14,"moot");
}
}
}
})();

