
jQuery.cookie=function(key,value,options){if(arguments.length>1&&String(value)!=="[object Object]"){options=jQuery.extend({},options);if(value===null||value===undefined){options.expires=-1;};if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);};value=String(value);return(document.cookie=[encodeURIComponent(key),'=',options.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));};options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};if(typeof($fc)=='undefined')var $fc={};(function(fc,$){fc.openLB=function startOverlay(html,width,height,backgroundclose){var newContent=$(html);width=width||425;height=height||355;$("body").append('<div class="overlay" style="position:absolute;top:0;left:0;height:100%;width:100%;background:#000;opacity:0;filter:alpha(opacity=0);z-index:150;'+(backgroundclose>0?'cursor:pointer;':'')+'"></div>').append('<div class="overlaycontainer" style="position:absolute;opacity:0;filter:alpha(opacity=0);left:-9999em;z-index:151;"></div>').css({"overflow-y":"hidden"});var overlay=$(".overlay").animate({"opacity":"0.6"},400,"linear");if(backgroundclose>0)overlay.bind("click",function(){fc.closeLB();});var overlaycontainer=$(".overlaycontainer");overlaycontainer.html(html).css({"top":$(document).scrollTop()+$(window).height()/2,"left":"50%","width":width,"height":height}).css({"margin-top":-(overlaycontainer.height()/2),"margin-left":-(overlaycontainer.width()/2)}).animate({"opacity":"1"},400,"linear").find(".closeLB").bind("click",function(){fc.closeLB();return false;});setTimeout(function(){overlaycontainer.css({"margin-top":-(overlaycontainer.height()/2),"margin-left":-(overlaycontainer.width()/2)});},200);};fc.closeLB=function removeOverlay(){$(".overlaycontainer, .overlay").animate({"opacity":"0"},200,"linear",function(){$(".overlaycontainer, .overlay").remove();$("body").css({"overflow-y":""});});};})($fc,jQuery);(function(fc,$){var aPromos=[];function getSessionTimeout(){var d=new Date();d.setMinutes(d.getMinutes()+20);return d;};function getLifetimeTimeout(){var d=new Date();d.setFullYear(d.getFullYear()+20);return d;};function getSessionID(){var id=$.cookie("promo-session-id");if(id===null)id=Math.floor(Math.random()*10000000)+1;else id=parseInt(id);$.cookie("promo-session-id",id,{expires:getSessionTimeout(),path:"/"});return id;};function checkPromoTrigger(p,c,s){if(c.shown)return false;if(c.hits>=p.triggerMax)return false;if(p.triggerType=="visit"&&c.visits<p.triggerNumber)return false;if(p.triggerType=="page"&&c.pages<p.triggerNumber)return false;return true;};function getPromoCookies(p,s){var dl=($.cookie("promo-"+p.id+'-l')||"0,0,0").split(",");var ds=($.cookie("promo-"+p.id+'-s')||"0,0,0").split(",");if(parseInt(ds[2])!=s)ds=["0","0",s.toString()];var c={visits:parseInt(dl[0]),hits:parseInt(dl[1]),lastsession:parseInt(dl[2]),pages:parseInt(ds[0]),shown:parseInt(ds[1]),currentsession:parseInt(ds[2])};if(c.lastsession!=s){c.visits+=1;c.lastsession=s;$.cookie("promo-"+p.id+'-l',c.visits.toString()+','+c.hits.toString()+','+c.lastsession.toString(),{expires:getLifetimeTimeout(),path:"/"});};c.pages+=1;$.cookie("promo-"+p.id+'-s',c.pages.toString()+','+c.shown.toString()+','+c.currentsession.toString(),{path:"/"});return c;};function showPromo(p,c){c.hits+=1;$.cookie("promo-"+p.id+'-l',c.visits.toString()+','+c.hits.toString()+','+c.lastsession.toString(),{expires:getLifetimeTimeout(),path:"/"});c.shown=1;$.cookie("promo-"+p.id+'-s',c.pages.toString()+','+c.shown.toString()+','+c.currentsession.toString(),{path:"/"});$(function(){if(fc.displayPromo)return fc.displayPromo(p);$.ajax({type:"GET",url:p.url,cache:false,timeout:20000,success:function(html){fc.openLB(html,p.width,p.height,p.backgroundclose);if(p.timeout>0)setTimeout(function(){fc.closeLB();},p.timeout*1000);}});});};fc.declarePromos=function declarePromos(p){var sessionID=getSessionID();var promoShown=false;if(fc.skipPromo())return;for(var i=0;i<p.length;i++){cookie=getPromoCookies(p[i],sessionID);if(!promoShown&&checkPromoTrigger(p[i],cookie,sessionID)){showPromo(p[i],cookie);promoShown=true;}}};if(typeof(fc.skipPromo)=='undefined'){fc.skipPromo=function(){return false;};}})($fc,jQuery);$fc.declarePromos([]);

