var solatis_adlib_request_ts=-1,solatis_adlib_request_id=-1,solatis_adlib_show_queue=[],solatis_deferred_adlibs={},solatis_defer_is_hooked=!1,solatis_dom_ready_events=[],solatis_dom_ready_timer=-1,solatis_window_is_framed=!0,solatis_dom_ready_checks=[];try{solatis_window_is_framed=null!=window.frameElement}catch(e$$5){}document.addEventListener&&document.addEventListener("DOMContentLoaded",solatis_fire_dom_ready,!1);var testElement=document.createElement("div");
testElement.doScroll&&!1==solatis_window_is_framed&&solatis_dom_ready_checks.push(function(){try{return testElement.doScroll(),!0}catch(a){}return!1});document.readyState&&solatis_dom_ready_checks.push(function(){var a=document.readyState;return-1!=a.indexOf("loaded")||-1!=a.indexOf("complete")});function solatis_dom_is_ready(){for(var a=0;a<solatis_dom_ready_checks.length;++a)if(!0==solatis_dom_ready_checks[a]())return!0;return!1}
function solatis_poll_dom_ready(){clearTimeout(solatis_dom_ready_timer);!0==solatis_dom_is_ready()?solatis_fire_dom_ready():solatis_dom_ready_timer=setTimeout("solatis_poll_dom_ready ()",10)}function solatis_fire_dom_ready(){for(var a=solatis_dom_ready_checks.length=0;a<solatis_dom_ready_events.length;++a)solatis_dom_ready_events[a]()}
function adlib(){this.zone=function(a){a=a.split("/");this._network_id=a[0];this._site_id=a[1];this._zone_id=a[2]};this.session_id=function(a){this._sti=a};this.zone_global_id=function(){return this._network_id+"/"+this._site_id+"/"+this._zone_id};this.companions=function(a){this._creative_group_companion_ids=a};this.bt_tag=function(a){if(!this.bt_tags)this.bt_tags=[];this.bt_tags.push(this._urlencode(a))};this.bt_key_value=function(a,b){if(!this.bt_key_values)this.bt_key_values=[];this.bt_key_values.push(this._urlencode(this._escape("=",
a)+"="+this._escape("=",b)))};this.custom_target=function(a,b){if(!this.custom_targets)this.custom_targets=[];this.custom_targets.push(this._urlencode(this._escape("=",a)+"="+this._escape("=",b)))};this.demographic=function(a,b){if(!this.demographics)this.demographics=[];this.demographics.push(this._urlencode(this._escape("=",a)+"="+this._escape("=",b)))};this.sale_value=function(a){this._sale_value=a};this.env=function(a,b){if(!this.environment)this.environment=[];this.environment.push(this._urlencode(this._escape("=",
a)+"="+this._escape("=",b)))};this.content_url=function(a){this._content_url=this._urlencode(a)};this.enable_deferred=function(){this._defer=!0;this._deferred_groups=[]};this.disable_deferred=function(){this._defer=!1};this.deferred_groups=function(){return this._deferred_groups};this.show_here=function(a){var b="_solatis_adlib_"+this._random_number();solatis_adlib_show_queue.push({location:b,group_id:a});document.write("<span id='"+b+"' />")};this.show=function(a){a||(a=[]);if(!1==a instanceof Array)return alert("Adcode invocation error: provided adgroups is not an array"),
!1;a=a.concat(solatis_adlib_show_queue);this._init();!0==this._defer?!1==this._do_defer(a)&&this._do_show(a):this._do_show(a)};this._do_show=function(a){for(var b="",d=null,c=0;c<a.length;++c){var f=a[c];if(null!=document.getElementById(f.location))d=f.location,b+="g="+this._urlencode(f.group_id)+";",b+="gap="+this._resolve_position(f.location)+";",b+="ghi="+f.location+";",b+="gr="+(f.redirect?this._urlencode(f.redirect):"")+";"}this._load_script(this._protocol()+"ads.solatis.com/ad;n="+this._network_id+
";s="+this._site_id+";z="+this._zone_id+";"+b+";f="+(!0==this._has_flash()?"t":"f")+";ref="+this._referrer+";"+this._companions()+this._custom_targets()+this._demographics()+this._bt_tags()+this._bt_key_values()+this._environment()+this._tearsheet()+this._session_id()+"cu="+this._content_url+";vt="+this._visitor_timestamp+";r="+this._request_id,d)};this._do_defer=function(a){if(!1==this._hook_defer_event(this._show_deferred))return!1;this._deferred_groups=this._deferred_groups.concat(a);solatis_deferred_adlibs[this.zone_global_id()]?
solatis_deferred_adlibs[this.zone_global_id()]._merge(this):solatis_deferred_adlibs[this.zone_global_id()]=this};this.track=function(a){this._init();var b=a.split("/"),a=b[0],d=b[1],b=b[2],c=this._sale_value;null==c&&(c=0);this._load_script(this._protocol()+"//ads.solatis.com/tracker;n="+a+";t="+d+";i="+b+";sv="+c+";tu="+this._content_url+";r="+this._request_id)};this.callback=function(a,b,d){if(a=document.getElementById(a)){this._remove_child_nodes(a);var c=this._resolve_css_id_classes(a),f=this._resolve_stylesheets(),
g=document.createElement("iframe");g.src="";g.width=b.width;g.height=b.height;g.marginWidth=0;g.marginHeight=0;g.frameBorder="no";g.scrolling="no";a.appendChild(g);var e=g.contentWindow.document;e.open();e.write("<html>");e.write("<head>");e.write('<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />');for(b=0;b<f.length;++b)style=f[b],style.src?e.write("<link rel='stylesheet' type='text/css' href='"+style.src+"' media='all' />"):style.content&&e.write("<style type='text/css'>"+
style.content+"</style>");e.write("</head>");e.write("<body ");for(b=0;b<c.length;++b)a=c[b],a["class"]?e.write("class='"+a["class"]+"' "):a.id&&e.write("id='"+a.id+"' ");e.write(" style='margin: 0px; padding: 0px'>");e.write(d);e.write("</body></html>");window.setTimeout(function(){e.close()},5E3)}else{a.innerHTML=d;d=a.getElementsByTagName("script");a="";for(b=0;b<d.length;++b)a+=d[b].innerHTML;eval(a)}};this._init=function(){if(top==self&&(this._referrer=document.referrer?this._urlencode(document.referrer):
"",!this._content_url&&location.href))this._content_url=this._urlencode(location.href);var a=new Date;this._visitor_timestamp=a.getTime()/1E3-a.getTime()/1E3%1;if(-1==solatis_adlib_request_ts||solatis_adlib_request_ts+15<this._visitor_timestamp)solatis_adlib_request_ts=this._visitor_timestamp,solatis_adlib_request_id=this._random_number();this._request_id=solatis_adlib_request_id;if(!this._defer)this._defer=!1;this._initialize_array("_creative_group_companion_ids");this._initialize_array("environment");
this._initialize_array("demographics");this._initialize_array("custom_targets");this._initialize_array("bt_tags");this._initialize_array("bt_key_values");this._initialize_array("_deferred_groups")};this._initialize_array=function(a){this[a]||(this[a]=[])};this._merge=function(a){if(a.zone_global_id()!=this.zone_global_id())return alert("Internal adlib error: unable to merge adlibs of different zones!"),!1;this._creative_group_companion_ids=this._creative_group_companion_ids.concat(a._creative_group_companion_ids);
this.environment=this.environment.concat(a.environment);this.demographics=this.demographics.concat(a.demographics);this.custom_targets=this.custom_targets.concat(a.custom_targets);this.bt_tags=this.bt_tags.concat(a.bt_tags);this.bt_key_values=this.bt_key_values.concat(a.bt_key_values);this._deferred_groups=this._deferred_groups.concat(a._deferred_groups)};this._hook_defer_event=function(a){if(!0==solatis_defer_is_hooked)return!0;solatis_defer_is_hooked=!0;this._add_dom_ready_listener(a)};this._add_dom_ready_listener=
function(a){!0==solatis_dom_is_ready()?a():(solatis_dom_ready_events.push(a),-1==solatis_dom_ready_timer&&solatis_poll_dom_ready())};this._show_deferred=function(){for(var a in solatis_deferred_adlibs){var b=solatis_deferred_adlibs[a];b._do_show(b._deferred_groups)}};this._companions=function(){return this._serialize("cp",this._creative_group_companion_ids)};this._environment=function(){return this._serialize("e",this.environment)};this._demographics=function(){return this._serialize("td",this.demographics)};
this._custom_targets=function(){return this._serialize("ct",this.custom_targets)};this._bt_tags=function(){return this._serialize("btt",this.bt_tags)};this._bt_key_values=function(){return this._serialize("btkv",this.bt_key_values)};this._session_id=function(){return this._sti?"sti="+this._urlencode(this._sti)+";":""};this._serialize=function(a,b){if(!b)return"";for(var d="",c=0;c<b.length;++c)d+=a+"="+b[c]+";";return d};this._urlencode=function(a){return encodeURIComponent(a)};this._escape=function(a,
b){return b.replace(a,"\\"+a)};this._resolve_position=function(a){if(""==a)return"-1x-1";a=this._resolve_obj_position(document.getElementById(a));return a.x+"x"+a.y};this._tearsheet=function(){hash=this._hash();if("#"==hash)return"";hash=hash.substr(1);pairs=hash.split(";");for(var a="",b=0;b<pairs.length;++b)kv=this._parse_key_value(pairs[b]),"adlib_tid"==kv.key?a+="tid="+kv.value+";":"adlib_tgid"==kv.key&&(a+="tgid="+kv.value+";");return a};this._parse_key_value=function(a){tokens=a.split("=");
return 2==tokens.length?{key:tokens[0],value:tokens[1]}:!1};this._hash=function(){return self.document.location.hash?self.document.location.toString?(str=self.document.location.toString(),tokens=str.split("#"),"#"+tokens[1]):self.document.location.hash:"#"};this._resolve_obj_position=function(a){y=x=0;if(a&&a.offsetParent)for(;;){x+=a.offsetLeft;y+=a.offsetTop;if(!a.offsetParent)break;a=a.offsetParent}else a&&a.x&&a.y?(x+=a.x,y+=a.y):y=x=-1;return{x:x,y:y}};this._protocol=function(){return"https://"==
window.location.protocol?"https://":"http://"};this._has_flash=function(){if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description)return!0}else if(navigator.userAgent&&0<=navigator.userAgent.indexOf("Windows CE")){for(var a=1,b=3;a;)try{b++,a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b)}catch(d){a=null}if(4<b)return!0}else{try{return a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),!0}catch(c){version=-1;try{return a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),
version=6,!0}catch(f){if(6==version)return!0}try{a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(g){}}if(null!=a)return!0}};this._resolve_css_id_classes=function(a,b){b||(b=[]);a.parentNode&&b.concat(this._resolve_css_id_classes(a.parentNode,b));a.id&&b.push({id:a.id});a.className&&b.push({"class":a.className});return b};this._resolve_stylesheets=function(){for(var a=[],b=document.getElementsByTagName("style"),d=document.getElementsByTagName("link"),c=0;c<b.length;++c)a.push({content:b[c].innerHTML});
for(c=0;c<d.length;++c)b=d[c],(b.type&&"text/css"==b.type||b.rel&&"stylesheet"==b.rel)&&a.push({src:b.href});return a};this._resolve_computed_css=function(a){return"undefined"!=typeof a.currentStyle?a.currentStyle:document.defaultView.getComputedStyle(a,null)};this._set_attached_defer_event=function(){this._attached_defer_event=!0};this._is_attached_defer_event=function(){return this._attached_defer_event};this._remove_child_nodes=function(a){for(;a.childNodes[0];)a.removeChild(a.childNodes[0])};
this._load_script=function(a,b){var d=null;b&&(d=document.getElementById(b));d||(d=document.head||document.getElementsByTagName("head")[0]);if(d){var c=document.createElement("script");c.src=a;c.charset="utf-8";c.type="text/javascript";d.appendChild(c)}else document.write("<script src='"+a+"' type='text/javascript' charset='utf-8'><\/script>")};this._random_number=function(){return Math.floor(1E16*Math.random())}};

