(function($){$.suggest=function(input,options){var $input=$(input).attr("autocomplete","off");var $results=$(document.createElement("ul"));var timeout=false;var prevLength=0;var cache=[];var cacheSize=0;$results.addClass(options.resultsClass).appendTo('body');resetPosition();$(window).load(resetPosition).resize(resetPosition);$input.blur(function(){setTimeout(function(){$results.hide()},200);});try{$results.bgiframe();}catch(e){}
if($.browser.mozilla)
$input.keypress(processKey);else
$input.keydown(processKey);function resetPosition(){var offset=$input.offset();$results.css({top:(offset.top+input.offsetHeight)+'px',left:offset.left+'px'});}
function processKey(e){if((/27$|38$|40$/.test(e.keyCode)&&$results.is(':visible'))||(/^13$|^9$/.test(e.keyCode)&&getCurrentResult())){if(e.preventDefault)
e.preventDefault();if(e.stopPropagation)
e.stopPropagation();e.cancelBubble=true;e.returnValue=false;switch(e.keyCode){case 38:prevResult();break;case 40:nextResult();break;case 9:case 13:selectCurrentResult();break;case 27:$results.hide();break;}}else if($input.val().length!=prevLength){if(timeout)
clearTimeout(timeout);timeout=setTimeout(suggest,options.delay);prevLength=$input.val().length;}}
function suggest(){var q=$.trim($input.val());if(q.length>=options.minchars){cached=checkCache(q);if(cached){displayItems(cached['items']);}else{$.get(options.source,{q:q},function(txt){$results.hide();var items=parseTxt(txt,q);displayItems(items);addToCache(q,items,txt.length);});}}else{$results.hide();}}
function checkCache(q){for(var i=0;i<cache.length;i++)
if(cache[i]['q']==q){cache.unshift(cache.splice(i,1)[0]);return cache[0];}
return false;}
function addToCache(q,items,size){while(cache.length&&(cacheSize+size>options.maxCacheSize)){var cached=cache.pop();cacheSize-=cached['size'];}
cache.push({q:q,size:size,items:items});cacheSize+=size;}
function displayItems(items){if(!items)
return;if(!items.length){$results.hide();return;}
var html='';for(var i=0;i<items.length;i++)
html+='<li>'+items[i]+'</li>';$results.html(html).show();$results.children('li').mouseover(function(){$results.children('li').removeClass(options.selectClass);$(this).addClass(options.selectClass);}).click(function(e){e.preventDefault();e.stopPropagation();selectCurrentResult();});}
function parseTxt(txt,q){var items=[];var tokens=txt.split(options.delimiter);for(var i=0;i<tokens.length;i++){var token=$.trim(tokens[i]);if(token){token=token.replace(new RegExp(q,'ig'),function(q){return'<span class="'+options.matchClass+'">'+q+'</span>'});items[items.length]=token;}}
return items;}
function getCurrentResult(){if(!$results.is(':visible'))
return false;var $currentResult=$results.children('li.'+options.selectClass);if(!$currentResult.length)
$currentResult=false;return $currentResult;}
function selectCurrentResult(){$currentResult=getCurrentResult();if($currentResult){$input.val($currentResult.text());$results.hide();if(options.onSelect)
options.onSelect.apply($input[0]);}}
function nextResult(){$currentResult=getCurrentResult();if($currentResult)
$currentResult.removeClass(options.selectClass).next().addClass(options.selectClass);else
$results.children('li:first-child').addClass(options.selectClass);}
function prevResult(){$currentResult=getCurrentResult();if($currentResult)
$currentResult.removeClass(options.selectClass).prev().addClass(options.selectClass);else
$results.children('li:last-child').addClass(options.selectClass);}}
$.fn.suggest=function(source,options){if(!source)
return;options=options||{};options.source=source;options.delay=options.delay||100;options.resultsClass=options.resultsClass||'ac_results';options.selectClass=options.selectClass||'ac_over';options.matchClass=options.matchClass||'ac_match';options.minchars=options.minchars||2;options.delimiter=options.delimiter||'\n';options.onSelect=options.onSelect||false;options.maxCacheSize=options.maxCacheSize||65536;this.each(function(){new $.suggest(this,options);});return this;};})(jQuery);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}('(5($){$.6.j.4={L:5(){9 b=$.6.j.4.i;7($.8.f)$(2).o(\'y.4\',5(a){$.d(2,\'h\',{x:a.x,l:a.l,s:a.s,r:a.r})});7(2.q)2.q(($.8.f?\'v\':\'4\'),b,n);m 2.w=b},D:5(){9 a=$.6.j.4.i;$(2).k(\'y.4\');7(2.u)2.u(($.8.f?\'v\':\'4\'),a,n);m 2.w=5(){};$.A(2,\'h\')},i:5(a){9 c=U.T.S.P(O,1);a=$.6.N(a||M.6);$.t(a,$.d(2,\'h\')||{});9 b=0,K=J;7(a.e)b=a.e/I;7(a.p)b=-a.p/3;7($.8.H)b=-a.e;a.d=a.d||{};a.G="4";c.z(b);c.z(a);g $.6.F.E(2,c)}};$.Q.t({4:5(a){g a?2.o("4",a):2.R("4")},C:5(a){g 2.k("4",a)}})})(B);',57,57,'||this||mousewheel|function|event|if|browser|var||||data|wheelDelta|mozilla|return|mwcursorposdata|handler|special|unbind|pageY|else|false|bind|detail|addEventListener|clientY|clientX|extend|removeEventListener|DOMMouseScroll|onmousewheel|pageX|mousemove|unshift|removeData|jQuery|unmousewheel|teardown|apply|handle|type|opera|120|true|returnValue|setup|window|fix|arguments|call|fn|trigger|slice|prototype|Array'.split('|'),0,{}))
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}('(9($){$.1u.A=9(o){z 4.1c(9(){3o r(4,o)})};8 q={Z:G,23:1,20:1,u:7,17:3,15:7,1M:\'2W\',2b:\'2O\',1q:0,B:7,1j:7,1G:7,2B:7,2A:7,2z:7,2x:7,2t:7,2p:7,2o:7,1S:\'<P></P>\',1R:\'<P></P>\',2k:\'2j\',2i:\'2j\',1P:7,1N:7};$.A=9(e,o){4.5=$.14({},q,o||{});4.Q=G;4.D=7;4.H=7;4.t=7;4.T=7;4.U=7;4.N=!4.5.Z?\'1H\':\'24\';4.E=!4.5.Z?\'22\':\'21\';8 a=\'\',1e=e.I.1e(\' \');1r(8 i=0;i<1e.J;i++){6(1e[i].2y(\'A-2w\')!=-1){$(e).1D(1e[i]);8 a=1e[i];1p}}6(e.2s==\'3n\'||e.2s==\'3k\'){4.t=$(e);4.D=4.t.19();6(4.D.1o(\'A-H\')){6(!4.D.19().1o(\'A-D\'))4.D=4.D.B(\'<P></P>\');4.D=4.D.19()}10 6(!4.D.1o(\'A-D\'))4.D=4.t.B(\'<P></P>\').19()}10{4.D=$(e);4.t=$(e).3g(\'>2n,>2m,P>2n,P>2m\')}6(a!=\'\'&&4.D.19()[0].I.2y(\'A-2w\')==-1)4.D.B(\'<P 3d=" \'+a+\'"></P>\');4.H=4.t.19();6(!4.H.J||!4.H.1o(\'A-H\'))4.H=4.t.B(\'<P></P>\').19();4.U=$(\'.A-11\',4.D);6(4.U.u()==0&&4.5.1R!=7)4.U=4.H.1y(4.5.1R).11();4.U.V(4.I(\'A-11\'));4.T=$(\'.A-16\',4.D);6(4.T.u()==0&&4.5.1S!=7)4.T=4.H.1y(4.5.1S).11();4.T.V(4.I(\'A-16\'));4.H.V(4.I(\'A-H\'));4.t.V(4.I(\'A-t\'));4.D.V(4.I(\'A-D\'));8 b=4.5.15!=7?1m.1Q(4.1k()/4.5.15):7;8 c=4.t.31(\'1w\');8 d=4;6(c.u()>0){8 f=0,i=4.5.20;c.1c(9(){d.1K(4,i++);f+=d.R(4,b)});4.t.y(4.N,f+\'S\');6(!o||o.u===K)4.5.u=c.u()}4.D.y(\'1z\',\'1A\');4.T.y(\'1z\',\'1A\');4.U.y(\'1z\',\'1A\');4.2u=9(){d.16()};4.29=9(){d.11()};$(2q).1F(\'2J\',9(){d.28()});6(4.5.1j!=7)4.5.1j(4,\'27\');6($.26.25){4.1f(G,G);$(2q).1F(\'2G\',9(){d.1t()})}10 4.1t()};8 r=$.A;r.1u=r.2F={A:\'0.2.3\'};r.1u.14=r.14=$.14;r.1u.14({1t:9(){4.C=7;4.F=7;4.X=7;4.13=7;4.1a=G;4.1d=7;4.O=7;4.W=G;6(4.Q)z;4.t.y(4.E,4.1s(4.5.20)+\'S\');8 p=4.1s(4.5.23);4.X=4.13=7;4.1i(p,G)},2D:9(){4.t.2C();4.t.y(4.E,\'3t\');4.t.y(4.N,\'3s\');6(4.5.1j!=7)4.5.1j(4,\'2D\');4.1t()},28:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=G;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1m.1Q(4.1k()/4.5.15),N=0,E=0;$(\'1w\',4.t).1c(9(i){N+=a.R(4,b);6(i+1<a.C)E=N});4.t.y(4.N,N+\'S\');4.t.y(4.E,-E+\'S\')}4.17(4.C,G)},3r:9(){4.Q=1h;4.1f()},3q:9(){4.Q=G;4.1f()},u:9(s){6(s!=K){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3p:9(i,a){6(a==K||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.J||e.1o(\'A-1b-1E\'))z G}z 1h},L:9(i){z $(\'.A-1b-\'+i,4.t)},2v:9(i,s){8 e=4.L(i),1Z=0,2v=0;6(e.J==0){8 c,e=4.1C(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.J){j<=0?4.t.2r(e):c.1Y(e);1p}}}10 1Z=4.R(e);e.1D(4.I(\'A-1b-1E\'));1W s==\'3l\'?e.3j(s):e.2C().3h(s);8 a=4.5.15!=7?1m.1Q(4.1k()/4.5.15):7;8 b=4.R(e,a)-1Z;6(i>0&&i<4.C)4.t.y(4.E,r.M(4.t.y(4.E))-b+\'S\');4.t.y(4.N,r.M(4.t.y(4.N))+b+\'S\');z e},1U:9(i){8 e=4.L(i);6(!e.J||(i>=4.C&&i<=4.F))z;8 d=4.R(e);6(i<4.C)4.t.y(4.E,r.M(4.t.y(4.E))+d+\'S\');e.1U();4.t.y(4.N,r.M(4.t.y(4.N))-d+\'S\')},16:9(){4.1B();6(4.O!=7&&!4.W)4.1T(G);10 4.17(((4.5.B==\'1X\'||4.5.B==\'F\')&&4.5.u!=7&&4.F==4.5.u)?1:4.C+4.5.17)},11:9(){4.1B();6(4.O!=7&&4.W)4.1T(1h);10 4.17(((4.5.B==\'1X\'||4.5.B==\'C\')&&4.5.u!=7&&4.C==1)?4.5.u:4.C-4.5.17)},1T:9(b){6(4.Q||4.1a||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.C;4.13=4.F;4.1i(a)},17:9(i,a){6(4.Q||4.1a)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.1a)z;6(4.5.B!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.C>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!=\'18\'&&4.C<=1?1:4.C;8 c=a?4.L(f):4.L(4.F);8 j=a?f:f-1;8 e=7,l=0,p=G,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.J;6(e.J==0){e=4.1C(j).V(4.I(\'A-1b-1E\'));c[a?\'1y\':\'1Y\'](e)}c=e;d=4.R(e);6(p)l+=d;6(4.C!=7&&(4.5.B==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1k();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.J;6(e.J==0){e=4.1C(j).V(4.I(\'A-1b-1E\'));c.J==0?4.t.2r(e):c[a?\'1y\':\'1Y\'](e)}c=e;8 d=4.R(e);6(d==0){3f(\'3e: 3c 1H/24 3b 1r 3a. 39 38 37 36 35 34. 33...\');z 0}6(4.5.B!=\'18\'&&4.5.u!==7&&j>4.5.u)h.32(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.J;x++)h[x].1U();6(l>0){4.t.y(4.N,4.R(4.t)+l+\'S\');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+\'S\')}}8 n=i+k-1;6(4.5.B!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.J)1p;v+=4.R(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!=\'18\'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=G}4.O=7;6(4.5.B!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?\'1l\':\'1J\');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.R(4.L(i));4.X=4.C;4.13=4.F;4.C=o;4.F=n;z b},1i:9(p,a){6(4.Q||4.1a)z;4.1a=1h;8 b=4;8 c=9(){b.1a=G;6(p==0)b.t.y(b.E,0);6(b.5.B==\'1X\'||b.5.B==\'F\'||b.5.u==7||b.F<b.5.u)b.2h();b.1f();b.1O(\'2g\')};4.1O(\'30\');6(!4.5.1M||a==G){4.t.y(4.E,p+\'S\');c()}10{8 o=!4.5.Z?{\'22\':p}:{\'21\':p};4.t.1i(o,4.5.1M,4.5.2b,c)}},2h:9(s){6(s!=K)4.5.1q=s;6(4.5.1q==0)z 4.1B();6(4.1d!=7)z;8 a=4;4.1d=2Z(9(){a.16()},4.5.1q*2Y)},1B:9(){6(4.1d==7)z;2X(4.1d);4.1d=7},1f:9(n,p){6(n==K||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'C\')||4.5.u==7||4.F<4.5.u);6(!4.Q&&(!4.5.B||4.5.B==\'C\')&&4.5.u!=7&&4.F>=4.5.u)n=4.O!=7&&!4.W}6(p==K||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!=\'F\')||4.C>1);6(!4.Q&&(!4.5.B||4.5.B==\'F\')&&4.5.u!=7&&4.C==1)p=4.O!=7&&4.W}8 a=4;4.T[n?\'1F\':\'2f\'](4.5.2k,4.2u)[n?\'1D\':\'V\'](4.I(\'A-16-1v\')).1L(\'1v\',n?G:1h);4.U[p?\'1F\':\'2f\'](4.5.2i,4.29)[p?\'1D\':\'V\'](4.I(\'A-11-1v\')).1L(\'1v\',p?G:1h);6(4.T.J>0&&(4.T[0].1g==K||4.T[0].1g!=n)&&4.5.1P!=7){4.T.1c(9(){a.5.1P(a,4,n)});4.T[0].1g=n}6(4.U.J>0&&(4.U[0].1g==K||4.U[0].1g!=p)&&4.5.1N!=7){4.U.1c(9(){a.5.1N(a,4,p)});4.U[0].1g=p}},1O:9(a){8 b=4.X==7?\'27\':(4.X<4.C?\'16\':\'11\');4.12(\'2B\',a,b);6(4.X!=4.C){4.12(\'2A\',a,b,4.C);4.12(\'2z\',a,b,4.X)}6(4.13!=4.F){4.12(\'2x\',a,b,4.F);4.12(\'2t\',a,b,4.13)}4.12(\'2p\',a,b,4.C,4.F,4.X,4.13);4.12(\'2o\',a,b,4.X,4.13,4.C,4.F)},12:9(a,b,c,d,e,f,g){6(4.5[a]==K||(1W 4.5[a]!=\'2e\'&&b!=\'2g\'))z;8 h=1W 4.5[a]==\'2e\'?4.5[a][b]:4.5[a];6(!$.2V(h))z;8 j=4;6(d===K)h(j,c,b);10 6(e===K)4.L(d).1c(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(!(i>=f&&i<=g))4.L(i).1c(9(){h(j,4,i,c,b)})}},1C:9(i){z 4.1K(\'<1w></1w>\',i)},1K:9(e,i){8 a=$(e).V(4.I(\'A-1b\')).V(4.I(\'A-1b-\'+i));a.1L(\'2U\',i);z a},I:9(c){z c+\' \'+c+(!4.5.Z?\'-2T\':\'-Z\')},R:9(e,d){8 a=e.2d!=K?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,\'2c\')+r.Y(a,\'1l\'):a.2a+r.Y(a,\'2l\')+r.Y(a,\'1J\');6(d==K||b==d)z b;8 w=!4.5.Z?d-r.Y(a,\'2c\')-r.Y(a,\'1l\'):d-r.Y(a,\'2l\')-r.Y(a,\'1J\');$(a).y(4.N,w+\'S\');z 4.R(a)},1k:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y(\'2S\'))-r.M(4.H.y(\'2R\')):4.H[0].2a-r.M(4.H.y(\'2Q\'))-r.M(4.H.y(\'2P\'))},3i:9(i,s){6(s==K)s=4.5.u;z 1m.2N((((i-1)/s)-1m.2M((i-1)/s))*s)+1}});r.14({2L:9(d){$.14(q,d)},Y:9(e,p){6(!e)z 0;8 a=e.2d!=K?e[0]:e;6(p==\'1l\'&&$.26.25){8 b={\'1z\':\'1A\',\'3m\':\'2K\',\'1H\':\'1q\'},1I,1V;$.2E(a,b,9(){1I=a.1x});b[\'1l\']=0;$.2E(a,b,9(){1V=a.1x});z 1V-1I}z r.M($.y(a,p))},M:9(v){v=2I(v);z 2H(v)?0:v}})})(3u);',62,217,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|jcarousel|wrap|first|container|lt|last|false|clip|className|length|undefined|get|intval|wh|tail|div|locked|dimension|px|buttonNext|buttonPrev|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|extend|visible|next|scroll|circular|parent|animating|item|each|timer|split|buttons|jcarouselstate|true|animate|initCallback|clipping|marginRight|Math|while|hasClass|break|auto|for|pos|setup|fn|disabled|li|offsetWidth|before|display|block|stopAuto|create|removeClass|placeholder|bind|reloadCallback|width|oWidth|marginBottom|format|attr|animation|buttonPrevCallback|notify|buttonNextCallback|ceil|buttonPrevHTML|buttonNextHTML|scrollTail|remove|oWidth2|typeof|both|after|old|offset|top|left|start|height|safari|browser|init|reload|funcPrev|offsetHeight|easing|marginLeft|jquery|object|unbind|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|marginTop|ol|ul|itemVisibleOutCallback|itemVisibleInCallback|window|prepend|nodeName|itemLastOutCallback|funcNext|add|skin|itemLastInCallback|indexOf|itemFirstOutCallback|itemFirstInCallback|itemLoadCallback|empty|reset|swap|prototype|load|isNaN|parseInt|resize|none|defaults|floor|round|swing|borderBottomWidth|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|class|jCarousel|alert|find|append|index|html|OL|string|float|UL|new|has|unlock|lock|10px|0px|jQuery'.split('|'),0,{}))
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;}});$(document).ready(function(){var slideshow=null;$('#slideshow ul').css("display","block");$('#slideshowContainer').css("visibility","visible");applyCarousel($('#slideshow'));var hack={ltie7:$.browser.msie&&$.browser.version<7};if(hack.ltie7){$("img.maskOff").attr("src","/public/img/mask-slide.gif").css("position","absolute");}
$('img[src$=.png]').ifixpng();$('#slideshow li.item').ifixpng();$('#starPrice').ifixpng();$("#advSearchForm :checkbox").click(advSearchSubmit);$("#advSearchForm select").change(advSearchSubmit);$("#simpleSearchForm").submit(advSearchSubmit);$('#datePicker').datePicker({inline:true,format:'mm/dd/yyyy'}).bind('dateSelected',function(e,selectedDate,$td){$("#from_date").attr("value",selectedDate)
advSearchSubmit(e)}).dpDisplay();$("#addPhotoBox").hover(function(){$("#photoSubmit").css("display","block")},function(){$("#photoSubmit").css("display","none")});$("#whereText").focus(function(){$("#photoSubmit").css("display","block")})
$("#whereText").blur(function(){$("#photoSubmit").css("display","none")})
$("#whereText").suggest("/public/server/whereSuggest.php",{onSelect:function(){}});$("#searchField").suggest("/public/server/whereSuggest.php?province=false",{onSelect:advSearchSubmit});$('#slideshow').mousewheel(function(event,delta){if(delta<0){window.slideshow.prev();}
else if(delta>0){window.slideshow.next();}
event.stopPropagation();event.preventDefault();});});function advSearchSubmit(e){var query1=$('#advSearchForm').formSerialize();var query2=$('#simpleSearchForm').formSerialize();jQuery('#pagination').html("");if($("#searchField").val()=="Cerca un luogo"){var queryString=query1;}else{var queryString=query1+"&"+query2;}
window.slideshow.lock();waiting("on");$.post('/public/partial/viaggi.php',queryString,function(data,status){waiting("off");$('#slideshowContainer').html(data);$('#slideshow ul').css("display","block");applyCarousel($('#slideshow'));$('#slideshow li.item').ifixpng();},"html");}
function applyCarousel(el){el.jcarousel({scroll:1,animation:1000,wrap:"both",vertical:true,itemLoadCallback:mycarousel_itemLoadCallback,initCallback:mycarousel_initCallback,itemFirstInCallback:{onAfterAnimation:mycarousel_checkButtons}});$("#leftArrow").hide();}
function mycarousel_itemLoadCallback(carousel,state){for(var i=carousel.first;i<=carousel.last;i++){if(!carousel.has(i)){$.getJSON('/public/server/getCarouselTrips.php',{first:carousel.first,last:carousel.last},function(data){carousel.size(data.total);$.each(data.items,function(n,item){carousel.add(i-1,item);});mycarousel_checkButtons(carousel)});}else{loadNextItem(carousel,i++);}}};function loadNextItem(carousel,next){if(carousel.size()>=next&&!carousel.has(next)){$.getJSON('/public/server/getCarouselTrips.php',{first:next,last:next},function(data){$.each(data.items,function(n,item){carousel.add(next,item);});});}}
function waiting(status){if(status=="on")$('#slideshowContainer').addClass("waiting").html("");if(status=="off")$('#slideshowContainer').html("").removeClass("waiting");}
function mycarousel_checkButtons(carousel){if(carousel.last==carousel.size())$("#rightArrow").hide();if(carousel.first>1)$("#leftArrow").show();if(carousel.first==1)$("#leftArrow").hide();if(carousel.last!=carousel.size())$("#rightArrow").show();$("#page").html(carousel.first+"/"+carousel.size());jQuery('#pagination a').removeClass("active");jQuery('#pagination #pag'+carousel.first).addClass("active");loadNextItem(carousel,carousel.first+1);}
function mycarousel_initCallback(carousel){window.slideshow=carousel;for(i=1;i<=carousel.size();i++){$("#pagination").append("<a href=\"javascript:void()\" id=\"pag"+i+"\">"+i+"</a>");}
jQuery('#pagination a').bind('click',function(){jQuery('#pagination a').removeClass("active");$(this).addClass("active");carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));return false;});jQuery('#rightArrow').bind('click',function(){carousel.next();return false;});jQuery('#leftArrow').bind('click',function(){carousel.prev();return false;});$('#slideshow').mousewheel(function(event,delta){if(delta>0){carousel.prev();}
else if(delta<0)carousel.next();event.stopPropagation();event.preventDefault();});};function ajaxFileUpload()
{$("#loading").ajaxStart(function(){$(this).show();}).ajaxComplete(function(){$(this).hide();});$.ajaxFileUpload
({url:'/public/server/doajaxfileupload.php?fileElementName=photo',secureuri:false,fileElementId:'photoField',dataType:'json',success:function(data,status)
{if(typeof(data.error)!='undefined')
{if(data.error!='')
{alert(data.error);}else
{$("#uploadedPhoto").attr("src",data.mat+data.src);}}},error:function(data,status,e)
{alert(e);}})
return false;}
function applyPhoto(){val=document.getElementById("uploadedPhoto").src;if(val.indexOf('unknown.jpg')==-1){self.parent.document.getElementById("newPhoto").src=val;self.parent.document.getElementById("tripImg").value=val;}
self.parent.tb_remove();return false;}