/*  2010-08-24-46c345a ad-layout/jquery.ad.js */
jQuery.fn.adcontent=function(){return this.find(">.asset:first").children().not("script,noscript,a:empty,img[height=1],iframe[height=1]")}
/*  2010-08-24-46c345a ad-layout/lib/jquery.ad.stylesheet.js */
;jQuery(function(a){a(".ad .asset a[href][rel~=stylesheet]").each(function(){a("head").append('<link rel="stylesheet" type="text/css" href="'+a(this).attr("href")+'">');a(this).remove()})});
/*  2010-08-24-46c345a ad-layout/lib/jquery.ad.pushdown.js */
jQuery(function(a){a(".ad.pushdown").each(function(){function d(g){f.first().animate({height:g.data.size},g.data.duration)}var c=a(this),f=c.adcontent(),e,b;if(c.length&&f.length){e=f.height();b=f.first().children().first().height();if(e&&e<b){c.bind("expand",{size:b,duration:600},d);c.bind("collapse",{size:e,duration:300},d)}}})});
/*  2010-08-24-46c345a ad-layout/lib/jquery.ad.footer.js */
jQuery(function(a){a(".ad.footer:last").each(function(){function c(s){var r=s.data.size||0,t=o(m.css("bottom"));if(t-(r-k)){if(t+k){if(!r){q()}}else{g()}m.stop().animate({bottom:r-k},{step:function(u){m.next().height(k+u)}})}}function p(r){return function(){m.trigger(r)}}function o(r){return +((/^(-{0,1}\d+).*/.exec(r)||[])[1])}function q(){function r(){a(this).one("click",p("show")).toggleClass("active")}b(-1,r)}function g(){function r(){a(this).one("click",p("hide")).toggleClass("active")}b(+1,r)}function b(u,r){var t=-1,s;f.show().animate({bottom:e(0,-(f.height()*u))});l.animate({frame:n(0,4*u)},{complete:r,queue:!1,step:function(v){s=j(v);if(t!=s){t=s;this.style.backgroundPosition="0 "+(-18*t)+"px"}}})}var m=a(this),d=m.adcontent(),l,f,j=Math.round,e=Math.min,n=Math.max,h,k,i=1500;if(d.length){m.find("script").remove();m.appendTo("body").css("width","100%").css("height",m.height());h=m.height();k=m.css("height",d.first("a").find(">img:first").css("height")||d.first().css("height")).height();if(k<=h*2){h=k}m.height(k);if(!a.browser.msie||((/^(\d+)/.exec(a.browser.version))||[])[1]>6){m.css("position","fixed").css("bottom",-k).css("left",0);l=a('<div class="ad ui"></div>').css("position","fixed").css("z-index",o(m.css("z-index"))+100).css("bottom",h/2-10).css("right",8).css("width",18).css("height",18).insertAfter(m).delay(i*2).fadeIn(0);f=d.eq(1);f=f.wrap('<div class="asset"/>').parent().insertBefore(m).css("position","fixed").css("z-index",o(m.css("z-index"))-100).css("width",f.width()).css("height",f.height()).css("bottom",-f.height()).css("right",0);m.after("<div></div>").next().css("position","relative").css("height",0);m.add(l).add(f).bind("collapse",{size:h},c).bind("expand",{size:k},c).bind("show",{size:h},c).bind("hide",{size:0},c).bind("accept",p("hide")).bind("reject",p("hide")).bind("submit",p("hide")).one("load",p("show"));m.show();setTimeout(p("load"),i);return}d.slice(1).remove();m.show()}})});
