
(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))
return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;q.run();return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)
$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)
this.elements.unbind(this.type,this.fn);else if(this.fn2)
this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
$.event.remove(el,query.type,query.fn);});}
else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)
$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);}
else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)
$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)
r.context=a.context,r.selector=a.selector;if(typeof a=='string')
r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
;(function($){var ver="2.65";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length==0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){options=handleArguments(this,options,arg2);if(options===false){return;}if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts=buildOptions($cont,$slides,els,options,o);if(opts===false){return;}if(opts.timeout||opts.continuous){this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},opts.continuous?10:opts.timeout+(opts.delay||0));}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"stop":cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;if(arg2===true){options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,1);}return false;default:options={fx:options};}}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.rev);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=0;opts.startingSlide=opts.randomMap[0];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z=first?i>=first?els.length-(i-first):first-i:els.length-i;$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var i=0;i<els.length;i++){var $e=$(els[i]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth;}if(!h){h=e.offsetHeight;}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingOp=($.browser.opera&&this.cycleW==42&&this.cycleH==19&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){opts.nextSlide=opts.currSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).click(function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).click(function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(var i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];var tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){var tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(var i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}log("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){$(els).stop(true,true);opts.busy=false;}if(opts.busy){return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}if(manual||!p.cyclePause){var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after);}else{$.fn.cycle.custom(curr,next,opts,after,manual&&opts.fastOnEvent);}}}opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}if(opts.pager){$.fn.cycle.updateActivePagerLink(opts.pager,opts.currSlide);}}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(curr,next,opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide){$(pager).find("a").removeClass("activeSlide").filter("a:eq("+currSlide+")").addClass("activeSlide");};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn(curr,next,opts,fwd);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}if($.isFunction(opts.prevNextClick)){opts.prevNextClick(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});$.fn.cycle.updateActivePagerLink(opts.pager,opts.startingSlide);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a=($.isFunction(opts.pagerAnchorBuilder))?opts.pagerAnchorBuilder(i,el):'<a href="#">'+(i+1)+"</a>";if(!a){return;}var $a=$(a);if($a.parents("body").length==0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone);});$a=$(arr);}else{$a.appendTo($p);}}$a.bind(opts.pagerEvent,function(){opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if($.isFunction(opts.pagerClick)){opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);return false;});if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250};})(jQuery);
;(function($){$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});opts.speed=opts.speed/2;opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(var i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(var i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var t=parseInt(h/2);var l=parseInt(w/2);clip="rect("+t+"px "+l+"px "+t+"px "+l+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);

(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings)
{settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function()
{var $this=$(this);var paneEle=this;var currentScrollPosition=0;var paneWidth;var paneHeight;var trackHeight;var trackOffset=settings.topCapHeight;if($(this).parent().is('.jScrollPaneContainer')){currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();paneWidth=$c.innerWidth();paneHeight=$c.outerHeight();$('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown, >.jScollCap',$c).remove();$this.css({'top':0});}else{$this.data('originalStyleTag',$this.attr('style'));$this.css('overflow','hidden');this.originalPadding=$this.css('paddingTop')+' '+$this.css('paddingRight')+' '+$this.css('paddingBottom')+' '+$this.css('paddingLeft');this.originalSidePaddingTotal=(parseInt($this.css('paddingLeft'))||0)+(parseInt($this.css('paddingRight'))||0);paneWidth=$this.innerWidth();paneHeight=$this.innerHeight();var $container=$('<div></div>').attr({'className':'jScrollPaneContainer'}).css({'height':paneHeight+'px','width':paneWidth+'px'});$this.wrap($container);$(document).bind('emchange',function(e,cur,prev)
{$this.jScrollPane(settings);});}
trackHeight=paneHeight;if(settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,'jScrollPaneImagesToLoad')||$('img',$this);var loadedImages=[];if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind('load readystatechange',function(){if($.inArray(i,loadedImages)==-1){loadedImages.push(val);$imagesToLoad=$.grep($imagesToLoad,function(n,i){return n!=val;});$.data(paneEle,'jScrollPaneImagesToLoad',$imagesToLoad);var s2=$.extend(settings,{reinitialiseOnImageLoad:false});$this.jScrollPane(s2);}}).each(function(i,val){if(this.complete||this.complete===undefined){this.src=this.src;}});});};}
var p=this.originalSidePaddingTotal;var realPaneWidth=paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p;var cssToApply={'height':'auto','width':realPaneWidth+'px'}
if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+'px';}else{cssToApply.paddingRight=settings.scrollbarMargin+'px';}
$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<.99){var $container=$this.parent();$container.append($('<div></div>').addClass('jScrollCap jScrollCapTop').css({height:settings.topCapHeight}),$('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),$('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'}))),$('<div></div>').addClass('jScrollCap jScrollCapBottom').css({height:settings.bottomCapHeight}));var $track=$('>.jScrollPaneTrack',$container);var $drag=$('>.jScrollPaneTrack .jScrollPaneDrag',$container);var currentArrowDirection;var currentArrowTimerArr=[];var currentArrowInc;var whileArrowButtonDown=function()
{if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}
currentArrowInc++;};if(settings.enableKeyboardNavigation){$container.bind('keydown.jscrollpane',function(e)
{switch(e.keyCode){case 38:currentArrowDirection=-1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 40:currentArrowDirection=1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 33:case 34:return false;default:}}).bind('keyup.jscrollpane',function(e)
{if(e.keyCode==38||e.keyCode==40){for(var i=0;i<currentArrowTimerArr.length;i++){clearInterval(currentArrowTimerArr[i]);}
return false;}});}
if(settings.showArrows){var currentArrowButton;var currentArrowInterval;var onArrowMouseUp=function(event)
{$('html').unbind('mouseup',onArrowMouseUp);currentArrowButton.removeClass('jScrollActiveArrowButton');clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$('html').bind('mouseup',onArrowMouseUp);currentArrowButton.addClass('jScrollActiveArrowButton');currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowUp'}).css({'width':settings.scrollbarWidth+'px','top':settings.topCapHeight+'px'}).html('Scroll up').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind('click',rf),$('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowDown'}).css({'width':settings.scrollbarWidth+'px','bottom':settings.bottomCapHeight+'px'}).html('Scroll down').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind('click',rf));var $upArrow=$('>.jScrollArrowUp',$container);var $downArrow=$('>.jScrollArrowDown',$container);}
if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;trackOffset+=settings.arrowSize;}else if($upArrow){var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();trackOffset+=topArrowHeight;}
trackHeight-=settings.topCapHeight+settings.bottomCapHeight;$track.css({'height':trackHeight+'px',top:trackOffset+'px'})
var $pane=$(this).css({'position':'absolute','overflow':'visible'});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=='X'?'Left':'Top';return event['page'+c]||(event['client'+c]+(document.documentElement['scroll'+p]||document.body['scroll'+p]))||0;};var ignoreNativeDrag=function(){return false;};var initDrag=function()
{ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event)
{initDrag();dragMiddle=getPos(event,'Y')-dragPosition-currentOffset.top;$('html').bind('mouseup',onStopDrag).bind('mousemove',updateScroll);if($.browser.msie){$('html').bind('dragstart',ignoreNativeDrag).bind('selectstart',ignoreNativeDrag);}
return false;};var onStopDrag=function()
{$('html').unbind('mouseup',onStopDrag).unbind('mousemove',updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$('html').unbind('dragstart',ignoreNativeDrag).unbind('selectstart',ignoreNativeDrag);}};var positionDrag=function(destY)
{$container.scrollTop(0);destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({'top':destY+'px'});var p=destY/maxY;$this.data('jScrollPanePosition',(paneHeight-contentHeight)*-p);$pane.css({'top':((paneHeight-contentHeight)*p)+'px'});$this.trigger('scroll');if(settings.showArrows){$upArrow[destY==0?'addClass':'removeClass']('disabled');$downArrow[destY==maxY?'addClass':'removeClass']('disabled');}};var updateScroll=function(e)
{positionDrag(getPos(e,'Y')-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({'height':dragH+'px'}).bind('mousedown',onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function()
{if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}
trackScrollInc++;};var onStopTrackClick=function()
{clearInterval(trackScrollInterval);$('html').unbind('mouseup',onStopTrackClick).unbind('mousemove',onTrackMouseMove);};var onTrackMouseMove=function(event)
{trackScrollMousePos=getPos(event,'Y')-currentOffset.top-dragMiddle;};var onTrackClick=function(event)
{initDrag();onTrackMouseMove(event);trackScrollInc=0;$('html').bind('mouseup',onStopTrackClick).bind('mousemove',onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();return false;};$track.bind('mousedown',onTrackClick);$container.bind('mousewheel',function(event,delta){delta=delta||(event.wheelDelta?event.wheelDelta/120:(event.detail)?-event.detail/3:0);initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition()
{var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}
var ceaseAnimation=function()
{if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni)
{if(typeof pos=="string"){$e=$(pos,$this);if(!$e.length)return;pos=$e.offset().top-$this.offset().top;}
ceaseAnimation();var maxScroll=contentHeight-paneHeight;pos=pos>maxScroll?maxScroll:pos;$this.data('jScrollPaneMaxScroll',maxScroll);var destDragPosition=pos/maxScroll*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{$container.scrollTop(0);_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta)
{var currentPos=-parseInt($pane.css('top'))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$('*',this).bind('focus',function(event)
{var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}
var viewportTop=-parseInt($pane.css('top'))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}
scrollTo(destPos);}})
if(location.hash){setTimeout(function(){scrollTo(location.hash);},$.browser.safari?100:0);}
$(document).bind('click',function(e)
{$target=$(e.target);if($target.is('a')){var h=$target.attr('href');if(h&&h.substr(0,1)=='#'&&h.length>1){setTimeout(function(){scrollTo(h,!settings.animateToInternalLinks);},$.browser.safari?100:0);}}});function onSelectScrollMouseDown(e)
{$(document).bind('mousemove.jScrollPaneDragging',onTextSelectionScrollMouseMove);$(document).bind('mouseup.jScrollPaneDragging',onSelectScrollMouseUp);}
var textDragDistanceAway;var textSelectionInterval;function onTextSelectionInterval()
{direction=textDragDistanceAway<0?-1:1;$this[0].scrollBy(textDragDistanceAway/2);}
function clearTextSelectionInterval()
{if(textSelectionInterval){clearInterval(textSelectionInterval);textSelectionInterval=undefined;}}
function onTextSelectionScrollMouseMove(e)
{var offset=$this.parent().offset().top;var maxOffset=offset+paneHeight;var mouseOffset=getPos(e,'Y');textDragDistanceAway=mouseOffset<offset?mouseOffset-offset:(mouseOffset>maxOffset?mouseOffset-maxOffset:0);if(textDragDistanceAway==0){clearTextSelectionInterval();}else{if(!textSelectionInterval){textSelectionInterval=setInterval(onTextSelectionInterval,100);}}}
function onSelectScrollMouseUp(e)
{$(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging');clearTextSelectionInterval();}
$container.bind('mousedown.jScrollPane',onSelectScrollMouseDown);$.jScrollPane.active.push($this[0]);}else{$this.css({'height':paneHeight+'px','width':paneWidth-this.originalSidePaddingTotal+'px','padding':this.originalPadding});$this[0].scrollTo=$this[0].scrollBy=function(){};$this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane');}})};$.fn.jScrollPaneRemove=function()
{$(this).each(function()
{$this=$(this);var $c=$this.parent();if($c.is('.jScrollPaneContainer')){$this.css({'top':'','height':'','width':'','padding':'','overflow':'','position':''});$this.attr('style',$this.data('originalStyleTag'));$c.after($this).remove();}});}
$.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false,enableKeyboardNavigation:true,animateToInternalLinks:false,topCapHeight:0,bottomCapHeight:0};$(window).bind('unload',function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)
$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)
this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=handler;},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)
this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery);
(function($){var i=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()};$.fn.checkbox=function(f){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}var g={cls:'jquery-checkbox',empty:rootUrl + 'public/images/default/Agenda/empty.png'};g=$.extend(g,f||{});var h=function(a){var b=a.checked;var c=a.disabled;var d=$(a);if(a.stateInterval)clearInterval(a.stateInterval);a.stateInterval=setInterval(function(){if(a.disabled!=c)d.trigger((c=!!a.disabled)?'disable':'enable');if(a.checked!=b)d.trigger((b=!!a.checked)?'check':'uncheck')},10);return d};return this.each(function(){var a=this;var b=h(a);if(a.wrapper)a.wrapper.remove();a.wrapper=$('<span class="'+g.cls+'"><span class="mark"><img src="'+g.empty+'" /></span></span>');a.wrapperInner=a.wrapper.children('span:eq(0)');a.wrapper.hover(function(e){a.wrapperInner.addClass(g.cls+'-hover');i(e)},function(e){a.wrapperInner.removeClass(g.cls+'-hover');i(e)});b.css({position:'absolute',zIndex:-1,visibility:'hidden'}).after(a.wrapper);var c=false;if(b.attr('id')){c=$('label[for='+b.attr('id')+']');if(!c.length)c=false}if(!c){c=b.closest?b.closest('label'):b.parents('label:eq(0)');if(!c.length)c=false}if(c){c.hover(function(e){a.wrapper.trigger('mouseover',[e])},function(e){a.wrapper.trigger('mouseout',[e])});c.click(function(e){b.trigger('click',[e]);i(e);return false})}a.wrapper.click(function(e){b.trigger('click',[e]);i(e);return false});b.click(function(e){i(e)});b.bind('disable',function(){a.wrapperInner.addClass(g.cls+'-disabled')}).bind('enable',function(){a.wrapperInner.removeClass(g.cls+'-disabled')});b.bind('check',function(){a.wrapper.addClass(g.cls+'-checked')}).bind('uncheck',function(){a.wrapper.removeClass(g.cls+'-checked')});$('img',a.wrapper).bind('dragstart',function(){return false}).bind('mousedown',function(){return false});if(window.getSelection)a.wrapper.css('MozUserSelect','none');if(a.checked)a.wrapper.addClass(g.cls+'-checked');if(a.disabled)a.wrapperInner.addClass(g.cls+'-disabled')})}})(jQuery);

jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};
/*
 * jquery.tools 1.1.2 - The missing UI library for the Web
 * 
 * [tools.overlay-1.1.2, tools.overlay.gallery-1.0.0, tools.overlay.apple-1.0.1]
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 * 
 * -----
 * 
 * File generated: Wed Oct 07 12:37:52 GMT+00:00 2009
 */
