/*!
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.9995 (09-AUG-2011)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.3.2 or later
 */
(function(a){function c(b){a.fn.cycle.debug&&d(b)}function d(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function e(b,c,d){var e=a(b).data("cycle.opts"),f=!!b.cyclePause;f&&e.paused?e.paused(b,e,c,d):!f&&e.resumed&&e.resumed(b,e,c,d)}function f(b,c,f){function j(b,c,e){if(!b&&c===!0){var f=a(e).data("cycle.opts");if(!f)return d("options not found, can not resume"),!1;e.cycleTimeout&&(clearTimeout(e.cycleTimeout),e.cycleTimeout=0),m(f.elements,f,1,!f.backwards)}}b.cycleStop==undefined&&(b.cycleStop=0);if(c===undefined||c===null)c={};if(c.constructor==String){switch(c){case"destroy":case"stop":var g=a(b).data("cycle.opts");if(!g)return!1;return b.cycleStop++,b.cycleTimeout&&clearTimeout(b.cycleTimeout),b.cycleTimeout=0,g.elements&&a(g.elements).stop(),a(b).removeData("cycle.opts"),c=="destroy"&&h(g),!1;case"toggle":return b.cyclePause=b.cyclePause===1?0:1,j(b.cyclePause,f,b),e(b),!1;case"pause":return b.cyclePause=1,e(b),!1;case"resume":return b.cyclePause=0,j(!1,f,b),e(b),!1;case"prev":case"next":var g=a(b).data("cycle.opts");if(!g)return d('options not found, "prev/next" ignored'),!1;return a.fn.cycle[c](g),!1;default:c={fx:c}}return c}if(c.constructor==Number){var i=c;return c=a(b).data("cycle.opts"),c?i<0||i>=c.elements.length?(d("invalid slide index: "+i),!1):(c.nextSlide=i,b.cycleTimeout&&(clearTimeout(b.cycleTimeout),b.cycleTimeout=0),typeof f=="string"&&(c.oneTimeFx=f),m(c.elements,c,1,i>=c.currSlide),!1):(d("options not found, can not advance slide"),!1)}return c}function g(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter)try{b.style.removeAttribute("filter")}catch(d){}}function h(b){b.next&&a(b.next).unbind(b.prevNextEvent),b.prev&&a(b.prev).unbind(b.prevNextEvent),(b.pager||b.pagerAnchorBuilder)&&a.each(b.pagerAnchors||[],function(){this.unbind().remove()}),b.pagerAnchors=null,b.destroy&&b.destroy(b)}function i(b,c,f,h,i){var n=a.extend({},a.fn.cycle.defaults,h||{},a.metadata?b.metadata():a.meta?b.data():{}),p=a.isFunction(b.data)?b.data(n.metaAttr):null;p&&(n=a.extend(n,p)),n.autostop&&(n.countdown=n.autostopCount||f.length);var s=b[0];b.data("cycle.opts",n),n.$cont=b,n.stopCount=s.cycleStop,n.elements=f,n.before=n.before?[n.before]:[],n.after=n.after?[n.after]:[],!a.support.opacity&&n.cleartype&&n.after.push(function(){g(this,n)}),n.continuous&&n.after.push(function(){m(f,n,0,!n.backwards)}),j(n),!a.support.opacity&&n.cleartype&&!n.cleartypeNoBg&&r(c),b.css("position")=="static"&&b.css("position","relative"),n.width&&b.width(n.width),n.height&&n.height!="auto"&&b.height(n.height),n.startingSlide?n.startingSlide=parseInt(n.startingSlide,10):n.backwards&&(n.startingSlide=f.length-1);if(n.random){n.randomMap=[];for(var t=0;t<f.length;t++)n.randomMap.push(t);n.randomMap.sort(function(a,b){return Math.random()-.5}),n.randomIndex=1,n.startingSlide=n.randomMap[1]}else n.startingSlide>=f.length&&(n.startingSlide=0);n.currSlide=n.startingSlide||0;var u=n.startingSlide;c.css({position:"absolute",top:0,left:0}).hide().each(function(b){var c;n.backwards?c=u?b<=u?f.length+(b-u):u-b:f.length-b:c=u?b>=u?f.length-(b-u):u-b:f.length-b,a(this).css("z-index",c)}),a(f[u]).css("opacity",1).show(),g(f[u],n),n.fit&&(n.aspect?c.each(function(){var b=a(this),c=n.aspect===!0?b.width()/b.height():n.aspect;n.width&&b.width()!=n.width&&(b.width(n.width),b.height(n.width/c)),n.height&&b.height()<n.height&&(b.height(n.height),b.width(n.height*c))}):(n.width&&c.width(n.width),n.height&&n.height!="auto"&&c.height(n.height))),n.center&&(!n.fit||n.aspect)&&c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})}),n.center&&!n.fit&&!n.slideResize&&c.each(function(){var b=a(this);b.css({"margin-left":n.width?(n.width-b.width())/2+"px":0,"margin-top":n.height?(n.height-b.height())/2+"px":0})});var v=n.containerResize&&!b.innerHeight();if(v){var w=0,x=0;for(var y=0;y<f.length;y++){var z=a(f[y]),A=z[0],B=z.outerWidth(),C=z.outerHeight();B||(B=A.offsetWidth||A.width||z.attr("width")),C||(C=A.offsetHeight||A.height||z.attr("height")),w=B>w?B:w,x=C>x?C:x}w>0&&x>0&&b.css({width:w+"px",height:x+"px"})}var D=!1;n.pause&&b.hover(function(){D=!0,this.cyclePause++,e(s,!0)},function(){D&&this.cyclePause--,e(s,!0)});if(k(n)===!1)return!1;var E=!1;h.requeueAttempts=h.requeueAttempts||0,c.each(function(){var b=a(this);this.cycleH=n.fit&&n.height?n.height:b.height()||this.offsetHeight||this.height||b.attr("height")||0,this.cycleW=n.fit&&n.width?n.width:b.width()||this.offsetWidth||this.width||b.attr("width")||0;if(b.is("img")){var c=a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete,e=a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete,f=a.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,g=this.cycleH==0&&this.cycleW==0&&!this.complete;if(c||e||f||g){if(i.s&&n.requeueOnImageNotLoaded&&++h.requeueAttempts<100)return d(h.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH),setTimeout(function(){a(i.s,i.c).cycle(h)},n.requeueTimeout),E=!0,!1;d("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}return!0});if(E)return!1;n.cssBefore=n.cssBefore||{},n.cssAfter=n.cssAfter||{},n.cssFirst=n.cssFirst||{},n.animIn=n.animIn||{},n.animOut=n.animOut||{},c.not(":eq("+u+")").css(n.cssBefore),a(c[u]).css(n.cssFirst);if(n.timeout){n.timeout=parseInt(n.timeout,10),n.speed.constructor==String&&(n.speed=a.fx.speeds[n.speed]||parseInt(n.speed,10)),n.sync||(n.speed=n.speed/2);var F=n.fx=="none"?0:n.fx=="shuffle"?500:250;while(n.timeout-n.speed<F)n.timeout+=n.speed}n.easing&&(n.easeIn=n.easeOut=n.easing),n.speedIn||(n.speedIn=n.speed),n.speedOut||(n.speedOut=n.speed),n.slideCount=f.length,n.currSlide=n.lastSlide=u,n.random?(++n.randomIndex==f.length&&(n.randomIndex=0),n.nextSlide=n.randomMap[n.randomIndex]):n.backwards?n.nextSlide=n.startingSlide==0?f.length-1:n.startingSlide-1:n.nextSlide=n.startingSlide>=f.length-1?0:n.startingSlide+1;if(!n.multiFx){var G=a.fn.cycle.transitions[n.fx];if(a.isFunction(G))G(b,c,n);else if(n.fx!="custom"&&!n.multiFx)return d("unknown transition: "+n.fx,"; slideshow terminating"),!1}var H=c[u];return n.skipInitializationCallbacks||(n.before.length&&n.before[0].apply(H,[H,H,n,!0]),n.after.length&&n.after[0].apply(H,[H,H,n,!0])),n.next&&a(n.next).bind(n.prevNextEvent,function(){return o(n,1)}),n.prev&&a(n.prev).bind(n.prevNextEvent,function(){return o(n,0)}),(n.pager||n.pagerAnchorBuilder)&&q(f,n),l(n,f),n}function j(b){b.original={before:[],after:[]},b.original.cssBefore=a.extend({},b.cssBefore),b.original.cssAfter=a.extend({},b.cssAfter),b.original.animIn=a.extend({},b.animIn),b.original.animOut=a.extend({},b.animOut),a.each(b.before,function(){b.original.before.push(this)}),a.each(b.after,function(){b.original.after.push(this)})}function k(b){var e,f,g=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=!0,b.fxs=b.fx.replace(/\s*/g,"").split(",");for(e=0;e<b.fxs.length;e++){var h=b.fxs[e];f=g[h];if(!f||!g.hasOwnProperty(h)||!a.isFunction(f))d("discarding unknown transition: ",h),b.fxs.splice(e,1),e--}if(!b.fxs.length)return d("No valid transitions named; slideshow terminating."),!1}else if(b.fx=="all"){b.multiFx=!0,b.fxs=[];for(p in g)f=g[p],g.hasOwnProperty(p)&&a.isFunction(f)&&b.fxs.push(p)}if(b.multiFx&&b.randomizeEffects){var i=Math.floor(Math.random()*20)+30;for(e=0;e<i;e++){var j=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(j,1)[0])}c("randomized fx sequence: ",b.fxs)}return!0}function l(b,c){b.addSlide=function(d,e){var f=a(d),g=f[0];b.autostopCount||b.countdown++,c[e?"unshift":"push"](g),b.els&&b.els[e?"unshift":"push"](g),b.slideCount=c.length,f.css("position","absolute"),f[e?"prependTo":"appendTo"](b.$cont),e&&(b.currSlide++,b.nextSlide++),!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg&&r(f),b.fit&&b.width&&f.width(b.width),b.fit&&b.height&&b.height!="auto"&&f.height(b.height),g.cycleH=b.fit&&b.height?b.height:f.height(),g.cycleW=b.fit&&b.width?b.width:f.width(),f.css(b.cssBefore),(b.pager||b.pagerAnchorBuilder)&&a.fn.cycle.createPagerAnchor(c.length-1,g,a(b.pager),c,b),a.isFunction(b.onAddSlide)?b.onAddSlide(f):f.hide()}}function m(b,d,e,f){e&&d.busy&&d.manualTrump&&(c("manualTrump in go(), stopping active transition"),a(b).stop(!0,!0),d.busy=0);if(d.busy){c("transition active, ignoring new tx request");return}var g=d.$cont[0],h=b[d.currSlide],i=b[d.nextSlide];if(g.cycleStop!=d.stopCount||g.cycleTimeout===0&&!e)return;if(!e&&!g.cyclePause&&!d.bounce&&(d.autostop&&--d.countdown<=0||d.nowrap&&!d.random&&d.nextSlide<d.currSlide)){d.end&&d.end(d);return}var j=!1;if((e||!g.cyclePause)&&d.nextSlide!=d.currSlide){j=!0;var k=d.fx;h.cycleH=h.cycleH||a(h).height(),h.cycleW=h.cycleW||a(h).width(),i.cycleH=i.cycleH||a(i).height(),i.cycleW=i.cycleW||a(i).width(),d.multiFx&&(f&&(d.lastFx==undefined||++d.lastFx>=d.fxs.length)?d.lastFx=0:!f&&(d.lastFx==undefined||--d.lastFx<0)&&(d.lastFx=d.fxs.length-1),k=d.fxs[d.lastFx]),d.oneTimeFx&&(k=d.oneTimeFx,d.oneTimeFx=null),a.fn.cycle.resetState(d,k),d.before.length&&a.each(d.before,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])});var l=function(){d.busy=0,a.each(d.after,function(a,b){if(g.cycleStop!=d.stopCount)return;b.apply(i,[h,i,d,f])})};c("tx firing("+k+"); currSlide: "+d.currSlide+"; nextSlide: "+d.nextSlide),d.busy=1,d.fxFn?d.fxFn(h,i,d,l,f,e&&d.fastOnEvent):a.isFunction(a.fn.cycle[d.fx])?a.fn.cycle[d.fx](h,i,d,l,f,e&&d.fastOnEvent):a.fn.cycle.custom(h,i,d,l,f,e&&d.fastOnEvent)}if(j||d.nextSlide==d.currSlide){d.lastSlide=d.currSlide;if(d.random)d.currSlide=d.nextSlide,++d.randomIndex==b.length&&(d.randomIndex=0),d.nextSlide=d.randomMap[d.randomIndex],d.nextSlide==d.currSlide&&(d.nextSlide=d.currSlide==d.slideCount-1?0:d.currSlide+1);else if(d.backwards){var o=d.nextSlide-1<0;o&&d.bounce?(d.backwards=!d.backwards,d.nextSlide=1,d.currSlide=0):(d.nextSlide=o?b.length-1:d.nextSlide-1,d.currSlide=o?0:d.nextSlide+1)}else{var o=d.nextSlide+1==b.length;o&&d.bounce?(d.backwards=!d.backwards,d.nextSlide=b.length-2,d.currSlide=b.length-1):(d.nextSlide=o?0:d.nextSlide+1,d.currSlide=o?b.length-1:d.nextSlide-1)}}j&&d.pager&&d.updateActivePagerLink(d.pager,d.currSlide,d.activePagerClass);var p=0;d.timeout&&!d.continuous?p=n(b[d.currSlide],b[d.nextSlide],d,f):d.continuous&&g.cyclePause&&(p=10),p>0&&(g.cycleTimeout=setTimeout(function(){m(b,d,0,!d.backwards)},p))}function n(a,b,d,e){if(d.timeoutFn){var f=d.timeoutFn.call(a,a,b,d,e);while(d.fx!="none"&&f-d.speed<250)f+=d.speed;c("calculated timeout: "+f+"; speed: "+d.speed);if(f!==!1)return f}return d.timeout}function o(b,c){var d=c?1:-1,e=b.elements,f=b.$cont[0],g=f.cycleTimeout;g&&(clearTimeout(g),f.cycleTimeout=0);if(b.random&&d<0)b.randomIndex--,--b.randomIndex==-2?b.randomIndex=e.length-2:b.randomIndex==-1&&(b.randomIndex=e.length-1),b.nextSlide=b.randomMap[b.randomIndex];else if(b.random)b.nextSlide=b.randomMap[b.randomIndex];else{b.nextSlide=b.currSlide+d;if(b.nextSlide<0){if(b.nowrap)return!1;b.nextSlide=e.length-1}else if(b.nextSlide>=e.length){if(b.nowrap)return!1;b.nextSlide=0}}var h=b.onPrevNextEvent||b.prevNextClick;return a.isFunction(h)&&h(d>0,b.nextSlide,e[b.nextSlide]),m(e,b,1,c),!1}function q(b,c){var d=a(c.pager);a.each(b,function(e,f){a.fn.cycle.createPagerAnchor(e,f,d,b,c)}),c.updateActivePagerLink(c.pager,c.startingSlide,c.activePagerClass)}function r(b){function d(a){return a=parseInt(a,10).toString(16),a.length<2?"0"+a:a}function e(b){for(;b&&b.nodeName.toLowerCase()!="html";b=b.parentNode){var c=a.css(b,"background-color");if(c&&c.indexOf("rgb")>=0){var e=c.match(/\d+/g);return"#"+d(e[0])+d(e[1])+d(e[2])}if(c&&c!="transparent")return c}return"#ffffff"}c("applying clearType background-color hack"),b.each(function(){a(this).css("background-color",e(this))})}var b="2.9995";a.support==undefined&&(a.support={opacity:!a.browser.msie}),a.expr[":"].paused=function(a){return a.cyclePause},a.fn.cycle=function(b,e){var g={s:this.selector,c:this.context};return this.length===0&&b!="stop"?!a.isReady&&g.s?(d("DOM not ready, queuing slideshow"),a(function(){a(g.s,g.c).cycle(b,e)}),this):(d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this):this.each(function(){var h=f(this,b,e);if(h===!1)return;h.updateActivePagerLink=h.updateActivePagerLink||a.fn.cycle.updateActivePagerLink,this.cycleTimeout&&clearTimeout(this.cycleTimeout),this.cycleTimeout=this.cyclePause=0;var j=a(this),k=h.slideExpr?a(h.slideExpr,this):j.children(),l=k.get(),o=i(j,k,l,h,g);if(o===!1)return;if(l.length<2){d("terminating; too few slides: "+l.length);return}var p=o.continuous?10:n(l[o.currSlide],l[o.nextSlide],o,!o.backwards);p&&(p+=o.delay||0,p<10&&(p=10),c("first timeout: "+p),this.cycleTimeout=setTimeout(function(){m(l,o,0,!h.backwards)},p))})},a.fn.cycle.resetState=function(b,c){c=c||b.fx,b.before=[],b.after=[],b.cssBefore=a.extend({},b.original.cssBefore),b.cssAfter=a.extend({},b.original.cssAfter),b.animIn=a.extend({},b.original.animIn),b.animOut=a.extend({},b.original.animOut),b.fxFn=null,a.each(b.original.before,function(){b.before.push(this)}),a.each(b.original.after,function(){b.after.push(this)});var d=a.fn.cycle.transitions[c];a.isFunction(d)&&d(b.$cont,a(b.elements),b)},a.fn.cycle.updateActivePagerLink=function(b,c,d){a(b).each(function(){a(this).children().removeClass(d).eq(c).addClass(d)})},a.fn.cycle.next=function(a){o(a,1)},a.fn.cycle.prev=function(a){o(a,0)},a.fn.cycle.createPagerAnchor=function(b,d,f,g,h){var i;a.isFunction(h.pagerAnchorBuilder)?(i=h.pagerAnchorBuilder(b,d),c("pagerAnchorBuilder("+b+", el) returned: "+i)):i='<a href="#">'+(b+1)+"</a>";if(!i)return;var j=a(i);if(j.parents("body").length===0){var k=[];f.length>1?(f.each(function(){var b=j.clone(!0);a(this).append(b),k.push(b[0])}),j=a(k)):j.appendTo(f)}h.pagerAnchors=h.pagerAnchors||[],h.pagerAnchors.push(j);var l=function(c){c.preventDefault(),h.nextSlide=b;var d=h.$cont[0],e=d.cycleTimeout;e&&(clearTimeout(e),d.cycleTimeout=0);var f=h.onPagerEvent||h.pagerClick;a.isFunction(f)&&f(h.nextSlide,g[h.nextSlide]),m(g,h,1,h.currSlide<b)};/mouseenter|mouseover/i.test(h.pagerEvent)?j.hover(l,function(){}):j.bind(h.pagerEvent,l),!/^click/.test(h.pagerEvent)&&!h.allowPagerClickBubble&&j.bind("click.cycle",function(){return!1});var n=h.$cont[0],o=!1;h.pauseOnPagerHover&&j.hover(function(){o=!0,n.cyclePause++,e(n,!0,!0)},function(){o&&n.cyclePause--,e(n,!0,!0)})},a.fn.cycle.hopsFromLast=function(a,b){var c,d=a.lastSlide,e=a.currSlide;return b?c=e>d?e-d:a.slideCount-d:c=e<d?d-e:d+a.slideCount-e,c},a.fn.cycle.commonReset=function(b,c,d,e,f,g){a(d.elements).not(b).hide(),typeof d.cssBefore.opacity=="undefined"&&(d.cssBefore.opacity=1),d.cssBefore.display="block",d.slideResize&&e!==!1&&c.cycleW>0&&(d.cssBefore.width=c.cycleW),d.slideResize&&f!==!1&&c.cycleH>0&&(d.cssBefore.height=c.cycleH),d.cssAfter=d.cssAfter||{},d.cssAfter.display="none",a(b).css("zIndex",d.slideCount+(g===!0?1:0)),a(c).css("zIndex",d.slideCount+(g===!0?0:1))},a.fn.cycle.custom=function(b,c,d,e,f,g){var h=a(b),i=a(c),j=d.speedIn,k=d.speedOut,l=d.easeIn,m=d.easeOut;i.css(d.cssBefore),g&&(typeof g=="number"?j=k=g:j=k=1,l=m=null);var n=function(){i.animate(d.animIn,j,l,function(){e()})};h.animate(d.animOut,k,m,function(){h.css(d.cssAfter),d.sync||n()}),d.sync&&n()},a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0),d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.cssBefore.opacity=0}),d.animIn={opacity:1},d.animOut={opacity:0},d.cssBefore={top:0,left:0}}},a.fn.cycle.ver=function(){return b},a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:!1,animIn:null,animOut:null,aspect:!1,autostop:0,autostopCount:0,backwards:!1,before:null,center:null,cleartype:!a.support.opacity,cleartypeNoBg:!1,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:!0,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:!0,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:!1,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery),function(a){a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(b,c,d,e){a(c).show(),a(b).hide(),e()}},a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1}),d.before.push(function(b,c,d,e,f,g){a(b).css("zIndex",d.slideCount+(!g==1?1:0)),a(c).css("zIndex",d.slideCount+(!g==1?0:1))}),d.animIn.opacity=1,d.animOut.opacity=0,d.cssBefore.opacity=1,d.cssBefore.display="block",d.cssAfter.zIndex=0},a.fn.cycle.transitions.scrollUp=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssBefore.top=e,d.cssBefore.left=0,d.cssFirst.top=0,d.animIn.top=0,d.animOut.top=-e},a.fn.cycle.transitions.scrollDown=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssFirst.top=0,d.cssBefore.top=-e,d.cssBefore.left=0,d.animIn.top=0,d.animOut.top=e},a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0,d.cssBefore.left=e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=0-e},a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden"),d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0,d.cssBefore.left=-e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=e},a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width(),d.before.push(function(b,c,d,e){d.rev&&(e=!e),a.fn.cycle.commonReset(b,c,d),d.cssBefore.left=e?c.cycleW-1:1-c.cycleW,d.animOut.left=e?-b.cycleW:b.cycleW}),d.cssFirst.left=0,d.cssBefore.top=0,d.animIn.left=0,d.animOut.top=0},a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden"),d.before.push(function(b,c,d,e){d.rev&&(e=!e),a.fn.cycle.commonReset(b,c,d),d.cssBefore.top=e?1-c.cycleH:c.cycleH-1,d.animOut.top=e?b.cycleH:-b.cycleH}),d.cssFirst.top=0,d.cssBefore.left=0,d.animIn.top=0,d.animOut.left=0},a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide(),a.fn.cycle.commonReset(b,c,d,!1,!0),d.animIn.width=c.cycleW}),d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.width=0,d.animIn.width="show",d.animOut.width=0},a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide(),a.fn.cycle.commonReset(b,c,d,!0,!1),d.animIn.height=c.cycleH}),d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.height=0,d.animIn.height="show",d.animOut.height=0},a.fn.cycle.transitions.shuffle=function(b,c,d){var e,f=b.css("overflow","visible").width();c.css({left:0,top:0}),d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0)}),d.speedAdjusted||(d.speed=d.speed/2,d.speedAdjusted=!0),d.random=0,d.shuffle=d.shuffle||{left:-f,top:15},d.els=[];for(e=0;e<c.length;e++)d.els.push(c[e]);for(e=0;e<d.currSlide;e++)d.els.push(d.els.shift());d.fxFn=function(b,c,d,e,f){d.rev&&(f=!f);var g=f?a(b):a(c);a(c).css(d.cssBefore);var h=d.slideCount;g.animate(d.shuffle,d.speedIn,d.easeIn,function(){var c=a.fn.cycle.hopsFromLast(d,f);for(var i=0;i<c;i++)f?d.els.push(d.els.shift()):d.els.unshift(d.els.pop());if(f)for(var j=0,k=d.els.length;j<k;j++)a(d.els[j]).css("z-index",k-j+h);else{var l=a(b).css("z-index");g.css("z-index",parseInt(l,10)+1+h)}g.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(f?this:b).hide(),e&&e()})})},a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})},a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.cssBefore.top=c.cycleH,d.animIn.height=c.cycleH,d.animOut.width=c.cycleW}),d.cssFirst.top=0,d.cssBefore.left=0,d.cssBefore.height=0,d.animIn.top=0,d.animOut.height=0},a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssFirst.top=0,d.cssBefore.left=0,d.cssBefore.top=0,d.cssBefore.height=0,d.animOut.height=0},a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.cssBefore.left=c.cycleW,d.animIn.width=c.cycleW}),d.cssBefore.top=0,d.cssBefore.width=0,d.animIn.left=0,d.animOut.width=0},a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.animIn.width=c.cycleW,d.animOut.left=b.cycleW}),a.extend(d.cssBefore,{top:0,left:0,width:0}),d.animIn.left=0,d.animOut.width=0},a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!1,!0),d.cssBefore.top=c.cycleH/2,d.cssBefore.left=c.cycleW/2,a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH}),a.extend(d.animOut,{width:0,height:0,top:b.cycleH/2,left:b.cycleW/2})}),d.cssFirst.top=0,d.cssFirst.left=0,d.cssBefore.width=0,d.cssBefore.height=0},a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!1),d.cssBefore.left=c.cycleW/2,d.cssBefore.top=c.cycleH/2,a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH})}),d.cssBefore.width=0,d.cssBefore.height=0,d.animOut.opacity=0},a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.width=c.cycleW,d.animOut.left=b.cycleW}),d.cssBefore.left=e,d.cssBefore.top=0,d.animIn.left=0,d.animOut.left=e},a.fn.cycle.transitions.blindY=function(b,c,d){var e=b.css("overflow","hidden").height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssBefore.top=e,d.cssBefore.left=0,d.animIn.top=0,d.animOut.top=e},a.fn.cycle.transitions.blindZ=function(b,c,d){var e=b.css("overflow","hidden").height(),f=b.width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),d.animIn.height=c.cycleH,d.animOut.top=b.cycleH}),d.cssBefore.top=e,d.cssBefore.left=f,d.animIn.top=0,d.animIn.left=0,d.animOut.top=e,d.animOut.left=f},a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0),d.cssBefore.left=this.cycleW/2,d.animIn.left=0,d.animIn.width=this.cycleW,d.animOut.left=0}),d.cssBefore.top=0,d.cssBefore.width=0},a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1),d.cssBefore.top=this.cycleH/2,d.animIn.top=0,d.animIn.height=this.cycleH,d.animOut.top=0}),d.cssBefore.height=0,d.cssBefore.left=0},a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!1,!0,!0),d.cssBefore.left=c.cycleW/2,d.animIn.left=0,d.animIn.width=this.cycleW,d.animOut.left=b.cycleW/2,d.animOut.width=0}),d.cssBefore.top=0,d.cssBefore.width=0},a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!1,!0),d.cssBefore.top=c.cycleH/2,d.animIn.top=0,d.animIn.height=c.cycleH,d.animOut.top=b.cycleH/2,d.animOut.height=0}),d.cssBefore.height=0,d.cssBefore.left=0},a.fn.cycle.transitions.cover=function(b,c,d){var e=d.direction||"left",f=b.css("overflow","hidden").width(),g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d),e=="right"?d.cssBefore.left=-f:e=="up"?d.cssBefore.top=g:e=="down"?d.cssBefore.top=-g:d.cssBefore.left=f}),d.animIn.left=0,d.animIn.top=0,d.cssBefore.top=0,d.cssBefore.left=0},a.fn.cycle.transitions.uncover=function(b,c,d){var e=d.direction||"left",f=b.css("overflow","hidden").width(),g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0),e=="right"?d.animOut.left=f:e=="up"?d.animOut.top=-g:e=="down"?d.animOut.top=g:d.animOut.left=-f}),d.animIn.left=0,d.animIn.top=0,d.cssBefore.top=0,d.cssBefore.left=0},a.fn.cycle.transitions.toss=function(b,c,d){var e=b.css("overflow","visible").width(),f=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,!0,!0,!0),!d.animOut.left&&!d.animOut.top?a.extend(d.animOut,{left:e*2,top:-f/2,opacity:0}):d.animOut.opacity=0}),d.cssBefore.left=0,d.cssBefore.top=0,d.animIn.left=0},a.fn.cycle.transitions.wipe=function(b,c,d){var e=b.css("overflow","hidden").width(),f=b.height();d.cssBefore=d.cssBefore||{};var g;if(d.clip)if(/l2r/.test(d.clip))g="rect(0px 0px "+f+"px 0px)";else if(/r2l/.test(d.clip))g="rect(0px "+e+"px "+f+"px "+e+"px)";else if(/t2b/.test(d.clip))g="rect(0px "+e+"px 0px 0px)";else if(/b2t/.test(d.clip))g="rect("+f+"px "+e+"px "+f+"px 0px)";else if(/zoom/.test(d.clip)){var h=parseInt(f/2,10),i=parseInt(e/2,10);g="rect("+h+"px "+i+"px "+h+"px "+i+"px)"}d.cssBefore.clip=d.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var j=d.cssBefore.clip.match(/(\d+)/g),k=parseInt(j[0],10),l=parseInt(j[1],10),m=parseInt(j[2],10),n=parseInt(j[3],10);d.before.push(function(b,c,d){if(b==c)return;var g=a(b),h=a(c);a.fn.cycle.commonReset(b,c,d,!0,!0,!1),d.cssAfter.display="block";var i=1,j=parseInt(d.speedIn/13,10)-1;(function o(){var a=k?k-parseInt(i*(k/j),10):0,b=n?n-parseInt(i*(n/j),10):0,c=m<f?m+parseInt(i*((f-m)/j||1),10):f,d=l<e?l+parseInt(i*((e-l)/j||1),10):e;h.css({clip:"rect("+a+"px "+d+"px "+c+"px "+b+"px)"}),i++<=j?setTimeout(o,13):g.css("display","none")})()}),a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0}),d.animIn={left:0},d.animOut={left:0}}}(jQuery),function($){var msOldDiv="",dd=function(element,options){var sElement=element,$this=this,options=$.extend({height:120,visibleRows:7,rowHeight:23,showIcon:!0,zIndex:9999,mainCSS:"dd",useSprite:!1,animStyle:"slideDown",onInit:"",style:""},options);this.ddProp=new Object;var oldSelectedValue="",actionSettings={};actionSettings.insideWindow=!0,actionSettings.keyboardAction=!1,actionSettings.currentKey=null;var ddList=!1,config={postElementHolder:"_msddHolder",postID:"_msdd",postTitleID:"_title",postTitleTextID:"_titletext",postChildID:"_child",postAID:"_msa",postOPTAID:"_msopta",postInputID:"_msinput",postArrowID:"_arrow",postInputhidden:"_inp"},styles={dd:options.mainCSS,ddTitle:"ddTitle",arrow:"arrow",ddChild:"ddChild",ddTitleText:"ddTitleText",disabled:.3,ddOutOfVision:"ddOutOfVision",borderTop:"borderTop",noBorderTop:"noBorderTop",selected:"selected"},attributes={actions:"focus,blur,change,click,dblclick,mousedown,mouseup,mouseover,mousemove,mouseout,keypress,keydown,keyup",prop:"size,multiple,disabled,tabindex"};this.onActions=new Object;var elementid=$(sElement).prop("id");if(typeof elementid=="undefined"||elementid.length<=0)elementid="msdrpdd"+$.msDropDown.counter++,$(sElement).attr("id",elementid);var inlineCSS=$(sElement).prop("style");options.style+=inlineCSS==undefined?"":inlineCSS;var allOptions=$(sElement).children();ddList=$(sElement).prop("size")>1||$(sElement).prop("multiple")==1?!0:!1,ddList&&(options.visibleRows=$(sElement).prop("size"));var a_array={},currentP=0,isFilter=!1,oldHeight,cacheElement={},getElement=function(a){return typeof cacheElement[a]=="undefined"&&(cacheElement[a]=document.getElementById(a)),cacheElement[a]},getPostID=function(a){return elementid+config[a]},getOptionsProperties=function(a){var b=a,c=$(b).prop("style");return c},matchIndex=function(a){var b=$("#"+elementid+" option:selected");if(b.length>1){for(var c=0;c<b.length;c++)if(a==b[c].index)return!0}else if(b.length==1&&b[0].index==a)return!0;return!1},createA=function(a,b,c,d){var e="",f=d=="opt"?getPostID("postOPTAID"):getPostID("postAID"),g=d=="opt"?f+"_"+b+"_"+c:f+"_"+b,h="",i="";options.useSprite!=0?i=" "+options.useSprite+" "+a.className:(h=$(a).prop("title"),h=h.length==0?"":'<img src="'+h+'" align="absmiddle" /> ');var j=$(a).text(),k=$(a).val(),l=$(a).prop("disabled")==1?"disabled":"enabled";a_array[g]={html:h+j,value:k,text:j,index:a.index,id:g};var m=getOptionsProperties(a);return matchIndex(a.index)==1?e+='<a href="javascript:void(0);" class="'+styles.selected+" "+l+i+'"':e+='<a  href="javascript:void(0);" class="'+l+i+'"',m!==!1&&m!==undefined&&(e+=" style='"+m+"'"),e+=' id="'+g+'">',e+=h+'<span class="'+styles.ddTitleText+'">'+j+"</span></a>",e},in_array=function(a){var b=a.toLowerCase();if(b.length==0)return-1;var c="";for(var d in a_array){var e=a_array[d].text.toLowerCase();e.substr(0,b.length)==b&&(c+="#"+a_array[d].id+", ")}return c==""?-1:c},createATags=function(){var a=allOptions;if(a.length==0)return"";var b="",c=getPostID("postAID"),d=getPostID("postOPTAID");return a.each(function(c){var d=a[c];if(d.nodeName=="OPTGROUP"){b+="<div class='opta'>",b+="<span style='font-weight:bold;font-style:italic; clear:both;'>"+$(d).prop("label")+"</span>";var e=$(d).children();e.each(function(a){var d=e[a];b+=createA(d,c,a,"opt")}),b+="</div>"}else b+=createA(d,c,"","")}),b},createChildDiv=function(){var a=getPostID("postID"),b=getPostID("postChildID"),c=options.style;return sDiv="",sDiv+='<div id="'+b+'" class="'+styles.ddChild+'"',ddList?sDiv+=c!=""?' style="border-top:1px solid #c3c3c3;display:block;position:relative;'+c+'"':"":sDiv+=c!=""?' style="'+c+'"':"",sDiv+=">",sDiv},createTitleDiv=function(){var a=getPostID("postTitleID"),b=getPostID("postArrowID"),c=getPostID("postTitleTextID"),d=getPostID("postInputhidden"),e="",f="";getElement(elementid).options.length>0&&(e=$("#"+elementid+" option:selected").text(),f=$("#"+elementid+" option:selected").prop("title")),f=f.length==0||f==undefined||options.showIcon==0||options.useSprite!=0?"":'<img src="'+f+'" align="absmiddle" /> ';var g='<div id="'+a+'" class="'+styles.ddTitle+'"';return g+=">",g+='<span id="'+b+'" class="'+styles.arrow+'"></span><span class="'+styles.ddTitleText+'" id="'+c+'">'+f+'<span class="'+styles.ddTitleText+'">'+e+"</span></span></div>",g},applyEventsOnA=function(){var a=getPostID("postChildID");$("#"+a+" a.enabled").unbind("click"),$("#"+a+" a.enabled").bind("click",function(b){b.preventDefault(),manageSelection(this),setValue();if(!ddList){$("#"+a).unbind("mouseover"),setInsideWindow(!1);var c=options.showIcon==0?$(this).text():$(this).html();setTitleText(c),$this.close()}})},createDropDown=function(){var a=!1,b=getPostID("postID"),c=getPostID("postTitleID"),d=getPostID("postTitleTextID"),e=getPostID("postChildID"),f=getPostID("postArrowID"),g=$("#"+elementid).width();g+=2;var h=options.style;$("#"+b).length>0&&($("#"+b).remove(),a=!0);var i='<div id="'+b+'" class="'+styles.dd+'"';i+=h!=""?' style="'+h+'"':"",i+=">",i+=createTitleDiv(),i+=createChildDiv(),i+=createATags(),i+="</div>",i+="</div>";if(a==1){var j=getPostID("postElementHolder");$("#"+j).after(i)}else $("#"+elementid).after(i);if(ddList){var c=getPostID("postTitleID");$("#"+c).hide()}$("#"+b).css("width",g+"px"),$("#"+e).css("width",g-2+"px");if(allOptions.length>options.visibleRows){var k=parseInt($("#"+e+" a:first").css("padding-bottom"))+parseInt($("#"+e+" a:first").css("padding-top")),l=options.rowHeight*options.visibleRows-k;$("#"+e).css("height",l+"px")}else if(ddList){var l=$("#"+elementid).height();$("#"+e).css("height",l+"px")}a==0&&(setOutOfVision(),addRefreshMethods(elementid)),$("#"+elementid).prop("disabled")==1&&$("#"+b).css("opacity",styles.disabled),applyEvents(),$("#"+c).bind("mouseover",function(a){hightlightArrow(1)}),$("#"+c).bind("mouseout",function(a){hightlightArrow(0)}),applyEventsOnA(),$("#"+e+" a.disabled").css("opacity",styles.disabled),ddList&&$("#"+e).bind("mouseover",function(a){actionSettings.keyboardAction||(actionSettings.keyboardAction=!0,$(document).bind("keydown",function(a){var b=a.keyCode;actionSettings.currentKey=b;if(b==39||b==40)a.preventDefault(),a.stopPropagation(),next(),setValue();if(b==37||b==38)a.preventDefault(),a.stopPropagation(),previous(),setValue()}))}),$("#"+e).bind("mouseout",function(a){setInsideWindow(!1),$(document).unbind("keydown"),actionSettings.keyboardAction=!1,actionSettings.currentKey=null}),$("#"+c).bind("click",function(a){setInsideWindow(!1),$("#"+e+":visible").length==1?$("#"+e).unbind("mouseover"):($("#"+e).bind("mouseover",function(a){setInsideWindow(!0)}),$this.open())}),$("#"+
c).bind("mouseout",function(a){setInsideWindow(!1)}),options.showIcon&&options.useSprite!=0&&setTitleImageSprite()},getByIndex=function(a){for(var b in a_array)if(a_array[b].index==a)return a_array[b];return-1},manageSelection=function(a){var b=getPostID("postChildID");$("#"+b+" a."+styles.selected).length==1&&(oldSelectedValue=$("#"+b+" a."+styles.selected).text()),ddList||$("#"+b+" a."+styles.selected).removeClass(styles.selected);var c=$("#"+b+" a."+styles.selected).prop("id");if(c!=undefined)var d=actionSettings.oldIndex==undefined||actionSettings.oldIndex==null?a_array[c].index:actionSettings.oldIndex;a&&!ddList&&$(a).addClass(styles.selected);if(ddList){var e=actionSettings.currentKey;if($("#"+elementid).prop("multiple")==1)if(e==17)actionSettings.oldIndex=a_array[$(a).prop("id")].index,$(a).toggleClass(styles.selected);else if(e==16){$("#"+b+" a."+styles.selected).removeClass(styles.selected),$(a).addClass(styles.selected);var f=$(a).prop("id"),g=a_array[f].index;for(var h=Math.min(d,g);h<=Math.max(d,g);h++)$("#"+getByIndex(h).id).addClass(styles.selected)}else $("#"+b+" a."+styles.selected).removeClass(styles.selected),$(a).addClass(styles.selected),actionSettings.oldIndex=a_array[$(a).prop("id")].index;else $("#"+b+" a."+styles.selected).removeClass(styles.selected),$(a).addClass(styles.selected),actionSettings.oldIndex=a_array[$(a).prop("id")].index}},addRefreshMethods=function(a){var b=a;getElement(b).refresh=function(a){$("#"+b).msDropDown(options)}},setInsideWindow=function(a){actionSettings.insideWindow=a},getInsideWindow=function(){return actionSettings.insideWindow},applyEvents=function(){var a=getPostID("postID"),b=attributes.actions.split(",");for(var c=0;c<b.length;c++){var d=b[c],e=has_handler(d);if(e==1)switch(d){case"focus":$("#"+a).bind("mouseenter",function(a){getElement(elementid).focus()});break;case"click":$("#"+a).bind("click",function(a){$("#"+elementid).trigger("click")});break;case"dblclick":$("#"+a).bind("dblclick",function(a){$("#"+elementid).trigger("dblclick")});break;case"mousedown":$("#"+a).bind("mousedown",function(a){$("#"+elementid).trigger("mousedown")});break;case"mouseup":$("#"+a).bind("mouseup",function(a){$("#"+elementid).trigger("mouseup")});break;case"mouseover":$("#"+a).bind("mouseover",function(a){$("#"+elementid).trigger("mouseover")});break;case"mousemove":$("#"+a).bind("mousemove",function(a){$("#"+elementid).trigger("mousemove")});break;case"mouseout":$("#"+a).bind("mouseout",function(a){$("#"+elementid).trigger("mouseout")})}}},setOutOfVision=function(){var a=getPostID("postElementHolder");$("#"+elementid).after("<div class='"+styles.ddOutOfVision+"' style='height:0px;overflow:hidden;position:absolute;' id='"+a+"'></div>"),$("#"+elementid).appendTo($("#"+a))},setTitleText=function(a){var b=getPostID("postTitleTextID");$("#"+b).html(a)},navigateA=function(a){var b=a,c=getPostID("postChildID"),d=$("#"+c+" a:visible"),e=d.length,f=$("#"+c+" a:visible").index($("#"+c+" a.selected:visible")),g;switch(b){case"next":f<e-1&&(f++,g=d[f]);break;case"previous":f<e&&f>0&&(f--,g=d[f])}if(typeof g=="undefined")return!1;$("#"+c+" a."+styles.selected).removeClass(styles.selected),$(g).addClass(styles.selected);var h=g.id;if(!ddList){var i=options.showIcon==0?a_array[h].text:$("#"+h).html();setTitleText(i),setTitleImageSprite(a_array[h].index)}b=="next"?parseInt($("#"+h).position().top+$("#"+h).height())>=parseInt($("#"+c).height())&&$("#"+c).scrollTop($("#"+c).scrollTop()+$("#"+h).height()+$("#"+h).height()):parseInt($("#"+h).position().top+$("#"+h).height())<=0&&$("#"+c).scrollTop($("#"+c).scrollTop()-$("#"+c).height()-$("#"+h).height())},next=function(){navigateA("next")},previous=function(){navigateA("previous")},setTitleImageSprite=function(a){if(options.useSprite!=0){var b=getPostID("postTitleTextID"),c=typeof a=="undefined"?getElement(elementid).selectedIndex:a,d=getElement(elementid).options[c].className;if(d.length>0){var e=getPostID("postChildID"),f=$("#"+e+" a."+d).prop("id"),g=$("#"+f).css("background-image"),h=$("#"+f).css("background-position"),i=$("#"+f).css("padding-left");g!=undefined&&$("#"+b).find("."+styles.ddTitleText).attr("style","background:"+g),h!=undefined&&$("#"+b).find("."+styles.ddTitleText).css("background-position",h),i!=undefined&&$("#"+b).find("."+styles.ddTitleText).css("padding-left",i),$("#"+b).find("."+styles.ddTitleText).css("background-repeat","no-repeat"),$("#"+b).find("."+styles.ddTitleText).css("padding-bottom","2px")}}},setValue=function(){var a=getPostID("postChildID"),b=$("#"+a+" a."+styles.selected);if(b.length==1){var c=$("#"+a+" a."+styles.selected).text(),d=$("#"+a+" a."+styles.selected).prop("id");if(d!=undefined){var e=a_array[d].value;getElement(elementid).selectedIndex=a_array[d].index}options.showIcon&&options.useSprite!=0&&setTitleImageSprite()}else if(b.length>1)for(var f=0;f<b.length;f++){var d=$(b[f]).prop("id"),g=a_array[d].index;getElement(elementid).options[g].selected="selected"}var h=getElement(elementid).selectedIndex;$this.ddProp.selectedIndex=h},has_handler=function(a){if($("#"+elementid).prop("on"+a)!=undefined)return!0;var b=$("#"+elementid).data("events");return b&&b[a]?!0:!1},checkMethodAndApply=function(){var a=getPostID("postChildID");if(has_handler("change")==1){var b=a_array[$("#"+a+" a.selected").prop("id")].text;$.trim(oldSelectedValue)!==$.trim(b)&&oldSelectedValue!==""&&$("#"+elementid).trigger("change")}has_handler("mouseup")==1&&$("#"+elementid).trigger("mouseup"),has_handler("blur")==1&&$(document).bind("mouseup",function(a){$("#"+elementid).focus(),$("#"+elementid)[0].blur(),setValue(),$(document).unbind("mouseup")})},hightlightArrow=function(a){var b=getPostID("postArrowID");a==1?$("#"+b).css({backgroundPosition:"0 100%"}):$("#"+b).css({backgroundPosition:"0 0"})},setOriginalProperties=function(){for(var a in getElement(elementid))typeof getElement(elementid)[a]!="function"&&getElement(elementid)[a]!==undefined&&getElement(elementid)[a]!==null&&$this.set(a,getElement(elementid)[a],!0)},setValueByIndex=function(a,b){if(getByIndex(b)!=-1){getElement(elementid)[a]=b;var c=getPostID("postChildID");$("#"+c+" a."+styles.selected).removeClass(styles.selected),$("#"+getByIndex(b).id).addClass(styles.selected);var d=getByIndex(getElement(elementid).selectedIndex).html;setTitleText(d)}},addRemoveFromIndex=function(a,b){if(b=="d")for(var c in a_array)if(a_array[c].index==a){delete a_array[c];break}var d=0;for(var c in a_array)a_array[c].index=d,d++},shouldOpenOpposite=function(){var a=getPostID("postChildID"),b=getPostID("postID"),c=$("#"+b).position(),d=$("#"+b).height(),e=$(window).height(),f=$(window).scrollTop(),g=$("#"+a).height(),h={zIndex:options.zIndex,top:c.top+d+"px",display:"none"},i=options.animStyle,j=!1,k=styles.noBorderTop;$("#"+a).removeClass(styles.noBorderTop),$("#"+a).removeClass(styles.borderTop);if(e+f<Math.floor(g+d+c.top)){var l=c.top-g;c.top-g<0&&(l=10),h={zIndex:options.zIndex,top:l+"px",display:"none"},i="show",j=!0,k=styles.borderTop}return{opp:j,ani:i,css:h,border:k}},fireOpenEvent=function(){$this.onActions["onOpen"]!=null&&eval($this.onActions.onOpen)($this)},fireCloseEvent=function(){checkMethodAndApply(),$this.onActions["onClose"]!=null&&eval($this.onActions.onClose)($this)};this.open=function(){if($this.get("disabled",true)==1||$this.get("options",true).length==0)return;var a=getPostID("postChildID");msOldDiv!=""&&a!=msOldDiv&&($("#"+msOldDiv).fadeOut("fast"),$("#"+msOldDiv).css({zIndex:"0"}));if($("#"+a).css("display")=="none"){oldSelectedValue=a_array[$("#"+a+" a.selected").prop("id")].text;var b="";oldHeight=$("#"+a).height(),$("#"+a+" a").show(),$(document).bind("keydown",function(c){var d=c.keyCode;d==8&&(c.preventDefault(),c.stopPropagation(),b=b.length==0?"":b.substr(0,b.length-1));switch(d){case 39:case 40:c.preventDefault(),c.stopPropagation(),next();break;case 37:case 38:c.preventDefault(),c.stopPropagation(),previous();break;case 27:case 13:$this.close(),setValue();break;default:d>46&&(b+=String.fromCharCode(d));var e=in_array(b);if(e!=-1){$("#"+a).css({height:"auto"}),$("#"+a+" a").hide(),$(e).show();var f=shouldOpenOpposite();$("#"+a).css(f.css),$("#"+a).css({display:"block"})}else $("#"+a+" a").show(),$("#"+a).css({height:oldHeight+"px"})}has_handler("keydown")==1&&getElement(elementid).onkeydown()}),$(document).bind("keyup",function(a){$("#"+elementid).prop("onkeyup")!=undefined&&getElement(elementid).onkeyup()}),$(document).bind("mouseup",function(a){getInsideWindow()==0&&$this.close()});var c=shouldOpenOpposite();$("#"+a).css(c.css),c.opp==1?($("#"+a).css({display:"block"}),$("#"+a).addClass(c.border),fireOpenEvent()):$("#"+a)[c.ani]("fast",function(){$("#"+a).addClass(c.border),fireOpenEvent()}),a!=msOldDiv&&(msOldDiv=a)}},this.close=function(){var a=getPostID("postChildID"),b=$("#"+getPostID("postTitleID")).position().top,c=shouldOpenOpposite();isFilter=!1,c.opp==1?$("#"+a).animate({height:0,top:b},function(){$("#"+a).css({height:oldHeight+"px",display:"none"}),fireCloseEvent()}):$("#"+a).fadeOut("fast",function(b){fireCloseEvent(),$("#"+a).css({zIndex:"0"}),$("#"+a).css({height:oldHeight+"px"})}),setTitleImageSprite(),$(document).unbind("keydown"),$(document).unbind("keyup"),$(document).unbind("mouseup")},this.selectedIndex=function(a){if(typeof a=="undefined")return $this.get("selectedIndex");$this.set("selectedIndex",a)},this.debug=function(a){typeof a=="undefined"||a==1?$("."+styles.ddOutOfVision).removeAttr("style"):$("."+styles.ddOutOfVision).attr("style","height:0px;overflow:hidden;position:absolute")},this.set=function(a,b,c){if(a==undefined||b==undefined)throw{message:"set to what?"};$this.ddProp[a]=b;if(c!=1)switch(a){case"selectedIndex":setValueByIndex(a,b);break;case"disabled":$this.disabled(b,!0);break;case"multiple":getElement(elementid)[a]=b,ddList=$(sElement).prop("size")>0||$(sElement).prop("multiple")==1?!0:!1;if(ddList){var d=$("#"+elementid).height(),e=getPostID("postChildID");$("#"+e).css("height",d+"px");var f=getPostID("postTitleID");$("#"+f).hide();var e=getPostID("postChildID");$("#"+e).css({display:"block",position:"relative"}),applyEventsOnA()}break;case"size":getElement(elementid)[a]=b,b==0&&(getElement(elementid).multiple=!1),ddList=$(sElement).prop("size")>0||$(sElement).prop("multiple")==1?!0:!1;if(b==0){var f=getPostID("postTitleID");$("#"+f).show();var e=getPostID("postChildID");$("#"+e).css({display:"none",position:"absolute"});var g="";if(getElement(elementid).selectedIndex>=0){var h=getByIndex(getElement(elementid).selectedIndex);g=h.html,manageSelection($("#"+h.id))}setTitleText(g)}else{var f=getPostID("postTitleID");$("#"+f).hide();var e=getPostID("postChildID");$("#"+e).css({display:"block",position:"relative"})}break;default:try{getElement(elementid)[a]=b}catch(i){}}},this.get=function(a,b){if(a==undefined&&b==undefined)return $this.ddProp;if(a!=undefined&&b==undefined)return $this.ddProp[a]!=undefined?$this.ddProp[a]:null;if(a!=undefined&&b!=undefined)return getElement(elementid)[a]},this.visible=function(a){var b=getPostID("postID");if(a==1)$("#"+b).show();else{if(a!=0)return $("#"+b).css("display");$("#"+b).hide()}},this.add=function(a,b){var c=a,d=c.text,e=c.value==undefined||c.value==null?d:c.value,f=c["title"]==undefined||c["title"]==null?"":c.title,g=b==undefined||b==null?getElement(elementid).options.length:b;getElement(elementid).options[g]=new Option(d,e),f!=""&&(getElement(elementid).options[g].title=f);var h=getByIndex(g);if(h!=-1){var i=createA(getElement(elementid).options[g],g,"","");$("#"+h.id).html(i)}else{var i=createA(getElement(elementid).options[g],g,"",""),j=getPostID("postChildID");$("#"+j).append(i),applyEventsOnA()}},this.remove=function(a){getElement(elementid).remove(a),getByIndex(a)!=-1&&($("#"+getByIndex(a).id).remove(),addRemoveFromIndex(a,"d"));if(getElement(elementid).length==0)setTitleText("");else{var b=getByIndex(getElement(elementid).selectedIndex).html;setTitleText(b)}$this.set("selectedIndex",getElement(elementid).selectedIndex)},this.disabled=function(a,b){getElement(elementid).disabled=a;var c=getPostID("postID");a==1?($("#"+c).css("opacity",styles.disabled),$this.close()):a==0&&$("#"+c).css("opacity",1),b!=1&&$this.set("disabled",a)},this.form=function(){return getElement(elementid).form==undefined?null:getElement(elementid).form},this.item=function(){if(arguments.length==1)return getElement(elementid).item(arguments[0]);if(arguments.length==2)return getElement(elementid).item(arguments[0],arguments[1]);throw{message:"An index is required!"}},this.namedItem=function(a){return getElement(elementid).namedItem(a)},this.multiple=function(a){if(typeof a=="undefined")return $this.get("multiple");$this.set("multiple",a)},this.size=function(a){if(typeof a=="undefined")return $this.get("size");$this.set("size",a)},this.addMyEvent=function(a,b){$this.onActions[a]=b},this.fireEvent=function(nm){eval($this.onActions[nm])($this)};var updateCommonVars=function(){$this.set("version",$.msDropDown.version),$this.set("author",$.msDropDown.author)},init=function(){createDropDown(),setOriginalProperties(),updateCommonVars(),options.onInit!=""&&eval(options.onInit)($this)};init()};$.msDropDown={version:2.37,author:"Marghoob Suleman",counter:20,create:function(a,b){return $(a).msDropDown(b).data("dd")}},$.fn.extend({msDropDown:function(a){return this.each(function(){var b=new dd(this,a);$(this).data("dd",b)})}}),typeof $.fn.prop=="undefined"&&($.fn.prop=function(a){return $(this).attr(a)})}(jQuery),$(function(){$("#hello_future").delay(1250).fadeOut("fast",function(){$("#traffic_director_wrapper").fadeIn("fast")}),$("#i_am_id").msDropDown({showIcon:!1,visibleRows:12,animStyle:"fadeIn"}),$("#looking_for_id").msDropDown({showIcon:!1,visibleRows:18,animStyle:"fadeIn"}),$("#traffic_director").submit(function(){if($("#i_am_id").val()==""||$("#looking_for_id").val()=="")return alert('Both "I Am" and "Looking For" are required.'),!1;$("input[type=image]",this).attr("disabled","true"),$("#traffic_director_wrapper").fadeOut("fast",function(){$("#traffic_director_loading").fadeIn("fast")}),$(":submit",this).click(function(){return!1})})})
