/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 * TERMS OF USE - jQuery Easing
 * Open source under the BSD License. 
 * Copyright � 2008 George McGinley Smith
 * All rights reserved.
 * 
 *
*/
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return -.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});
/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * Open source under the BSD License. 
 * Copyright � 2001 Robert Penner
 * All rights reserved.
 */

/*
 * FancyBox - jQuery Plugin
 * simple and fancy lightbox alternative
 *
 * Copyright (c) 2009 Janis Skarnelis
 * Examples and documentation at: http://fancybox.net
 * 
 * Version: 1.2.6 (16/11/2009)
 * Requires: jQuery v1.3+
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
 
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(p($){$.q.1Q=p(){J O.2n(p(){n b=$(O).u(\'2o\');8(b.1d(/^3i\\(["\']?(.*\\.2p)["\']?\\)$/i)){b=3j.$1;$(O).u({\'2o\':\'3k\',\'1e\':"3l:3m.3n.3o(3p=D, 3q="+($(O).u(\'3r\')==\'2q-3s\'?\'3t\':\'3u\')+", 13=\'"+b+"\')"}).2n(p(){n a=$(O).u(\'1u\');8(a!=\'2r\'&&a!=\'2s\')$(O).u(\'1u\',\'2s\')})}})};n l,4,1f=F,X=1v 1w,1x,1y=1,1z=/\\.(3v|3w|2p|3x|3y)(.*)?$/i;n m=1A,18=$.14.1g&&$.14.2t.1R(0,1)==6&&!19.3z,1S=18||($.14.1g&&$.14.2t.1R(0,1)==7);$.q.r=p(o){n j=$.2u({},$.q.r.2v,o);n k=O;p 2w(){l=O;4=$.2u({},j);2x();J F};p 2x(){8(1f)J;8($.1T(4.1U)){4.1U()}4.v=[];4.t=0;8(j.v.Y>0){4.v=j.v}C{n a={};8(!l.1B||l.1B==\'\'){n a={K:l.K,G:l.G};8($(l).1C("1l:1D").Y){a.S=$(l).1C("1l:1D")}C{a.S=$(l)}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}C{n b=$(k).1e("a[1B="+l.1B+"]");n a={};3A(n i=0;i<b.Y;i++){a={K:b[i].K,G:b[i].G};8($(b[i]).1C("1l:1D").Y){a.S=$(b[i]).1C("1l:1D")}C{a.S=$(b[i])}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}}}3B(4.v[4.t].K!=l.K){4.t++}8(4.1E){8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'3C\');$("#T").u(\'A\',$(U).A())}$("#T").u({\'3D-3E\':4.2A,\'22\':4.2B}).Z()}$(19).11("23.L 24.L",$.q.r.2C);1h()};p 1h(){$("#1n, #1o, #1i, #H").1a();n b=4.v[4.t].K;8(b.1d("1j")||l.3F.2D("1j")>=0){$.q.r.1F();1p(\'<1j s="2E" 3G="2F.q.r.2G()" 3H="3I\'+P.1b(P.3J()*3K)+\'" 2H="0" 3L="0" 13="\'+b+\'"></1j>\',4.1G,4.1H)}C 8(b.1d(/#/)){n c=19.3M.K.3N(\'#\')[0];c=b.3O(c,\'\');c=c.1R(c.2D(\'#\'));1p(\'<9 s="3P">\'+$(c).2I()+\'</9>\',4.1G,4.1H)}C 8(b.1d(1z)){X=1v 1w;X.13=b;8(X.3Q){25()}C{$.q.r.1F();$(X).Q().11(\'3R\',p(){$("#M").1a();25()})}}C{$.q.r.1F();$.3S(b,p(a){$("#M").1a();1p(\'<9 s="3T">\'+a+\'</9>\',4.1G,4.1H)})}};p 25(){n a=X.E;n b=X.A;n c=(4.N*2)+40;n d=(4.N*2)+26;n w=$.q.r.1q();8(4.2J&&(a>(w[0]-c)||b>(w[1]-d))){n e=P.28(P.28(w[0]-c,a)/a,P.28(w[1]-d,b)/b);a=P.1b(e*a);b=P.1b(e*b)}1p(\'<1l 1W="" s="3U" 13="\'+X.13+\'" />\',a,b)};p 2K(){8((4.v.Y-1)>4.t){n a=4.v[4.t+1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}8(4.t>0){n a=4.v[4.t-1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}};p 1p(a,b,c){1f=D;n d=4.N;8(1S||m){$("#y")[0].15.2L("A");$("#y")[0].15.2L("E")}8(d>0){b+=d*2;c+=d*2;$("#y").u({\'z\':d+\'R\',\'2M\':d+\'R\',\'2N\':d+\'R\',\'B\':d+\'R\',\'E\':\'2O\',\'A\':\'2O\'});8(1S||m){$("#y")[0].15.2P(\'A\',\'(O.2Q.3V - \'+d*2+\')\');$("#y")[0].15.2P(\'E\',\'(O.2Q.3W - \'+d*2+\')\')}}C{$("#y").u({\'z\':0,\'2M\':0,\'2N\':0,\'B\':0,\'E\':\'2R%\',\'A\':\'2R%\'})}8($("#x").16(":V")&&b==$("#x").E()&&c==$("#x").A()){$("#y").1J(\'29\',p(){$("#y").1r().1K($(a)).2a("1L",p(){1s()})});J}n w=$.q.r.1q();n e=(c+26)>w[1]?w[3]:(w[3]+P.1b((w[1]-c-26)*0.5));n f=(b+40)>w[0]?w[2]:(w[2]+P.1b((w[0]-b-40)*0.5));n g={\'B\':f,\'z\':e,\'E\':b+\'R\',\'A\':c+\'R\'};8($("#x").16(":V")){$("#y").1J("1L",p(){$("#y").1r();$("#x").2b(g,4.2S,4.2T,p(){$("#y").1K($(a)).2a("1L",p(){1s()})})})}C{8(4.2c>0&&4.v[4.t].S!==1m){$("#y").1r().1K($(a));n h=4.v[4.t].S;n i=$.q.r.2d(h);$("#x").u({\'B\':(i.B-20-4.N)+\'R\',\'z\':(i.z-20-4.N)+\'R\',\'E\':$(h).E()+(4.N*2),\'A\':$(h).A()+(4.N*2)});8(4.2e){g.22=\'Z\'}$("#x").2b(g,4.2c,4.2U,p(){1s()})}C{$("#y").1a().1r().1K($(a)).Z();$("#x").u(g).2a("1L",p(){1s()})}}};p 2V(){8(4.t!==0){$("#1o, #2W").Q().11("17",p(e){e.2X();4.t--;1h();J F});$("#1o").Z()}8(4.t!=(4.v.Y-1)){$("#1n, #2Y").Q().11("17",p(e){e.2X();4.t++;1h();J F});$("#1n").Z()}};p 1s(){8($.14.1g){$("#y")[0].15.1M(\'1e\');$("#x")[0].15.1M(\'1e\')}2V();2K();$(U).11("1N.L",p(e){8(e.2f==27&&4.2Z){$.q.r.1c()}C 8(e.2f==37&&4.t!==0){$(U).Q("1N.L");4.t--;1h()}C 8(e.2f==39&&4.t!=(4.v.Y-1)){$(U).Q("1N.L");4.t++;1h()}});8(4.30){$("#y").17($.q.r.1c)}8(4.1E&&4.31){$("#T").11("17",$.q.r.1c)}8(4.33){$("#1i").11("17",$.q.r.1c).Z()}8(1V 4.v[4.t].G!==\'1m\'&&4.v[4.t].G.Y>0){n a=$("#x").1u();$(\'#H 9\').3X(4.v[4.t].G).2I();$(\'#H\').u({\'z\':a.z+$("#x").34()-32,\'B\':a.B+(($("#x").35()*0.5)-($(\'#H\').E()*0.5))}).Z()}8(4.1E&&18){$(\'1X, 1Y, 1Z\',$(\'#y\')).u(\'21\',\'V\')}8($.1T(4.2g)){4.2g(4.v[4.t])}8($.14.1g){$("#x")[0].15.1M(\'1e\');$("#y")[0].15.1M(\'1e\')}1f=F};J O.Q(\'17.L\').11(\'17.L\',2w)};$.q.r.2C=p(){n w=$.q.r.1q();8(4.2h&&$("#x").16(\':V\')){n a=$("#x").35();n b=$("#x").34();n c={\'z\':(b>w[1]?w[3]:w[3]+P.1b((w[1]-b)*0.5)),\'B\':(a>w[0]?w[2]:w[2]+P.1b((w[0]-a)*0.5))};$("#x").u(c);$(\'#H\').u({\'z\':c.z+b-32,\'B\':c.B+((a*0.5)-($(\'#H\').E()*0.5))})}8(18&&$("#T").16(\':V\')){$("#T").u({\'A\':$(U).A()})}8($("#M").16(\':V\')){$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])})}};$.q.r.1t=p(a,b){J 3Y($.3Z(a.41?a[0]:a,b,D))||0};$.q.r.2d=p(a){n b=a.42();b.z+=$.q.r.1t(a,\'43\');b.z+=$.q.r.1t(a,\'44\');b.B+=$.q.r.1t(a,\'45\');b.B+=$.q.r.1t(a,\'46\');J b};$.q.r.2G=p(){$("#M").1a();$("#2E").Z()};$.q.r.1q=p(){J[$(19).E(),$(19).A(),$(U).47(),$(U).48()]};$.q.r.36=p(){8(!$("#M").16(\':V\')){38(1x);J}$("#M > 9").u(\'z\',(1y*-40)+\'R\');1y=(1y+1)%12};$.q.r.1F=p(){38(1x);n w=$.q.r.1q();$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])}).Z();$("#M").11(\'17\',$.q.r.1c);1x=49($.q.r.36,4a)};$.q.r.1c=p(){1f=D;$(X).Q();$(U).Q("1N.L");$(19).Q("23.L 24.L");$("#T, #y, #1i").Q();$("#1i, #M, #1o, #1n, #H").1a();1O=p(){8($("#T").16(\':V\')){$("#T").1J("29")}$("#y").1r();8(4.2h){$(19).Q("23.L 24.L")}8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'V\')}8($.1T(4.2i)){4.2i()}1f=F};8($("#x").16(":V")!==F){8(4.2j>0&&4.v[4.t].S!==1m){n a=4.v[4.t].S;n b=$.q.r.2d(a);n c={\'B\':(b.B-20-4.N)+\'R\',\'z\':(b.z-20-4.N)+\'R\',\'E\':$(a).E()+(4.N*2),\'A\':$(a).A()+(4.N*2)};8(4.2e){c.22=\'1a\'}$("#x").3a(F,D).2b(c,4.2j,4.3b,1O)}C{$("#x").3a(F,D).1J(\'29\',1O)}}C{1O()}J F};$.q.r.3c=p(){n a=\'\';a+=\'<9 s="T"></9>\';a+=\'<9 s="M"><9></9></9>\';a+=\'<9 s="x">\';a+=\'<9 s="3d">\';a+=\'<9 s="1i"></9>\';a+=\'<9 s="W"><9 I="W" s="4b"></9><9 I="W" s="4c"></9><9 I="W" s="4d"></9><9 I="W" s="4e"></9><9 I="W" s="4f"></9><9 I="W" s="4g"></9><9 I="W" s="4h"></9><9 I="W" s="4i"></9></9>\';a+=\'<a K="2k:;" s="1o"><1P I="2l" s="2W"></1P></a><a K="2k:;" s="1n"><1P I="2l" s="2Y"></1P></a>\';a+=\'<9 s="y"></9>\';a+=\'</9>\';a+=\'</9>\';a+=\'<9 s="H"></9>\';$(a).3e("4j");$(\'<3f 4k="0" 4l="0" 4m="0"><3g><1k I="H" s="4n"></1k><1k I="H" s="4o"><9></9></1k><1k I="H" s="4p"></1k></3g></3f>\').3e(\'#H\');8($.14.1g){$(".W").1Q()}8(18){$("9#T").u("1u","2r");$("#M 9, #1i, .H, .2l").1Q();$("#3d").4q(\'<1j s="3h" 13="2k:F;" 4r="2q" 2H="0"></1j>\');n b=$(\'#3h\')[0].4s.U;b.4t();b.1c()}};$.q.r.2v={N:10,2J:D,2e:D,2c:0,2j:0,2S:4u,2U:\'2m\',3b:\'2m\',2T:\'2m\',1G:4v,1H:4w,1E:D,2B:0.3,2A:\'#4x\',2Z:D,33:D,31:D,30:D,2h:D,v:[],1U:1A,2g:1A,2i:1A};$(U).4y(p(){m=$.14.1g&&!$.4z;8($("#x").Y<1){$.q.r.3c()}})})(2F);',62,284,'||||opts||||if|div||||||||||||||var||function|fn|fancybox|id|itemCurrent|css|itemArray||fancy_outer|fancy_content|top|height|left|else|true|width|false|title|fancy_title|class|return|href|fb|fancy_loading|padding|this|Math|unbind|px|orig|fancy_overlay|document|visible|fancy_bg|imagePreloader|length|show||bind||src|browser|style|is|click|IE6|window|hide|round|close|match|filter|busy|msie|_change_item|fancy_close|iframe|td|img|undefined|fancy_right|fancy_left|_set_content|getViewport|empty|_finish|getNumeric|position|new|Image|loadingTimer|loadingFrame|imageRegExp|null|rel|children|first|overlayShow|showLoading|frameWidth|frameHeight|objNext|fadeOut|append|normal|removeAttribute|keydown|__cleanup|span|fixPNG|substr|oldIE|isFunction|callbackOnStart|typeof|alt|embed|object|select||visibility|opacity|resize|scroll|_proceed_image|60||min|fast|fadeIn|animate|zoomSpeedIn|getPosition|zoomOpacity|keyCode|callbackOnShow|centerOnScroll|callbackOnClose|zoomSpeedOut|javascript|fancy_ico|swing|each|backgroundImage|png|no|absolute|relative|version|extend|defaults|_initialize|_start|attr|push|overlayColor|overlayOpacity|scrollBox|indexOf|fancy_frame|jQuery|showIframe|frameborder|html|imageScale|_preload_neighbor_images|removeExpression|right|bottom|auto|setExpression|parentNode|100|zoomSpeedChange|easingChange|easingIn|_set_navigation|fancy_left_ico|stopPropagation|fancy_right_ico|enableEscapeButton|hideOnContentClick|hideOnOverlayClick||showCloseButton|outerHeight|outerWidth|animateLoading||clearInterval||stop|easingOut|build|fancy_inner|appendTo|table|tr|fancy_bigIframe|url|RegExp|none|progid|DXImageTransform|Microsoft|AlphaImageLoader|enabled|sizingMethod|backgroundRepeat|repeat|crop|scale|jpg|gif|bmp|jpeg|XMLHttpRequest|for|while|hidden|background|color|className|onload|name|fancy_iframe|random|1000|hspace|location|split|replace|fancy_div|complete|load|get|fancy_ajax|fancy_img|clientHeight|clientWidth|text|parseInt|curCSS||jquery|offset|paddingTop|borderTopWidth|paddingLeft|borderLeftWidth|scrollLeft|scrollTop|setInterval|66|fancy_bg_n|fancy_bg_ne|fancy_bg_e|fancy_bg_se|fancy_bg_s|fancy_bg_sw|fancy_bg_w|fancy_bg_nw|body|cellspacing|cellpadding|border|fancy_title_left|fancy_title_main|fancy_title_right|prepend|scrolling|contentWindow|open|300|560|340|666|ready|boxModel'.split('|'),0,{}));

// jQuery swfobject
(function(F,C){var D=function(H){var G,I=[];for(G in H){if(/string|number/.test(typeof H[G])&&H[G]!==""){I.push(G+'="'+H[G]+'"')}}return I[A]("")},E=function(I){var G,K,J=[],H;if(typeof I=="object"){for(G in I){if(typeof I[G]=="object"){H=[];for(K in I[G]){H.push([K,"=",encodeURIComponent(I[G][K])][A](""))}I[G]=H[A]("&amp;")}if(I[G]){J.push(['<param name="',G,'" value="',I[G],'" />'][A](""))}}I=J[A]("")}return I},B=false,A="join";F[C]=(function(){try{var G="0,0,0",H=navigator.plugins["Shockwave Flash"]||ActiveXObject;G=H.description||(function(){try{return(new H("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(J){}}())}catch(I){}G=G.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+[d|r]|,)(\d+)/);return{available:G[1]>0,activeX:H&&!H.name,version:{major:G[1]*1,minor:G[2]*1,release:G[3]*1},hasVersion:function(K){var N=this.version,L="major",M="minor",J="release";K=(/string|number/.test(typeof K))?K.toString().split("."):K||[0,0,0];K=[K[L]||K[0]||N[L],K[M]||K[1]||N[M],K[J]||K[2]||N[J]];return(K[0]<N[L])||(K[0]==N[L]&&K[1]<N[M])||(K[0]==N[L]&&K[1]==N[M]&&K[2]<=N[J])},expressInstall:"expressInstall.swf",create:function(J){if(!F[C].available||B||!typeof J=="object"||!J.swf){return false}if(J.hasVersion&&!F[C].hasVersion(J.hasVersion)){J={swf:J.expressInstall||F[C].expressInstall,attrs:{id:J.id||"SWFObjectExprInst",name:J.name,height:Math.max(J.height||137),width:Math.max(J.width||214)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:(F[C].activeX)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}};B=true}else{J=F.extend(true,{attrs:{id:J.id,name:J.name,height:J.height||180,width:J.width||320},params:{wmode:J.wmode||"opaque",flashvars:J.flashvars}},J)}if(F[C].activeX){J.attrs.classid=J.attrs.classid||"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";J.params.movie=J.params.movie||J.swf}else{J.attrs.type=J.attrs.classid||"application/x-shockwave-flash";J.attrs.data=J.attrs.data||J.swf}return["<object ",D(J.attrs),">",E(J.params),"</object>"][A]("")}}}());F.fn[C]=function(G){if(typeof G=="object"){this.each(function(){var I=document.createElement(C);var H=F[C].create(G);if(H){I.innerHTML=H;if(I.childNodes[0]){this.appendChild(I.childNodes[0])}}})}else{if(typeof G=="function"){this.find("object").andSelf().filter("object").each(function(){var I=this,H="jsInteractionTimeoutMs";I[H]=I[H]||0;if(I[H]<660){if(I.clientWidth||I.clientHeight){G.call(this)}else{setTimeout(function(){F(I)[C](G)},I[H]+66)}}})}}return this}}(jQuery,"flash"));

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * jQuery cookie plugin
 * Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        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(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        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 { // only name given, get cookie
        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]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

// marshall afd
(function($){
	
	$.fadenLinkOut = function(){
		var $this = $(this);
		var $a = $this
			//.css({opacity : '1'})
			.animate({ 
				opacity:0
			},
			{ queue:false, duration:200,easing:'easeInExpo'} );
		};
	$.fadeLinkIn = function(){
		var $this = $(this);
		var $a = $this
			.stop(true,true)
			.animate({ 
				opacity:1				
			},
			{ queue:false, duration:500,easing:'easeOutExpo' } );			
		};
	$.simpleFadeOut = function(){
		var $this = $(this);
		var $me = $this
		.pause(300)
		.animate({ 
				opacity:0.7
			},
			{ queue:false, duration:600,easing:'easeOutExpo'} );
		};
	$.simpleFadeIn = function(){
		var $this = $(this);
		var $me = $this
		.animate({ 
				opacity:1
			},
			{ queue:false, duration:200,easing:'easeInExpo'} );
		};
	$.fn.pause = function (n) {
	  return this.queue(function () {
	    var el = this;
	    setTimeout(function () {
	      return $(el).dequeue();
	    }, n);
	  });
	};
	
	//==================================================
	// minimal input boxes
	
	$.fn.mininput = function(options){
		
		return this.each(function(){
			
			var $this = $(this);
			
			// handle label
			$this.data('label',$this.attr('title')).removeAttr('title');
			
			// events
			$this.blur(function(){
				var $this = $(this);
				if (!$this.val() || $this.val()==$this.data('label')){
					$this.val($this.data('label')).addClass('defaulted');
					}
				else{
					$this.attr('type',$this.data('otype'));
					}
				});
			$this.focus(function(){
				var $this = $(this).removeClass('defaulted');
				if ($this.val()==$this.data('label')){
					$this.val('');
					}
				});
				
			// blur element
			$this.blur();
			
			});
		
		}
	
	//================================================
	// step control plugin
	
	$.fn.stepControl = function(options){
		
		// defaults
		var options = $.extend({
			wrapper: '<div class="step-control"></div>',
			controlbar: '<ul class="controlbar"></ul>',
			button: 'h2',
			next: '<p class="field"><a href="" class="button button-next">Next Step</a></p>'
			},options);
			
		// store the selection
		var steps = this;
		
		// wrap the selection
		this.wrapAll(options.wrapper);
		var wrapper = steps.parent();
		
		// cache the selection in the wrapper
		wrapper.data('steps',steps);
		
		// insert the controlbar
		var controlbar = $(options.controlbar);
		wrapper.prepend(controlbar);
		wrapper.data('controlbar',controlbar);
		
		// functions
		steps.each(function(i){
			
			// get the step
			var step = $(this)
				.addClass('step')
				.data('index',i)
				.data('background',$(this).css('background-image'))
				.css({display:'none',backgroundImage:'none'});
			
			/*// add a next button
			if (i<steps.length-1){
				var next = $(options.next).find('a').eq(0).data('next',i+1);
				next.click(function(){
					var next = $(this);
					var button = next
						.closest('.step-control')
						.data('controlbar')
						.find('li').eq(next.data('next'))
						.find('a').eq(0);
					button.click();
					return false;
					});
				step.append(next);
				}*/
				
			// get the button text
			var button_original = step.find(options.button);
			var button = $('<li><a href="">'+button_original.text()+'</a></li>');
			// hide the original button
			button_original.css({display:'none'});
			
			// cache the selection in each button
			button.data('steps',wrapper.data('steps'));
			button.data('step',step);
			
			// handle button clicking
			button.find('a',0).click(function(){
				
				// get the button
				var button = $(this);
				
				// get the li
				var li = button.closest('li');
				
				// get all li's
				var lis = li.parent().find('li');
				
				// hide all steps
				li.data('steps').css({display:'none'});
				
				// show the clicked step
				li.data('step').css({display:'block'});
				
				// add the background image
				if (li.data('step').data('background') && li.data('step').data('background')!='none'){
					//$('#content').css({backgroundImage:li.data('step').data('background')});
					}
				
				// handle li classes
				lis.removeClass('current');
				li.addClass('current');
				
				// return false (prevent link from triggering)
				return false;
				
				});
			
			// append the button to the controlbar
			controlbar.append(button);
			
			});
		
		steps.eq(0).css({display:'block'});
		controlbar.find('li').eq(0).addClass('current');
		
		// return the wrapper
		return wrapper;
		
		};
	
	//==================================================
			
	//DOM LOAD
	$(function(){
		
		//==================================================
		// set javascript cookie
		
		jQuery.cookie('jsok', '1', {
			path: '/',
			expires: 3 // expires in one day
			});
		
		//==================================================
		// remove noscript
		
		$('body').removeClass('noscript').addClass('script');
		
		//==================================================
		// fixed position pma and navigation
		
		// create the fixed content div
		$('#content-overview').wrapInner('<div id="content-overview-fixed"></div>').append('&nbsp;');
		
		// get the fixed content div
		var $fixedcontent = $('#content-overview-fixed');
		
		// get the navigation height
		var navheight = $('#navigation').outerHeight();
		
		// get the document
		var $document = $(document);
		
		// move the fixed content div
		$fixedcontent
			.remove()
			.appendTo('#container')
			.css({
				position: 'absolute',
				left: 15,
				top: navheight+10+$document.scrollTop(),
				zIndex: 100000
				});
		
		// window scroll event
		$(window).scroll(function(e){
			$fixedcontent.animate({top:navheight+10+$document.scrollTop()},{queue:false,delay:300,duration:800,easing:'easeOutExpo'});
			});
		
		//==================================================
		// navigation fading
		
		$('#navigation-overview li a').each(function(){
			var $this = $(this);
			$this.mouseenter($.fadenLinkOut);
			$this.mouseleave($.fadeLinkIn)
			});
		  $('#navigation a').each(function(){
			var $this = $(this)
			$this.css({opacity:0.7});
			$this.mouseenter($.simpleFadeIn);
			$this.mouseleave($.simpleFadeOut)										   
		});
		$('body.page- #background-wrapper')
			.css({opacity:0})
			.pause(1000)
			.animate({ 
				opacity:1
			},{ queue:true, duration:800,easing:'easeOutExpo'});
		$("a.post-gallery-thumbnail").fancybox({
			'overlayOpacity': 0.6,
			'overlayColor':'#660000',
			'showTitle':false
		});
		
		//==================================================
		// step controls
		
		$('div.step').stepControl();

		//==================================================
		// hide all but latest 3 comments
		
		// get the comment container
		var $commentcontainer = $('div.post-comments-latest');
		
		// make sure we have some comments to work with
		if ($commentcontainer.length){
			
			// get the comments
			var $comments = $commentcontainer.find('div.comment');
			
			// make sure we have more than 4 comments
			if ($comments.length>4){
				
				// get the comments we need to hide and wrap them
				var $firstcomments = $comments
					.slice(0,$comments.length-3)
					.wrapAll('<div id="comment-masker"><div id="comment-masker-inner"></div></div>');
				
				// get the comment masker
				var $commentmasker = $('#comment-masker')
					.css({position:'relative',overflow:'hidden'});
				
				// get the comment masker inner
				var $commentmaskerinner = $('#comment-masker-inner');
				
				// get the height of the comment masker
				$commentmasker.data('fullheight',$commentmasker.height());
					
				// position the comment masker inner
				$commentmaskerinner.css({position:'absolute',bottom:0});
					
				// set the height of the comment masker
				$commentmasker.height('0');
					
				// add a 'more' button above the remaining comments
				var $morecomments = $('<a class="more-comments" href="#">View '+($firstcomments.length)+' more comments <span>+</span></a>');
				$morecomments.insertBefore($commentmasker);
				
				// handle clicking of the 'more' button
				$morecomments.click(function(){
					
					// animate the comments in
					$commentmasker.animate({height:$commentmasker.data('fullheight')},{duration:800,easing:'easeOutExpo',complete:function(){
						
						// animate the 'more' button out
						$morecomments.animate({height:0},{duration:800,easing:'easeOutExpo',complete:function(){
							
							// remove the 'more' button
							$morecomments.remove();
							
							}});
						
						}});
					
					// return false
					return false;
					
					});
				
				}
			
			}
		
		//==================================================
		// image posts cascade
		
		// hide all image posts
		var $imageposts = $("#image-posts div").css({opacity:0});
		
		// make sure we have some image posts to work with
		if ($imageposts.length){
			// set the pause time
			var pausetime = 400;
			// loop the images
			$imageposts.each(function(ii){
				// animate the image
				$(this).pause(pausetime).animate({opacity:1},{duration:600,easing:'easeInExpo'});
				// increment the pause time
				pausetime += 150;
				});
			}
		
		//==================================================
		// video posts cascade
		
		// hide all video posts
		var $videoposts = $("#video-posts div").css({opacity:0});
		
		// make sure we have some video posts to work with
		if ($videoposts.length){
			// set the pause time
			var pausetime = 400;
			// loop the videos
			$videoposts.each(function(ii){
				// animate the video
				$(this).pause(pausetime).animate({opacity:1},{duration:600,easing:'easeInExpo'});
				// increment the pause time
				pausetime += 150;
				});
			}
		
		//==================================================
		// checkbox and radio clicking
		
		var $allthecheckables = $('p.field input:checkbox, p.field input:radio').each(function(){
			var input = $(this);
			var field = input.closest('p.field').data('input',input);
			input.data('field',field);
			input.click(function(event){event.stopPropagation();});
			field.click(function(event){
				var $this = $(this);
				$this.data('input').focus().click();
				
				$allthecheckables.each(function(){
					var $checkable = $(this);
					if ($checkable.attr('checked')){
						$checkable.data('field').addClass('input-checked');
						}
					else{
						$checkable.data('field').removeClass('input-checked');
						}
					});

				return false;
				});
			if (input.hasClass('hideinput')){
				input.css({display:'none'});
				}
			});
		
		//==================================================
		// mininput
		
		$('input.mininput').mininput();
		
		//==================================================
		// like a comment
	
		$('a.likes').click(function(){
			var commentid = $(this).attr('rel');
			var data = {comment:commentid};
			// run action
			system.action('like_comment',data,function(d){
				if (d.success){
					var likebox = $('#comment-'+commentid).find('a.likes').eq(0);
					likebox.text(parseInt(likebox.text())+1);
					likebox.closest('.comment').addClass('ilike');
					}
				else{
					if (d.errors){
						var message = d.errors.join('\n');
						alert(message);
						}
					}
				});
			return false;
			});
		
		//==================================================
		// youtube link click
		
		$('a.youtube-link').click(function(){
			// NOTE video size = 520x365
			
			// store reference to this ('a.youtube-link')
			var $this = $(this);
			
			// get videodata from the link
			if (!$this.data('videodata')){
				var videodata = {
					title: $this.attr('title'),
					description: $this.attr('data-description'),
					posterframe: $this.attr('data-posterframe'),
					youtubeid: $this.attr('data-youtubeid'),
					youtubeurl: $this.attr('href')
					};
				$this.data('videodata',videodata);
				}
			else{
				var videodata = $this.data('videodata');
				}
			
			// slide the navigation down
			var nav = $('#navigation-overview').animate({marginTop:20},{duration:600,easing:'easeOutExpo'});
			
			// fade the pma out
			var pma = $('#pma').animate({opacity:0},{duration:600,easing:'easeOutExpo',complete:function(){
				
				// store reference to pma
				var pma = $(this);
				
				// load the video
				pma.html('<div id="pmaObject"> </div>');
				$('#pmaObject').flash({
					swf: '/skins/marshall/script/mediaplayer.4.6.swf',
					width:520,
					height:365,
					flashvars:{
						file: videodata.youtubeurl+'?fmt=35',
						image: videodata.posterframe,
						controlbar: 'over',
						backcolor:'000000',
						frontcolor:'FF0000',
						lightcolor:'FF3333',
						screencolor:'000000',
						bufferlength:2,
						autostart: true
						},
					params:{
						allowfullscreen: true,
						menu: false
						}
					});				
				
				// fade the pma in
				pma.pause(600).animate({opacity:1},{duration:1800,easing:'easeOutExpo'});
				
				}});
			
			return false;
			
			});
		
		//==================================================
		
	});
	
})(jQuery);