(function(c){c.tools=c.tools||{};c.tools.overlay={version:"1.1.2",addEffect:function(e,f,g){b[e]=[f,g]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var b={};c.tools.overlay.addEffect("default",function(e){this.getOverlay().fadeIn(this.getConf().speed,e)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)});var d=[];function a(g,k){var o=this,m=c(this),n=c(window),j,i,h,e=k.expose&&c.tools.expose.version;var f=k.target||g.attr("rel");i=f?c(f):null||g;if(!i.length){throw"Could not find Overlay: "+f}if(g&&g.index(i)==-1){g.click(function(p){o.load(p);return p.preventDefault()})}c.each(k,function(p,q){if(c.isFunction(q)){m.bind(p,q)}});c.extend(o,{load:function(u){if(o.isOpened()){return o}var r=b[k.effect];if(!r){throw'Overlay: cannot find effect : "'+k.effect+'"'}if(k.oneInstance){c.each(d,function(){this.close(u)})}u=u||c.Event();u.type="onBeforeLoad";m.trigger(u);if(u.isDefaultPrevented()){return o}h=true;if(e){i.expose().load(u)}var t=k.top;var s=k.left;var p=i.outerWidth({margin:true});var q=i.outerHeight({margin:true});if(typeof t=="string"){t=t=="center"?Math.max((n.height()-q)/2,0):parseInt(t,10)/100*n.height()}if(s=="center"){s=Math.max((n.width()-p)/2,0)}if(!k.absolute){t+=n.scrollTop();s+=n.scrollLeft()}i.css({top:t,left:s,position:"absolute"});u.type="onStart";m.trigger(u);r[0].call(o,function(){if(h){u.type="onLoad";m.trigger(u)}});if(k.closeOnClick){c(document).bind("click.overlay",function(w){if(!o.isOpened()){return}var v=c(w.target);if(v.parents(i).length>1){return}c.each(d,function(){this.close(w)})})}if(k.closeOnEsc){c(document).unbind("keydown.overlay").bind("keydown.overlay",function(v){if(v.keyCode==27){c.each(d,function(){this.close(v)})}})}return o},close:function(q){if(!o.isOpened()){return o}q=q||c.Event();q.type="onBeforeClose";m.trigger(q);if(q.isDefaultPrevented()){return}h=false;b[k.effect][1].call(o,function(){q.type="onClose";m.trigger(q)});var p=true;c.each(d,function(){if(this.isOpened()){p=false}});if(p){c(document).unbind("click.overlay").unbind("keydown.overlay")}return o},getContent:function(){return i},getOverlay:function(){return i},getTrigger:function(){return g},getClosers:function(){return j},isOpened:function(){return h},getConf:function(){return k},bind:function(p,q){m.bind(p,q);return o},unbind:function(p){m.unbind(p);return o}});c.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(p,q){o[q]=function(r){return o.bind(q,r)}});if(e){if(typeof k.expose=="string"){k.expose={color:k.expose}}c.extend(k.expose,{api:true,closeOnClick:k.closeOnClick,closeOnEsc:false});var l=i.expose(k.expose);l.onBeforeClose(function(p){o.close(p)});o.onClose(function(p){l.close(p)})}j=i.find(k.close||".close");if(!j.length&&!k.close){j=c('<div class="close"></div>');i.prepend(j)}j.click(function(p){o.close(p)})}c.fn.overlay=function(e){var f=this.eq(typeof e=="number"?e:0).data("overlay");if(f){return f}if(c.isFunction(e)){e={onBeforeLoad:e}}var g=c.extend({},c.tools.overlay.conf);e=c.extend(true,g,e);this.each(function(){f=new a(c(this),e);d.push(f);c(this).data("overlay",f)});return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.overlay;a.plugins=a.plugins||{};a.plugins.gallery={version:"1.0.0",conf:{imgId:"img",next:".next",prev:".prev",info:".info",progress:".progress",disabledClass:"disabled",activeClass:"active",opacity:0.8,speed:"slow",template:"<strong>${title}</strong> <span>Image ${index} of ${total}</span>",autohide:true,preload:true,api:false}};b.fn.gallery=function(d){var o=b.extend({},a.plugins.gallery.conf),m;b.extend(o,d);m=this.overlay();var r=this,j=m.getOverlay(),k=j.find(o.next),g=j.find(o.prev),e=j.find(o.info),c=j.find(o.progress),h=g.add(k).add(e).css({opacity:o.opacity}),s=m.getClosers(),l;function p(u){c.fadeIn();h.hide();s.hide();var t=u.attr("href");var v=new Image();v.onload=function(){c.fadeOut();var y=b("#"+o.imgId,j);if(!y.length){y=b("<img/>").attr("id",o.imgId).css("visibility","hidden");j.prepend(y)}y.attr("src",t).css("visibility","hidden");var z=v.width;var A=(b(window).width()-z)/2;l=r.index(r.filter("[href="+t+"]"));r.removeClass(o.activeClass).eq(l).addClass(o.activeClass);var w=o.disabledClass;h.removeClass(w);if(l===0){g.addClass(w)}if(l==r.length-1){k.addClass(w)}var B=o.template.replace("${title}",u.attr("title")||u.data("title")).replace("${index}",l+1).replace("${total}",r.length);var x=parseInt(e.css("paddingLeft"),10)+parseInt(e.css("paddingRight"),10);e.html(B).css({width:z-x});j.animate({width:z,height:v.height,left:A},o.speed,function(){y.hide().css("visibility","visible").fadeIn(function(){if(!o.autohide){h.fadeIn();s.show()}})})};v.onerror=function(){j.fadeIn().html("Cannot find image "+t)};v.src=t;if(o.preload){r.filter(":eq("+(l-1)+"), :eq("+(l+1)+")").each(function(){var w=new Image();w.src=b(this).attr("href")})}}function f(t,u){t.click(function(){if(t.hasClass(o.disabledClass)){return}var v=r.eq(i=l+(u?1:-1));if(v.length){p(v)}})}f(k,true);f(g);b(document).keydown(function(t){if(!j.is(":visible")||t.altKey||t.ctrlKey){return}if(t.keyCode==37||t.keyCode==39){var u=t.keyCode==37?g:k;u.click();return t.preventDefault()}return true});function q(){if(!j.is(":animated")){h.show();s.show()}}if(o.autohide){j.hover(q,function(){h.fadeOut();s.hide()}).mousemove(q)}var n;this.each(function(){var v=b(this),u=b(this).overlay(),t=u;u.onBeforeLoad(function(){p(v)});u.onClose(function(){r.removeClass(o.activeClass)})});return o.api?n:this}})(jQuery);
(function(d){var b=d.tools.overlay;b.effects=b.effects||{};b.effects.apple={version:"1.0.1"};d.extend(b.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function c(f){var g=f.offset();return[g.top+f.height()/2,g.left+f.width()/2]}var e=function(n){var k=this.getOverlay(),f=this.getConf(),i=this.getTrigger(),q=this,r=k.outerWidth({margin:true}),m=k.data("img");if(!m){var l=k.css("backgroundImage");if(!l){throw"background-image CSS property not set for overlay"}l=l.substring(l.indexOf("(")+1,l.indexOf(")")).replace(/\"/g,"");k.css("backgroundImage","none");m=d('<img src="'+l+'"/>');m.css({border:0,position:"absolute",display:"none"}).width(r);d("body").append(m);k.data("img",m)}var o=d(window),j=f.start.top||Math.round(o.height()/2),h=f.start.left||Math.round(o.width()/2);if(i){var g=c(i);j=g[0];h=g[1]}if(!f.start.absolute){j+=o.scrollTop();h+=o.scrollLeft()}m.css({top:j,left:h,width:0,zIndex:f.zIndex}).show();m.animate({top:k.css("top"),left:k.css("left"),width:r},f.speed,function(){k.css("zIndex",f.zIndex+1).fadeIn(f.fadeInSpeed,function(){if(q.isOpened()&&!d(this).index(k)){n.call()}else{k.hide()}})})};var a=function(f){var h=this.getOverlay(),i=this.getConf(),g=this.getTrigger(),l=i.start.top,k=i.start.left;h.hide();if(g){var j=c(g);l=j[0];k=j[1]}h.data("img").animate({top:l,left:k,width:0},i.closeSpeed,f)};b.addEffect("apple",e,a)})(jQuery);


var CRITEO=function(){var f={F:[],C:function(){if(arguments.callee.ag){return;}arguments.callee.ag=true;for(var i=0;i<f.F.length;i++){f.F[i]();}},Q:function(R){this.F[this.F.length]=R;if(document.addEventListener){document.addEventListener("DOMContentLoaded",f.C,null);}if(/KHTML|WebKit/i.test(navigator.userAgent)){var P=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(P);delete P;f.C();}},10);};if(typeof window.onload!='function'){window.onload=f.C;}else{var D=window.onload;window.onload=function(){f.C();if(D){D();}};}}};function A(s){if(document.getElementsByTagName){var h=document.getElementsByTagName('head')[0];if(!h){h=document.createElement('HEAD');document.documentElement.appendChild(h);}if(h&&h.appendChild){h.appendChild(s);}}};function B(){if(typeof(window.encodeURIComponent)==='undefined'){var r={ab:function(H){H=""+H;var t,s,G="",i=0;while(i<H.length){t=H.charCodeAt(i++);if(t>=0xDC00&&t<0xE000){continue;}if(t>=0xD800&&t<0xDC00){if(i>=H.length){continue;}s=H.charCodeAt(i++);if(s<0xDC00||t>=0xDE00){continue;}t=((t-0xD800)<<10)+(s-0xDC00)+0x10000;}if(t<0x80){G+=String.fromCharCode(t);}else if(t<0x800){G+=String.fromCharCode(0xC0+(t>>6),0x80+(t&0x3F));}else if(t<0x10000){G+=String.fromCharCode(0xE0+(t>>12),0x80+(t>>6&0x3F),0x80+(t&0x3F));}else{G+=String.fromCharCode(0xF0+(t>>18),0x80+(t>>12&0x3F),0x80+(t>>6&0x3F),0x80+(t&0x3F));}}return G;},I:"0123456789ABCDEF",V:function(n){return r.I.charAt(n>>4)+r.I.charAt(n&0xF);},K:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"};window.encodeURIComponent=function(s){s=r.ab(s);var G="";for(var i=0;i<s.length;i++){if(r.K.indexOf(s.charAt(i))==-1){G+="%"+r.V(s.charCodeAt(i));}else{G+=s.charAt(i);}}return G;};}};function L(){if(document.getElementsByTagName){var n=1;var o=[];var l=[];var U,O,M,aa,ae,ac;var a=document.getElementsByTagName('div');for(var i=0;i<a.length;i++){if(a[i].id&&a[i].id.substring(0,3).toLowerCase()=="cto"&&a[i].childNodes){U=O=M=aa=ac=null;ae=2;for(var j=0;j<a[i].childNodes.length;j++){var t=a[i].childNodes[j];if(t&&t.tagName&&t.tagName.toLowerCase()=="div"&&t.className&&t.className.substring(0,3).toLowerCase()=="cto"){var v=(t.textContent?t.textContent:(t.innerText?t.innerText:null));switch(t.className.toLowerCase()){case'ctowidgetserver':U=v;break;case'ctodatatype':O=v;break;case'ctowidgettype':M=v;break;case'ctoparams':aa=v;break;case'ctoversion':ae=v;break;case'ctodata':ac=t.innerHTML;break;}}}if(U&&((!O&&M)||(O&&!M))){var u="v="+ae;if(aa){u+="&"+aa;}u="p"+n+"="+encodeURIComponent(u);if(ac){u+="&d"+n+"="+encodeURIComponent(ac);}if(M){u+="&w"+n+"="+M;}else{u+="&t"+n+"="+O;}var s;for(s=0;s<o.length;s++){if(o[s]==U){break;}}if(s!=o.length&&l[s]&&(l[s].length+u.length)>2000){CRITEO.AddScript(l[s]);l[s]=null;}if(s==o.length||!l[s]){o[s]=U;l[s]=U+"display.js?";}else{l[s]+="&";}l[s]+=u;n++;}}}for(var k=0;k<l.length;k++){if(l[k]){CRITEO.AddScript(l[k]);}}}};function J(){B();L();};return{Q:function(){if(typeof(CRITEO_Loaded)!="undefined"){return;}CRITEO_Loaded=1;f.Q(function(){J();});},AddStyle:function(ad){if(document.createElement){var s=document.createElement('style');if(s){s.setAttribute('type','text/css');A(s);if(s.styleSheet){try{s.styleSheet.cssText=ad;}catch(e){}}else{var t=document.createTextNode(ad);s.appendChild(t);}}}},AddScript:function(u){if(document.createElement){var s=document.createElement('script');if(s){s.type='text/javascript';s.src=u;A(s);}}},AddImage:function(a,u){if(document.createElement){var af=document.createElement('IMG');if(af){if(a){var d=document.getElementById(a);if(d===null){d=document.createElement('DIV');d.id=a;d.style.display="none";document.body.appendChild(d);}if(d!==null&&d.appendChild){d.appendChild(af);}}af.src=u;}}},NewGuid:function(m){var g="";for(var i=0;i<m;i++){g+=Math.floor(Math.random()*0xF).toString(0xF);}return g+"";}};}();var CRITEO_Loaded;CRITEO.Q();
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $
 * $Rev: 2447 $
 *
 * Version 2.1.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}
break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}
break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}
break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}
break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}
break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}
if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}
$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])
cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)
return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}
progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}
v+=options.multipleSeparator;}
hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
function onChange(crap,skipPrevCheck){$input.flushCache();if(lastKeyPressCode==KEY.DEL){select.hide();return;}
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)
return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)
currentValue=currentValue.toLowerCase();$('#searchLoadingImage').css('display','block');request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)
return[""];if(!options.multiple)
return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}
function lastWord(value){if(!options.multiple)
return value;var words=trimWords(value);if(words.length==1)
return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}
return words[words.length-1];}
function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}
else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)
term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}
return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)
s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}
if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}
if(!data[q]){length++;}
data[q]=value;}
function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)
continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])
stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}
setTimeout(populate,25);function flush(){data={};length=0;}
return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)
return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}
return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}
return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)
return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$("li > #listTicketnoclick",list).removeClass(CLASSES.ACTIVE).index(target(event));if($('#listTicketnoclick',$(target(event))).size()==0){$(target(event)).addClass(CLASSES.ACTIVE);}
else{$('#listTicketnoclick',$(target(event))).addClass(CLASSES.ACTIVE);}}}).click(function(event){obj=$(target(event));if($('#listTicketnoclick',obj).size()==0&&$('#listVenuenoclick',obj).size()==0){obj.addClass(CLASSES.ACTIVE);if(obj.attr('text')!='')
input.value=obj.attr('text');select();input.focus();}
else
{if(obj.attr('text')!='')
input.value=obj.attr('text');}
return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)
element.css("width",options.width);needsInit=false;}
function target(event){var element=event.target;while(element&&element.tagName!="LI")
element=element.parentNode;if(!element)
return[];return element;}
function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);$("#listTicketnoclick",listItems.slice(active,active+1)).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1);if($('#listTicketnoclick',activeItem).size()==0){if(activeItem.attr('text')!='')
input.value=activeItem.attr('text');activeItem.addClass(CLASSES.ACTIVE);}
else{$('#listTicketnoclick',activeItem).addClass(CLASSES.ACTIVE);}
if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}
function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}
function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])
continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)
continue;var regexDiv=new RegExp('<div.*');var regexSpan=new RegExp('<.*?>');var liValue=data[i].value;liValue=liValue.replace(regexDiv,"");liValue=liValue.replace(regexSpan,"");liValue=liValue.replace(regexSpan,"");var li=$("<li/>").html(options.highlight(formatted,term)).attr('text',liValue).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}
listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}
if($.fn.bgiframe)
list.bgiframe();}
return{display:function(d,q){init();data=d;term=q;fillList();$('#searchLoadingImage').delay(500).css('display','none');},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;$('#searchLoadingImage').delay(500).css('display','none');},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();var curHeight=element.css('height');var ticketCount=$('li > #listTicketnoclick',element).size();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:curHeight,overflow:'auto'});var listHeight=0;if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}
var fullHeight=0;$('li',element).each(function(){fullHeight+=parseInt($(this).css('height').replace('px',''))+8;});if(ticketCount>0){list.animate({maxHeight:fullHeight},200);}
else
{list.animate({maxHeight:options.scrollHeight},200);}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}
var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);
/*
 *
 * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version 2.2.4
 * Demo: http://www.texotela.co.uk/code/jquery/select/
 *
 * $LastChangedDate: 2008-06-17 17:27:25 +0100 (Tue, 17 Jun 2008) $
 * $Rev: 5727 $
 *
 */
;(function(h){h.fn.addOption=function(){var j=function(a,f,c,g){var d=document.createElement("option");d.value=f,d.text=c;var b=a.options;var e=b.length;if(!a.cache){a.cache={};for(var i=0;i<e;i++){a.cache[b[i].value]=i}}if(typeof a.cache[f]=="undefined")a.cache[f]=e;a.options[a.cache[f]]=d;if(g){d.selected=true}};var k=arguments;if(k.length==0)return this;var l=true;var m=false;var n,o,p;if(typeof(k[0])=="object"){m=true;n=k[0]}if(k.length>=2){if(typeof(k[1])=="boolean")l=k[1];else if(typeof(k[2])=="boolean")l=k[2];if(!m){o=k[0];p=k[1]}}this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(m){for(var a in n){j(this,a,n[a],l)}}else{j(this,o,p,l)}});return this};h.fn.ajaxAddOption=function(c,g,d,b,e){if(typeof(c)!="string")return this;if(typeof(g)!="object")g={};if(typeof(d)!="boolean")d=true;this.each(function(){var f=this;h.getJSON(c,g,function(a){h(f).addOption(a,d);if(typeof b=="function"){if(typeof e=="object"){b.apply(f,e)}else{b.call(f)}}})});return this};h.fn.removeOption=function(){var d=arguments;if(d.length==0)return this;var b=typeof(d[0]);var e,i;if(b=="string"||b=="object"||b=="function"){e=d[0];if(e.constructor==Array){var j=e.length;for(var k=0;k<j;k++){this.removeOption(e[k],d[1])}return this}}else if(b=="number")i=d[0];else return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(this.cache)this.cache=null;var a=false;var f=this.options;if(!!e){var c=f.length;for(var g=c-1;g>=0;g--){if(e.constructor==RegExp){if(f[g].value.match(e)){a=true}}else if(f[g].value==e){a=true}if(a&&d[1]===true)a=f[g].selected;if(a){f[g]=null}a=false}}else{if(d[1]===true){a=f[i].selected}else{a=true}if(a){this.remove(i)}}});return this};h.fn.sortOptions=function(e){var i=h(this).selectedValues();var j=typeof(e)=="undefined"?true:!!e;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;var c=this.options;var g=c.length;var d=[];for(var b=0;b<g;b++){d[b]={v:c[b].value,t:c[b].text}}d.sort(function(a,f){o1t=a.t.toLowerCase(),o2t=f.t.toLowerCase();if(o1t==o2t)return 0;if(j){return o1t<o2t?-1:1}else{return o1t>o2t?-1:1}});for(var b=0;b<g;b++){c[b].text=d[b].t;c[b].value=d[b].v}}).selectOptions(i,true);return this};h.fn.selectOptions=function(g,d){var b=g;var e=typeof(g);if(e=="object"&&b.constructor==Array){var i=this;h.each(b,function(){i.selectOptions(this,d)})};var j=d||false;if(e!="string"&&e!="function"&&e!="object")return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b.constructor==RegExp){if(a[c].value.match(b)){a[c].selected=true}else if(j){a[c].selected=false}}else{if(a[c].value==b){a[c].selected=true}else if(j){a[c].selected=false}}}});return this};h.fn.copyOptions=function(g,d){var b=d||"selected";if(h(g).size()==0)return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b=="all"||(b=="selected"&&a[c].selected)){h(g).addOption(a[c].value,a[c].text)}}});return this};h.fn.containsOption=function(g,d){var b=false;var e=g;var i=typeof(e);var j=typeof(d);if(i!="string"&&i!="function"&&i!="object")return j=="function"?this:b;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;if(b&&j!="function")return false;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(e.constructor==RegExp){if(a[c].value.match(e)){b=true;if(j=="function")d.call(a[c],c)}}else{if(a[c].value==e){b=true;if(j=="function")d.call(a[c],c)}}}});return j=="function"?this:b};h.fn.selectedValues=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.value});return a};h.fn.selectedTexts=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.text});return a};h.fn.selectedOptions=function(){return this.find("option:selected")}})(jQuery);

(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);

jQuery.fn.boxy=function(options){options=options||{};return this.each(function(){var node=this.nodeName.toLowerCase(),self=this;if(node=='a'){jQuery(this).click(function(){var active=Boxy.linkedTo(this),href=this.getAttribute('href'),localOptions=jQuery.extend({actuator:this,title:this.title},options);if(active){active.show();}else if(href.indexOf('#')>=0){var content=jQuery(href.substr(href.indexOf('#'))),newContent=content.clone(true);content.remove();localOptions.unloadOnHide=false;new Boxy(newContent,localOptions);}else{if(!localOptions.cache)localOptions.unloadOnHide=true;Boxy.load(this.href,localOptions);}
return false;});}else if(node=='form'){jQuery(this).bind('submit.boxy',function(){Boxy.confirm(options.message||'Please confirm:',function(){jQuery(self).unbind('submit.boxy').submit();});return false;});}});};function Boxy(element,options){this.boxy=jQuery(Boxy.WRAPPER);jQuery.data(this.boxy[0],'boxy',this);this.visible=false;this.options=jQuery.extend({},Boxy.DEFAULTS,options||{});if(this.options.modal){this.options=jQuery.extend(this.options,{center:true,draggable:false});}
if(this.options.actuator){jQuery.data(this.options.actuator,'active.boxy',this);}
this.setContent(element||"<div></div>");this._setupTitleBar();this.boxy.css('display','none').appendTo(document.body);this.toTop();if(this.options.fixed){if(jQuery.browser.msie&&jQuery.browser.version<7){this.options.fixed=false;}else{this.boxy.addClass('fixed');}}
if(this.options.center&&Boxy._u(this.options.x,this.options.y)){this.center();}else{this.moveTo(Boxy._u(this.options.x)?this.options.x:Boxy.DEFAULT_X,Boxy._u(this.options.y)?this.options.y:Boxy.DEFAULT_Y);}
if(this.options.show)this.show();};Boxy.EF=function(){};jQuery.extend(Boxy,{WRAPPER:"<table cellspacing='0' cellpadding='0' border='0' class='boxy-wrapper'>"+"<tr><td class='top-left'></td><td class='top'></td><td class='top-right'></td></tr>"+"<tr><td class='left'></td><td class='boxy-inner'></td><td class='right'></td></tr>"+"<tr><td class='bottom-left'></td><td class='bottom'></td><td class='bottom-right'></td></tr>"+"</table>",DEFAULTS:{title:null,closeable:true,draggable:true,clone:false,actuator:null,center:true,show:true,modal:false,fixed:true,closeText:'[close]',unloadOnHide:false,clickToFront:false,behaviours:Boxy.EF,afterDrop:Boxy.EF,afterShow:Boxy.EF,afterHide:Boxy.EF,beforeUnload:Boxy.EF},DEFAULT_X:50,DEFAULT_Y:50,zIndex:1337,dragConfigured:false,resizeConfigured:false,dragging:null,load:function(url,options){options=options||{};var ajax={url:url,type:'GET',dataType:'html',cache:false,success:function(html){html=jQuery(html);if(options.filter)html=jQuery(options.filter,html);new Boxy(html,options);}};jQuery.each(['type','cache'],function(){if(this in options){ajax[this]=options[this];delete options[this];}});jQuery.ajax(ajax);},get:function(ele){var p=jQuery(ele).parents('.boxy-wrapper');return p.length?jQuery.data(p[0],'boxy'):null;},linkedTo:function(ele){return jQuery.data(ele,'active.boxy');},alert:function(message,callback,options){return Boxy.ask(message,['OK'],callback,options);},confirm:function(message,after,options){return Boxy.ask(message,['OK','Cancel'],function(response){if(response=='OK')after();},options);},ask:function(question,answers,callback,options){options=jQuery.extend({modal:true,closeable:false},options||{},{show:true,unloadOnHide:true});var body=jQuery('<div></div>').append(jQuery('<div class="question"></div>').html(question));var map={},answerStrings=[];if(answers instanceof Array){for(var i=0;i<answers.length;i++){map[answers[i]]=answers[i];answerStrings.push(answers[i]);}}else{for(var k in answers){map[answers[k]]=k;answerStrings.push(answers[k]);}}
var buttons=jQuery('<form class="answers"></form>');buttons.html(jQuery.map(answerStrings,function(v){return"<input type='button' value='"+v+"' />";}).join(' '));jQuery('input[type=button]',buttons).click(function(){var clicked=this;Boxy.get(this).hide(function(){if(callback)callback(map[clicked.value]);});});body.append(buttons);new Boxy(body,options);},isModalVisible:function(){return jQuery('.boxy-modal-blackout').length>0;},_u:function(){for(var i=0;i<arguments.length;i++)
if(typeof arguments[i]!='undefined')return false;return true;},_handleResize:function(evt){var d=jQuery(document);jQuery('.boxy-modal-blackout').css('display','none').css({width:d.width(),height:d.height()}).css('display','block');},_handleDrag:function(evt){var d;if(d=Boxy.dragging){d[0].boxy.css({left:evt.pageX-d[1],top:evt.pageY-d[2]});}},_nextZ:function(){return Boxy.zIndex++;},_viewport:function(){var d=document.documentElement,b=document.body,w=window;return jQuery.extend(jQuery.browser.msie?{left:b.scrollLeft||d.scrollLeft,top:b.scrollTop||d.scrollTop}:{left:w.pageXOffset,top:w.pageYOffset},!Boxy._u(w.innerWidth)?{width:w.innerWidth,height:w.innerHeight}:(!Boxy._u(d)&&!Boxy._u(d.clientWidth)&&d.clientWidth!=0?{width:d.clientWidth,height:d.clientHeight}:{width:b.clientWidth,height:b.clientHeight}));}});Boxy.prototype={estimateSize:function(){this.boxy.css({visibility:'hidden',display:'block'});var dims=this.getSize();this.boxy.css('display','none').css('visibility','visible');return dims;},getSize:function(){return[this.boxy.width(),this.boxy.height()];},getContentSize:function(){var c=this.getContent();return[c.width(),c.height()];},getPosition:function(){var b=this.boxy[0];return[b.offsetLeft,b.offsetTop];},getCenter:function(){var p=this.getPosition();var s=this.getSize();return[Math.floor(p[0]+s[0]/2),Math.floor(p[1]+s[1]/2)];},getInner:function(){return jQuery('.boxy-inner',this.boxy);},getContent:function(){return jQuery('.boxy-content',this.boxy);},setContent:function(newContent){newContent=jQuery(newContent).css({display:'block'}).addClass('boxy-content');if(this.options.clone)newContent=newContent.clone(true);this.getContent().remove();this.getInner().append(newContent);this._setupDefaultBehaviours(newContent);this.options.behaviours.call(this,newContent);return this;},moveTo:function(x,y){this.moveToX(x).moveToY(y);return this;},moveToX:function(x){if(typeof x=='number')this.boxy.css({left:x});else this.centerX();return this;},moveToY:function(y){if(typeof y=='number')this.boxy.css({top:y});else this.centerY();return this;},centerAt:function(x,y){var s=this[this.visible?'getSize':'estimateSize']();if(typeof x=='number')this.moveToX(x-s[0]/2);if(typeof y=='number')this.moveToY(y-s[1]/2);return this;},centerAtX:function(x){return this.centerAt(x,null);},centerAtY:function(y){return this.centerAt(null,y);},center:function(axis){var v=Boxy._viewport();var o=this.options.fixed?[0,0]:[v.left,v.top];if(!axis||axis=='x')this.centerAt(o[0]+v.width/2,null);if(!axis||axis=='y')this.centerAt(null,o[1]+v.height/2);return this;},centerX:function(){return this.center('x');},centerY:function(){return this.center('y');},resize:function(width,height,after){if(!this.visible)return;var bounds=this._getBoundsForResize(width,height);this.boxy.css({left:bounds[0],top:bounds[1]});this.getContent().css({width:bounds[2],height:bounds[3]});if(after)after(this);return this;},tween:function(width,height,after){if(!this.visible)return;var bounds=this._getBoundsForResize(width,height);var self=this;this.boxy.stop().animate({left:bounds[0],top:bounds[1]});this.getContent().stop().animate({width:bounds[2],height:bounds[3]},function(){if(after)after(self);});return this;},isVisible:function(){return this.visible;},show:function(){if(this.visible)return;if(this.options.modal){var self=this;if(!Boxy.resizeConfigured){Boxy.resizeConfigured=true;jQuery(window).resize(function(){Boxy._handleResize();});}
this.modalBlackout=jQuery('<div class="boxy-modal-blackout"></div>').css({zIndex:Boxy._nextZ(),opacity:0.7,width:jQuery(document).width(),height:jQuery(document).height()}).appendTo(document.body);this.toTop();if(this.options.closeable){jQuery(document.body).bind('keypress.boxy',function(evt){var key=evt.which||evt.keyCode;if(key==27){self.hide();jQuery(document.body).unbind('keypress.boxy');}});}}
this.boxy.stop().css({opacity:1}).show();this.visible=true;this._fire('afterShow');return this;},hide:function(after){if(!this.visible)return;var self=this;if(this.options.modal){jQuery(document.body).unbind('keypress.boxy');this.modalBlackout.animate({opacity:0},function(){jQuery(this).remove();});}
this.boxy.stop().animate({opacity:0},300,function(){self.boxy.css({display:'none'});self.visible=false;self._fire('afterHide');if(after)after(self);if(self.options.unloadOnHide)self.unload();});return this;},toggle:function(){this[this.visible?'hide':'show']();return this;},hideAndUnload:function(after){this.options.unloadOnHide=true;this.hide(after);return this;},unload:function(){this._fire('beforeUnload');this.boxy.remove();if(this.options.actuator){jQuery.data(this.options.actuator,'active.boxy',false);}},toTop:function(){this.boxy.css({zIndex:Boxy._nextZ()});return this;},getTitle:function(){return jQuery('> .title-bar h2',this.getInner()).html();},setTitle:function(t){jQuery('> .title-bar h2',this.getInner()).html(t);return this;},_getBoundsForResize:function(width,height){var csize=this.getContentSize();var delta=[width-csize[0],height-csize[1]];var p=this.getPosition();return[Math.max(p[0]-delta[0]/2,0),Math.max(p[1]-delta[1]/2,0),width,height];},_setupTitleBar:function(){if(this.options.title){var self=this;var tb=jQuery("<div class='title-bar'></div>").html("<h2>"+this.options.title+"</h2>");if(this.options.closeable){tb.append(jQuery("<a href='#' class='close'></a>").html(this.options.closeText));}
if(this.options.draggable){tb[0].onselectstart=function(){return false;}
tb[0].unselectable='on';tb[0].style.MozUserSelect='none';if(!Boxy.dragConfigured){jQuery(document).mousemove(Boxy._handleDrag);Boxy.dragConfigured=true;}
tb.mousedown(function(evt){self.toTop();Boxy.dragging=[self,evt.pageX-self.boxy[0].offsetLeft,evt.pageY-self.boxy[0].offsetTop];jQuery(this).addClass('dragging');}).mouseup(function(){jQuery(this).removeClass('dragging');Boxy.dragging=null;self._fire('afterDrop');});}
this.getInner().prepend(tb);this._setupDefaultBehaviours(tb);}},_setupDefaultBehaviours:function(root){var self=this;if(this.options.clickToFront){root.click(function(){self.toTop();});}
jQuery('.close',root).click(function(){self.hide();return false;}).mousedown(function(evt){evt.stopPropagation();});},_fire:function(event){this.options[event].call(this);}};

(function($)
{$.fn.document=function()
{var element=this.get(0);if(element.nodeName.toLowerCase()=='iframe')
{return element.contentWindow.document;}
return this;};$.fn.documentSelection=function()
{var element=this.get(0);if(element.contentWindow.document.selection)
return element.contentWindow.document.selection.createRange().text;else
return element.contentWindow.getSelection().toString();};$.fn.wysiwyg=function(options)
{if(arguments.length>0&&arguments[0].constructor==String)
{var action=arguments[0].toString();var params=[];for(var i=1;i<arguments.length;i++)
params[i-1]=arguments[i];if(action in Wysiwyg)
{return this.each(function()
{$.data(this,'wysiwyg').designMode();Wysiwyg[action].apply(this,params);});}
else return this;}
var controls={};if(options&&options.controls)
{var controls=options.controls;delete options.controls;}
options=$.extend({html:'<'+'?xml version="1.0" encoding="UTF-8"?'+'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">STYLE_SHEET</head><body style="margin: 0px;">INITIAL_CONTENT</body></html>',css:{},debug:false,autoSave:true,rmUnwantedBr:true,brIE:true,controls:{},messages:{}},options);options.messages=$.extend(true,options.messages,Wysiwyg.MSGS_EN);options.controls=$.extend(true,options.controls,Wysiwyg.TOOLBAR);for(var control in controls)
{if(control in options.controls)
$.extend(options.controls[control],controls[control]);else
options.controls[control]=controls[control];}
return this.each(function()
{Wysiwyg(this,options);});};function Wysiwyg(element,options)
{return this instanceof Wysiwyg?this.init(element,options):new Wysiwyg(element,options);}
$.extend(Wysiwyg,{insertImage:function(szURL,attributes)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0)
{if($.browser.msie)self.focus();if(attributes)
{self.editorDoc.execCommand('insertImage',false,'#jwysiwyg#');var img=self.getElementByAttributeValue('img','src','#jwysiwyg#');if(img)
{img.src=szURL;for(var attribute in attributes)
{img.setAttribute(attribute,attributes[attribute]);}}}
else
{self.editorDoc.execCommand('insertImage',false,szURL);}}},createLink:function(szURL)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0)
{var selection=$(self.editor).documentSelection();if(selection.length>0)
{if($.browser.msie)self.focus();self.editorDoc.execCommand('unlink',false,[]);self.editorDoc.execCommand('createLink',false,szURL);}
else if(self.options.messages.nonSelection)
alert(self.options.messages.nonSelection);}},insertHtml:function(szHTML)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szHTML&&szHTML.length>0)
{if($.browser.msie)
{self.focus();self.editorDoc.execCommand('insertImage',false,'#jwysiwyg#');var img=self.getElementByAttributeValue('img','src','#jwysiwyg#');if(img)
{$(img).replaceWith(szHTML);}}
else
{self.editorDoc.execCommand('insertHTML',false,szHTML);}}},setContent:function(newContent)
{var self=$.data(this,'wysiwyg');self.setContent(newContent);self.saveContent();},clear:function()
{var self=$.data(this,'wysiwyg');self.setContent('');self.saveContent();},MSGS_EN:{nonSelection:'select the text you wish to link'},TOOLBAR:{bold:{visible:true,tags:['b','strong'],css:{fontWeight:'bold'},tooltip:"Bold"},italic:{visible:true,tags:['i','em'],css:{fontStyle:'italic'},tooltip:"Italic"},strikeThrough:{visible:true,tags:['s','strike'],css:{textDecoration:'line-through'},tooltip:"Strike-through"},underline:{visible:true,tags:['u'],css:{textDecoration:'underline'},tooltip:"Underline"},separator00:{visible:true,separator:true},justifyLeft:{visible:true,css:{textAlign:'left'},tooltip:"Justify Left"},justifyCenter:{visible:true,tags:['center'],css:{textAlign:'center'},tooltip:"Justify Center"},justifyRight:{visible:true,css:{textAlign:'right'},tooltip:"Justify Right"},justifyFull:{visible:true,css:{textAlign:'justify'},tooltip:"Justify Full"},separator01:{visible:true,separator:true},indent:{visible:true,tooltip:"Indent"},outdent:{visible:true,tooltip:"Outdent"},separator02:{visible:false,separator:true},subscript:{visible:true,tags:['sub'],tooltip:"Subscript"},superscript:{visible:true,tags:['sup'],tooltip:"Superscript"},separator03:{visible:true,separator:true},undo:{visible:true,tooltip:"Undo"},redo:{visible:true,tooltip:"Redo"},separator04:{visible:true,separator:true},insertOrderedList:{visible:true,tags:['ol'],tooltip:"Insert Ordered List"},insertUnorderedList:{visible:true,tags:['ul'],tooltip:"Insert Unordered List"},insertHorizontalRule:{visible:true,tags:['hr'],tooltip:"Insert Horizontal Rule"},separator05:{separator:true},createLink:{visible:true,exec:function()
{var selection=$(this.editor).documentSelection();if(selection.length>0)
{if($.browser.msie)
{this.focus();this.editorDoc.execCommand('createLink',true,null);}
else
{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0)
{this.editorDoc.execCommand('unlink',false,[]);this.editorDoc.execCommand('createLink',false,szURL);}}}
else if(this.options.messages.nonSelection)
alert(this.options.messages.nonSelection);},tags:['a'],tooltip:"Create link"},insertImage:{visible:true,exec:function()
{if($.browser.msie)
{this.focus();this.editorDoc.execCommand('insertImage',true,null);}
else
{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0)
this.editorDoc.execCommand('insertImage',false,szURL);}},tags:['img'],tooltip:"Insert image"},separator06:{separator:true},h1mozilla:{visible:true&&$.browser.mozilla,className:'h1',command:'heading',arguments:['h1'],tags:['h1'],tooltip:"Header 1"},h2mozilla:{visible:true&&$.browser.mozilla,className:'h2',command:'heading',arguments:['h2'],tags:['h2'],tooltip:"Header 2"},h3mozilla:{visible:true&&$.browser.mozilla,className:'h3',command:'heading',arguments:['h3'],tags:['h3'],tooltip:"Header 3"},h1:{visible:true&&!($.browser.mozilla),className:'h1',command:'formatBlock',arguments:['<H1>'],tags:['h1'],tooltip:"Header 1"},h2:{visible:true&&!($.browser.mozilla),className:'h2',command:'formatBlock',arguments:['<H2>'],tags:['h2'],tooltip:"Header 2"},h3:{visible:true&&!($.browser.mozilla),className:'h3',command:'formatBlock',arguments:['<H3>'],tags:['h3'],tooltip:"Header 3"},separator07:{visible:false,separator:true},cut:{visible:false,tooltip:"Cut"},copy:{visible:false,tooltip:"Copy"},paste:{visible:false,tooltip:"Paste"},separator08:{separator:false&&!($.browser.msie)},increaseFontSize:{visible:false&&!($.browser.msie),tags:['big'],tooltip:"Increase font size"},decreaseFontSize:{visible:false&&!($.browser.msie),tags:['small'],tooltip:"Decrease font size"},separator09:{separator:true},html:{visible:false,exec:function()
{if(this.viewHTML)
{this.setContent($(this.original).val());$(this.original).hide();}
else
{this.saveContent();$(this.original).show();}
this.viewHTML=!(this.viewHTML);},tooltip:"View source code"},removeFormat:{visible:true,exec:function()
{if($.browser.msie)this.focus();this.editorDoc.execCommand('removeFormat',false,[]);this.editorDoc.execCommand('unlink',false,[]);},tooltip:"Remove formatting"}}});$.extend(Wysiwyg.prototype,{original:null,options:{},element:null,editor:null,focus:function()
{$(this.editorDoc.body).focus();},init:function(element,options)
{var self=this;this.editor=element;this.options=options||{};$.data(element,'wysiwyg',this);var newX=element.width||element.clientWidth;var newY=element.height||element.clientHeight;if(element.nodeName.toLowerCase()=='textarea')
{this.original=element;if(newX==0&&element.cols)
newX=(element.cols*8)+21;if(newY==0&&element.rows)
newY=(element.rows*16)+16;var editor=this.editor=$('<iframe src="javascript:false;"></iframe>').css({minHeight:(newY-6).toString()+'px',width:(newX-8).toString()+'px'}).attr('id',$(element).attr('id')+'IFrame').attr('frameborder','0');this.editor.attr('tabindex',$(element).attr('tabindex'));if($.browser.msie)
{this.editor.css('height',(newY).toString()+'px');}}
var panel=this.panel=$('<ul role="menu" class="panel"></ul>');this.appendControls();this.element=$('<div></div>').css({width:(newX>0)?(newX).toString()+'px':'100%'}).addClass('wysiwyg').append(panel).append($('<div><!-- --></div>').css({clear:'both'})).append(editor);$(element).hide().before(this.element);this.viewHTML=false;this.initialHeight=newY-8;this.initialContent=$(element).val();this.initFrame();if(this.initialContent.length==0)
this.setContent('');var form=$(element).closest('form');if(this.options.autoSave)
{form.submit(function(){self.saveContent();});}
form.bind('reset',function()
{self.setContent(self.initialContent);self.saveContent();});},initFrame:function()
{var self=this;var style='';if(this.options.css&&this.options.css.constructor==String)
{style='<link rel="stylesheet" type="text/css" media="screen" href="'+this.options.css+'" />';}
this.editorDoc=$(this.editor).document();this.editorDoc_designMode=false;try{this.editorDoc.designMode='on';this.editorDoc_designMode=true;}catch(e){$(this.editorDoc).focus(function()
{self.designMode();});}
this.editorDoc.open();this.editorDoc.write(this.options.html.replace(/INITIAL_CONTENT/,function(){return self.initialContent;}).replace(/STYLE_SHEET/,function(){return style;}));this.editorDoc.close();this.editorDoc.contentEditable='true';if($.browser.msie)
{setTimeout(function(){$(self.editorDoc.body).css('border','none');},0);}
$(this.editorDoc).click(function(event)
{self.checkTargets(event.target?event.target:event.srcElement);});$(this.original).focus(function()
{if(!$.browser.msie)
{self.focus();}});if(this.options.autoSave)
{$(this.editorDoc).keydown(function(){self.saveContent();}).keyup(function(){self.saveContent();}).mousedown(function(){self.saveContent();});}
if(this.options.css)
{setTimeout(function()
{if(self.options.css.constructor==String)
{}
else
$(self.editorDoc).find('body').css(self.options.css);},0);}
$(this.editorDoc).keydown(function(event)
{if($.browser.msie&&self.options.brIE&&event.keyCode==13)
{var rng=self.getRange();rng.pasteHTML('<br />');rng.collapse(false);rng.select();return false;}
return true;});},designMode:function()
{if(!(this.editorDoc_designMode))
{try{this.editorDoc.designMode='on';this.editorDoc_designMode=true;}catch(e){}}},getSelection:function()
{return(window.getSelection)?window.getSelection():document.selection;},getRange:function()
{var selection=this.getSelection();if(!(selection))
return null;return(selection.rangeCount>0)?selection.getRangeAt(0):selection.createRange();},getContent:function()
{return $($(this.editor).document()).find('body').html();},setContent:function(newContent)
{$($(this.editor).document()).find('body').html(newContent);},saveContent:function()
{if(this.original)
{var content=this.getContent();if(this.options.rmUnwantedBr)
{content=(content.substr(-4)=='<br>')?content.substr(0,content.length-4):content;}
$(this.original).val(content);}},withoutCss:function()
{if($.browser.mozilla)
{try
{this.editorDoc.execCommand('styleWithCSS',false,false);}
catch(e)
{try
{this.editorDoc.execCommand('useCSS',false,true);}
catch(e)
{}}}},appendMenu:function(cmd,args,className,fn,tooltip)
{var self=this;args=args||[];$('<li></li>').append($('<a role="menuitem" tabindex="-1" href="javascript:;">'+(className||cmd)+'</a>').addClass(className||cmd).attr('title',tooltip)).click(function(){if(fn)fn.apply(self);else
{self.withoutCss();self.editorDoc.execCommand(cmd,false,args);}
if(self.options.autoSave)self.saveContent();}).appendTo(this.panel);},appendMenuSeparator:function()
{$('<li role="separator" class="separator"></li>').appendTo(this.panel);},appendControls:function()
{for(var name in this.options.controls)
{var control=this.options.controls[name];if(control.separator)
{if(control.visible!==false)
this.appendMenuSeparator();}
else if(control.visible)
{this.appendMenu(control.command||name,control.arguments||[],control.className||control.command||name||'empty',control.exec,control.tooltip||control.command||name||'');}}},checkTargets:function(element)
{for(var name in this.options.controls)
{var control=this.options.controls[name];var className=control.className||control.command||name||'empty';$('.'+className,this.panel).removeClass('active');if(control.tags)
{var elm=element;do{if(elm.nodeType!=1)
break;if($.inArray(elm.tagName.toLowerCase(),control.tags)!=-1)
$('.'+className,this.panel).addClass('active');}while((elm=elm.parentNode));}
if(control.css)
{var elm=$(element);do{if(elm[0].nodeType!=1)
break;for(var cssProperty in control.css)
if(elm.css(cssProperty).toString().toLowerCase()==control.css[cssProperty])
$('.'+className,this.panel).addClass('active');}while((elm=elm.parent()));}}},getElementByAttributeValue:function(tagName,attributeName,attributeValue)
{var elements=this.editorDoc.getElementsByTagName(tagName);for(var i=0;i<elements.length;i++)
{var value=elements[i].getAttribute(attributeName);if($.browser.msie)
{value=value.substr(value.length-attributeValue.length);}
if(value==attributeValue)
return elements[i];}
return false;}});})(jQuery);

var debug=false;var JsonFilter='';$(document).ready(function(){$('#footerBumper').css('height',$('#footerWrapper').height()+'px');$('#pageWrapper').css('background-color',$('#footerBumper').prev().css('background-color'));initNavHover();initToggleBoxes();initTicketsToggle();initPopups();initPremiumMerchants();initTweets();initGraphs();initSearchbar();initDialogs();initSearchResults();initVenues();initHovers();initEvents();$('a.openBlank').attr('target','_blank');if(jQuery.browser.msie){$('object').each(function()
{$(this).replaceWith($('<iframe></iframe>').attr('src',$(this).attr('data')).attr('style',$(this).attr('style')).attr('scrolling','no').attr('frameborder','0').attr('allowtransparency','true'));});}
$('#eventfadeimages p').cycle({before:function(element,nextelement){$('#eventfadeimagesCopyright p').html($(nextelement).attr('title'));}});$('.showAllVenues').click(function(){nextElement=$(this).parent().next();$(this).parent().fadeOut('fast');showNextVenue(nextElement);return false;});function showNextVenue(element){element.fadeIn(50,function(){if(element.next().exists()){showNextVenue(element.next());}else{return false;}
if(jQuery.browser.msie&&jQuery.browser.version<7){repositionFooter();}})}
$('.newsletterEmail').focus(newsletterEmailFocus);$('.newsletterEmail').change(newsletterEmailChange);$('.newsletterSignup').click(newsletterSignupClick);$('.searchNextTickets').click(searchNextTicketsClick);$('.searchPreviousTickets').click(searchPreviousTicketsClick);$('.searchNextVenues').click(searchNextVenuesClick);$('.searchPreviousVenues').click(searchPreviousVenuesClick);$('.searchNextEvents').click(searchNextEventsClick);$('.searchPreviousEvents').click(searchPreviousEventsClick);$('.searchTicketBlock').each(function(){$(this).hover(searchTableMouseover,searchTableMouseout);});$("table[class^='searchVenueTable']").each(function(){$(this).hover(searchTableMouseover,searchTableMouseout);});$("li[class^='searchEventBlock']").each(function(){$(this).hover(searchTableMouseover,searchTableMouseout);});$('.contactform').submit(contactformSubmit);if(eval("typeof getJsonFilterArray == 'function'")){initFilter();}
$('.albumsThumbs > ul > li').click(albumsThumbClick);$('.albumsThumbs > ul > li:eq(0)').click();$('.home_popularevent').click(home_populareventClick);$('.home_popularevent').hoverIntent({sensitivity:2,interval:150,over:home_populareventMouseover,timeout:200,out:home_populareventMouseout});$('.ticketBox').click(function(){if($('a',this).attr('href')!=''){window.location.href=$('a',this).attr('href');}else{return false;}})
$('div.ticketsBox div.ticketsCategories ul li ul li').click(function(){if($('a',this).attr('href')!=''){window.location.href=$('a',this).attr('href');}else{return false;}})
$('.resetFilter').click(function(){$('ul.filterList select option[value!=""]').attr('selected',false);$('ul.filterList select option[value=""]').attr('selected',true);$('.ticketsTickets > ul').slideDown('normal');$('li.ticketRow').slideDown('normal');$('.filteredTicketCount').html($('.totalTicketCount').html());initFilter();return false;});$(".tipTip").tipTip({'delay':0,'edgeOffset':5,'defaultPosition':'top'});$.fn.delay=function(time,callback)
{return this.animate({opacity:'+=0'},time,callback);}
$('#quicksearch_submit').click(quicksearch_submitClick);$('#quicksearch_submit').click(quicksearch_submitClick);$('#venuesearch_submit').click(jsonUpdateVenues);$("#venuesearch_searchvalue").keypress(function(e){if(e.which==13)$("#venuesearch_submit").click();});$('#quicksearch_searchvalue').one("focus",function(){$(this).attr('value','');});$(document).ready(function(){var url=rootUrl+'search/engine/venuesearch/searchvalue';$("#venuesearch_searchvalue").autocomplete(url);$("#venuesearch_searchvalue").result(jsonUpdateVenues);});var ajaxSearchboxLog=new Array();$('.ajaxSearchbox').focus(function(){if(ajaxSearchboxLog[$(this).attr('id')]==undefined){ajaxSearchboxLog[$(this).attr('id')]=new Array();ajaxSearchboxLog[$(this).attr('id')]['originalValue']=$(this).val();}
$(this).css('color','black');if($(this).val()==ajaxSearchboxLog[$(this).attr('id')]['originalValue']){$(this).val('');}});$('.ajaxSearchbox').blur(function()
{setTimeout('ajaxSearchboxBlur("'+$(this).attr('id')+'")',200);});$('.ajaxSearchbox').keydown(function()
{clearTimeout(ajaxSearchboxLog[$(this).attr('id')]['timer']);});$('.ajaxSearchbox').keyup(function()
{if($(this).val()!=ajaxSearchboxLog[$(this).attr('id')]['lastSearchedValue']&&$(this).val().length>=3){ajaxSearchboxLog[$(this).attr('id')]['lastSearchedValue']=$(this).val();ajaxSearchboxLog[$(this).attr('id')]['timer']=setTimeout('ajaxSearchboxRealKeyup("'+$(this).attr('id')+'", "'+$(this).val()+'");',300);}});function jsonUpdateVenues(){id='venuesearch_searchvalue';value=$("#venuesearch_searchvalue").val();$.post(rootUrl+'venues/index/search','value='+value+'&id='+id,updateVenueSearchResults);}
function updateVenueSearchResults(response)
{response=eval('('+response+')');$('#venuesSearchResults > h1 > span').html(': '+response['searchvalue']+' ('+response['results'].length+')');$('#venuesSearchResults > div > table > tbody > tr:first').css('visibility','visible');$('#venuesSearchResults > div > table > tbody > tr').each(function(i){if(i>0){$(this).remove();}});for(x=0;x<response['results'].length;x++){$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > strong').html(response['results'][x]['name']);$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > span').html(response['results'][x]['city'].replace('<strong>','').replace('</strong>','')+', '+response['results'][x]['country']);$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > img').attr('src',rootUrl+'public/images/default/Common/countries/'+response['results'][x]['countryalpha2']+'.png');$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(1) > a > strong').html(response['results'][x]['eventCount']+' ');$('#venuesSearchResults > div > table > tbody').append($('#venuesSearchResults > div > table > tbody > tr:first').clone());$('#venuesSearchResults > div > table > tbody > tr:last').attr('id',rootUrl+response['destinationRoute'].replace('replaceme',response['results'][x]['urlsafename']).substr(1)+'/');}
if($('#venuesSearchResults > div > table > tbody > tr').size()>1){$('#venuesSearchResults > div > table > tbody > tr:first').remove();}else{$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > strong').html('');$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > span').html('');$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(0) > a > img').attr('');$('#venuesSearchResults > div > table > tbody > tr:first > td:eq(1) > a > strong').html('');$('#venuesSearchResults > div > table > tbody > tr:first').css('visibility','hidden');}
$('.venuestable > tbody > tr > td').hover(tableMouseover,tableMouseout);$('#venuesInCountryDiv').slideUp('slow',function()
{$('#venuesOutsideCountryDiv').slideUp('slow',function(){$('#venuesSearchResults').slideDown('slow');$('#venuesSearchResults > div > table > tbody > tr').click(function(){window.location=$(this).attr('id');});});});$("#venuesearch_searchvalue").val('');}
function searchTableMouseover(){$(this).css('background-color','#CFEBFF');}
function searchTableMouseout(){$(this).css('background-color','');}
function searchNextTicketsClick(){var showCount=4;var id=parseInt($('.searchTicketBlockWrapper').attr('id').replace('searchTicketBlockWrapper',''));var nextStartId=id+showCount;if($('#searchTicketBlockWrapper'+(nextStartId)).length>0)
{$('.searchTicketBlockWrapper').each(function(){$(this).removeClass('searchTicketBlockWrapper');$(this).addClass('searchTicketBlockWrapperHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++)
{$('#searchTicketBlockWrapper'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'20'},0);$('#searchTicketBlockWrapper'+curId).removeClass('searchTicketBlockWrapperHidden');$('#searchTicketBlockWrapper'+curId).addClass('searchTicketBlockWrapper');$('#searchTicketBlockWrapper'+curId).stop().delay(80*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},500);$('#searchTicketBlockWrapper'+curId).css('position','relative');inum++;}
if($('#searchTicketBlockWrapper'+(nextStartId+showCount)).length==0){$('.searchNextTickets').css('display','none');}
else{$('.searchNextTickets').css('display','');}
if($('#searchTicketBlockWrapper'+(nextStartId-1)).length==0){$('.searchPreviousTickets').css('display','none');}
else{$('.searchPreviousTickets').css('display','');}}}
function searchPreviousTicketsClick()
{var showCount=4;var id=parseInt($('.searchTicketBlockWrapper').attr('id').replace('searchTicketBlockWrapper',''));var nextStartId=id-showCount;if($('#searchTicketBlockWrapper'+(nextStartId)).length>0){$('.searchTicketBlockWrapper').each(function(){$(this).removeClass('searchTicketBlockWrapper');$(this).addClass('searchTicketBlockWrapperHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++){$('#searchTicketBlockWrapper'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'-20'},0);$('#searchTicketBlockWrapper'+curId).removeClass('searchTicketBlockWrapperHidden');$('#searchTicketBlockWrapper'+curId).addClass('searchTicketBlockWrapper');$('#searchTicketBlockWrapper'+curId).stop().delay(80*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},500);$('#searchTicketBlockWrapper'+curId).css('position','relative');inum++;}
if($('#searchTicketBlockWrapper'+(nextStartId+showCount)).length==0){$('.searchNextTickets').css('display','none');}else{$('.searchNextTickets').css('display','');}
if($('#searchTicketBlockWrapper'+(nextStartId-1)).length==0){$('.searchPreviousTickets').css('display','none');}else{$('.searchPreviousTickets').css('display','');}}}
function searchNextVenuesClick()
{var showCount=5;var id=parseInt($('.searchVenueTable').attr('id').replace('searchVenueTable',''));var nextStartId=id+showCount;if($('#searchVenueTable'+(nextStartId)).length>0){$('.searchVenueTable').each(function(){$(this).removeClass('searchVenueTable');$(this).addClass('searchVenueTableHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++){$('#searchVenueTable'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'20'},0);$('#searchVenueTable'+curId).removeClass('searchVenueTableHidden');$('#searchVenueTable'+curId).addClass('searchVenueTable');$('#searchVenueTable'+curId).stop().delay(40*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},500);$('#searchVenueTable'+curId).css('position','relative');inum++;}
if($('#searchVenueTable'+(nextStartId+showCount)).length==0){$('.searchNextVenues').css('display','none');}
else{$('.searchNextVenues').css('display','');}
if($('#searchVenueTable'+(nextStartId-1)).length==0){$('.searchPreviousVenues').css('display','none');}else{$('.searchPreviousVenues').css('display','');}}}
function searchPreviousVenuesClick()
{var showCount=5;var id=parseInt($('.searchVenueTable').attr('id').replace('searchVenueTable',''));var nextStartId=id-showCount;if($('#searchVenueTable'+(nextStartId)).length>0){$('.searchVenueTable').each(function(){$(this).removeClass('searchVenueTable');$(this).addClass('searchVenueTableHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++){$('#searchVenueTable'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'-20'},0);$('#searchVenueTable'+curId).removeClass('searchVenueTableHidden');$('#searchVenueTable'+curId).addClass('searchVenueTable');$('#searchVenueTable'+curId).stop().delay(40*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},500);$('#searchVenueTable'+curId).css('position','relative');inum++;}
if($('#searchVenueTable'+(nextStartId+showCount)).length==0){$('.searchNextVenues').css('display','none');}else{$('.searchNextVenues').css('display','');}
if($('#searchVenueTable'+(nextStartId-1)).length==0){$('.searchPreviousVenues').css('display','none');}else{$('.searchPreviousVenues').css('display','');}}}
function quicksearch_submitClick()
{if($('#quicksearch_searchvalue').attr('value').length>0){$('#quicksearchform').submit();}}
function searchNextEventsClick()
{var showCount=12;var id=parseInt($('.searchEventBlock').attr('id').replace('searchEventBlock',''));var nextStartId=id+showCount;if($('#searchEventBlock'+(nextStartId)).length>0){$('.searchEventBlock').each(function(){$(this).removeClass('searchEventBlock');$(this).addClass('searchEventBlockHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++){$('#searchEventBlock'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'20'},0);$('#searchEventBlock'+curId).removeClass('searchEventBlockHidden');$('#searchEventBlock'+curId).addClass('searchEventBlock');$('#searchEventBlock'+curId).stop().delay(20*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},200);$('#searchEventBlock'+curId).css('position','relative');inum++;}
if($('#searchEventBlock'+(nextStartId+showCount)).length==0){$('.searchNextEvents').css('display','none');}else{$('.searchNextEvents').css('display','');}
if($('#searchEventBlock'+(nextStartId-1)).length==0){$('.searchPreviousEvents').css('display','none');}else{$('.searchPreviousEvents').css('display','');}}}
function searchPreviousEventsClick()
{var showCount=12;var id=parseInt($('.searchEventBlock').attr('id').replace('searchEventBlock',''));var nextStartId=id-showCount;if($('#searchEventBlock'+(nextStartId)).length>0){$('.searchEventBlock').each(function(){$(this).removeClass('searchEventBlock');$(this).addClass('searchEventBlockHidden');});var inum=1;for(var curId=nextStartId;curId<nextStartId+showCount;curId++){$('#searchEventBlock'+curId).css('position','absolute').stop().animate({opacity:'0',filter:'alpha(opacity=0)',left:'-20'},0);$('#searchEventBlock'+curId).removeClass('searchEventBlockHidden');$('#searchEventBlock'+curId).addClass('searchEventBlock');$('#searchEventBlock'+curId).stop().delay(20*inum).animate({opacity:'1',filter:'alpha(opacity=100)',left:'0'},200);$('#searchEventBlock'+curId).css('position','relative');inum++;}
if($('#searchEventBlock'+(nextStartId+showCount)).length==0){$('.searchNextEvents').css('display','none');}else{$('.searchNextEvents').css('display','');}
if($('#searchEventBlock'+(nextStartId-1)).length==0){$('.searchPreviousEvents').css('display','none');}else{$('.searchPreviousEvents').css('display','');}}}});function autoCompleteClick(data){var url=rootUrl+'search/engine/autocompleteclick/';$.post(url,{searchvalue:data});}
function contactformSubmit()
{if($('.inputEmail').val()==''||!/^[^@]+@[^@]+.[a-z]{2,}$/i.test($('.inputEmail').val())){error=true;$('.emailerror').show();}else{$('.emailerror').hide();}
if($('.inputSubject').val()==''){error=true;$('.subjecterror').show();}else{$('.subjecterror').hide();}
if($('.textareaMessage').val()==''){error=true;$('.messageerror').show();}else{$('.messageerror').hide();}
if(error){$('.contacterror').show('normal');return false;}
return true;}
function home_populareventClick(){hrefStart=$(this).html().indexOf('href="')+6;hrefEnd=$(this).html().indexOf('"',hrefStart)-hrefStart;window.location=$(this).html().substr(hrefStart,hrefEnd);}
function home_populareventMouseover(){var newHeight=($('.content > .extra',$(this)).height()+70)+'px';$('.content > .extra',$(this)).slideDown(300);$('.transparentCanvas',$(this)).animate({height:newHeight,opacity:0.9},300);}
function home_populareventMouseout(){$('.content > .extra',$(this)).slideUp(1000);$('.transparentCanvas',$(this)).animate({height:'50px',opacity:0.6},1000);}
function initNavHover(){var navHoverTimerId=0;$('.navHover').each(function(k,v){$('li:last',$(this)).addClass('bottomRight');$('li:eq('+($('li',$(this)).length-3)+')',$(this)).addClass('bottomLeft');});$('#tabNav div ul li a[rel!=""]').hover(function(){if(hideNavHovers($(this).attr('rel'))){$('#'+$(this).attr('rel')).css({'left':$(this).position().left-1,'top':$(this).position().top+40}).fadeIn();var t=this;$('#'+$(this).attr('rel')).hover(function(){$(t).mouseover();},function(){$(t).mouseout();});$(this).addClass('hovered');}},function(){var elementNeeded=$(this).attr('rel'),element=$(this);navHoverTimerId=setTimeout(function()
{$('#'+elementNeeded).fadeOut("fast",function(){element.removeClass('hovered');});},250);$('#'+elementNeeded).hover(function(){clearTimeout(navHoverTimerId);},function(){});$(this).hover(function(){clearTimeout(navHoverTimerId);},function(){});});}
function initSearchResults(){$('div.searchResults div.content ul li').each(function(){if(!$(this).hasClass('inactive')){$(this).hover(function(){$(this).addClass('hovered');},function(){$(this).removeClass('hovered');});$(this).click(function(){window.location.href=$('a:first',this).attr('href');return false;});}});}
function initTicketsToggle(){$('.ticketsToggle').click(function(){$(this).toggleClass('active');$(this).closest('.ticketsTickets > ul').children('.hiddenListItem').toggle(300);return false;});}
function hideNavHovers(ignore)
{$('#tabNav div ul li a').each(function(){if($(this).attr('rel')!=''){if($(this).attr('rel')!=ignore){$('#'+$(this).attr('rel')).hide();$(this).removeClass('hovered');}}});return true;}
function initToggleBoxes()
{$('.toggledBox > a').click(function()
{if($(this).parent().hasClass('toggledOut')){$('div.content',$(this).parent()).slideUp('normal',function()
{$(this).parent().removeClass('toggledOut');$(this).parent().addClass('toggledIn');if(jQuery.browser.msie&&jQuery.browser.version<7){repositionFooter();}});}else{$('div.content',$(this).parent()).slideDown('normal',function()
{$(this).parent().removeClass('toggledIn');$(this).parent().addClass('toggledOut');if(jQuery.browser.msie&&jQuery.browser.version<7){repositionFooter();}});}
return false;});}
function initTweets()
{setInterval(switchTweet,30000);}
function switchTweet()
{tweetList=$('li.tweetsList ul');currentTweet=$('li.tweetsList ul li:first');nextTweet=currentTweet.next();nextTweet.fadeIn(500);currentTweet.slideUp(500,function(){currentTweet.appendTo(tweetList);});}
function initGraphs()
{$('.ticketsTickets.EventVenuePage li ul').each(function(){$(this).hover(function(){changeGraph($(this).attr('id'));},function(){changeGraph('default');});});}
var curDivId='';function changeGraph(divId)
{if(divId=='default'){realDivId='default';}else{realDivId='div_'+divId;}
$('#'+realDivId).parent().children('.graphDiv').each(function()
{id=$(this).attr('id');if(id!=null){if(id!=divId){$('#'+id).css({'display':'none'});}}});$('#'+realDivId).css({'display':'block'});}
function initPopups()
{$('.showPopup').click(function(){if(jQuery.browser.msie&&jQuery.browser.version<7){return true;}
var popup=new Boxy('<div id="boxy" style="position: relative;"><div class="close" style="position: absolute; width: 30px; height: 30px; right: -20px; top: -20px; z-index: 3; cursor: pointer;"><img src="/public/images/version2/core/overlay/closebox.png" alt="Close" /></div><div class="content"><div class="loading"></div></div></div>',{title:false,modal:true});$(document).keyup(function(e){if(e.keyCode==27){popup.hide();}});$.post(rootUrl+'events/view/venue-popup',{'url':$(this).attr('href'),'date':$(this).attr('rel')},function(data){popup.setContent(data.html);popup.moveTo(null,null);$('#boxy a.order').click(function(){$(this).parent('li').click();return false;});},'json');return false;});}
function initEvents()
{$('.eventPage a.noOnClick').click(function(){var ticketRow=$(this).closest('li.ticketRow');var clickFunction=$(this).closest('li.ticketRow').attr('onclick');$(this).closest('li.ticketRow').attr('onclick','');$(this).closest('li.ticketRow').unbind('click');$(this).closest('li.ticketRow').stop(true,true);setTimeout(function(){ticketRow.click(clickFunction);},500);return false;});}
function initVenues()
{$('.ticketsTabs li a').click(function(){if(!$(this).parent().hasClass('inactive')){hashTag=this.href.split('#')[1];$('.ticketsTabs li a.hovered').removeClass('hovered');$(this).addClass('hovered');if($('#Wrapper_'+hashTag).html()==''){anchorClicked=$(this);anchorClicked.addClass('loading');$.post(rootUrl+'venues/index/shows-for-venue/','venueId='+$('#venueId').val()+'&month='+$(this).attr('id'),function(html){$('div.monthWrapper:not(:last)').hide();anchorClicked.removeClass('loading');$('div.monthWrapper:last').show();$('#Wrapper_'+hashTag).hide().html(html).show();initPopups();if(jQuery.browser.msie&&jQuery.browser.version<7){repositionFooter();}
if(jQuery.browser.msie&&jQuery.browser.version<8){$('.adsense').hide().show();}});}else{$('div.monthWrapper:not(:last)').hide();$('div.monthWrapper:last').hide();$('#Wrapper_'+hashTag).show();if(jQuery.browser.msie&&jQuery.browser.version<7){repositionFooter();}
if(jQuery.browser.msie&&jQuery.browser.version<8){$('.adsense').hide().show();}}}
return false;});}
function repositionFooter()
{offset=$('#footerBumper').offset();$('#footerWrapper').css('top',(offset.top)+'px');}
function initFilter(element)
{JsonFilter=getJsonFilterArray();selectedValues=new Array();if(element!=null){$(element).removeAttr('rel');JsonFilter=applyTicketsFilter();$('ul.filterList select').each(function(key){if($(this).attr('rel')!='autoset'){selectedValues[key]=$('option:selected',this).val();}
if(key!=1){$('option',this).remove();}});count=0;for(var i in JsonFilter){if(JsonFilter[i]!=null){count++;}}
$('.filteredTicketCount').html(count);if(count==0){if(selectedValues[1]!=''){initFilter(element);return false;}}}else{$('ul.filterList select').each(function(){$(this).html('');});count=0;for(var i in JsonFilter){if(JsonFilter[i]!=null){count++;}}
$('.filteredTicketCount').html(count);$('.totalTicketCount').html(count);}
availableDays=getJsonFilterDaysArray();for(var i in JsonFilter){for(var select in JsonFilter[i]){if(!$('ul.filterList select:eq('+select+') option[value='+JsonFilter[i][select]+']').exists()){$('ul.filterList select:eq('+select+')').append($('<option></option>').attr('value',JsonFilter[i][select]).text(ucfirst(JsonFilter[i][select])));if(select==3){if(JsonFilter[i][select]==availableDays[4]||JsonFilter[i][select]==availableDays[5]||JsonFilter[i][select]==availableDays[6]){if(!$('ul.filterList select:eq('+select+') option[value='+availableDays[7]+']').exists()){$('ul.filterList select:eq('+select+')').append($('<option></option>').attr('value',availableDays[7]).text(ucfirst(availableDays[7])));}}}}}}
if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$('ul.filterList select:eq(2)').sortOptions();}
values=new Array();daySelect=$('ul.filterList select:eq(3)');$('option',daySelect).each(function(){values[values.length]=$(this).val();});values.sort(sortDays);$('option',daySelect).remove();$(values).each(function(){$(daySelect).append('<option value="'+this+'">'+ucfirst(this)+'</option>');});$('ul.filterList select').each(function(key){if(element==null&&key==1){if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$(this).sortOptions();}}
if(element==null||(element!=null&&key!=1)){$(this).prepend($('<option></option>').attr('value','').text($(this).attr('title')));$('option:first',this).attr('selected',true);}
if(element==null){$(this).change(function(){initFilter($(this));});}
if(selectedValues[key]!=null){$('option',this).each(function(optionKey){if(selectedValues[key]==$(this).val()){$(this).attr('selected',true);}});}
if(key!=1){if($('option',this).length==2){if(element==null){$('option:last',this).attr('selected',true);$(this).attr('rel','autoset');}else{if(element.attr('name')!=$(this).attr('name')){$('option:last',this).attr('selected',true);$(this).attr('rel','autoset');}}}}else{availableCountries=new Array();for(var i in JsonFilter){if(JsonFilter[i]!=null){if(availableCountries.join().indexOf(JsonFilter[i][1])==-1){availableCountries[availableCountries.length]=JsonFilter[i][1];}}}
if(availableCountries.length==1){if(element==null){if(jQuery.browser.msie&&jQuery.browser.version<7){setTimeout("$('select[name=country] option:last').attr('selected', true);",100);}else{$('option:last',this).attr('selected',true);}}}}});}
function applyTicketsFilter(){optionsSelected=Array();visibleTicketRows=getJsonFilterArray();completeArray=getJsonFilterArray();availableDays=getJsonFilterDaysArray();$('ul.filterList select').each(function(k,v){if($('option:selected',this).exists()){optionsSelected[k]=$('option:selected',this);}else{optionsSelected[k]=null;}});for(var i in completeArray){for(var select in completeArray[i]){if(optionsSelected[select]!=null&&$(optionsSelected[select]).parent().attr('rel')!='autoset'){if($(optionsSelected[select]).val()!=''&&$(optionsSelected[select]).val()!=completeArray[i][select]){if(select==3){if($(optionsSelected[select]).val()==availableDays[7]){if(completeArray[i][select]==availableDays[4]||completeArray[i][select]==availableDays[5]||completeArray[i][select]==availableDays[6]){continue;}}}
visibleTicketRows[i]=null;}}}}
$('.ticketsTickets ul li.ticketRow').each(function(){if(visibleTicketRows[$(this).attr('id').substr(2)]!=null){$(this).slideDown('normal',function()
{if(!$(this).parent().is(':visible')){$(this).parent().slideDown('normal');}
$(this).hide().show();});}else{$(this).slideUp('normal',function()
{if($(this).parent().children(':visible').length==1){if($(this).parent().is(':visible')){$(this).parent().slideUp('normal');}}});}});return visibleTicketRows;}
var newsletterEmailChangeBool=false;function newsletterEmailChange()
{newsletterEmailChangeBool=true;}
function newsletterEmailFocus()
{if(newsletterEmailChangeBool==false){$(this).css('color','black');$(this).val('');}}
function newsletterSignupClick()
{if(newsletterEmailChangeBool&&/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($('.newsletterEmail').val())){$('.newsletterEmailSubmition').html($('.newsletterEmail').val());$.post(rootUrl+'newsletter/subscription/add','eventId='+$('input[name=eid]').val()+'&email='+$('.newsletterEmail',$(this).parent()).val()+'&sourceEventId='+$('input[name=eid]').val()+'&sourceVenueId='+$('input[name=vid]').val());$(this).parent().parent().slideUp('normal',function(){$('.newsletterSuccess').slideDown('normal');});}else{$('.newsletterEmail').css('color','red');newsletterEmailChangeBool=false;}}
function sortDays(a,b)
{template=getJsonFilterDaysArray();a=template.join().indexOf(a);b=template.join().indexOf(b);if(a<b){return-1}else if(a==b){return 0;}else{return 1;}}
function ucfirst(str)
{str+='';var f=str.charAt(0).toUpperCase();return f+str.substr(1);}
jQuery.fn.exists=function(){return this.length>0;}
function initDialogs()
{$('.jQueryDialog').dialog({'modal':true,'resizable':false,'draggable':false,'width':500,open:function(e,ui){$('.ui-widget-overlay').click(function(){$('.jQueryDialog').dialog('close');});},beforeclose:function(e,ui){$('.ui-dialog').fadeOut(500,function(){$(this).remove();});$('.ui-widget-overlay').fadeOut(500,function(){$(this).remove();});return false;}});}
function removeSuggestionBox(){$('#suggestionBox').slideUp(300,function(){$(this).html('');$('.searchShadow').removeClass('active');});}
function initSearchbar()
{var timeoutId;$('#quicksearchform').attr('autocomplete','off');$('.keywordsInput').keyup(function(e){if($(this).val().length>1){inputField=$(this);inputFieldPosition=inputField.offset();topOffset=Math.ceil((inputFieldPosition.top*1)+(inputField.height()*1)+(inputField.css('padding-top').replace('px','')*1)+(inputField.css('padding-bottom').replace('px','')*1));leftOffset=Math.ceil(inputFieldPosition.left-6);code=(e.keyCode?e.keyCode:e.which);if(code==40||code==38){var suggestionBox=$('#suggestionBox');if($('li.hovered',suggestionBox).length==0){editElement=$('li:first',suggestionBox);}else{currentElement=$('li.hovered',suggestionBox);if(e.keyCode==40){index=$('#suggestionBox li').index(currentElement)+1;}else{index=$('#suggestionBox li').index(currentElement)-1;}
editElement=$('li:eq('+index+')',suggestionBox);currentElement.removeClass('hovered');}
editElement.addClass('hovered');}else if(e.keyCode==27){$(this).blur();}else{clearTimeout(timeoutId);$('.searchLoadingImage').fadeIn(100);timeoutId=setTimeout(function()
{$.post(rootUrl+'search/engine/autosearch/searchvalue',{'q':$('.keywordsInput').val()},function(data){$('#suggestionBox').html(data);$('#suggestionBox').css({'left':leftOffset,'top':topOffset});$('#suggestionBox').slideDown(300);$('.searchShadow').addClass('active');$('#suggestionBox li').hover(function(){$(this).addClass('hovered');},function(){$(this).removeClass('hovered');});$('.searchLoadingImage').fadeOut(100);});},500);}
$('#quicksearchform').submit(function(){if($('#suggestionBox li.hovered').length==1){window.location.href=$('a:first',$('#suggestionBox li.hovered')).attr('href');return false;}});}});$('.keywordsInput').blur(function(){setTimeout('removeSuggestionBox();',200);});}
function albumsThumbClick()
{smallImage=$('img',this);selectedImage=$('.albumsSelected > .albumImage img');clickedAlbum=$(this);var positionOffset=smallImage.offset();var position=smallImage.position();var width=selectedImage.width();var height=selectedImage.height();clone=smallImage.clone(true).appendTo(smallImage.parent());clone.css('position','absolute').animate({left:'-='+(positionOffset.left-selectedImage.offset().left),top:'-='+(positionOffset.top-selectedImage.offset().top),width:width,height:height,opacity:0},200,function()
{$(this).remove();selectedImage.attr('src',smallImage.attr('src').replace('60','260'));$('.albumsSelected').removeAttr('onclick');$('.albumsSelected').unbind('click');$('.albumsSelected').bind('click',function()
{pageTracker._trackPageview('extra/Amazon/'+$('.eventname').text());window.open($('.detailPageURL',clickedAlbum).text());});$('.albumsSelected > .albumInfo > h5').text($('.title',clickedAlbum).text());$('.albumsSelected > .albumInfo > p > span').text($('.price',clickedAlbum).text());$('.albumsSelected > p > small > span').text($('.retrievalDate',clickedAlbum).text());});return false;}
function hideShow(id){var result=prompt('Reason:','');if(result!=null){$('#reasontext_'+id).val(result);$('#hideform_'+id).submit();}}
function initHovers()
{elements=['.ticketBox','div.ticketsBox div.ticketsTickets ul > li.ticketRow','li.ticketRow','#boxy ul.ticketsList > li.ticketRow'];for(element in elements){$(elements[element]).hover(function(){$(this).addClass('hovered');},function(){$(this).removeClass('hovered');});}}
function initPremiumMerchants()
{$('.toggleNonPremium').click(function(){$('li.nonPremium',$(this).closest('ul.ticketsList')).slideDown(300);$(this).closest('li.header').slideUp(500);return false;});}
