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}('C 12={5A:\'1.5.1.1\',1Z:{3X:!!(1j.3Y&&!1j.4C),5B:!!1j.4C,3r:3Z.41.3s(\'9n/\')>-1,4D:3Z.41.3s(\'4D\')>-1&&3Z.41.3s(\'6Y\')==-1},3b:{5C:!!11.25,42:!!1j.43,5D:(11.2y(\'2e\').44!==11.2y(\'5E\').44)},4E:\'<5F[^>]*>([\\\\S\\\\s]*?)<\\/5F>\',6Z:/^\\/\\*-9o-([\\s\\S]*)\\*\\/\\s*$/,2J:o(){},K:o(x){B x}};C 1C={1D:o(){B o(){7.26.2m(7,17)}}};C 1O=V N();N.M=o(a,b){J(C c 1u b){a[c]=b[c]}B a};N.M(N,{1H:o(a){1P{D(a===1l)B\'1l\';D(a===18)B\'18\';B a.1H?a.1H():a.28()}1V(e){D(e 5G 9p)B\'...\';2z e;}},1Q:o(a){C b=1m a;45(b){1I\'1l\':1I\'o\':1I\'9q\':B;1I\'9r\':B a.28()}D(a===18)B\'18\';D(a.1Q)B a.1Q();D(a.5H===11)B;C c=[];J(C d 1u a){C e=N.1Q(a[d]);D(e!==1l)c.O(d.1Q()+\': \'+e)}B\'{\'+c.1R(\', \')+\'}\'},70:o(a){C b=[];J(C c 1u a)b.O(c);B b},3t:o(a){C b=[];J(C c 1u a)b.O(a[c]);B b},2o:o(a){B N.M({},a)}});71.U.1J=o(){C a=7,2p=$A(17),47=2p.4F();B o(){B a.2m(47,2p.1v($A(17)))}};71.U.9s=o(b){C c=7,2p=$A(17),b=2p.4F();B o(a){B c.2m(b,[a||1j.9t].1v(2p))}};N.M(3u.U,{9u:o(){B 7.2K(2,16)},5I:o(){B 7+1},4G:o(a){$R(0,7,1c).1e(a);B 7},2K:o(a,b){C c=7.28(b||10);B\'0\'.4G(a-c.I)+c},1Q:o(){B 9v(7)?7.28():\'18\'}});9w.U.1Q=o(){B\'"\'+7.9x()+\'-\'+(7.9y()+1).2K(2)+\'-\'+7.9z().2K(2)+\'T\'+7.9A().2K(2)+\':\'+7.9B().2K(2)+\':\'+7.9C().2K(2)+\'"\'};C 72={73:o(){C a;J(C i=0,I=17.I;i<I;i++){C b=17[i];1P{a=b();1y}1V(e){}}B a}};C 74=1C.1D();74.U={26:o(a,b){7.3v=a;7.3c=b;7.4H=1d;7.3d()},3d:o(){7.3w=75(7.3e.1J(7),7.3c*5J)},5K:o(){D(!7.3w)B;9D(7.3w);7.3w=18},3e:o(){D(!7.4H){1P{7.4H=1c;7.3v(7)}9E{7.4H=1d}}}};N.M(1S,{5L:o(a){B a==18?\'\':1S(a)},76:{\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'\\\\\':\'\\\\\\\\\'}});N.M(1S.U,{29:o(a,b){C c=\'\',2L=7,1f;b=17.5M.5N(b);1o(2L.I>0){D(1f=2L.1f(a)){c+=2L.3x(0,1f.4I);c+=1S.5L(b(1f));2L=2L.3x(1f.4I+1f[0].I)}1b{c+=2L,2L=\'\'}}B c},77:o(b,c,d){c=7.29.5N(c);d=d===1l?1:d;B 7.29(b,o(a){D(--d<0)B a[0];B c(a)})},78:o(a,b){7.29(a,b);B 7},9F:o(a,b){a=a||30;b=b===1l?\'...\':b;B 7.I>a?7.3x(0,a-b.I)+b:7},3f:o(){B 7.1q(/^\\s+/,\'\').1q(/\\s+$/,\'\')},79:o(){B 7.1q(/<\\/?[^>]+>/5O,\'\')},2q:o(){B 7.1q(V 1W(12.4E,\'7a\'),\'\')},7b:o(){C b=V 1W(12.4E,\'7a\');C c=V 1W(12.4E,\'9G\');B(7.1f(b)||[]).20(o(a){B(a.1f(c)||[\'\',\'\'])[1]})},3y:o(){B 7.7b().20(o(a){B 4J(a)})},4K:o(){C a=17.5M;a.2r.9H=7;B a.2e.2s},7c:o(){C c=11.2y(\'2e\');c.2s=7.79();B c.2a[0]?(c.2a.I>1?$A(c.2a).2A(\'\',o(a,b){B a+b.48}):c.2a[0].48):\'\'},4L:o(e){C f=7.3f().1f(/([^?#]*)(#.*)?$/);D(!f)B{};B f[1].3z(e||\'&\').2A({},o(a,b){D((b=b.3z(\'=\'))[0]){C c=7d(b.4F());C d=b.I>1?b.1R(\'=\'):b[0];D(d!=1l)d=7d(d);D(c 1u a){D(a[c].3g!=1E)a[c]=[a[c]];a[c].O(d)}1b a[c]=d}B a})},2b:o(){B 7.3z(\'\')},5I:o(){B 7.3x(0,7.I-1)+1S.9I(7.7e(7.I-1)+1)},4G:o(a){C b=\'\';J(C i=0;i<a;i++)b+=7;B b},4M:o(){C a=7.3z(\'-\'),5P=a.I;D(5P==1)B a[0];C b=7.4N(0)==\'-\'?a[0].4N(0).1X()+a[0].49(1):a[0];J(C i=1;i<5P;i++)b+=a[i].4N(0).1X()+a[i].49(1);B b},5Q:o(){B 7.4N(0).1X()+7.49(1).21()},9J:o(){B 7.29(/::/,\'/\').29(/([A-Z]+)([A-Z][a-z])/,\'#{1}4a#{2}\').29(/([a-z\\d])([A-Z])/,\'#{1}4a#{2}\').29(/-/,\'4a\').21()},9K:o(){B 7.29(/4a/,\'-\')},1H:o(c){C d=7.29(/[\\9L-\\9M\\\\]/,o(a){C b=1S.76[a[0]];B b?b:\'\\\\9N\'+a[0].7e().2K(2,16)});D(c)B\'"\'+d.1q(/"/g,\'\\\\"\')+\'"\';B"\'"+d.1q(/\'/g,\'\\\\\\\'\')+"\'"},1Q:o(){B 7.1H(1c)},5R:o(a){B 7.77(a||12.6Z,\'#{1}\')},7f:o(){C a=7.1q(/\\\\./g,\'@\').1q(/"[^"\\\\\\n\\r]*"/g,\'\');B(/^[,:{}\\[\\]0-9.\\-+9O-u \\n\\r\\t]*$/).2M(a)},4O:o(a){C b=7.5R();1P{D(!a||b.7f())B 4J(\'(\'+b+\')\')}1V(e){}2z V 9P(\'9Q 9R 7g 2B: \'+7.1H());},1p:o(a){B 7.3s(a)>-1},7h:o(a){B 7.3s(a)===0},7i:o(a){C d=7.I-a.I;B d>=0&&7.9S(a)===d},4b:o(){B 7==\'\'},7j:o(){B/^\\s*$/.2M(7)}});D(12.1Z.3r||12.1Z.3X){N.M(1S.U,{4K:o(){B 7.1q(/&/g,\'&7k;\').1q(/</g,\'&7l;\').1q(/>/g,\'&7m;\')},7c:o(){B 7.1q(/&7k;/g,\'&\').1q(/&7l;/g,\'<\').1q(/&7m;/g,\'>\')}})}1S.U.29.5N=o(b){D(1m b==\'o\')B b;C c=V 22(b);B o(a){B c.25(a)}};1S.U.9T=1S.U.4L;N.M(1S.U.4K,{2e:11.2y(\'2e\'),2r:11.9U(\'\')});7n(1S.U.4K)2e.5S(2r);C 22=1C.1D();22.7o=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;22.U={26:o(a,b){7.7p=a.28();7.4P=b||22.7o},25:o(c){B 7.7p.29(7.4P,o(a){C b=a[1];D(b==\'\\\\\')B a[2];B b+1S.5L(c[a[3]])})}};C $1y={};C $2c=V 9V(\'"2z $2c" 9W 9X, 9Y "B" 9Z\');C 23={1e:o(b){C c=0;1P{7.2f(o(a){b(a,c++)})}1V(e){D(e!=$1y)2z e;}B 7},7q:o(a,b){C c=-a,5T=[],5U=7.2b();1o((c+=a)<5U.I)5T.O(5U.3x(c,c+a));B 5T.20(b)},a0:o(c){C d=1c;7.1e(o(a,b){d=d&&!!(c||12.K)(a,b);D(!d)2z $1y;});B d},a1:o(c){C d=1d;7.1e(o(a,b){D(d=!!(c||12.K)(a,b))2z $1y;});B d},7r:o(c){C d=[];7.1e(o(a,b){d.O((c||12.K)(a,b))});B d},7s:o(c){C d;7.1e(o(a,b){D(c(a,b)){d=a;2z $1y;}});B d},7t:o(c){C d=[];7.1e(o(a,b){D(c(a,b))d.O(a)});B d},a2:o(d,e){C f=[];7.1e(o(a,b){C c=a.28();D(c.1f(d))f.O((e||12.K)(a,b))});B f},1p:o(b){C c=1d;7.1e(o(a){D(a==b){c=1c;2z $1y;}});B c},a3:o(b,c){c=c===1l?18:c;B 7.7q(b,o(a){1o(a.I<b)a.O(c);B a})},2A:o(c,d){7.1e(o(a,b){c=d(c,a,b)});B c},5V:o(b){C c=$A(17).3x(1);B 7.20(o(a){B a[b].2m(a,c)})},a4:o(c){C d;7.1e(o(a,b){a=(c||12.K)(a,b);D(d==1l||a>=d)d=a});B d},a5:o(c){C d;7.1e(o(a,b){a=(c||12.K)(a,b);D(d==1l||a<d)d=a});B d},a6:o(c){C d=[],5W=[];7.1e(o(a,b){((c||12.K)(a,b)?d:5W).O(a)});B[d,5W]},4c:o(c){C d=[];7.1e(o(a,b){d.O(a[c])});B d},a7:o(c){C d=[];7.1e(o(a,b){D(!c(a,b))d.O(a)});B d},a8:o(e){B 7.20(o(a,b){B{1w:a,4d:e(a,b)}}).a9(o(c,d){C a=c.4d,b=d.4d;B a<b?-1:a>b?1:0}).4c(\'1w\')},2b:o(){B 7.20()},aa:o(){C c=12.K,2p=$A(17);D(1m 2p.1z()==\'o\')c=2p.ab();C d=[7].1v(2p).20($A);B 7.20(o(a,b){B c(d.4c(b))})},7u:o(){B 7.2b().I},1H:o(){B\'#<23:\'+7.2b().1H()+\'>\'}};N.M(23,{20:23.7r,7v:23.7s,2g:23.7t,ac:23.1p,ad:23.2b});C $A=1E.7w=o(a){D(!a)B[];D(a.2b){B a.2b()}1b{C b=[];J(C i=0,I=a.I;i<I;i++)b.O(a[i]);B b}};D(12.1Z.3r){$A=1E.7w=o(a){D(!a)B[];D(!(1m a==\'o\'&&a==\'[47 ae]\')&&a.2b){B a.2b()}1b{C b=[];J(C i=0,I=a.I;i<I;i++)b.O(a[i]);B b}}}N.M(1E.U,23);D(!1E.U.5X)1E.U.5X=1E.U.4Q;N.M(1E.U,{2f:o(a){J(C i=0,I=7.I;i<I;i++)a(7[i])},7x:o(){7.I=0;B 7},2h:o(){B 7[0]},1z:o(){B 7[7.I-1]},af:o(){B 7.2g(o(a){B a!=18})},7y:o(){B 7.2A([],o(a,b){B a.1v(b&&b.3g==1E?b.7y():[b])})},5Y:o(){C b=$A(17);B 7.2g(o(a){B!b.1p(a)})},3s:o(a){J(C i=0,I=7.I;i<I;i++)D(7[i]==a)B i;B-1},4Q:o(a){B(a!==1d?7:7.2b()).5X()},ag:o(){B 7.I>1?7:7[0]},ah:o(d){B 7.2A([],o(a,b,c){D(0==c||(d?a.1z()!=b:!a.1p(b)))a.O(b);B a})},2o:o(){B[].1v(7)},7u:o(){B 7.I},1H:o(){B\'[\'+7.20(N.1H).1R(\', \')+\']\'},1Q:o(){C c=[];7.1e(o(a){C b=N.1Q(a);D(b!==1l)c.O(b)});B\'[\'+c.1R(\', \')+\']\'}});1E.U.2b=1E.U.2o;o $w(a){a=a.3f();B a?a.3z(/\\s+/):[]}D(12.1Z.5B){1E.U.1v=o(){C a=[];J(C i=0,I=7.I;i<I;i++)a.O(7[i]);J(C i=0,I=17.I;i<I;i++){D(17[i].3g==1E){J(C j=0,7z=17[i].I;j<7z;j++)a.O(17[i][j])}1b{a.O(17[i])}}B a}}C 1F=o(a){D(a 5G 1F)7.7A(a);1b N.M(7,a||{})};N.M(1F,{3h:o(d){C e=[];e.3A=17.5M.7B;7.U.2f.5Z(d,o(b){D(!b.2i)B;C c=b.1w;D(c&&1m c==\'47\'){D(c.3g==1E)c.1e(o(a){e.3A(b.2i,a)});B}e.3A(b.2i,c)});B e.1R(\'&\')},1Q:o(c){C d=[];7.U.2f.5Z(c,o(a){C b=N.1Q(a.1w);D(b!==1l)d.O(a.2i.1Q()+\': \'+b)});B\'{\'+d.1R(\', \')+\'}\'}});1F.3h.7B=o(a,b,c){a=7C(a);D(b===1l)7.O(a);1b 7.O(a+\'=\'+(b==18?\'\':7C(b)))};N.M(1F.U,23);N.M(1F.U,{2f:o(a){J(C b 1u 7){C c=7[b];D(c&&c==1F.U[b])2c;C d=[b,c];d.2i=b;d.1w=c;a(d)}},70:o(){B 7.4c(\'2i\')},3t:o(){B 7.4c(\'1w\')},7A:o(c){B $H(c).2A(7,o(a,b){a[b.2i]=b.1w;B a})},4e:o(){C a;J(C i=0,I=17.I;i<I;i++){C b=7[17[i]];D(b!==1l){D(a===1l)a=b;1b{D(a.3g!=1E)a=[a];a.O(b)}}7D 7[17[i]]}B a},3h:o(){B 1F.3h(7)},1H:o(){B\'#<1F:{\'+7.20(o(a){B a.20(N.1H).1R(\': \')}).1R(\', \')+\'}>\'},1Q:o(){B 1F.1Q(7)}});o $H(a){D(a 5G 1F)B a;B V 1F(a)};D(o(){C i=0,60=o(a){7.2i=a};60.U.2i=\'ai\';J(C b 1u V 60(\'aj\'))i++;B i>1}())1F.U.2f=o(a){C b=[];J(C c 1u 7){C d=7[c];D((d&&d==1F.U[c])||b.1p(c))2c;b.O(c);C e=[c,d];e.2i=c;e.1w=d;a(e)}};4R=1C.1D();N.M(4R.U,23);N.M(4R.U,{26:o(a,b,c){7.4f=a;7.61=b;7.7E=c},2f:o(a){C b=7.4f;1o(7.1p(b)){a(b);b=b.5I()}},1p:o(a){D(a<7.4f)B 1d;D(7.7E)B a<7.61;B a<=7.61}});C $R=o(a,b,c){B V 4R(a,b,c)};C 1h={62:o(){B 72.73(o(){B V 7F()},o(){B V 7G(\'ak.7H\')},o(){B V 7G(\'al.7H\')})||1d},63:0};1h.3B={4g:[],2f:o(a){7.4g.2f(a)},7I:o(a){D(!7.1p(a))7.4g.O(a)},am:o(a){7.4g=7.4g.5Y(a)},4S:o(b,c,d,f){7.1e(o(a){D(1m a[b]==\'o\'){1P{a[b].2m(a,[c,d,f])}1V(e){}}})}};N.M(1h.3B,23);1h.3B.7I({4T:o(){1h.63++},2t:o(){1h.63--}});1h.4U=o(){};1h.4U.U={4V:o(a){7.14={1K:\'4h\',4W:1c,7J:\'64/x-an-5E-ao\',65:\'ap-8\',2C:\'\'};N.M(7.14,a||{});7.14.1K=7.14.1K.21();D(1m 7.14.2C==\'2B\')7.14.2C=7.14.2C.4L()}};1h.3C=1C.1D();1h.3C.7K=[\'aq\',\'ar\',\'as\',\'at\',\'66\'];1h.3C.U=N.M(V 1h.4U(),{67:1d,26:o(a,b){7.1r=1h.62();7.4V(b);7.4X(a)},4X:o(a){7.3D=a;7.1K=7.14.1K;C b=N.2o(7.14.2C);D(![\'7L\',\'4h\'].1p(7.1K)){b[\'au\']=7.1K;7.1K=\'4h\'}7.2C=b;D(b=1F.3h(b)){D(7.1K==\'7L\')7.3D+=(7.3D.1p(\'?\')?\'&\':\'?\')+b;1b D(/av|aw|6Y/.2M(3Z.41))b+=\'&4a=\'}1P{D(7.14.4T)7.14.4T(7.1r);1h.3B.4S(\'4T\',7,7.1r);7.1r.ax(7.1K.1X(),7.3D,7.14.4W);D(7.14.4W)3i(o(){7.68(1)}.1J(7),10);7.1r.7M=7.69.1J(7);7.7N();7.1T=7.1K==\'4h\'?(7.14.ay||b):18;7.1r.az(7.1T);D(!7.14.4W&&7.1r.7O)7.69()}1V(e){7.4i(e)}},69:o(){C a=7.1r.7P;D(a>1&&!((a==4)&&7.67))7.68(7.1r.7P)},7N:o(){C b={\'X-aA-aB\':\'7F\',\'X-12-5A\':12.5A,\'aC\':\'2r/aD, 2r/aE, 64/7Q, 2r/7Q, */*\'};D(7.1K==\'4h\'){b[\'7R-1g\']=7.14.7J+(7.14.65?\'; aF=\'+7.14.65:\'\');D(7.1r.7O&&(3Z.41.1f(/4D\\/(\\d{4})/)||[0,7S])[1]<7S)b[\'aG\']=\'aH\'}D(1m 7.14.7T==\'47\'){C c=7.14.7T;D(1m c.O==\'o\')J(C i=0,I=c.I;i<I;i+=2)b[c[i]]=c[i+1];1b $H(c).1e(o(a){b[a.2i]=a.1w})}J(C d 1u b)7.1r.aI(d,b[d])},2N:o(){B!7.1r.4Y||(7.1r.4Y>=aJ&&7.1r.4Y<aK)},68:o(a){C b=1h.3C.7K[a];C c=7.1r,4Z=7.4O();D(b==\'66\'){1P{7.67=1c;(7.14[\'3E\'+7.1r.4Y]||7.14[\'3E\'+(7.2N()?\'aL\':\'aM\')]||12.2J)(c,4Z)}1V(e){7.4i(e)}C d=7.6a(\'7R-1g\');D(d&&d.3f().1f(/^(2r|64)\\/(x-)?(aN|aO)5F(;.*)?$/i))7.7U()}1P{(7.14[\'3E\'+b]||12.2J)(c,4Z);1h.3B.4S(\'3E\'+b,7,c,4Z)}1V(e){7.4i(e)}D(b==\'66\'){7.1r.7M=12.2J}},6a:o(a){1P{B 7.1r.aP(a)}1V(e){B 18}},4O:o(){1P{C a=7.6a(\'X-7g\');B a?a.4O():18}1V(e){B 18}},7U:o(){1P{B 4J((7.1r.50||\'\').5R())}1V(e){7.4i(e)}},4i:o(a){(7.14.7V||12.2J)(7,a);1h.3B.4S(\'7V\',7,a)}});1h.6b=1C.1D();N.M(N.M(1h.6b.U,1h.3C.U),{26:o(c,d,e){7.51={2N:(c.2N||c),6c:(c.6c||(c.2N?18:c))};7.1r=1h.62();7.4V(e);C f=7.14.2t||12.2J;7.14.2t=(o(a,b){7.7W();f(a,b)}).1J(7);7.4X(d)},7W:o(){C a=7.51[7.2N()?\'2N\':\'6c\'];C b=7.1r.50;D(!7.14.3y)b=b.2q();D(a=$(a)){D(7.14.7X)V 7.14.7X(a,b);1b a.6d(b)}D(7.2N()){D(7.2t)3i(7.2t.1J(7),10)}}});1h.7Y=1C.1D();1h.7Y.U=N.M(V 1h.4U(),{26:o(a,b,c){7.4V(c);7.2t=7.14.2t;7.3c=(7.14.3c||2);7.3j=(7.14.3j||1);7.6e={};7.51=a;7.3D=b;7.4f()},4f:o(){7.14.2t=7.7Z.1J(7);7.3e()},5K:o(){7.6e.14.2t=1l;aQ(7.3w);(7.2t||12.2J).2m(7,17)},7Z:o(a){D(7.14.3j){7.3j=(a.50==7.80?7.3j*7.14.3j:1);7.80=a.50}7.3w=3i(7.3e.1J(7),7.3j*7.3c*5J)},3e:o(){7.6e=V 1h.6b(7.51,7.3D,7.14)}});o $(a){D(17.I>1){J(C i=0,6f=[],I=17.I;i<I;i++)6f.O($(17[i]));B 6f}D(1m a==\'2B\')a=11.aR(a);B G.M(a)}D(12.3b.5C){11.6g=o(a,b){C c=[];C d=11.25(a,$(b)||11,18,aS.aT,18);J(C i=0,I=d.aU;i<I;i++)c.O(d.aV(i));B c};11.52=o(a,b){C q=".//*[4j(1v(\' \', @6h, \' \'), \' "+a+" \')]";B 11.6g(q,b)}}1b{11.52=o(a,b){C c=($(b)||11.1T).2D(\'*\');C d=[],1i,4P=V 1W("(^|\\\\s)"+a+"(\\\\s|$)");J(C i=0,I=c.I;i<I;i++){1i=c[i];C e=1i.2j;D(e.I==0)2c;D(e==a||e.1f(4P))d.O(G.M(1i))}B d}}D(!1j.G)C G={};G.M=o(a){C F=12.3b;D(!a||!a.1k||a.2u==3||a.81||F.5D||a==1j)B a;C b={},1k=a.1k,4k=G.M.4k,T=G.19.2E;D(!F.42){N.M(b,G.19),N.M(b,G.19.53)}D(T[1k])N.M(b,T[1k]);J(C c 1u b){C d=b[c];D(1m d==\'o\'&&!(c 1u a))a[c]=4k.6i(d)}a.81=12.2J;B a};G.M.4k={6i:o(a){B 7[a]=7[a]||o(){B a.2m(18,[7].1v($A(17)))}}};G.19={6j:o(a){B $(a).Y.2F!=\'54\'},82:o(a){a=$(a);G[G.6j(a)?\'83\':\'84\'](a);B a},83:o(a){$(a).Y.2F=\'54\';B a},84:o(a){$(a).Y.2F=\'\';B a},4e:o(a){a=$(a);a.1L.6k(a);B a},6d:o(a,b){b=1m b==\'1l\'?\'\':b.28();$(a).2s=b.2q();3i(o(){b.3y()},10);B a},1q:o(a,b){a=$(a);b=1m b==\'1l\'?\'\':b.28();D(a.85){a.85=b.2q()}1b{C c=a.5H.86();c.6l(a);a.1L.aW(c.87(b.2q()),a)}3i(o(){b.3y()},10);B a},1H:o(d){d=$(d);C e=\'<\'+d.1k.21();$H({\'2O\':\'2O\',\'2j\':\'6h\'}).1e(o(a){C b=a.2h(),88=a.1z();C c=(d[b]||\'\').28();D(c)e+=\' \'+88+\'=\'+c.1H(1c)});B e+\'>\'},55:o(a,b){a=$(a);C c=[];1o(a=a[b])D(a.2u==1)c.O(G.M(a));B c},89:o(a){B $(a).55(\'1L\')},8a:o(a){B $A($(a).2D(\'*\')).1e(G.M)},8b:o(a){a=$(a).3F;1o(a&&a.2u!=1)a=a.3G;B $(a)},8c:o(a){D(!(a=$(a).3F))B[];1o(a&&a.2u!=1)a=a.3G;D(a)B[a].1v($(a).4l());B[]},6m:o(a){B $(a).55(\'8d\')},4l:o(a){B $(a).55(\'3G\')},aX:o(a){a=$(a);B a.6m().4Q().1v(a.4l())},1f:o(a,b){D(1m b==\'2B\')b=V L(b);B b.1f($(a))},aY:o(a,b,c){a=$(a);D(17.I==1)B $(a.1L);C d=a.89();B b?L.3H(d,b,c):d[c||0]},aZ:o(a,b,c){a=$(a);D(17.I==1)B a.8b();C d=a.8a();B b?L.3H(d,b,c):d[c||0]},b0:o(a,b,c){a=$(a);D(17.I==1)B $(L.1s.4m(a));C d=a.6m();B b?L.3H(d,b,c):d[c||0]},b1:o(a,b,c){a=$(a);D(17.I==1)B $(L.1s.4n(a));C d=a.4l();B b?L.3H(d,b,c):d[c||0]},b2:o(){C a=$A(17),15=$(a.4F());B L.6n(15,a)},52:o(a,b){B 11.52(b,a)},6o:o(a,b){a=$(a);D(12.1Z.3X){D(!a.8e)B 18;C t=G.56;D(t.3t[b])B t.3t[b](a,b);D(t.57[b])b=t.57[b];C c=a.8e[b];B c?c.48:18}B a.8f(b)},b3:o(a){B $(a).6p().2P},b4:o(a){B $(a).6p().2Q},58:o(a){B V G.59(a)},8g:o(a,b){D(!(a=$(a)))B;C c=a.2j;D(c.I==0)B 1d;D(c==b||c.1f(V 1W("(^|\\\\s)"+b+"(\\\\s|$)")))B 1c;B 1d},b5:o(a,b){D(!(a=$(a)))B;G.58(a).3A(b);B a},b6:o(a,b){D(!(a=$(a)))B;G.58(a).4e(b);B a},b7:o(a,b){D(!(a=$(a)))B;G.58(a)[a.8g(b)?\'4e\':\'3A\'](b);B a},3I:o(){1x.3I.2m(1x,17);B $A(17).2h()},5a:o(){1x.5a.2m(1x,17);B $A(17).2h()},b8:o(a){a=$(a);C b=a.3F;1o(b){C c=b.3G;D(b.2u==3&&!/\\S/.2M(b.48))a.6k(b);b=c}B a},4b:o(a){B $(a).2s.7j()},5b:o(a,b){a=$(a),b=$(b);1o(a=a.1L)D(a==b)B 1c;B 1d},8h:o(a){a=$(a);C b=2G.4o(a);1j.8h(b[0],b[1]);B a},1M:o(a,b){a=$(a);b=b==\'6q\'?\'5c\':b.4M();C c=a.Y[b];D(!c){C d=11.b9.ba(a,18);c=d?d[b]:18}D(b==\'2R\')B c?3J(c):1.0;B c==\'5d\'?18:c},bb:o(a){B $(a).1M(\'2R\')},bc:o(a,b,c){a=$(a);C d=a.Y;J(C e 1u b)D(e==\'2R\')a.5e(b[e]);1b d[(e==\'6q\'||e==\'5c\')?(d.6r===1l?\'5c\':\'6r\'):(c?e:e.4M())]=b[e];B a},5e:o(a,b){a=$(a);a.Y.2R=(b==1||b===\'\')?\'\':(b<0.6s)?0:b;B a},6p:o(a){a=$(a);C b=$(a).1M(\'2F\');D(b!=\'54\'&&b!=18)B{2Q:a.3K,2P:a.3L};C c=a.Y;C d=c.6t;C e=c.1A;C f=c.2F;c.6t=\'5f\';c.1A=\'3k\';c.2F=\'bd\';C g=a.8i;C h=a.8j;c.2F=f;c.1A=e;c.6t=d;B{2Q:g,2P:h}},be:o(a){a=$(a);C b=G.1M(a,\'1A\');D(b==\'6u\'||!b){a.6v=1c;a.Y.1A=\'5g\';D(1j.4C){a.Y.2S=0;a.Y.2T=0}}B a},bf:o(a){a=$(a);D(a.6v){a.6v=1l;a.Y.1A=a.Y.2S=a.Y.2T=a.Y.8k=a.Y.8l=\'\'}B a},bg:o(a){a=$(a);D(a.3M)B a;a.3M=a.Y.5h||\'5d\';D((G.1M(a,\'5h\')||\'6j\')!=\'5f\')a.Y.5h=\'5f\';B a},bh:o(a){a=$(a);D(!a.3M)B a;a.Y.5h=a.3M==\'5d\'?\'\':a.3M;a.3M=18;B a}};N.M(G.19,{bi:G.19.5b,bj:G.19.8c});D(12.1Z.5B){G.19.6w=G.19.1M;G.19.1M=o(a,b){45(b){1I\'2T\':1I\'2S\':1I\'8l\':1I\'8k\':D(G.6w(a,\'1A\')==\'6u\')B 18;6x:B G.6w(a,b)}}}1b D(12.1Z.3X){G.19.1M=o(a,b){a=$(a);b=(b==\'6q\'||b==\'5c\')?\'6r\':b.4M();C c=a.Y[b];D(!c&&a.8m)c=a.8m[b];D(b==\'2R\'){D(c=(a.1M(\'5i\')||\'\').1f(/5j\\(2R=(.*)\\)/))D(c[1])B 3J(c[1])/8n;B 1.0}D(c==\'5d\'){D((b==\'2Q\'||b==\'2P\')&&(a.1M(\'2F\')!=\'54\'))B a[\'24\'+b.5Q()]+\'2k\';B 18}B c};G.19.5e=o(a,b){a=$(a);C c=a.1M(\'5i\'),Y=a.Y;D(b==1||b===\'\'){Y.5i=c.1q(/5j\\([^\\)]*\\)/5O,\'\');B a}1b D(b<0.6s)b=0;Y.5i=c.1q(/5j\\([^\\)]*\\)/5O,\'\')+\'5j(2R=\'+(b*8n)+\')\';B a};G.19.6d=o(b,c){b=$(b);c=1m c==\'1l\'?\'\':c.28();C d=b.1k.1X();D([\'6y\',\'5k\',\'5l\',\'6z\'].1p(d)){C e=11.2y(\'2e\');45(d){1I\'6y\':1I\'5k\':e.2s=\'<2U><2V>\'+c.2q()+\'</2V></2U>\';5m=2;1y;1I\'5l\':e.2s=\'<2U><2V><5n>\'+c.2q()+\'</5n></2V></2U>\';5m=3;1y;1I\'6z\':e.2s=\'<2U><2V><5n><8o>\'+c.2q()+\'</8o></5n></2V></2U>\';5m=4}$A(b.2a).1e(o(a){b.6k(a)});5m.4G(o(){e=e.3F});$A(e.2a).1e(o(a){b.5S(a)})}1b{b.2s=c.2q()}3i(o(){c.3y()},10);B b}}1b D(12.1Z.4D){G.19.5e=o(a,b){a=$(a);a.Y.2R=(b==1)?0.bk:(b===\'\')?\'\':(b<0.6s)?0:b;B a}}G.56={57:{bl:"bm",bn:"bo",bp:"bq",br:"bs",bt:"bu",bv:"bw",bx:"by",bz:"bA",8p:"bB",bC:"bD"},3t:{5o:o(a,b){B a.8f(b,2)},4p:o(a,b){B $(a).2H(b)?b:18},Y:o(a){B a.Y.bE.21()},8q:o(a){C b=a.8r(\'8q\');B b.8s?b.48:18}}};(o(){N.M(7,{bF:7.5o,bG:7.5o,1g:7.5o,2d:7.4p,3l:7.4p,8p:7.4p,bH:7.4p})}).5Z(G.56.3t);G.19.53={2H:o(a,b){C t=G.56,E;b=t.57[b]||b;E=$(a).8r(b);B E&&E.8s}};G.19.2E={};N.M(G,G.19);D(!12.3b.42&&11.2y(\'2e\').44){1j.43={};1j.43.U=11.2y(\'2e\').44;12.3b.42=1c}G.2H=o(a,b){D(a.2H)B a.2H(b);B G.19.53.2H(a,b)};G.8t=o(g){C F=12.3b,T=G.19.2E;D(!g){N.M(1a,1a.19);N.M(1a.G,1a.G.19);N.M(G.19.2E,{"bI":N.2o(1a.19),"bJ":N.2o(1a.G.19),"bK":N.2o(1a.G.19),"8u":N.2o(1a.G.19)})}D(17.I==2){C h=g;g=17[1]}D(!h)N.M(G.19,g||{});1b{D(h.3g==1E)h.1e(M);1b M(h)}o M(a){a=a.1X();D(!G.19.2E[a])G.19.2E[a]={};N.M(G.19.2E[a],g)}o 5p(a,b,c){c=c||1d;C d=G.M.4k;J(C e 1u a){C f=a[e];D(!c||!(e 1u b))b[e]=d.6i(f)}}o 8v(a){C b;C c={"bL":"bM","8u":"bN","P":"bO","bP":"bQ","bR":"bS","bT":"bU","bV":"bW","bX":"bY","bZ":"3N","c0":"3N","c1":"3N","c2":"3N","c3":"3N","c4":"3N","Q":"c5","c6":"8w","c7":"8w","A":"c8","c9":"ca","cb":"cc","cd":"8x","ce":"8x","6y":"6A","cf":"6A","5k":"6A","5l":"cg","ch":"8y","6z":"8y","ci":"cj","ck":"cl"};D(c[a])b=\'6B\'+c[a]+\'G\';D(1j[b])B 1j[b];b=\'6B\'+a+\'G\';D(1j[b])B 1j[b];b=\'6B\'+a.5Q()+\'G\';D(1j[b])B 1j[b];1j[b]={};1j[b].U=11.2y(a).44;B 1j[b]}D(F.42){5p(G.19,43.U);5p(G.19.53,43.U,1c)}D(F.5D){J(C i 1u G.19.2E){C j=8v(i);D(1m j=="1l")2c;5p(T[i],j.U)}}N.M(G,G.19);7D G.2E};C cm={2F:G.82};1O.1U=o(a){7.6C=a};1O.1U.U={26:o(a,b){7.15=$(a);7.5q=b.2q();D(7.6C&&7.15.8z){1P{7.15.8z(7.6C,7.5q)}1V(e){C c=7.15.1k.1X();D([\'5k\',\'5l\'].1p(c)){7.3O(7.8A())}1b{2z e;}}}1b{7.2W=7.15.5H.86();D(7.3P)7.3P();7.3O([7.2W.87(7.5q)])}3i(o(){b.3y()},10)},8A:o(){C a=11.2y(\'2e\');a.2s=\'<2U><2V>\'+7.5q+\'</2V></2U>\';B $A(a.2a[0].2a[0].2a)}};C 1U=V N();1U.8B=1C.1D();1U.8B.U=N.M(V 1O.1U(\'cn\'),{3P:o(){7.2W.co(7.15)},3O:o(b){b.1e((o(a){7.15.1L.6D(a,7.15)}).1J(7))}});1U.8C=1C.1D();1U.8C.U=N.M(V 1O.1U(\'cp\'),{3P:o(){7.2W.6l(7.15);7.2W.8D(1c)},3O:o(b){b.4Q(1d).1e((o(a){7.15.6D(a,7.15.3F)}).1J(7))}});1U.8E=1C.1D();1U.8E.U=N.M(V 1O.1U(\'cq\'),{3P:o(){7.2W.6l(7.15);7.2W.8D(7.15)},3O:o(b){b.1e((o(a){7.15.5S(a)}).1J(7))}});1U.8F=1C.1D();1U.8F.U=N.M(V 1O.1U(\'cr\'),{3P:o(){7.2W.cs(7.15)},3O:o(b){b.1e((o(a){7.15.1L.6D(a,7.15.3G)}).1J(7))}});G.59=1C.1D();G.59.U={26:o(a){7.15=$(a)},2f:o(b){7.15.2j.3z(/\\s+/).2g(o(a){B a.I>0}).2f(b)},6E:o(a){7.15.2j=a},3A:o(a){D(7.1p(a))B;7.6E($A(7).1v(a).1R(\' \'))},4e:o(a){D(!7.1p(a))B;7.6E($A(7).5Y(a).1R(\' \'))},28:o(){B $A(7).1R(\' \')}};N.M(G.59.U,23);C L=1C.1D();L.U={26:o(a){7.2X=a.3f();7.8G()},8G:o(){D(12.3b.5C&&!(/\\[[\\w-]*?:/).2M(7.2X))B 7.8H();C e=7.2X,3Q=L.5r,h=L.1s,c=L.4d,2I,p,m;D(L.3m[e]){7.2l=L.3m[e];B}7.2l=["7.2l = o(8I) {","C r = 8I, h = L.1s, c = 1d, n;"];1o(e&&2I!=e&&(/\\S/).2M(e)){2I=e;J(C i 1u 3Q){p=3Q[i];D(m=e.1f(p)){7.2l.O(1m c[i]==\'o\'?c[i](m):V 22(c[i]).25(m));e=e.1q(m[0],\'\');1y}}}7.2l.O("B h.6F(n);\\n}");4J(7.2l.1R(\'\\n\'));L.3m[7.2X]=7.2l},8H:o(){C e=7.2X,3Q=L.5r,x=L.1B,2I,m;D(L.3m[e]){7.1B=L.3m[e];B}7.2l=[\'.//*\'];1o(e&&2I!=e&&(/\\S/).2M(e)){2I=e;J(C i 1u 3Q){D(m=e.1f(3Q[i])){7.2l.O(1m x[i]==\'o\'?x[i](m):V 22(x[i]).25(m));e=e.1q(m[0],\'\');1y}}}7.1B=7.2l.1R(\'\');L.3m[7.2X]=7.1B},4q:o(a){a=a||11;D(7.1B)B 11.6g(7.1B,a);B 7.2l(a)},1f:o(a){B 7.4q(11).1p(a)},28:o(){B 7.2X},1H:o(){B"#<L:"+7.2X.1H()+">"}};N.M(L,{3m:{},1B:{2Y:"//*",1i:"/*",3R:"/4r-2Z::*[1]",4s:\'/4r-2Z::*\',1k:o(m){D(m[1]==\'*\')B\'\';B"[8J-3n()=\'"+m[1].21()+"\' 6G 8J-3n()=\'"+m[1].1X()+"\']"},2j:"[4j(1v(\' \', @6h, \' \'), \' #{1} \')]",2O:"[@2O=\'#{1}\']",4t:"[@#{1}]",4u:o(m){m[3]=m[5]||m[6];B V 22(L.1B.5s[m[2]]).25(m)},4v:o(m){C h=L.1B.1t[m[1]];D(!h)B\'\';D(1m h===\'o\')B h(m);B V 22(L.1B.1t[m[1]]).25(m)},5s:{\'=\':"[@#{1}=\'#{3}\']",\'!=\':"[@#{1}!=\'#{3}\']",\'^=\':"[ct-7n(@#{1}, \'#{3}\')]",\'$=\':"[49(@#{1}, (2B-I(@#{1}) - 2B-I(\'#{3}\') + 1))=\'#{3}\']",\'*=\':"[4j(@#{1}, \'#{3}\')]",\'~=\':"[4j(1v(\' \', @#{1}, \' \'), \' #{3} \')]",\'|=\':"[4j(1v(\'-\', @#{1}, \'-\'), \'-#{3}-\')]"},1t:{\'2h-1i\':\'[31(6H-2Z::*)]\',\'1z-1i\':\'[31(4r-2Z::*)]\',\'4w-1i\':\'[31(6H-2Z::* 6G 4r-2Z::*)]\',\'4b\':"[5t(*) = 0 6I (5t(2r()) = 0 6G cu(2r(), \' \\t\\r\\n\', \'\') = \'\')]",\'3l\':"[@3l]",\'2d\':"[@2d]",\'8K\':"[31(@2d)]",\'31\':o(m){C e=m[6],p=L.5r,x=L.1B,2I,m,v;C a=[];1o(e&&2I!=e&&(/\\S/).2M(e)){2I=e;J(C i 1u p){D(m=e.1f(p[i])){v=1m x[i]==\'o\'?x[i](m):V 22(x[i]).25(m);a.O("("+v.49(1,v.I-1)+")");e=e.1q(m[0],\'\');1y}}}B"[31("+a.1R(" 6I ")+")]"},\'1n-1i\':o(m){B L.1B.1t.1n("(5t(./6H-2Z::*) + 1) ",m)},\'1n-1z-1i\':o(m){B L.1B.1t.1n("(5t(./4r-2Z::*) + 1) ",m)},\'1n-1G-1g\':o(m){B L.1B.1t.1n("1A() ",m)},\'1n-1z-1G-1g\':o(m){B L.1B.1t.1n("(1z() + 1 - 1A()) ",m)},\'2h-1G-1g\':o(m){m[6]="1";B L.1B.1t[\'1n-1G-1g\'](m)},\'1z-1G-1g\':o(m){m[6]="1";B L.1B.1t[\'1n-1z-1G-1g\'](m)},\'4w-1G-1g\':o(m){C p=L.1B.1t;B p[\'2h-1G-1g\'](m)+p[\'1z-1G-1g\'](m)},1n:o(c,m){C d,3o=m[6],6J;D(3o==\'8L\')3o=\'2n+0\';D(3o==\'8M\')3o=\'2n+1\';D(d=3o.1f(/^(\\d+)$/))B\'[\'+c+"= "+d[1]+\']\';D(d=3o.1f(/^(-?\\d*)?n(([+-])(\\d+))?/)){D(d[1]=="-")d[1]=-1;C a=d[1]?3u(d[1]):1;C b=d[2]?3u(d[2]):0;6J="[((#{6K} - #{b}) cv #{a} = 0) 6I "+"((#{6K} - #{b}) 2e #{a} >= 0)]";B V 22(6J).25({6K:c,a:a,b:b})}}}},4d:{1k:\'n = h.1k(n, r, "#{1}", c);   c = 1d;\',2j:\'n = h.2j(n, r, "#{1}", c); c = 1d;\',2O:\'n = h.2O(n, r, "#{1}", c);        c = 1d;\',4t:\'n = h.4t(n, r, "#{1}"); c = 1d;\',4u:o(m){m[3]=(m[5]||m[6]);B V 22(\'n = h.4u(n, r, "#{1}", "#{3}", "#{2}"); c = 1d;\').25(m)},4v:o(m){D(m[6])m[6]=m[6].1q(/"/g,\'\\\\"\');B V 22(\'n = h.4v(n, "#{1}", "#{6}", r, c); c = 1d;\').25(m)},2Y:\'c = "2Y";\',1i:\'c = "1i";\',3R:\'c = "3R";\',4s:\'c = "4s";\'},5r:{4s:V 1W(\'^\\\\s\'+\'*\'+\'~\\\\s*\'),1i:V 1W(\'^\\\\s\'+\'*\'+\'>\\\\s*\'),3R:V 1W(\'^\\\\s\'+\'*\'+\'\\\\+\\\\s*\'),2Y:/^\\s/,1k:V 1W(\'^\\\\s*\'+\'(\\\\\'+\'*|[\\\\w\\\\-]+)(\\\\b|$)?\'),2O:V 1W(\'^#([\\\\w\\\\-\\\\\'+\'*]+)(\\\\b|$)\'),2j:V 1W(\'^\\\\.([\\\\w\\\\-\\\\\'+\'*]+)(\\\\b|$)\'),4v:V 1W(\'^:((2h|1z|1n|1n-1z|4w)(-1i|-1G-1g)|4b|3l|(cw|cx)cy|31)(\\\\((.*?)\\\\))?(\\\\b|$|\\\\s|(?=:))\'),4t:V 1W(\'^\\\\[([\\\\w]+)\\\\]\'),4u:V 1W(\'\\\\[((?:[\\\\w-]*:)?[\\\\w-]+)\\\\s*(?:([!^$*~|]?=)\\\\s*(([\\\'"])([^\\\\]]*?)\\\\4|([^\\\'"][^\\\\]]*?)))?\\\\]\')},1s:{1v:o(a,b){J(C i=0,E;E=b[i];i++)a.O(E);B a},5u:o(a){J(C i=0,E;E=a[i];i++)E.2v=1c;B a},3S:o(a){J(C i=0,E;E=a[i];i++)E.2v=1l;B a},4I:o(a,b,c){a.2v=1c;D(b){J(C d=a.2a,i=d.I-1,j=1;i>=0;i--){E=d[i];D(E.2u==1&&(!c||E.2v))E.5v=j++}}1b{J(C i=0,j=1,d=a.2a;E=d[i];i++)D(E.2u==1&&(!c||E.2v))E.5v=j++}},6F:o(a){D(a.I==0)B a;C b=[],n;J(C i=0,l=a.I;i<l;i++)D(!(n=a[i]).2v){n.2v=1c;b.O(G.M(n))}B L.1s.3S(b)},2Y:o(a){C h=L.1s;J(C i=0,W=[],E;E=a[i];i++)h.1v(W,E.2D(\'*\'));B W},1i:o(a){C h=L.1s;J(C i=0,W=[],E;E=a[i];i++){J(C j=0,cz=[],1i;1i=E.2a[j];j++)D(1i.2u==1&&1i.1k!=\'!\')W.O(1i)}B W},3R:o(a){J(C i=0,W=[],E;E=a[i];i++){C b=7.4n(E);D(b)W.O(b)}B W},4s:o(a){C h=L.1s;J(C i=0,W=[],E;E=a[i];i++)h.1v(W,G.4l(E));B W},4n:o(a){1o(a=a.3G)D(a.2u==1)B a;B 18},4m:o(a){1o(a=a.8d)D(a.2u==1)B a;B 18},1k:o(a,b,c,d){c=c.1X();C e=[],h=L.1s;D(a){D(d){D(d=="2Y"){J(C i=0,E;E=a[i];i++)h.1v(e,E.2D(c));B e}1b a=7[d](a);D(c=="*")B a}J(C i=0,E;E=a[i];i++)D(E.1k.1X()==c)e.O(E);B e}1b B b.2D(c)},2O:o(a,b,c,d){C e=$(c),h=L.1s;D(!a&&b==11)B e?[e]:[];D(a){D(d){D(d==\'1i\'){J(C i=0,E;E=a[i];i++)D(e.1L==E)B[e]}1b D(d==\'2Y\'){J(C i=0,E;E=a[i];i++)D(G.5b(e,E))B[e]}1b D(d==\'3R\'){J(C i=0,E;E=a[i];i++)D(L.1s.4m(e)==E)B[e]}1b a=h[d](a)}J(C i=0,E;E=a[i];i++)D(E==e)B[e];B[]}B(e&&G.5b(e,b))?[e]:[]},2j:o(a,b,c,d){D(a&&d)a=7[d](a);B L.1s.8N(a,b,c)},8N:o(a,b,c){D(!a)a=L.1s.2Y([b]);C d=\' \'+c+\' \';J(C i=0,W=[],E,4x;E=a[i];i++){4x=E.2j;D(4x.I==0)2c;D(4x==c||(\' \'+4x+\' \').1p(d))W.O(E)}B W},4t:o(a,b,c){C d=[];J(C i=0,E;E=a[i];i++)D(G.2H(E,c))d.O(E);B d},4u:o(a,b,c,d,e){D(!a)a=b.2D("*");C f=L.5s[e],W=[];J(C i=0,E;E=a[i];i++){C g=G.6o(E,c);D(g===18)2c;D(f(g,d))W.O(E)}B W},4v:o(a,b,c,d,e){D(a&&e)a=7[e](a);D(!a)a=d.2D("*");B L.1t[b](a,c,d)}},1t:{\'2h-1i\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++){D(L.1s.4m(E))2c;W.O(E)}B W},\'1z-1i\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++){D(L.1s.4n(E))2c;W.O(E)}B W},\'4w-1i\':o(a,b,c){C h=L.1s;J(C i=0,W=[],E;E=a[i];i++)D(!h.4m(E)&&!h.4n(E))W.O(E);B W},\'1n-1i\':o(a,b,c){B L.1t.1n(a,b,c)},\'1n-1z-1i\':o(a,b,c){B L.1t.1n(a,b,c,1c)},\'1n-1G-1g\':o(a,b,c){B L.1t.1n(a,b,c,1d,1c)},\'1n-1z-1G-1g\':o(a,b,c){B L.1t.1n(a,b,c,1c,1c)},\'2h-1G-1g\':o(a,b,c){B L.1t.1n(a,"1",c,1d,1c)},\'1z-1G-1g\':o(a,b,c){B L.1t.1n(a,"1",c,1c,1c)},\'4w-1G-1g\':o(a,b,c){C p=L.1t;B p[\'1z-1G-1g\'](p[\'2h-1G-1g\'](a,b,c),b,c)},8O:o(a,b,d){D(a==0)B b>0?[b]:[];B $R(1,d).2A([],o(c,i){D(0==(i-b)%a&&(i-b)/a>=0)c.O(i);B c})},1n:o(c,d,e,f,g){D(c.I==0)B[];D(d==\'8L\')d=\'2n+0\';D(d==\'8M\')d=\'2n+1\';C h=L.1s,W=[],6L=[],m;h.5u(c);J(C i=0,E;E=c[i];i++){D(!E.1L.2v){h.4I(E.1L,f,g);6L.O(E.1L)}}D(d.1f(/^\\d+$/)){d=3u(d);J(C i=0,E;E=c[i];i++)D(E.5v==d)W.O(E)}1b D(m=d.1f(/^(-?\\d*)?n(([+-])(\\d+))?/)){D(m[1]=="-")m[1]=-1;C a=m[1]?3u(m[1]):1;C b=m[2]?3u(m[2]):0;C k=L.1t.8O(a,b,c.I);J(C i=0,E,l=k.I;E=c[i];i++){J(C j=0;j<l;j++)D(E.5v==k[j])W.O(E)}}h.3S(c);h.3S(6L);B W},\'4b\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++){D(E.1k==\'!\'||(E.3F&&!E.2s.1f(/^\\s*$/)))2c;W.O(E)}B W},\'31\':o(a,b,c){C h=L.1s,cA,m;C d=V L(b).4q(c);h.5u(d);J(C i=0,W=[],E;E=a[i];i++)D(!E.2v)W.O(E);h.3S(d);B W},\'8K\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++)D(!E.2d)W.O(E);B W},\'2d\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++)D(E.2d)W.O(E);B W},\'3l\':o(a,b,c){J(C i=0,W=[],E;E=a[i];i++)D(E.3l)W.O(E);B W}},5s:{\'=\':o(a,v){B a==v},\'!=\':o(a,v){B a!=v},\'^=\':o(a,v){B a.7h(v)},\'$=\':o(a,v){B a.7i(v)},\'*=\':o(a,v){B a.1p(v)},\'~=\':o(a,v){B(\' \'+a+\' \').1p(\' \'+v+\' \')},\'|=\':o(a,v){B(\'-\'+a.1X()+\'-\').1p(\'-\'+v.1X()+\'-\')}},8P:o(a,b){C c=V L(b).4q(),h=L.1s;h.5u(c);J(C i=0,W=[],15;15=a[i];i++)D(15.2v)W.O(15);h.3S(c);B W},3H:o(a,b,c){D(1m b==\'cB\'){c=b;b=1d}B L.8P(a,b||\'*\')[c||0]},6n:o(a,b){C c=b.1R(\',\'),b=[];c.78(/(([\\w#:.~>+()\\s-]+|\\*|\\[.*?\\])+)\\s*(,|$)/,o(m){b.O(m[1].3f())});C d=[],h=L.1s;J(C i=0,l=b.I,6M;i<l;i++){6M=V L(b[i].3f());h.1v(d,6M.4q(a))}B(l>1)?h.6F(d):d}});o $$(){B L.6n(11,$A(17))}C 1a={6N:o(a){$(a).6N();B a},8Q:o(d,e){C f=d.2A({},o(a,b){D(!b.2d&&b.3n){C c=b.3n,1w=$(b).1Y();D(1w!=18){D(c 1u a){D(a[c].3g!=1E)a[c]=[a[c]];a[c].O(1w)}1b a[c]=1w}}B a});B e?f:1F.3h(f)}};1a.19={4y:o(a,b){B 1a.8Q(1a.3T(a),b)},3T:o(c){B $A($(c).2D(\'*\')).2A([],o(a,b){D(1a.G.4z[b.1k.21()])a.O(G.M(b));B a})},cC:o(a,b,c){a=$(a);C d=a.2D(\'5w\');D(!b&&!c)B $A(d).20(G.M);J(C i=0,6O=[],I=d.I;i<I;i++){C e=d[i];D((b&&e.1g!=b)||(c&&e.3n!=c))2c;6O.O(G.M(e))}B 6O},6P:o(a){a=$(a);1a.3T(a).5V(\'6P\');B a},6Q:o(a){a=$(a);1a.3T(a).5V(\'6Q\');B a},8R:o(b){B $(b).3T().7v(o(a){B a.1g!=\'5f\'&&!a.2d&&[\'5w\',\'2g\',\'6R\'].1p(a.1k.21())})},cD:o(a){a=$(a);a.8R().8S();B a},4X:o(a,b){a=$(a),b=N.2o(b||{});C c=b.2C;b.2C=a.4y(1c);D(c){D(1m c==\'2B\')c=c.4L();N.M(b.2C,c)}D(a.2H(\'1K\')&&!b.1K)b.1K=a.1K;B V 1h.3C(a.6o(\'cE\'),b)}};1a.G={6S:o(a){$(a).6S();B a},2g:o(a){$(a).2g();B a}};1a.G.19={4y:o(a){a=$(a);D(!a.2d&&a.3n){C b=a.1Y();D(b!=1l){C c={};c[a.3n]=b;B 1F.3h(c)}}B\'\'},1Y:o(a){a=$(a);C b=a.1k.21();B 1a.G.4z[b](a)},7x:o(a){$(a).1w=\'\';B a},cF:o(a){B $(a).1w!=\'\'},8S:o(a){a=$(a);1P{a.6S();D(a.2g&&(a.1k.21()!=\'5w\'||![\'6T\',\'6N\',\'cG\'].1p(a.1g)))a.2g()}1V(e){}B a},6P:o(a){a=$(a);a.cH();a.2d=1c;B a},6Q:o(a){a=$(a);a.2d=1d;B a}};C cI=1a.G;C $F=1a.G.19.1Y;1a.G.4z={5w:o(a){45(a.1g.21()){1I\'8T\':1I\'8U\':B 1a.G.4z.8V(a);6x:B 1a.G.4z.6R(a)}},8V:o(a){B a.3l?a.1w:18},6R:o(a){B a.1w},2g:o(a){B 7[a.1g==\'2g-cJ\'?\'8W\':\'8X\'](a)},8W:o(a){C b=a.cK;B b>=0?7.6U(a.14[b]):18},8X:o(a){C b,I=a.I;D(!I)B 18;J(C i=0,b=[];i<I;i++){C c=a.14[i];D(c.cL)b.O(7.6U(c))}B b},6U:o(a){B G.M(a).2H(\'1w\')?a.1w:a.2r}};1O.5x=o(){};1O.5x.U={26:o(a,b,c){7.3c=b;7.15=$(a);7.3v=c;7.32=7.1Y();7.3d()},3d:o(){75(7.3e.1J(7),7.3c*5J)},3e:o(){C a=7.1Y();C b=(\'2B\'==1m 7.32&&\'2B\'==1m a?7.32!=a:1S(7.32)!=1S(a));D(b){7.3v(7.15,a);7.32=a}}};1a.G.5y=1C.1D();1a.G.5y.U=N.M(V 1O.5x(),{1Y:o(){B 1a.G.1Y(7.15)}});1a.5y=1C.1D();1a.5y.U=N.M(V 1O.5x(),{1Y:o(){B 1a.4y(7.15)}});1O.3a=o(){};1O.3a.U={26:o(a,b){7.15=$(a);7.3v=b;7.32=7.1Y();D(7.15.1k.21()==\'5E\')7.8Y();1b 7.3d(7.15)},6V:o(){C a=7.1Y();D(7.32!=a){7.3v(7.15,a);7.32=a}},8Y:o(){1a.3T(7.15).1e(7.3d.1J(7))},3d:o(a){D(a.1g){45(a.1g.21()){1I\'8T\':1I\'8U\':1x.3I(a,\'cM\',7.6V.1J(7));1y;6x:1x.3I(a,\'cN\',7.6V.1J(7));1y}}}};1a.G.3a=1C.1D();1a.G.3a.U=N.M(V 1O.3a(),{1Y:o(){B 1a.G.1Y(7.15)}});1a.3a=1C.1D();1a.3a.U=N.M(V 1O.3a(),{1Y:o(){B 1a.4y(7.15)}});D(!1j.1x){C 1x=V N()}N.M(1x,{cO:8,cP:9,cQ:13,cR:27,cS:37,cT:38,cU:39,cV:40,cW:46,cX:36,cY:35,cZ:33,d0:34,15:o(a){B $(a.d1||a.d2)},d3:o(a){B(((a.8Z)&&(a.8Z==1))||((a.6T)&&(a.6T==1)))},d4:o(a){B a.d5||(a.d6+(11.5z.3U||11.1T.3U))},d7:o(a){B a.d8||(a.d9+(11.5z.3V||11.1T.3V))},5K:o(a){D(a.90){a.90();a.da()}1b{a.db=1d;a.dc=1c}},3H:o(a,b){C c=1x.15(a);1o(c.1L&&(!c.1k||(c.1k.1X()!=b.1X())))c=c.1L;B c},2w:1d,91:o(a,b,c,d){D(!7.2w)7.2w=[];D(a.92){7.2w.O([a,b,c,d]);a.92(b,c,d)}1b D(a.3Y){7.2w.O([a,b,c,d]);a.3Y(\'3E\'+b,c)}},93:o(){D(!1x.2w)B;J(C i=0,I=1x.2w.I;i<I;i++){1x.5a.2m(7,1x.2w[i]);1x.2w[i][0]=18}1x.2w=1d},3I:o(a,b,c,d){a=$(a);d=d||1d;D(b==\'94\'&&(12.1Z.3r||a.3Y))b=\'95\';1x.91(a,b,c,d)},5a:o(a,b,c,d){a=$(a);d=d||1d;D(b==\'94\'&&(12.1Z.3r||a.3Y))b=\'95\';D(a.96){a.96(b,c,d)}1b D(a.97){1P{a.97(\'3E\'+b,c)}1V(e){}}}});D(12.1Z.3X)1x.3I(1j,\'dd\',1x.93,1d);C 2G={98:1d,6W:o(){7.99=1j.de||11.5z.3U||11.1T.3U||0;7.9a=1j.df||11.5z.3V||11.1T.3V||0},9b:o(a){C b=0,1N=0;3W{b+=a.3V||0;1N+=a.3U||0;a=a.1L}1o(a);B[1N,b]},4o:o(a){C b=0,1N=0;3W{b+=a.3p||0;1N+=a.3q||0;a=a.2x}1o(a);B[1N,b]},9c:o(a){C b=0,1N=0;3W{b+=a.3p||0;1N+=a.3q||0;a=a.2x;D(a){D(a.1k==\'9d\')1y;C p=G.1M(a,\'1A\');D(p==\'5g\'||p==\'3k\')1y}}1o(a);B[1N,b]},2x:o(a){D(a.2x)B a.2x;D(a==11.1T)B a;1o((a=a.1L)&&a!=11.1T)D(G.1M(a,\'1A\')!=\'6u\')B a;B 11.1T},dg:o(a,x,y){D(7.98)B 7.9e(a,x,y);7.4A=x;7.4B=y;7.24=7.4o(a);B(y>=7.24[1]&&y<7.24[1]+a.3L&&x>=7.24[0]&&x<7.24[0]+a.3K)},9e:o(a,x,y){C b=7.9b(a);7.4A=x+b[0]-7.99;7.4B=y+b[1]-7.9a;7.24=7.4o(a);B(7.4B>=7.24[1]&&7.4B<7.24[1]+a.3L&&7.4A>=7.24[0]&&7.4A<7.24[0]+a.3K)},dh:o(a,b){D(!a)B 0;D(a==\'di\')B((7.24[1]+b.3L)-7.4B)/b.3L;D(a==\'dj\')B((7.24[0]+b.3K)-7.4A)/b.3K},6X:o(a){C b=0,1N=0;C c=a;3W{b+=c.3p||0;1N+=c.3q||0;D(c.2x==11.1T)D(G.1M(c,\'1A\')==\'3k\')1y}1o(c=c.2x);c=a;3W{D(!1j.4C||c.1k==\'9d\'){b-=c.3V||0;1N-=c.3U||0}}1o(c=c.1L);B[1N,b]},2o:o(a,b){C c=N.M({9f:1c,9g:1c,9h:1c,9i:1c,3p:0,3q:0},17[2]||{});a=$(a);C p=2G.6X(a);b=$(b);C d=[0,0];C e=18;D(G.1M(b,\'1A\')==\'3k\'){e=2G.2x(b);d=2G.6X(e)}D(e==11.1T){d[0]-=11.1T.3q;d[1]-=11.1T.3p}D(c.9f)b.Y.2T=(p[0]-d[0]+c.3q)+\'2k\';D(c.9g)b.Y.2S=(p[1]-d[1]+c.3p)+\'2k\';D(c.9h)b.Y.2Q=a.3K+\'2k\';D(c.9i)b.Y.2P=a.3L+\'2k\'},dk:o(a){a=$(a);D(a.Y.1A==\'3k\')B;2G.6W();C b=2G.9c(a);C c=b[1];C d=b[0];C e=a.8i;C f=a.8j;a.9j=d-3J(a.Y.2T||0);a.9k=c-3J(a.Y.2S||0);a.9l=a.Y.2Q;a.9m=a.Y.2P;a.Y.1A=\'3k\';a.Y.2S=c+\'2k\';a.Y.2T=d+\'2k\';a.Y.2Q=e+\'2k\';a.Y.2P=f+\'2k\'},dl:o(a){a=$(a);D(a.Y.1A==\'5g\')B;2G.6W();a.Y.1A=\'5g\';C b=3J(a.Y.2S||0)-(a.9k||0);C c=3J(a.Y.2T||0)-(a.9j||0);a.Y.2S=b+\'2k\';a.Y.2T=c+\'2k\';a.Y.2P=a.9m;a.Y.2Q=a.9l}};D(12.1Z.3r){2G.4o=o(a){C b=0,1N=0;3W{b+=a.3p||0;1N+=a.3q||0;D(a.2x==11.1T)D(G.1M(a,\'1A\')==\'3k\')1y;a=a.2x}1o(a);B[1N,b]}}G.8t();',62,828,'|||||||this|||||||||||||||||function|||||||||||||return|var|if|node||Element||length|for||Selector|extend|Object|push||||||prototype|new|results||style|||document|Prototype||options|element||arguments|null|Methods|Form|else|true|false|each|match|type|Ajax|child|window|tagName|undefined|typeof|nth|while|include|replace|transport|handlers|pseudos|in|concat|value|Event|break|last|position|xpath|Class|create|Array|Hash|of|inspect|case|bind|method|parentNode|getStyle|valueL|Abstract|try|toJSON|join|String|body|Insertion|catch|RegExp|toUpperCase|getValue|Browser|map|toLowerCase|Template|Enumerable|offset|evaluate|initialize||toString|gsub|childNodes|toArray|continue|disabled|div|_each|select|first|key|className|px|matcher|apply||clone|args|stripScripts|text|innerHTML|onComplete|nodeType|_counted|observers|offsetParent|createElement|throw|inject|string|parameters|getElementsByTagName|ByTag|display|Position|hasAttribute|le|emptyFunction|toPaddedString|source|test|success|id|height|width|opacity|top|left|table|tbody|range|expression|descendant|sibling||not|lastValue||||||||EventObserver|BrowserFeatures|frequency|registerCallback|onTimerEvent|strip|constructor|toQueryString|setTimeout|decay|absolute|checked|_cache|name|formula|offsetTop|offsetLeft|WebKit|indexOf|values|Number|callback|timer|slice|evalScripts|split|add|Responders|Request|url|on|firstChild|nextSibling|findElement|observe|parseFloat|offsetWidth|offsetHeight|_overflow|Heading|insertContent|initializeRange|ps|adjacent|unmark|getElements|scrollLeft|scrollTop|do|IE|attachEvent|navigator||userAgent|ElementExtensions|HTMLElement|__proto__|switch||object|nodeValue|substring|_|empty|pluck|criteria|remove|start|responders|post|dispatchException|contains|cache|nextSiblings|previousElementSibling|nextElementSibling|cumulativeOffset|_flag|findElements|following|laterSibling|attrPresence|attr|pseudo|only|nodeClassName|serialize|Serializers|xcomp|ycomp|opera|Gecko|ScriptFragment|shift|times|currentlyExecuting|index|eval|escapeHTML|toQueryParams|camelize|charAt|evalJSON|pattern|reverse|ObjectRange|dispatch|onCreate|Base|setOptions|asynchronous|request|status|json|responseText|container|getElementsByClassName|Simulated|none|recursivelyCollect|_attributeTranslations|names|classNames|ClassNames|stopObserving|descendantOf|cssFloat|auto|setOpacity|hidden|relative|overflow|filter|alpha|TBODY|TR|depth|tr|_getAttr|copy|content|patterns|operators|count|mark|nodeIndex|input|TimedObserver|Observer|documentElement|Version|Opera|XPath|SpecificElementExtensions|form|script|instanceof|ownerDocument|succ|1000|stop|interpret|callee|prepareReplacement|gi|len|capitalize|unfilterJSON|appendChild|slices|array|invoke|falses|_reverse|without|call|Test|end|getTransport|activeRequestCount|application|encoding|Complete|_complete|respondToReadyState|onStateChange|getHeader|Updater|failure|update|updater|elements|_getElementsByXPath|class|findOrStore|visible|removeChild|selectNodeContents|previousSiblings|findChildElements|readAttribute|getDimensions|float|styleFloat|00001|visibility|static|_madePositioned|_getStyle|default|THEAD|TD|TableSection|HTML|adjacency|insertBefore|set|unique|or|preceding|and|predicate|fragment|indexed|selector|reset|matchingInputs|disable|enable|textarea|focus|button|optionValue|onElementEvent|prepare|page|KHTML|JSONFilter|keys|Function|Try|these|PeriodicalExecuter|setInterval|specialChar|sub|scan|stripTags|img|extractScripts|unescapeHTML|decodeURIComponent|charCodeAt|isJSON|JSON|startsWith|endsWith|blank|amp|lt|gt|with|Pattern|template|eachSlice|collect|detect|findAll|size|find|from|clear|flatten|arrayLength|merge|addPair|encodeURIComponent|delete|exclusive|XMLHttpRequest|ActiveXObject|XMLHTTP|register|contentType|Events|get|onreadystatechange|setRequestHeaders|overrideMimeType|readyState|xml|Content|2005|requestHeaders|evalResponse|onException|updateContent|insertion|PeriodicalUpdater|updateComplete|lastText|_extended|toggle|hide|show|outerHTML|createRange|createContextualFragment|attribute|ancestors|descendants|firstDescendant|immediateDescendants|previousSibling|attributes|getAttribute|hasClassName|scrollTo|clientWidth|clientHeight|bottom|right|currentStyle|100|td|readonly|title|getAttributeNode|specified|addMethods|TEXTAREA|findDOMClass|Mod|TableCol|TableCell|insertAdjacentHTML|contentFromAnonymousTable|Before|Top|collapse|Bottom|After|compileMatcher|compileXPathMatcher|root|local|enabled|even|odd|byClassName|getIndices|matchElements|serializeElements|findFirstElement|activate|checkbox|radio|inputSelector|selectOne|selectMany|registerFormCallbacks|which|preventDefault|_observeAndCache|addEventListener|unloadCache|keypress|keydown|removeEventListener|detachEvent|includeScrollOffsets|deltaX|deltaY|realOffset|positionedOffset|BODY|withinIncludingScrolloffsets|setLeft|setTop|setWidth|setHeight|_originalLeft|_originalTop|_originalWidth|_originalHeight|AppleWebKit|secure|RangeError|unknown|boolean|bindAsEventListener|event|toColorPart|isFinite|Date|getFullYear|getMonth|getDate|getHours|getMinutes|getSeconds|clearInterval|finally|truncate|im|data|fromCharCode|underscore|dasherize|x00|x1f|u00|Eaeflnr|SyntaxError|Badly|formed|lastIndexOf|parseQuery|createTextNode|Error|is|deprecated|use|instead|all|any|grep|inGroupsOf|max|min|partition|reject|sortBy|sort|zip|pop|member|entries|NodeList|compact|reduce|uniq|foo|bar|Msxml2|Microsoft|unregister|www|urlencoded|UTF|Uninitialized|Loading|Loaded|Interactive|_method|Konqueror|Safari|open|postBody|send|Requested|With|Accept|javascript|html|charset|Connection|close|setRequestHeader|200|300|Success|Failure|java|ecma|getResponseHeader|clearTimeout|getElementById|XPathResult|ORDERED_NODE_SNAPSHOT_TYPE|snapshotLength|snapshotItem|replaceChild|siblings|up|down|previous|next|getElementsBySelector|getHeight|getWidth|addClassName|removeClassName|toggleClassName|cleanWhitespace|defaultView|getComputedStyle|getOpacity|setStyle|block|makePositioned|undoPositioned|makeClipping|undoClipping|childOf|childElements|999999|colspan|colSpan|rowspan|rowSpan|valign|vAlign|datetime|dateTime|accesskey|accessKey|tabindex|tabIndex|enctype|encType|maxlength|maxLength|readOnly|longdesc|longDesc|cssText|href|src|multiple|FORM|INPUT|SELECT|OPTGROUP|OptGroup|TextArea|Paragraph|FIELDSET|FieldSet|UL|UList|OL|OList|DL|DList|DIR|Directory|H1|H2|H3|H4|H5|H6|Quote|INS|DEL|Anchor|IMG|Image|CAPTION|TableCaption|COL|COLGROUP|TFOOT|TableRow|TH|FRAMESET|FrameSet|IFRAME|IFrame|Toggle|beforeBegin|setStartBefore|afterBegin|beforeEnd|afterEnd|setStartAfter|starts|translate|mod|en|dis|abled|children|selectorType|number|getInputs|focusFirstElement|action|present|submit|blur|Field|one|selectedIndex|selected|click|change|KEY_BACKSPACE|KEY_TAB|KEY_RETURN|KEY_ESC|KEY_LEFT|KEY_UP|KEY_RIGHT|KEY_DOWN|KEY_DELETE|KEY_HOME|KEY_END|KEY_PAGEUP|KEY_PAGEDOWN|target|srcElement|isLeftClick|pointerX|pageX|clientX|pointerY|pageY|clientY|stopPropagation|returnValue|cancelBubble|unload|pageXOffset|pageYOffset|within|overlap|vertical|horizontal|absolutize|relativize'.split('|'),0,{}))/*----------------------------- SUPER CLASS -------------------------*/
/* MODULE - Class*/
var Class =
{
    // Creators
    create: function (proto)
    {
        var klass = function ()
        {
            if (this.initialize && arguments.callee.caller != Class.extend)
            {
                this.__class__ = arguments.callee.prototype;
                Object.extend(this, Class.Methods);
                this.initialize.apply(this, arguments);
            }
        };
        klass.prototype = proto || {};
        klass.extend = Class.extend;
        return klass;
    },
    singleton: function (proto)
    {
        var klass =
        {
            instance: function ()
            {
                if (!this.__instance__)
                {
                    var klass = Class.create(proto);
                    this.__instance__ = eval('new klass');
                    proto = null;
                }
                return this.__instance__;
            }
        };
        return klass;
    },
    append_features: function (object, module)
    {
        for (var prop in module)
            if (Class.kind_of(module[prop], Function))
                (function (method)
                {
                    object[method] = function ()
                    {
                        return module[method].apply(object, arguments);
                    };
                })(prop);
            else
                object[prop] = module[prop];
    },
    extend: function (subobj)   // implementation of inheritance
    {
        /* Create an instance of the superclass.  This is necessary to maintain
         * a prototype chain correctly.
         */
        var subproto = new this;
        // Update it with the subclass definitions
        Object.extend(subproto, subobj);
        subproto.__super__ = this.prototype;
        return Class.create(subproto);
    },
    get_method: function (klass, args)  // obtain method name being called
    {
        var c = args.callee.caller;
        for (var method in klass)
            if (klass[method] == c)
                return method;
        return null;
    },
    call_super: function (superclass, self, method, args)
    {
        // NOTE: `self' should always refer to the object being instantiated
        if (superclass && superclass[method])
        {
            /* Make the next call of `this.SUPER()' in the superclass refer
             * farther up the class hierarchy */
            var __class__  = self.__class__;
            self.__class__ = superclass;
            self.__super__ = superclass.__super__;

            try
            {
                superclass[method].apply(self, args);
            }
            finally
            {
                // Restore values
                self.__class__ = __class__;
                self.__super__ = superclass;
            }
        }
    },
    kind_of: function (object, klass)
    {
        return eval('klass.prototype.isPrototypeOf(object)');
    }
};

/*
 * MODULE - Class instance methods
 * Mixed into class-instances, so that these methods will become available asinstance methods
 */
Class.Methods =
{
    extend: function ()
    {
        var i = arguments.length;
        while (--i >= 0)
            Object.extend(this, arguments[i]);
        return this;
    },
    include: function ()
    {
        var i = arguments.length;
        while (--i >= 0)
            Class.append_features(this, arguments[i]);
        return this;
    },
    kind_of: function (klass)
    {
        return Class.kind_of(this, klass);
    },
    SUPER: function ()
    {
        var method = Class.get_method(this.__class__, arguments);
        Class.call_super(this.__super__, this, method, arguments);
    }
};
/*----------------------------- /SUPER CLASS -------------------------*/
Object.extend(Element, {
   	getWidth: function(element) {
    element = $(element);
    return element.offsetWidth;
	},
    getX: function(element) {
    element = $(element);
    return (document.all)?element.style.pixelLeft:parseInt(element.style.left) 
	},
 	getY: function(element) {
    element = $(element);
    return (document.all)?element.style.pixelTop:parseInt(element.style.top) 
	},
  	htZoneAffichage: function() {
		var windowHeight=0;
		if (typeof(window.innerHeight)=='number') {
			windowHeight=window.innerHeight;
		}
		else {
		 if (document.documentElement&&
		   document.documentElement.clientHeight) {
			 windowHeight = document.documentElement.clientHeight;
		}
		else {
		 if (document.body&&document.body.clientHeight) {
			 windowHeight=document.body.clientHeight;
		  }
		}
    }
    return windowHeight;
	},
	getOffSetPositionTop: function(element) {
		element = $(element);
		var position = 0;
		while (element && element.tagName != 'body')
		{
			position += element.offsetTop;
			element = element.offsetParent;
		}
		return position;
	},
	getOffSetPositionLeft: function(element,id_cible) {
		element = $(element);
		var position = 0;
		while (element && (element.id != id_cible))
		{
			position += element.offsetLeft;
			element = element.offsetParent;
		}
		return position;
	},
	getOffSetPositionLeftIFrame: function(element,id_cible,id_a_sauter) {
		element = $(element);
		var position = 0;
		var saut = false;
		while (element && (element.id != id_cible.id))
		{
			if(element.id == id_a_sauter)
			{
				var saut = true				
			}
			if(!saut)
			{
				position += element.offsetLeft;
			}
			element = element.offsetParent;
		}
		return position;
	},
	getScrollTop: function() {
		return document.documentElement.scrollTop || document.body.scrollTop;
	},
 	fixeHeight: function(element) {
		element = $(element);
		Element.setStyle(element,{height:Element.getHeight(element)+'px'});
	},
	fixeWidth: function(element) {
		element = $(element);
		Element.setStyle(element,{width:Element.getWidth(element)+'px'});
	},
 	fixeElement: function(element) {
   		element = $(element)
		Element.fixeHeight(element)
		Element.fixeWidth(element)
	},
	versPosition: function(element) {
		element = $(element);
		var x = 0,
		   y=Element.getOffSetPositionTop(element);
		window.scrollTo(x, y);
  	},
	coordXY : function(objet,conteneur)
	{
			var pos_obj = Position.cumulativeOffset($(objet));
			var pos_c = Position.cumulativeOffset($(conteneur));
		//alert(pos_obj+' '+pos_c)
		return  [pos_obj[0] - pos_c[0],pos_obj[1] - pos_c[1]]
	},
	pointXY : function(obj,pos)
	{
		var objet = $(obj)
		var h = Element.getHeight(objet)
		var v = Element.getWidth(objet)
		var l = null;
		var t = null;
		switch(pos)
		{
			case 1: l = 0; t = 0;
			break;
			case 2: l = v/2; t = 0;
			break;
			case 3: l = v; t = 0;
			break;
			case 4: l = 0; t = h/2;
			break;
			case 5: l = v/2; t = h/2;
			break;
			case 6: l = v; t = h/2;
			break;
			case 7: l = 0; t = h;
			break;
			case 8: l = v/2; t =h;
			break;
			case 9: l = v; t = h;
			break;
		}
		return  [l,t]
	}
});

function mpx(element) {
	return parseInt(element.replace(/px/,""));
}

function ppx(element) {
	element = element.toString()
	return element.search(/px/)== -1 ? element+'px':element;
}
/* ------------------------ Img_Rollover ---------------------------------*/
Img_rollover = Class.create();
Img_rollover.prototype = {
	   initialize: function(img) {
			this.image = img;
			this.source = this.image.src;
			this.url = this.source.substring(0,this.source.lastIndexOf('.'));
			this.format = this.source.substring(this.source.lastIndexOf('.'),this.source.length);
			this.source_on = this.url+"_on"+this.format;
			//assigning our method to the event
			this.image.onmouseover = this.change_on.bindAsEventListener(this);
			this.image.onmouseout = this.change_off.bindAsEventListener(this);
			this.rollover_actif = true;
	   },
	   change_on: function(evt) {
		 if(this.rollover_actif) this.set_src_on();
	   },
	   change_off: function(evt) {
		 if(this.rollover_actif) this.set_src_off();
	   },
	   set_rollover_actif: function(bool) {
		 this.rollover_actif = bool;
	   },
	   set_src_off: function() {
		 this.image.src = this.source;
	   },
	   set_src_on: function() {
		 this.image.src = this.source_on;
	   }

	};
/* ------------------------ /Img_Rollover ---------------------------------*/
/* ------------------------ Input_value ---------------------------------*/
Input_value = Class.create();
Input_value.prototype = {
	   initialize: function(element) {
			this.element = $(element);
			this.value = this.element.value;
			//assigning our method to the event
			this.element.onfocus = this.enlever_value.bindAsEventListener(this);
			this.element.onblur = this.remettre_value.bindAsEventListener(this);
	   },
	   enlever_value: function(evt) {
		 this.element.value = '';
	   },
	   remettre_value: function(evt) {
		 if(this.element.value == "") this.element.value = this.value;
	   }
	};
/* ------------------------ /Input_value ---------------------------------*/
/* ------------------------ TimerExecuter ---------------------------------*/
var TimerExecuter = Class.create();
TimerExecuter.prototype = {
  initialize: function(callback, frequency) {
    this.callback = callback;
    this.frequency = frequency;
    this.currentlyExecuting = false;

    this.registerCallback();
  },

  registerCallback: function() {
    this.var_timer = setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000);
  },
  
  arret: function() {
	clearTimeout(this.var_timer)
  },

  onTimerEvent: function() {
	this.callback();
  }
}
/* ------------------------ /TimerExecuter ---------------------------------*/
/* ------------------------ Cookie ---------------------------------*/
var Cookie = {
  set: function(name, value, daysToExpire) {
    var expire = '';
    if (daysToExpire != undefined) {
      var d = new Date();
      d.setTime(d.getTime() + (86400000 * parseFloat(daysToExpire)));
      expire = '; expires=' + d.toGMTString();
    }
    return (document.cookie = escape(name) + '=' + escape(value || '') + expire);
  },
  get: function(name) {
    var cookie = document.cookie.match(new RegExp('(^|;)\\s*' + escape(name) + '=([^;\\s]*)'));
    return (cookie ? unescape(cookie[2]) : null);
  },
  erase: function(name) {
    var cookie = Cookie.get(name) || true;
    Cookie.set(name, '', -1);
    return cookie;
  },
  accept: function() {
    if (typeof navigator.cookieEnabled == 'boolean') {
      return navigator.cookieEnabled;
    }
    Cookie.set('_test', '1');
    return (Cookie.erase('_test') == '1');
  }
};
/* ------------------------ ListeDeroulante ---------------------------------*/
var anim_liste = false;

ManagerSelects = Class.create();
ManagerSelects.prototype = {
	initialize: function() {
		this.selects = [];
		document.onclick = this.onclickout.bindAsEventListener(this);
	},
	addSelect : function(obj){
			this.selects.push(obj);
	},
	onclickout: function(e) {
		this.selects.each(function(element){
				if(!anim_liste)
				{
					if(element.liste_affichee)
					{
						element.desafficher(anim_liste);
					}
				}
		});	
	}
};

var manager_selects = new ManagerSelects();

ListeDeroulante = Class.create();
ListeDeroulante.prototype = {
	   initialize: function(liste,bouton, cible, monte) {
			this.liste = $(liste);
			this.bouton = $(bouton);
			this.cible = $(cible);
			this.h_liste = Element.getHeight(this.liste);
			this.liste_affichee = false;
			Element.setStyle(this.liste,{display:"none", top:"0px"})
			
			this.monte = monte;
			//this.monte = true;
			
			//assigning our method to the event
			this.bouton.onclick = this.click_bouton.bindAsEventListener(this);
			this.bouton.onmouseover = this.onmouseover_bouton.bindAsEventListener(this);
			this.bouton.onmouseout = this.onmouseout_bouton.bindAsEventListener(this);
			
			
			if (this.cible != null){
				this.cible.onclick = this.click_bouton.bindAsEventListener(this);
				this.cible.onmouseover = this.onmouseover_cible.bindAsEventListener(this);
				this.cible.onmouseout = this.onmouseout_cible.bindAsEventListener(this);
			}
			var maliste = this.liste.childElements();
			for (var i=0; i < maliste.length; ++i){
				maliste[i].onclick = this.click_bouton.bindAsEventListener(this);
			}
			manager_selects.addSelect(this);
	   },
	   click_bouton: function(evt){
		   manager_selects.onclickout();
			if(!anim_liste)
			{
				if(this.liste_affichee)
				{
					this.desafficher(anim_liste);
				}
				else
				{
					this.afficher(anim_liste);
				}
			}
	   },
	   afficher: function(anim_liste) {
			g_anim_liste(true)

			this.liste_affichee = true;

			var liste = this.liste;
			var h_liste = this.h_liste;
			
			if(this.monte){
				new Effect.Parallel(
				[ 
					new Effect.MoveBy(this.liste,-(this.h_liste),0,{sync:true}),
					new Effect.BlindDown(this.liste,{sync:true})
				],
				{duration:0.7,
					afterFinish: function(element, anim_liste)
					{ 
						Element.setStyle(liste,{top:-(h_liste)+"px"})
						Element.setStyle(liste,{display:"block"})
						g_anim_liste(false)
					}
				});
			} else {				
				new Effect.Parallel(
				[ 
					new Effect.MoveBy(this.liste,0,0,{sync:true}),
					new Effect.BlindDown(this.liste,{sync:true})
				],
				{duration:0.7,
					afterFinish: function(element, anim_liste)
					{ 
						Element.setStyle(liste,{top:0+"px"})
						Element.setStyle(liste,{display:"block"})
						g_anim_liste(false)
					}
				});
			}
	   },
	   desafficher: function() {
			g_anim_liste(true)

			this.liste_affichee = false;

			var liste = this.liste;
			var h_liste = this.h_liste;
			
			
			if(this.monte){
				new Effect.Parallel(
				[ 
					new Effect.MoveBy(this.liste,(this.h_liste),0,{sync:true}),
					new Effect.BlindUp(this.liste,{sync:true})
				],
				{duration:0.7,
					afterFinish: function(element, anim_liste)
					{ 
						Element.setStyle(liste,{display:"none"})
						Element.setStyle(liste,{top:"0px"})
						g_anim_liste(false)
					}
				});
			} else {
				new Effect.Parallel(
				[ 
					new Effect.MoveBy(this.liste,0,0,{sync:true}),
					new Effect.BlindUp(this.liste,{sync:true})
				],
				{duration:0.7,
					afterFinish: function(element, anim_liste)
					{ 
						Element.setStyle(liste,{display:"none"})
						Element.setStyle(liste,{top:"0px"})
						g_anim_liste(false)
					}
				});
			}
			
			
			
	   },
	   onmouseover_bouton: function() {
			Element.setStyle(this.bouton,{cursor:"pointer"})
	   },
	   onmouseout_bouton: function() {
			Element.setStyle(this.bouton,{cursor:"default"})
	   },
	   onmouseover_cible: function() {
			Element.setStyle(this.cible,{cursor:"pointer"})
	   },
	   onmouseout_cible: function() {
			Element.setStyle(this.cible,{cursor:"default"})
	   }

	};
	
function g_anim_liste(bool)
{
	anim_liste = bool;	
}


/* ------------------------ /ListeDeroulante ---------------------------------*/
/* ------------------------ /Cookie ---------------------------------*/

/* ------------- onDOMReady --------------*/
Object.extend(Event, {
  _domReady : function() {
    if (arguments.callee.done) return;
    arguments.callee.done = true;

    if (this._timer)  clearInterval(this._timer);
    
    this._readyCallbacks.each(function(f) { f() });
    this._readyCallbacks = null;
},
  onDOMReady : function(f) {
    if (!this._readyCallbacks) {
      var domReady = this._domReady.bind(this);
      
      if (document.addEventListener)
        document.addEventListener("DOMContentLoaded", domReady, false);
        
        /*@cc_on @*/
        /*@if (@_win32)
            document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
            document.getElementById("__ie_onload").onreadystatechange = function() {
                if (this.readyState == "complete") domReady(); 
            };
        /*@end @*/
        
        if (/WebKit/i.test(navigator.userAgent)) { 
          this._timer = setInterval(function() {
            if (/loaded|complete/.test(document.readyState)) domReady(); 
          }, 10);
        }
        
        Event.observe(window, 'load', domReady);
        Event._readyCallbacks =  [];
    }
    Event._readyCallbacks.push(f);
  }
});
/* ------------- /onDOMReady --------------*/
/*****************************************************************************
scalable Inman Flash Replacement (sIFR) version 3, revision 436.

Copyright 2006 â€“ 2008 Mark Wubben, <http://novemberborn.net/>

Older versions:
* IFR by Shaun Inman
* sIFR 1.0 by Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2.0 by Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

See also <http://novemberborn.net/sifr3> and <http://wiki.novemberborn.net/sifr3>.

This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*****************************************************************************/

var sIFR=new function(){var O=this;var E={ACTIVE:"sIFR-active",REPLACED:"sIFR-replaced",IGNORE:"sIFR-ignore",ALTERNATE:"sIFR-alternate",CLASS:"sIFR-class",LAYOUT:"sIFR-layout",FLASH:"sIFR-flash",FIX_FOCUS:"sIFR-fixfocus",DUMMY:"sIFR-dummy"};E.IGNORE_CLASSES=[E.REPLACED,E.IGNORE,E.ALTERNATE];this.MIN_FONT_SIZE=6;this.MAX_FONT_SIZE=126;this.FLASH_PADDING_BOTTOM=5;this.VERSION="436";this.isActive=false;this.isEnabled=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.replacements=[];var L=0;var R=false;function Y(){}function D(c){function d(e){return e.toLocaleUpperCase()}this.normalize=function(e){return e.replace(/\n|\r|\xA0/g,D.SINGLE_WHITESPACE).replace(/\s+/g,D.SINGLE_WHITESPACE)};this.textTransform=function(e,f){switch(e){case"uppercase":return f.toLocaleUpperCase();case"lowercase":return f.toLocaleLowerCase();case"capitalize":return f.replace(/^\w|\s\w/g,d)}return f};this.toHexString=function(e){if(e.charAt(0)!="#"||e.length!=4&&e.length!=7){return e}e=e.substring(1);return"0x"+(e.length==3?e.replace(/(.)(.)(.)/,"$1$1$2$2$3$3"):e)};this.toJson=function(g,f){var e="";switch(typeof(g)){case"string":e='"'+f(g)+'"';break;case"number":case"boolean":e=g.toString();break;case"object":e=[];for(var h in g){if(g[h]==Object.prototype[h]){continue}e.push('"'+h+'":'+this.toJson(g[h]))}e="{"+e.join(",")+"}";break}return e};this.convertCssArg=function(e){if(!e){return{}}if(typeof(e)=="object"){if(e.constructor==Array){e=e.join("")}else{return e}}var l={};var m=e.split("}");for(var h=0;h<m.length;h++){var k=m[h].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!k||k.length!=3){continue}if(!l[k[1]]){l[k[1]]={}}var g=k[2].split(";");for(var f=0;f<g.length;f++){var n=g[f].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!n||n.length!=3){continue}l[k[1]][n[1]]=n[2].replace(/\s+$/,"")}}return l};this.extractFromCss=function(g,f,i,e){var h=null;if(g&&g[f]&&g[f][i]){h=g[f][i];if(e){delete g[f][i]}}return h};this.cssToString=function(f){var g=[];for(var e in f){var j=f[e];if(j==Object.prototype[e]){continue}g.push(e,"{");for(var i in j){if(j[i]==Object.prototype[i]){continue}var h=j[i];if(D.UNIT_REMOVAL_PROPERTIES[i]){h=parseInt(h,10)}g.push(i,":",h,";")}g.push("}")}return g.join("")};this.escape=function(e){return escape(e).replace(/\+/g,"%2B")};this.encodeVars=function(e){return e.join("&").replace(/%/g,"%25")};this.copyProperties=function(g,f){for(var e in g){if(f[e]===undefined){f[e]=g[e]}}return f};this.domain=function(){var f="";try{f=document.domain}catch(g){}return f};this.domainMatches=function(h,g){if(g=="*"||g==h){return true}var f=g.lastIndexOf("*");if(f>-1){g=g.substr(f+1);var e=h.lastIndexOf(g);if(e>-1&&(e+g.length)==h.length){return true}}return false};this.uriEncode=function(e){return encodeURI(decodeURIComponent(e))};this.delay=function(f,h,g){var e=Array.prototype.slice.call(arguments,3);setTimeout(function(){h.apply(g,e)},f)}}D.UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};D.SINGLE_WHITESPACE=" ";function U(e){var d=this;function c(g,j,h){var k=d.getStyleAsInt(g,j,e.ua.ie);if(k==0){k=g[h];for(var f=3;f<arguments.length;f++){k-=d.getStyleAsInt(g,arguments[f],true)}}return k}this.getBody=function(){return document.getElementsByTagName("body")[0]||null};this.querySelectorAll=function(f){return window.parseSelector(f)};this.addClass=function(f,g){if(g){g.className=((g.className||"")==""?"":g.className+" ")+f}};this.removeClass=function(f,g){if(g){g.className=g.className.replace(new RegExp("(^|\\s)"+f+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(f,g){return new RegExp("(^|\\s)"+f+"(\\s|$)").test(g.className)};this.hasOneOfClassses=function(h,g){for(var f=0;f<h.length;f++){if(this.hasClass(h[f],g)){return true}}return false};this.ancestorHasClass=function(g,f){g=g.parentNode;while(g&&g.nodeType==1){if(this.hasClass(f,g)){return true}g=g.parentNode}return false};this.create=function(f,g){var h=document.createElementNS?document.createElementNS(U.XHTML_NS,f):document.createElement(f);if(g){h.className=g}return h};this.getComputedStyle=function(h,i){var f;if(document.defaultView&&document.defaultView.getComputedStyle){var g=document.defaultView.getComputedStyle(h,null);f=g?g[i]:null}else{if(h.currentStyle){f=h.currentStyle[i]}}return f||""};this.getStyleAsInt=function(g,i,f){var h=this.getComputedStyle(g,i);if(f&&!/px$/.test(h)){return 0}return parseInt(h)||0};this.getWidthFromStyle=function(f){return c(f,"width","offsetWidth","paddingRight","paddingLeft","borderRightWidth","borderLeftWidth")};this.getHeightFromStyle=function(f){return c(f,"height","offsetHeight","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth")};this.getDimensions=function(j){var h=j.offsetWidth;var f=j.offsetHeight;if(h==0||f==0){for(var g=0;g<j.childNodes.length;g++){var k=j.childNodes[g];if(k.nodeType!=1){continue}h=Math.max(h,k.offsetWidth);f=Math.max(f,k.offsetHeight)}}return{width:h,height:f}};this.getViewport=function(){return{width:window.innerWidth||document.documentElement.clientWidth||this.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||this.getBody().clientHeight}};this.blurElement=function(g){try{g.blur();return}catch(h){}var f=this.create("input");f.style.width="0px";f.style.height="0px";g.parentNode.appendChild(f);f.focus();f.blur();f.parentNode.removeChild(f)}}U.XHTML_NS="http://www.w3.org/1999/xhtml";function H(r){var g=navigator.userAgent.toLowerCase();var q=(navigator.product||"").toLowerCase();var h=navigator.platform.toLowerCase();this.parseVersion=H.parseVersion;this.macintosh=/^mac/.test(h);this.windows=/^win/.test(h);this.linux=/^linux/.test(h);this.quicktime=false;this.opera=/opera/.test(g);this.konqueror=/konqueror/.test(g);this.ie=false/*@cc_on||true@*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(g)/*@cc_on&&@_jscript_version>=5.5@*/;this.ieWin=this.ie&&this.windows/*@cc_on&&@_jscript_version>=5.1@*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on&&@_jscript_version<5.1@*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=/safari/.test(g);this.webkit=!this.konqueror&&/applewebkit/.test(g);this.khtml=this.webkit||this.konqueror;this.gecko=!this.khtml&&q=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(g)?this.parseVersion(RegExp.$1):"0";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(g)?this.parseVersion(RegExp.$2):"0";this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(g)?this.parseVersion(RegExp.$1):"0";this.geckoVersion=this.gecko&&/.*rv:\s*([^\)]+)\)\s+gecko/.exec(g)?this.parseVersion(RegExp.$1):"0";this.konquerorVersion=this.konqueror&&/.*konqueror\/([\d\.]+).*/.exec(g)?this.parseVersion(RegExp.$1):"0";this.flashVersion=0;if(this.ieWin){var l;var o=false;try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(m){try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=this.parseVersion("6");l.AllowScriptAccess="always"}catch(m){o=this.flashVersion==this.parseVersion("6")}if(!o){try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(m){}}}if(!o&&l){this.flashVersion=this.parseVersion((l.GetVariable("$version")||"").replace(/^\D+(\d+)\D+(\d+)\D+(\d+).*/g,"$1.$2.$3"))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var n=navigator.plugins["Shockwave Flash"].description.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var p=n.replace(/^\D*(\d+\.\d+).*$/,"$1");if(/r/.test(n)){p+=n.replace(/^.*r(\d*).*$/,".$1")}else{if(/d/.test(n)){p+=".0"}}this.flashVersion=this.parseVersion(p);var j=false;for(var k=0,c=this.flashVersion>=H.MIN_FLASH_VERSION;c&&k<navigator.mimeTypes.length;k++){var f=navigator.mimeTypes[k];if(f.type!="application/x-shockwave-flash"){continue}if(f.enabledPlugin){j=true;if(f.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){c=false;this.quicktime=true}}}if(this.quicktime||!j){this.flashVersion=this.parseVersion("0")}}}this.flash=this.flashVersion>=H.MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows||this.linux&&(this.flashVersion>=this.parseVersion("10")&&(this.gecko&&this.geckoVersion>=this.parseVersion("1.9")||this.opera));this.computedStyleSupport=this.ie||!!document.defaultView.getComputedStyle;this.fixFocus=this.gecko&&this.windows;this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=this.parseVersion("525")||this.konqueror&&this.konquerorMajor>this.parseVersion("03")||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkitVersion<this.parseVersion("523");this.properDocument=typeof(document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&this.computedStyleSupport&&(!this.opera||this.operaVersion>=this.parseVersion("9.61"))&&(!this.webkit||this.webkitVersion>=this.parseVersion("412"))&&(!this.gecko||this.geckoVersion>=this.parseVersion("1.8.0.12"))&&(!this.konqueror)}H.parseVersion=function(c){return c.replace(/(^|\D)(\d+)(?=\D|$)/g,function(f,e,g){f=e;for(var d=4-g.length;d>=0;d--){f+="0"}return f+g})};H.MIN_FLASH_VERSION=H.parseVersion("8");function F(c){this.fix=c.ua.ieWin&&window.location.hash!="";var d;this.cache=function(){d=document.title};function e(){document.title=d}this.restore=function(){if(this.fix){setTimeout(e,0)}}}function S(l){var e=null;function c(){try{if(l.ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left")}}catch(n){return setTimeout(c,10)}i()}function i(){if(l.useStyleCheck){h()}else{if(!l.ua.mustCheckStyle){d(null,true)}}}function h(){e=l.dom.create("div",E.DUMMY);l.dom.getBody().appendChild(e);m()}function m(){if(l.dom.getComputedStyle(e,"marginLeft")=="42px"){g()}else{setTimeout(m,10)}}function g(){if(e&&e.parentNode){e.parentNode.removeChild(e)}e=null;d(null,true)}function d(n,o){l.initialize(o);if(n&&n.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",d,false)}if(window.removeEventListener){window.removeEventListener("load",d,false)}}}function j(){l.prepareClearReferences();if(document.readyState=="interactive"){document.attachEvent("onstop",f);setTimeout(function(){document.detachEvent("onstop",f)},0)}}function f(){document.detachEvent("onstop",f);k()}function k(){l.clearReferences()}this.attach=function(){if(window.addEventListener){window.addEventListener("load",d,false)}else{window.attachEvent("onload",d)}if(!l.useDomLoaded||l.ua.forcePageLoad||l.ua.ie&&window.top!=window){return}if(l.ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",i,false)}else{if(l.ua.ie||l.ua.khtml){c()}}};this.attachUnload=function(){if(!l.ua.ie){return}window.attachEvent("onbeforeunload",j);window.attachEvent("onunload",k)}}var Q="sifrFetch";function N(c){var e=false;this.fetchMovies=function(f){if(c.setPrefetchCookie&&new RegExp(";?"+Q+"=true;?").test(document.cookie)){return}try{e=true;d(f)}catch(g){}if(c.setPrefetchCookie){document.cookie=Q+"=true;path="+c.cookiePath}};this.clear=function(){if(!e){return}try{var f=document.getElementsByTagName("script");for(var g=f.length-1;g>=0;g--){var h=f[g];if(h.type=="sifr/prefetch"){h.parentNode.removeChild(h)}}}catch(j){}};function d(f){for(var g=0;g<f.length;g++){document.write('<script defer type="sifr/prefetch" src="'+f[g].src+'"><\/script>')}}}function b(e){var g=e.ua.ie;var f=g&&e.ua.flashVersion<e.ua.parseVersion("9.0.115");var d={};var c={};this.fixFlash=f;this.register=function(h){if(!g){return}var i=h.getAttribute("id");this.cleanup(i,false);c[i]=h;delete d[i];if(f){window[i]=h}};this.reset=function(){if(!g){return false}for(var j=0;j<e.replacements.length;j++){var h=e.replacements[j];var k=c[h.id];if(!d[h.id]&&(!k.parentNode||k.parentNode.nodeType==11)){h.resetMovie();d[h.id]=true}}return true};this.cleanup=function(l,h){var i=c[l];if(!i){return}for(var k in i){if(typeof(i[k])=="function"){i[k]=null}}c[l]=null;if(f){window[l]=null}if(i.parentNode){if(h&&i.parentNode.nodeType==1){var j=document.createElement("div");j.style.width=i.offsetWidth+"px";j.style.height=i.offsetHeight+"px";i.parentNode.replaceChild(j,i)}else{i.parentNode.removeChild(i)}}};this.prepareClearReferences=function(){if(!f){return}__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}};this.clearReferences=function(){if(f){var j=document.getElementsByTagName("object");for(var h=j.length-1;h>=0;h--){c[j[h].getAttribute("id")]=j[h]}}for(var k in c){if(Object.prototype[k]!=c[k]){this.cleanup(k,true)}}}}function K(d,g,f,c,e){this.sIFR=d;this.id=g;this.vars=f;this.movie=null;this.__forceWidth=c;this.__events=e;this.__resizing=0}K.prototype={getFlashElement:function(){return document.getElementById(this.id)},getAlternate:function(){return document.getElementById(this.id+"_alternate")},getAncestor:function(){var c=this.getFlashElement().parentNode;return !this.sIFR.dom.hasClass(E.FIX_FOCUS,c)?c:c.parentNode},available:function(){var c=this.getFlashElement();return c&&c.parentNode},call:function(c){var d=this.getFlashElement();if(!d[c]){return false}return Function.prototype.apply.call(d[c],d,Array.prototype.slice.call(arguments,1))},attempt:function(){if(!this.available()){return false}try{this.call.apply(this,arguments)}catch(c){if(this.sIFR.debug){throw c}return false}return true},updateVars:function(c,e){for(var d=0;d<this.vars.length;d++){if(this.vars[d].split("=")[0]==c){this.vars[d]=c+"="+e;break}}var f=this.sIFR.util.encodeVars(this.vars);this.movie.injectVars(this.getFlashElement(),f);this.movie.injectVars(this.movie.html,f)},storeSize:function(c,d){this.movie.setSize(c,d);this.updateVars(c,d)},fireEvent:function(c){if(this.available()&&this.__events[c]){this.sIFR.util.delay(0,this.__events[c],this,this)}},resizeFlashElement:function(c,d,e){if(!this.available()){return}this.__resizing++;var f=this.getFlashElement();f.setAttribute("height",c);this.getAncestor().style.minHeight="";this.updateVars("renderheight",c);this.storeSize("height",c);if(d!==null){f.setAttribute("width",d);this.movie.setSize("width",d)}if(this.__events.onReplacement){this.sIFR.util.delay(0,this.__events.onReplacement,this,this);delete this.__events.onReplacement}if(e){this.sIFR.util.delay(0,function(){this.attempt("scaleMovie");this.__resizing--},this)}else{this.__resizing--}},blurFlashElement:function(){if(this.available()){this.sIFR.dom.blurElement(this.getFlashElement())}},resetMovie:function(){this.sIFR.util.delay(0,this.movie.reset,this.movie,this.getFlashElement(),this.getAlternate())},resizeAfterScale:function(){if(this.available()&&this.__resizing==0){this.sIFR.util.delay(0,this.resize,this)}},resize:function(){if(!this.available()){return}this.__resizing++;var g=this.getFlashElement();var f=g.offsetWidth;if(f==0){return}var e=g.getAttribute("width");var l=g.getAttribute("height");var m=this.getAncestor();var o=this.sIFR.dom.getHeightFromStyle(m);g.style.width="1px";g.style.height="1px";m.style.minHeight=o+"px";var c=this.getAlternate().childNodes;var n=[];for(var k=0;k<c.length;k++){var h=c[k].cloneNode(true);n.push(h);m.appendChild(h)}var d=this.sIFR.dom.getWidthFromStyle(m);for(var k=0;k<n.length;k++){m.removeChild(n[k])}g.style.width=g.style.height=m.style.minHeight="";g.setAttribute("width",this.__forceWidth?d:e);g.setAttribute("height",l);if(sIFR.ua.ie){g.style.display="none";var j=g.offsetHeight;g.style.display=""}if(d!=f){if(this.__forceWidth){this.storeSize("width",d)}this.attempt("resize",d)}this.__resizing--},replaceText:function(g,j){var d=this.sIFR.util.escape(g);if(!this.attempt("replaceText",d)){return false}this.updateVars("content",d);var f=this.getAlternate();if(j){while(f.firstChild){f.removeChild(f.firstChild)}for(var c=0;c<j.length;c++){f.appendChild(j[c])}}else{try{f.innerHTML=g}catch(h){}}return true},changeCSS:function(c){c=this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(c)));this.updateVars("css",c);return this.attempt("changeCSS",c)},remove:function(){if(this.movie&&this.available()){this.movie.remove(this.getFlashElement(),this.id)}}};var X=new function(){this.create=function(p,n,j,i,f,e,g,o,l,h,m){var k=p.ua.ie?d:c;return new k(p,n,j,i,f,e,g,o,["flashvars",l,"wmode",h,"bgcolor",m,"allowScriptAccess","always","quality","best"])};function c(s,q,l,h,f,e,g,r,n){var m=s.dom.create("object",E.FLASH);var p=["type","application/x-shockwave-flash","id",f,"name",f,"data",e,"width",g,"height",r];for(var o=0;o<p.length;o+=2){m.setAttribute(p[o],p[o+1])}var j=m;if(h){j=W.create("div",E.FIX_FOCUS);j.appendChild(m)}for(var o=0;o<n.length;o+=2){if(n[o]=="name"){continue}var k=W.create("param");k.setAttribute("name",n[o]);k.setAttribute("value",n[o+1]);m.appendChild(k)}l.style.minHeight=r+"px";while(l.firstChild){l.removeChild(l.firstChild)}l.appendChild(j);this.html=j.cloneNode(true)}c.prototype={reset:function(e,f){e.parentNode.replaceChild(this.html.cloneNode(true),e)},remove:function(e,f){e.parentNode.removeChild(e)},setSize:function(e,f){this.html.setAttribute(e,f)},injectVars:function(e,g){var h=e.getElementsByTagName("param");for(var f=0;f<h.length;f++){if(h[f].getAttribute("name")=="flashvars"){h[f].setAttribute("value",g);break}}}};function d(p,n,j,h,f,e,g,o,k){this.dom=p.dom;this.broken=n;this.html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+f+'" width="'+g+'" height="'+o+'" class="'+E.FLASH+'"><param name="movie" value="'+e+'"></param></object>';var m="";for(var l=0;l<k.length;l+=2){m+='<param name="'+k[l]+'" value="'+k[l+1]+'"></param>'}this.html=this.html.replace(/(<\/object>)/,m+"$1");j.style.minHeight=o+"px";j.innerHTML=this.html;this.broken.register(j.firstChild)}d.prototype={reset:function(f,g){g=g.cloneNode(true);var e=f.parentNode;e.innerHTML=this.html;this.broken.register(e.firstChild);e.appendChild(g)},remove:function(e,f){this.broken.cleanup(f)},setSize:function(e,f){this.html=this.html.replace(e=="height"?/(height)="\d+"/:/(width)="\d+"/,'$1="'+f+'"')},injectVars:function(e,f){if(e!=this.html){return}this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+f)}}};this.errors=new Y(O);var A=this.util=new D(O);var W=this.dom=new U(O);var T=this.ua=new H(O);var G={fragmentIdentifier:new F(O),pageLoad:new S(O),prefetch:new N(O),brokenFlashIE:new b(O)};this.__resetBrokenMovies=G.brokenFlashIE.reset;var J={kwargs:[],replaceAll:function(d){for(var c=0;c<this.kwargs.length;c++){O.replace(this.kwargs[c])}if(!d){this.kwargs=[]}}};this.activate=function(){if(!T.supported||!this.isEnabled||this.isActive||!C()||a()){return}G.prefetch.fetchMovies(arguments);this.isActive=true;this.setFlashClass();G.fragmentIdentifier.cache();G.pageLoad.attachUnload();if(!this.autoInitialize){return}G.pageLoad.attach()};this.setFlashClass=function(){if(this.hasFlashClassSet){return}W.addClass(E.ACTIVE,W.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}W.removeClass(E.ACTIVE,W.getBody());W.removeClass(E.ACTIVE,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(c){if(!this.isActive||!this.isEnabled){return}if(R){if(!c){J.replaceAll(false)}return}R=true;J.replaceAll(c);if(O.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",Z,false)}else{window.attachEvent("onresize",Z)}}G.prefetch.clear()};this.replace=function(x,u){if(!T.supported){return}if(u){x=A.copyProperties(x,u)}if(!R){return J.kwargs.push(x)}if(this.onReplacementStart){this.onReplacementStart(x)}var AM=x.elements||W.querySelectorAll(x.selector);if(AM.length==0){return}var w=M(x.src);var AR=A.convertCssArg(x.css);var v=B(x.filters);var AN=x.forceSingleLine===true;var AS=x.preventWrap===true&&!AN;var q=AN||(x.fitExactly==null?this.fitExactly:x.fitExactly)===true;var AD=q||(x.forceWidth==null?this.forceWidth:x.forceWidth)===true;var s=x.ratios||[];var AE=x.pixelFont===true;var r=parseInt(x.tuneHeight)||0;var z=!!x.onRelease||!!x.onRollOver||!!x.onRollOut;if(q){A.extractFromCss(AR,".sIFR-root","text-align",true)}var t=A.extractFromCss(AR,".sIFR-root","font-size",true)||"0";var e=A.extractFromCss(AR,".sIFR-root","background-color",true)||"#FFFFFF";var o=A.extractFromCss(AR,".sIFR-root","kerning",true)||"";var AW=A.extractFromCss(AR,".sIFR-root","opacity",true)||"100";var k=A.extractFromCss(AR,".sIFR-root","cursor",true)||"default";var AP=parseInt(A.extractFromCss(AR,".sIFR-root","leading"))||0;var AJ=x.gridFitType||(A.extractFromCss(AR,".sIFR-root","text-align")=="right")?"subpixel":"pixel";var h=this.forceTextTransform===false?"none":A.extractFromCss(AR,".sIFR-root","text-transform",true)||"none";t=/^\d+(px)?$/.test(t)?parseInt(t):0;AW=parseFloat(AW)<1?100*parseFloat(AW):AW;var AC=x.modifyCss?"":A.cssToString(AR);var AG=x.wmode||"";if(!AG){if(x.transparent){AG="transparent"}else{if(x.opaque){AG="opaque"}}}if(AG=="transparent"){if(!T.transparencySupport){AG="opaque"}else{e="transparent"}}else{if(e=="transparent"){e="#FFFFFF"}}for(var AV=0;AV<AM.length;AV++){var AF=AM[AV];if(W.hasOneOfClassses(E.IGNORE_CLASSES,AF)||W.ancestorHasClass(AF,E.ALTERNATE)){continue}var AO=W.getDimensions(AF);var f=AO.height;var c=AO.width;var AA=W.getComputedStyle(AF,"display");if(!f||!c||!AA||AA=="none"){continue}c=W.getWidthFromStyle(AF);var n,AH;if(!t){var AL=I(AF);n=Math.min(this.MAX_FONT_SIZE,Math.max(this.MIN_FONT_SIZE,AL.fontSize));if(AE){n=Math.max(8,8*Math.round(n/8))}AH=AL.lines}else{n=t;AH=1}var d=W.create("span",E.ALTERNATE);var AX=AF.cloneNode(true);AF.parentNode.appendChild(AX);for(var AU=0,AT=AX.childNodes.length;AU<AT;AU++){var m=AX.childNodes[AU];if(!/^(style|script)$/i.test(m.nodeName)){d.appendChild(m.cloneNode(true))}}if(x.modifyContent){x.modifyContent(AX,x.selector)}if(x.modifyCss){AC=x.modifyCss(AR,AX,x.selector)}var p=P(AX,h,x.uriEncode);AX.parentNode.removeChild(AX);if(x.modifyContentString){p.text=x.modifyContentString(p.text,x.selector)}if(p.text==""){continue}var AK=Math.round(AH*V(n,s)*n)+this.FLASH_PADDING_BOTTOM+r;if(AH>1&&AP){AK+=Math.round((AH-1)*AP)}var AB=AD?c:"100%";var AI="sIFR_replacement_"+L++;var AQ=["id="+AI,"content="+A.escape(p.text),"width="+c,"renderheight="+AK,"link="+A.escape(p.primaryLink.href||""),"target="+A.escape(p.primaryLink.target||""),"size="+n,"css="+A.escape(AC),"cursor="+k,"tunewidth="+(x.tuneWidth||0),"tuneheight="+r,"offsetleft="+(x.offsetLeft||""),"offsettop="+(x.offsetTop||""),"fitexactly="+q,"preventwrap="+AS,"forcesingleline="+AN,"antialiastype="+(x.antiAliasType||""),"thickness="+(x.thickness||""),"sharpness="+(x.sharpness||""),"kerning="+o,"gridfittype="+AJ,"flashfilters="+v,"opacity="+AW,"blendmode="+(x.blendMode||""),"selectable="+(x.selectable==null||AG!=""&&!sIFR.ua.macintosh&&sIFR.ua.gecko&&sIFR.ua.geckoVersion>=sIFR.ua.parseVersion("1.9")?"true":x.selectable===true),"fixhover="+(this.fixHover===true),"events="+z,"delayrun="+G.brokenFlashIE.fixFlash,"version="+this.VERSION];var y=A.encodeVars(AQ);var g=new K(O,AI,AQ,AD,{onReplacement:x.onReplacement,onRollOver:x.onRollOver,onRollOut:x.onRollOut,onRelease:x.onRelease});g.movie=X.create(sIFR,G.brokenFlashIE,AF,T.fixFocus&&x.fixFocus,AI,w,AB,AK,y,AG,e);this.replacements.push(g);this.replacements[AI]=g;if(x.selector){if(!this.replacements[x.selector]){this.replacements[x.selector]=[g]}else{this.replacements[x.selector].push(g)}}d.setAttribute("id",AI+"_alternate");AF.appendChild(d);W.addClass(E.REPLACED,AF)}G.fragmentIdentifier.restore()};this.getReplacementByFlashElement=function(d){for(var c=0;c<O.replacements.length;c++){if(O.replacements[c].id==d.getAttribute("id")){return O.replacements[c]}}};this.redraw=function(){for(var c=0;c<O.replacements.length;c++){O.replacements[c].resetMovie()}};this.prepareClearReferences=function(){G.brokenFlashIE.prepareClearReferences()};this.clearReferences=function(){G.brokenFlashIE.clearReferences();G=null;J=null;delete O.replacements};function C(){if(O.domains.length==0){return true}var d=A.domain();for(var c=0;c<O.domains.length;c++){if(A.domainMatches(d,O.domains[c])){return true}}return false}function a(){if(document.location.protocol=="file:"){if(O.debug){O.errors.fire("isFile")}return true}return false}function M(c){if(T.ie&&c.charAt(0)=="/"){c=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+c}return c}function V(d,e){for(var c=0;c<e.length;c+=2){if(d<=e[c]){return e[c+1]}}return e[e.length-1]||1}function B(g){var e=[];for(var d in g){if(g[d]==Object.prototype[d]){continue}var c=g[d];d=[d.replace(/filter/i,"")+"Filter"];for(var f in c){if(c[f]==Object.prototype[f]){continue}d.push(f+":"+A.escape(A.toJson(c[f],A.toHexString)))}e.push(d.join(","))}return A.escape(e.join(";"))}function Z(d){var e=Z.viewport;var c=W.getViewport();if(e&&c.width==e.width&&c.height==e.height){return}Z.viewport=c;if(O.replacements.length==0){return}if(Z.timer){clearTimeout(Z.timer)}Z.timer=setTimeout(function(){delete Z.timer;for(var f=0;f<O.replacements.length;f++){O.replacements[f].resize()}},200)}function I(f){var g=W.getComputedStyle(f,"fontSize");var d=g.indexOf("px")==-1;var e=f.innerHTML;if(d){f.innerHTML="X"}f.style.paddingTop=f.style.paddingBottom=f.style.borderTopWidth=f.style.borderBottomWidth="0px";f.style.lineHeight="2em";f.style.display="block";g=d?f.offsetHeight/2:parseInt(g,10);if(d){f.innerHTML=e}var c=Math.round(f.offsetHeight/(2*g));f.style.paddingTop=f.style.paddingBottom=f.style.borderTopWidth=f.style.borderBottomWidth=f.style.lineHeight=f.style.display="";if(isNaN(c)||!isFinite(c)||c==0){c=1}return{fontSize:g,lines:c}}function P(c,g,s){s=s||A.uriEncode;var q=[],m=[];var k=null;var e=c.childNodes;var o=false,p=false;var j=0;while(j<e.length){var f=e[j];if(f.nodeType==3){var t=A.textTransform(g,A.normalize(f.nodeValue)).replace(/</g,"&lt;");if(o&&p){t=t.replace(/^\s+/,"")}m.push(t);o=/\s$/.test(t);p=false}if(f.nodeType==1&&!/^(style|script)$/i.test(f.nodeName)){var h=[];var r=f.nodeName.toLowerCase();var n=f.className||"";if(/\s+/.test(n)){if(n.indexOf(E.CLASS)>-1){n=n.match("(\\s|^)"+E.CLASS+"-([^\\s$]*)(\\s|$)")[2]}else{n=n.match(/^([^\s]+)/)[1]}}if(n!=""){h.push('class="'+n+'"')}if(r=="a"){var d=s(f.getAttribute("href")||"");var l=f.getAttribute("target")||"";h.push('href="'+d+'"','target="'+l+'"');if(!k){k={href:d,target:l}}}m.push("<"+r+(h.length>0?" ":"")+h.join(" ")+">");p=true;if(f.hasChildNodes()){q.push(j);j=0;e=f.childNodes;continue}else{if(!/^(br|img)$/i.test(f.nodeName)){m.push("</",f.nodeName.toLowerCase(),">")}}}if(q.length>0&&!f.nextSibling){do{j=q.pop();e=f.parentNode.parentNode.childNodes;f=e[j];if(f){m.push("</",f.nodeName.toLowerCase(),">")}}while(j==e.length-1&&q.length>0)}j++}return{text:m.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g,"$1"),primaryLink:k||{}}}};
var parseSelector=(function(){var B=/\s*,\s*/;var A=/\s*([\s>+~(),]|^|$)\s*/g;var L=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var F=/(^|\))[^\s>+~]/g;var M=/(\)|^)/;var K=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function H(R,P){P=P||document.documentElement;var S=R.split(B),X=[];for(var U=0;U<S.length;U++){var N=[P],W=G(S[U]);for(var T=0;T<W.length;){var Q=W[T++],O=W[T++],V="";if(W[T]=="("){while(W[T++]!=")"&&T<W.length){V+=W[T]}V=V.slice(0,-1)}N=I(N,Q,O,V)}X=X.concat(N)}return X}function G(N){var O=N.replace(A,"$1").replace(L,"$1*$2").replace(F,D);return O.match(K)||[]}function D(N){return N.replace(M,"$1 ")}function I(N,P,Q,O){return(H.selectors[P])?H.selectors[P](N,Q,O):[]}var E={toArray:function(O){var N=[];for(var P=0;P<O.length;P++){N.push(O[P])}return N}};var C={isTag:function(O,N){return(N=="*")||(N.toLowerCase()==O.nodeName.toLowerCase())},previousSiblingElement:function(N){do{N=N.previousSibling}while(N&&N.nodeType!=1);return N},nextSiblingElement:function(N){do{N=N.nextSibling}while(N&&N.nodeType!=1);return N},hasClass:function(N,O){return(O.className||"").match("(^|\\s)"+N+"(\\s|$)")},getByTag:function(N,O){return O.getElementsByTagName(N)}};var J={"#":function(N,P){for(var O=0;O<N.length;O++){if(N[O].getAttribute("id")==P){return[N[O]]}}return[]}," ":function(O,Q){var N=[];for(var P=0;P<O.length;P++){N=N.concat(E.toArray(C.getByTag(Q,O[P])))}return N},">":function(O,R){var N=[];for(var Q=0,S;Q<O.length;Q++){S=O[Q];for(var P=0,T;P<S.childNodes.length;P++){T=S.childNodes[P];if(T.nodeType==1&&C.isTag(T,R)){N.push(T)}}}return N},".":function(O,Q){var N=[];for(var P=0,R;P<O.length;P++){R=O[P];if(C.hasClass([Q],R)){N.push(R)}}return N},":":function(N,P,O){return(H.pseudoClasses[P])?H.pseudoClasses[P](N,O):[]}};H.selectors=J;H.pseudoClasses={};H.util=E;H.dom=C;return H})();
var dax= {src: '/flash/dax.swf'}; 
var dax_bold= {src: '/flash/daxbold.swf'}; 
sIFR.compatMode = true;
sIFR.activate(dax);
/*Cures*/
var css_h1_popup = {
	'.sIFR-root' : {'color': '#FFFFFF', 'font-size': '30px', 'font-style': 'italic'}
};
var css_h1 = {
	'.sIFR-root' : {'color': '#054e6d', 'font-style': 'italic','font-weight':'bold'}
};
var css_h2 = {
	'.sIFR-root' : {'color': '#016d95', 'font-size': '17px', 'font-style': 'italic'},
	'em' : {'color': '#666666', 'font-size': '80%'}
};
var css_h3 = {
	'.sIFR-root' : {'color': '#016d95', 'font-style': 'italic'}
};
var css_h4_reserver = {
	'.sIFR-root' : {'color': '#016d95','font-weight':'bold', 'font-style': 'italic'}
};
var css_h4_cure = {
	'.sIFR-root' : {'color': '#ffffff', 'text-transform': 'uppercase'}
};
var css_h2_cont_ongles = {
	'.sIFR-root' : {'color': '#064F6E', 'font-style': 'italic'}
};
var css_h4_cont_gris = {
	'.sIFR-root' : {'color': '#054e6d', 'text-transform': 'uppercase'}
};
var css_h4_cont_bleu = {
	'.sIFR-root' : {'color': '#ffffff', 'text-transform': 'uppercase'}
};
var css_h2_cures = {
	'.sIFR-root' : {'color': '#1188a7', 'font-style': 'italic', 'font-size' : '16px'}
};
var css_h2_cures_push = {
	'.sIFR-root' : {'color': '#1188a7', 'font-style': 'italic', 'font-size' : '15px'}
};
var css_h3_cuisine = {
	'.sIFR-root' : {'color': '#61979d', 'font-style': 'italic', 'font-weight': 'bold', 'font-size' : '16px'}
};

var css_h5_cure = {
	'.sIFR-root' : {'color': '#ffffff'}
};
/*spas*/
var css_h1_spas = {
	'.sIFR-root' : {'color': '#556984', 'font-style': 'italic','font-weight':'bold'}
};
var css_h2_spas = {
	'.sIFR-root' : {'color': '#61979d', 'font-size': '17px', 'font-style': 'italic'}
};
var css_h3_spas = {
	'.sIFR-root' : {'color': '#61979d', 'font-style': 'italic'}
};
var css_h4_cure_spas = {
	'.sIFR-root' : {'color': '#ffffff', 'text-transform': 'uppercase'}
};
var css_h2_cont_ongles_spas = {
	'.sIFR-root' : {'color': '#556984', 'font-style': 'italic'}
};
var css_h4_cont_gris_spas = {
	'.sIFR-root' : {'color': '#054e6d', 'text-transform': 'uppercase'}
};
var css_h4_cont_bleu_spas = {
	'.sIFR-root' : {'color': '#ffffff', 'text-transform': 'uppercase'}
};
var css_h5_cure_spas = {
	'.sIFR-root' : {'color': '#ffffff'}
};

/*compte*/
var css_h1_compte = {
	'.sIFR-root' : {'color': '#30b3ad', 'font-style': 'italic','font-weight':'bold'}
};
var css_h2_compte = {
	'.sIFR-root' : {'color': '#028c86', 'font-size': '17px', 'font-style': 'italic'}
};
var css_h3_compte = {
	'.sIFR-root' : {'color': '#028c86', 'font-style': 'italic'}
};

/*cadeau*/
var css_h2_cadeau = {
	'.sIFR-root' : {'color': '#028c86', 'font-size': '15px', 'font-style': 'italic', 'font-weight':'bold'}
};

/*bienfaits*/
var css_video_hp = {
	'.sIFR-root' : {'color': '#ffffff', 'font-size': '22px', 'font-style': 'italic', 'font-weight':'normal'}
};

var css_accordeon_hp = {
	'.sIFR-root' : {'color': '#1188a7', 'font-size': '15px', 'font-style': 'italic', 'font-weight':'normal'}
};
var css_titre_citation = {
	'.sIFR-root' : {'color': '#ffffff', 'font-size': '15px', 'font-style': 'italic', 'font-weight':'normal'}
};


function reinitsifr() {
	
	sIFR.replace(dax, {selector: '.bienfait div.titre-video-bienfaits', wmode:'transparent', css: css_video_hp});
	sIFR.replace(dax, {selector: '.bienfait .header-accordeon-bienfaits h2 a', wmode:'transparent', css: css_accordeon_hp});
	sIFR.replace(dax, {selector: '.bienfait #citation-titre', wmode:'transparent', css: css_titre_citation});
	
	sIFR.replace(dax, {selector: '.titre-cadeau h2.sifr', wmode:'transparent', css: css_h2_cadeau});
	sIFR.replace(dax, {selector: '#cuisine h3', wmode:'transparent', css: css_h3_cuisine});
	sIFR.replace(dax, {selector: '.popup h1.sifr', wmode:'transparent', css: css_h1_popup});
	sIFR.replace(dax, {selector: '.popup h2.sifr', wmode:'transparent', css: css_h2});
	sIFR.replace(dax, {selector: '.popup h2.sifr_compte', wmode:'transparent', css: css_h3_compte});
	sIFR.replace(dax, {selector: '.thermales h1.sifr', wmode:'transparent', css: css_h1});
	sIFR.replace(dax, {selector: '.cures h2.sifr', wmode:'transparent', css: css_h2_cures});
	sIFR.replace(dax, {selector: '.cures .push_mini_cures h2', wmode:'transparent', css: css_h2_cures_push});
	sIFR.replace(dax, {selector: '.thermales h2.sifr', wmode:'transparent', css: css_h2});
	/*sIFR.replace(dax, {selector: '.thermales h3.sifr', wmode:'transparent', css: css_h3});*/
	sIFR.replace(dax, {selector: '.thermales .article h3', wmode:'transparent', css: css_h3});
	sIFR.replace(dax, {selector: '.thermales .reserver_col h4.sifr', wmode:'transparent', css: css_h4_reserver});
	/*sIFR.replace(dax, {selector: '.thermales .txt_cure h4.sifr', wmode:'transparent', css: css_h4_cure});
	sIFR.replace(dax, {selector: '.thermales .txt_cure h5.sifr', wmode:'transparent', css: css_h5_cure});*/
	sIFR.replace(dax, {selector: '.thermales .cont_ongles h2.ongles', wmode:'transparent', css: css_h2_cont_ongles});	
	sIFR.replace(dax, {selector: '.thermales .mod_gris h4.sifr', wmode:'transparent', css: css_h4_cont_gris});	
	sIFR.replace(dax, {selector: '.thermales .mod_bleu h4.sifr', wmode:'transparent', css: css_h4_cont_bleu});	
	sIFR.replace(dax, {selector: '.spas h1.sifr', wmode:'transparent', css: css_h1_spas});
	sIFR.replace(dax, {selector: '.spas h2.sifr', wmode:'transparent', css: css_h2_spas});
	/*sIFR.replace(dax, {selector: '.spas h3.sifr', wmode:'transparent', css: css_h3_spas});*/
	sIFR.replace(dax, {selector: '.spas .article h3', wmode:'transparent', css: css_h3_spas});
	/*sIFR.replace(dax, {selector: '.spas .txt_cure h4.sifr', wmode:'transparent', css: css_h4_cure_spas});
	sIFR.replace(dax, {selector: '.spas .txt_cure h5.sifr', wmode:'transparent', css: css_h5_cure_spas});
	*/
	sIFR.replace(dax, {selector: '.spas .mod_vert h4.sifr', wmode:'transparent', css: css_h4_cont_bleu_spas});
	sIFR.replace(dax, {selector: '.spas .cont_ongles h2.ongles', wmode:'transparent', css: css_h2_cont_ongles_spas});	
	sIFR.replace(dax, {selector: '.spas .mod_gris h4.sifr', wmode:'transparent', css: css_h4_cont_gris_spas});	
	sIFR.replace(dax, {selector: '.spas .mod_gris_f h4.sifr', wmode:'transparent', css: css_h4_cont_bleu_spas});	
		
	
	sIFR.replace(dax, {selector: '.mon_compte h1.sifr', wmode:'transparent', css: css_h1_compte});
	sIFR.replace(dax, {selector: '.mon_compte h2.sifr', wmode:'transparent', css: css_h2_compte});
	sIFR.replace(dax, {selector: '.mon_compte .article h3', wmode:'transparent', css: css_h3_compte});
	
	

}
function reinitsifr_light() {
	sIFR.replace(dax, {selector: '.spas .article h3', wmode:'transparent', css: css_h3_spas});
	sIFR.replace(dax, {selector: '.spas .cont_ongles h2.ongles', wmode:'transparent', css: css_h2_cont_ongles_spas});	
	sIFR.replace(dax, {selector: '.thermales .article h3', wmode:'transparent', css: css_h3});
	sIFR.replace(dax, {selector: '.thermales .cont_ongles h2.ongles', wmode:'transparent', css: css_h2_cont_ongles});	
	
	
}
function reinitsifr_carte_thermales () {
	sIFR.replace(dax, {selector: '.txt_cure h4.sifr', wmode:'transparent', css: css_h4_cure});
	sIFR.replace(dax, {selector: '.txt_cure h5.sifr', wmode:'transparent', css: css_h5_cure});	
}
function reinitsifr_carte_spas () {
	sIFR.replace(dax, {selector: '.txt_cure h4.sifr', wmode:'transparent', css: css_h4_cure_spas});
	sIFR.replace(dax, {selector: '.txt_cure h5.sifr', wmode:'transparent', css: css_h5_cure_spas});
}



/*----------------------------------------------------------------------------- browser --------------------------------------------------------------------*/
/* detection du navigateur */
function BrowserDetectLite() {
   var ua = navigator.userAgent.toLowerCase(); 
   
   // browser name
   this.isGecko     = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isMozilla   = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   this.isIE        = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) ); 
   this.isSafari    = (ua.indexOf('safari') != - 1);
   this.isOpera     = (ua.indexOf('opera') != -1); 
   this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari); 
   this.isIcab      = (ua.indexOf('icab') != -1); 
   this.isAol       = (ua.indexOf('aol') != -1); 
   this.isFirefox   = (ua.indexOf('firefox') != -1);
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isNS && this.isGecko) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   else if (this.isOpera) {
      if (ua.indexOf('opera/') != -1) {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
      }
      else {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
      }
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isIcab) {
      if (ua.indexOf('icab/') != -1) {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
      }
      else {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
      }
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin   = (ua.indexOf('win') != -1);
   this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac   = (ua.indexOf('mac') != -1);
   this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   this.isIE7x = (this.isIE && this.versionMajor == 7);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
   
   this.isAutre   = !(this.isIE || this.isFirefox || this.isSafari);
}
browser = new BrowserDetectLite();
/*----------------------------------------------------------------------------- /browser --------------------------------------------------------------------*/

/*---------------------------------------------------------------------------- popup ------------------------------------------------------------------------*/
// ouvre une popup qui se centre; url=url de la page ; nom_fenetre = nom de la fenetre ; hauteur et largeur en chaine et sans unit
// pour une popup fixe : hauteur=hauteur du contenu(<=534px) ; largueur=largueur du contenu(<=790px)
// pour une popup plein cran : hauteur='max' ; largueur='max';
// pour une popup de hauteur 'max' , le scroll est automatique mis avec la fenetre ; le contenu de la popup <= 771px;
// prend en compte les navigateurs IE5.5, IE6, Firefox et Safari +  l'interface du systme d'exploitation (barre des taches)
// si besoin d'avoir un scroll, il faut le crer  l'intrieur de la page appele

function popup(url,nom_fenetre,largeur,hauteur,scrollbar)
{
	//alert(url)
	// ecran
	var hauteurEcran = screen.height;
	var largeurEcran = screen.width;
	if (browser.isIE)
	{
		hauteurEcran = screen.availHeight;
		largeurEcran = screen.availWidth;
	}
	
	// dimension fenetre 
	var hauteurFenetre = null;
	var largeurFenetre = null;
	
	// resolution 800 * 600
	//if(largeur!="max" && parseInt(largeur)>790){largeur=790;alert('Le contenu de la popup ne dois pas dpass 790px en largeur pour s\'afficher correctement en 800 * 600')}
	//if(hauteur!="max" && parseInt(hauteur)>534){hauteur=534;alert('Le contenu de la popup ne dois pas dpass 534px en hauteur pour s\'afficher correctement en 800 * 600')}
	
	// largeur fenetre
	if(largeur=='max')
	{
		if(browser.isIE){largeurFenetre = largeurEcran-10;}
		if(browser.isFirefox || browser.isAutre){largeurFenetre = largeurEcran-6}
		if(browser.isSafari){largeurFenetre = largeurEcran;}
	} 
	else
	{largeurFenetre =  parseInt(largeur)}
	
	// hauteur fenetre
	if(hauteur=='max')
	{
		if(browser.isIE){hauteurFenetre = hauteurEcran-36;}
		if(browser.isFirefox || browser.isAutre){hauteurFenetre = hauteurEcran;}
		if(browser.isSafari){hauteurFenetre = hauteurEcran-48}
	} 
	else
	{ 
		if(browser.isIE){hauteurFenetre = parseInt(hauteur)}
		if(browser.isFirefox || browser.isAutre){hauteurFenetre = parseInt(hauteur)}
		if(browser.isSafari){hauteurFenetre = parseInt(hauteur)+1}
	}
	
	// largueur effective fenetre
	var largeurFenetreEffective = null;
	if(browser.isIE){largeurFenetreEffective=parseInt(largeurFenetre)+10;}
	if(browser.isFirefox || browser.isAutre){largeurFenetreEffective=parseInt(largeurFenetre)+6}
	if(browser.isSafari){largeurFenetreEffective=parseInt(largeurFenetre)}
	
	// hauteur effective fenetre
	var hauteurFenetreEffective = null;
	if(browser.isIE){hauteurFenetreEffective=parseInt(hauteurFenetre)+36;}
	if(browser.isFirefox || browser.isAutre){hauteurFenetreEffective=parseInt(hauteurFenetre)+36;}
	if(browser.isSafari){hauteurFenetreEffective=parseInt(hauteurFenetre)}
	
	// position fenetre
	var top = (hauteurEcran-hauteurFenetreEffective)/2;	
	var left = (largeurEcran-largeurFenetreEffective)/2;

	// bug safari
	if(browser.isSafari && left==0){left=1}
	// fenetre
	var nouvelleFenetre=open(url,nom_fenetre,"width="+largeurFenetre+"px,height="+hauteurFenetre+"px,top="+top+"px,left="+left+"px,menubar=no,resizable=no,scrollbars="+scrollbar);
	nouvelleFenetre.focus();
}
/*--------------------------------------------------------------------------- /popup ------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------- popup_dhtml ------------------------------------------------------------------------*/
/* requis : window.js */
win = null
function popup_dhtml(url, largeur, hauteur){
	win = new Window({className:"popup", width:largeur, height:hauteur, zIndex: 100, resizable: true, minimizable:false, maximizable:false, draggable:false})
	win.setURL(url);
	
	win.showCenter(true); /* le param true est pour modal */
	
}
/*--------------------------------------------------------------------------- /popup_dhtml ------------------------------------------------------------------------*/
/*---- css ----*/
function css(chemin,media)
{
	document.write('<link href="'+chemin+'" rel="stylesheet" type="text/css" media="'+media+'"/>')
}
/*---- /css ----*/



/* ------------------------ Compatibilite_site ---------------------------------*/
Compatibilite_site = Class.create({
	   initialize: function(nom_cookie,resolution,navigateur) {
			this.nom_cookie = nom_cookie;
			this.valeur = "0";
			this.resolution = resolution;
			this.navigateur = $A(navigateur);
			this.message = null;
	   },
	   setup: function(params) {
			function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
			param_default("message_activ_cookie","Si vous souhaitez que ce message n'apparaisse qu'une seule fois, vous devez activer les cookies dans votre navigateur.\n");
			param_default("message_resolution","La rsolution par dfaut du site est optimise pour du ");
			param_default("message_resolution_2","Votre rsolution d'cran n'est pas compatible, nous vous recommandons de l'adapter  la configuration par dfaut ou plus pour une navigation confortable.");
			param_default("message_navigateur","La compatibilit du site est assure pour les navigateurs Firefox 2.x, Internet Explorer 6, Internet Explorer 7 et Safari 2.x.\nVotre navigateur ou sa version n'est pas compatible. Nous vous recommandons de tlcharger le navigateur Firefox, gratuit et compatible pour tout ordinateur,  l'adresse www.firefox.com pour profiter d'une navigation optimale.");

			this.params = params;
			
			// attributs ayant un valeur par defaut
			this.message_activ_cookie = this.params["message_activ_cookie"];
			this.message_resolution = this.params["message_resolution"];
			this.message_resolution_2 = this.params["message_resolution_2"];
			this.message_navigateur = this.params["message_navigateur"];
			this.date = this.params["date"]; // date n'a aucune valeur par defaut => cookie efface a la fin de la session

			// test compatibilite
			this.compatibilite();
	   },
	   compatibilite: function() {
		   // si le cookie n'existe pas, le message n'a jamais t affiche
		   if(!Cookie.get(this.nom_cookie))
		   {
				this.message = "";
				this.detect_resolution();
				this.detect_navigateur();
				if(this.message != "")
				{
					this.detect_cookie();
					alert(this.message)
					Cookie.set(this.nom_cookie,this.valeur,this.date);
				}
		   }
	   },
	   detect_cookie: function() {
			if(!Cookie.accept())
			{
				this.message += this.message_activ_cookie;
			}
	   },
	   detect_resolution: function() {
		   var hauteur = (this.resolution == "800") ? "600" : "780";
		   if(screen.width < this.resolution) this.message += this.message_resolution+this.resolution+"*"+hauteur+".\n"+this.message_resolution_2+"\n\n";
	   },
	   detect_navigateur: function() {
		   var accept = false;
		   for(var i=0 ; (i < this.navigateur.length && !accept); i++)
		   {
			  accept = eval("browser."+this.navigateur[i])
		   }
		   if(accept == false) this.message += this.message_navigateur+"\n\n";
	   }
});
/* ------------------------ /Compatibilite_site ---------------------------------*/


//Event.onDOMReady(loading);
//Event.observe(window,"load",loading,false);



function test(elem,bloc){
	if($(elem)){
			if($(elem).checked==true){
			//alert("oui")
			$(bloc).style.display="block";
			}
		else{
		//alert("non")
		$(bloc).style.display="none";
		}
	}
}
								
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;
// script.aculo.us effects.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
//  Mark Pilgrim (http://diveintomark.org/)
//  Martin Bialasinki
// 
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/ 

// converts rgb() and #xxx to #xxxxxx format,  
// returns self (or first argument) if not convertable  
String.prototype.parseColor = function() {  
  var color = '#';
  if(this.slice(0,4) == 'rgb(') {  
    var cols = this.slice(4,this.length-1).split(',');  
    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
  } else {  
    if(this.slice(0,1) == '#') {  
      if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
      if(this.length==7) color = this.toLowerCase();  
    }  
  }  
  return(color.length==7 ? color : (arguments[0] || this));  
}

/*--------------------------------------------------------------------------*/

Element.collectTextNodes = function(element) {  
  return $A($(element).childNodes).collect( function(node) {
    return (node.nodeType==3 ? node.nodeValue : 
      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
  }).flatten().join('');
}

Element.collectTextNodesIgnoreClass = function(element, className) {  
  return $A($(element).childNodes).collect( function(node) {
    return (node.nodeType==3 ? node.nodeValue : 
      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
        Element.collectTextNodesIgnoreClass(node, className) : ''));
  }).flatten().join('');
}

Element.setContentZoom = function(element, percent) {
  element = $(element);  
  element.setStyle({fontSize: (percent/100) + 'em'});   
  if(Prototype.Browser.WebKit) window.scrollBy(0,0);
  return element;
}

Element.getInlineOpacity = function(element){
  return $(element).style.opacity || '';
}

Element.forceRerendering = function(element) {
  try {
    element = $(element);
    var n = document.createTextNode(' ');
    element.appendChild(n);
    element.removeChild(n);
  } catch(e) { }
};

/*--------------------------------------------------------------------------*/

Array.prototype.call = function() {
  var args = arguments;
  this.each(function(f){ f.apply(this, args) });
}

/*--------------------------------------------------------------------------*/

var Effect = {
  _elementDoesNotExistError: {
    name: 'ElementDoesNotExistError',
    message: 'The specified DOM element does not exist, but is required for this effect to operate'
  },
  tagifyText: function(element) {
    if(typeof Builder == 'undefined')
      throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
      
    var tagifyStyle = 'position:relative';
    if(Prototype.Browser.IE) tagifyStyle += ';zoom:1';
    
    element = $(element);
    $A(element.childNodes).each( function(child) {
      if(child.nodeType==3) {
        child.nodeValue.toArray().each( function(character) {
          element.insertBefore(
            Builder.node('span',{style: tagifyStyle},
              character == ' ' ? String.fromCharCode(160) : character), 
              child);
        });
        Element.remove(child);
      }
    });
  },
  multiple: function(element, effect) {
    var elements;
    if(((typeof element == 'object') || 
        (typeof element == 'function')) && 
       (element.length))
      elements = element;
    else
      elements = $(element).childNodes;
      
    var options = Object.extend({
      speed: 0.1,
      delay: 0.0
    }, arguments[2] || {});
    var masterDelay = options.delay;

    $A(elements).each( function(element, index) {
      new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
    });
  },
  PAIRS: {
    'slide':  ['SlideDown','SlideUp'],
    'blind':  ['BlindDown','BlindUp'],
    'appear': ['Appear','Fade']
  },
  toggle: function(element, effect) {
    element = $(element);
    effect = (effect || 'appear').toLowerCase();
    var options = Object.extend({
      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
    }, arguments[2] || {});
    Effect[element.visible() ? 
      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
  }
};

var Effect2 = Effect; // deprecated

/* ------------- transitions ------------- */

Effect.Transitions = {
  linear: Prototype.K,
  sinoidal: function(pos) {
    return (-Math.cos(pos*Math.PI)/2) + 0.5;
  },
  reverse: function(pos) {
    return 1-pos;
  },
  flicker: function(pos) {
    var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
    return (pos > 1 ? 1 : pos);
  },
  wobble: function(pos) {
    return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
  },
  pulse: function(pos, pulses) { 
    pulses = pulses || 5; 
    return (
      Math.round((pos % (1/pulses)) * pulses) == 0 ? 
            ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : 
        1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2))
      );
  },
  none: function(pos) {
    return 0;
  },
  full: function(pos) {
    return 1;
  }
};

/* ------------- core effects ------------- */

Effect.ScopedQueue = Class.create();
Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
  initialize: function() {
    this.effects  = [];
    this.interval = null;    
  },
  _each: function(iterator) {
    this.effects._each(iterator);
  },
  add: function(effect) {
    var timestamp = new Date().getTime();
    
    var position = (typeof effect.options.queue == 'string') ? 
      effect.options.queue : effect.options.queue.position;
    
    switch(position) {
      case 'front':
        // move unstarted effects after this effect  
        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
            e.startOn  += effect.finishOn;
            e.finishOn += effect.finishOn;
          });
        break;
      case 'with-last':
        timestamp = this.effects.pluck('startOn').max() || timestamp;
        break;
      case 'end':
        // start effect after last queued effect has finished
        timestamp = this.effects.pluck('finishOn').max() || timestamp;
        break;
    }
    
    effect.startOn  += timestamp;
    effect.finishOn += timestamp;

    if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
      this.effects.push(effect);
    
    if(!this.interval)
      this.interval = setInterval(this.loop.bind(this), 15);
  },
  remove: function(effect) {
    this.effects = this.effects.reject(function(e) { return e==effect });
    if(this.effects.length == 0) {
      clearInterval(this.interval);
      this.interval = null;
    }
  },
  loop: function() {
    var timePos = new Date().getTime();
    for(var i=0, len=this.effects.length;i<len;i++) 
      this.effects[i] && this.effects[i].loop(timePos);
  }
});

Effect.Queues = {
  instances: $H(),
  get: function(queueName) {
    if(typeof queueName != 'string') return queueName;
    
    if(!this.instances[queueName])
      this.instances[queueName] = new Effect.ScopedQueue();
      
    return this.instances[queueName];
  }
}
Effect.Queue = Effect.Queues.get('global');

Effect.DefaultOptions = {
  transition: Effect.Transitions.sinoidal,
  duration:   1.0,   // seconds
  fps:        100,   // 100= assume 66fps max.
  sync:       false, // true for combining
  from:       0.0,
  to:         1.0,
  delay:      0.0,
  queue:      'parallel'
}

Effect.Base = function() {};
Effect.Base.prototype = {
  position: null,
  start: function(options) {
    function codeForEvent(options,eventName){
      return (
        (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
        (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
      );
    }
    if(options.transition === false) options.transition = Effect.Transitions.linear;
    this.options      = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});
    this.currentFrame = 0;
    this.state        = 'idle';
    this.startOn      = this.options.delay*1000;
    this.finishOn     = this.startOn+(this.options.duration*1000);
    this.fromToDelta  = this.options.to-this.options.from;
    this.totalTime    = this.finishOn-this.startOn;
    this.totalFrames  = this.options.fps*this.options.duration;
    
    eval('this.render = function(pos){ '+
      'if(this.state=="idle"){this.state="running";'+
      codeForEvent(options,'beforeSetup')+
      (this.setup ? 'this.setup();':'')+ 
      codeForEvent(options,'afterSetup')+
      '};if(this.state=="running"){'+
      'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
      'this.position=pos;'+
      codeForEvent(options,'beforeUpdate')+
      (this.update ? 'this.update(pos);':'')+
      codeForEvent(options,'afterUpdate')+
      '}}');
    
    this.event('beforeStart');
    if(!this.options.sync)
      Effect.Queues.get(typeof this.options.queue == 'string' ? 
        'global' : this.options.queue.scope).add(this);
  },
  loop: function(timePos) {
    if(timePos >= this.startOn) {
      if(timePos >= this.finishOn) {
        this.render(1.0);
        this.cancel();
        this.event('beforeFinish');
        if(this.finish) this.finish(); 
        this.event('afterFinish');
        return;  
      }
      var pos   = (timePos - this.startOn) / this.totalTime,
          frame = Math.round(pos * this.totalFrames);
      if(frame > this.currentFrame) {
        this.render(pos);
        this.currentFrame = frame;
      }
    }
  },
  cancel: function() {
    if(!this.options.sync)
      Effect.Queues.get(typeof this.options.queue == 'string' ? 
        'global' : this.options.queue.scope).remove(this);
    this.state = 'finished';
  },
  event: function(eventName) {
    if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
    if(this.options[eventName]) this.options[eventName](this);
  },
  inspect: function() {
    var data = $H();
    for(property in this)
      if(typeof this[property] != 'function') data[property] = this[property];
    return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
  }
}

Effect.Parallel = Class.create();
Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
  initialize: function(effects) {
    this.effects = effects || [];
    this.start(arguments[1]);
  },
  update: function(position) {
    this.effects.invoke('render', position);
  },
  finish: function(position) {
    this.effects.each( function(effect) {
      effect.render(1.0);
      effect.cancel();
      effect.event('beforeFinish');
      if(effect.finish) effect.finish(position);
      effect.event('afterFinish');
    });
  }
});

Effect.Event = Class.create();
Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), {
  initialize: function() {
    var options = Object.extend({
      duration: 0
    }, arguments[0] || {});
    this.start(options);
  },
  update: Prototype.emptyFunction
});

Effect.Opacity = Class.create();
Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    // make this work on IE on elements without 'layout'
    if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
      this.element.setStyle({zoom: 1});
    var options = Object.extend({
      from: this.element.getOpacity() || 0.0,
      to:   1.0
    }, arguments[1] || {});
    this.start(options);
  },
  update: function(position) {
    this.element.setOpacity(position);
  }
});

Effect.Move = Class.create();
Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      x:    0,
      y:    0,
      mode: 'relative'
    }, arguments[1] || {});
    this.start(options);
  },
  setup: function() {
    // Bug in Opera: Opera returns the "real" position of a static element or
    // relative element that does not have top/left explicitly set.
    // ==> Always set top and left for position relative elements in your stylesheets 
    // (to 0 if you do not need them) 
    this.element.makePositioned();
    this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
    this.originalTop  = parseFloat(this.element.getStyle('top')  || '0');
    if(this.options.mode == 'absolute') {
      // absolute movement, so we need to calc deltaX and deltaY
      this.options.x = this.options.x - this.originalLeft;
      this.options.y = this.options.y - this.originalTop;
    }
  },
  update: function(position) {
    this.element.setStyle({
      left: Math.round(this.options.x  * position + this.originalLeft) + 'px',
      top:  Math.round(this.options.y  * position + this.originalTop)  + 'px'
    });
  }
});

// for backwards compatibility
Effect.MoveBy = function(element, toTop, toLeft) {
  return new Effect.Move(element, 
    Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));
};

Effect.Scale = Class.create();
Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
  initialize: function(element, percent) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      scaleX: true,
      scaleY: true,
      scaleContent: true,
      scaleFromCenter: false,
      scaleMode: 'box',        // 'box' or 'contents' or {} with provided values
      scaleFrom: 100.0,
      scaleTo:   percent
    }, arguments[2] || {});
    this.start(options);
  },
  setup: function() {
    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
    this.elementPositioning = this.element.getStyle('position');
    
    this.originalStyle = {};
    ['top','left','width','height','fontSize'].each( function(k) {
      this.originalStyle[k] = this.element.style[k];
    }.bind(this));
      
    this.originalTop  = this.element.offsetTop;
    this.originalLeft = this.element.offsetLeft;
    
    var fontSize = this.element.getStyle('font-size') || '100%';
    ['em','px','%','pt'].each( function(fontSizeType) {
      if(fontSize.indexOf(fontSizeType)>0) {
        this.fontSize     = parseFloat(fontSize);
        this.fontSizeType = fontSizeType;
      }
    }.bind(this));
    
    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
    
    this.dims = null;
    if(this.options.scaleMode=='box')
      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
    if(/^content/.test(this.options.scaleMode))
      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
    if(!this.dims)
      this.dims = [this.options.scaleMode.originalHeight,
                   this.options.scaleMode.originalWidth];
  },
  update: function(position) {
    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
    if(this.options.scaleContent && this.fontSize)
      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
  },
  finish: function(position) {
    if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
  },
  setDimensions: function(height, width) {
    var d = {};
    if(this.options.scaleX) d.width = Math.round(width) + 'px';
    if(this.options.scaleY) d.height = Math.round(height) + 'px';
    if(this.options.scaleFromCenter) {
      var topd  = (height - this.dims[0])/2;
      var leftd = (width  - this.dims[1])/2;
      if(this.elementPositioning == 'absolute') {
        if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
        if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
      } else {
        if(this.options.scaleY) d.top = -topd + 'px';
        if(this.options.scaleX) d.left = -leftd + 'px';
      }
    }
    this.element.setStyle(d);
  }
});

Effect.Highlight = Class.create();
Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
    this.start(options);
  },
  setup: function() {
    // Prevent executing on elements not in the layout flow
    if(this.element.getStyle('display')=='none') { this.cancel(); return; }
    // Disable background image during the effect
    this.oldStyle = {};
    if (!this.options.keepBackgroundImage) {
      this.oldStyle.backgroundImage = this.element.getStyle('background-image');
      this.element.setStyle({backgroundImage: 'none'});
    }
    if(!this.options.endcolor)
      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
    if(!this.options.restorecolor)
      this.options.restorecolor = this.element.getStyle('background-color');
    // init color calculations
    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
  },
  update: function(position) {
    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
      return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
  },
  finish: function() {
    this.element.setStyle(Object.extend(this.oldStyle, {
      backgroundColor: this.options.restorecolor
    }));
  }
});

Effect.ScrollTo = Class.create();
Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    this.start(arguments[1] || {});
  },
  setup: function() {
    Position.prepare();
    var offsets = Position.cumulativeOffset(this.element);
    if(this.options.offset) offsets[1] += this.options.offset;
    var max = window.innerHeight ? 
      window.height - window.innerHeight :
      document.body.scrollHeight - 
        (document.documentElement.clientHeight ? 
          document.documentElement.clientHeight : document.body.clientHeight);
    this.scrollStart = Position.deltaY;
    this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
  },
  update: function(position) {
    Position.prepare();
    window.scrollTo(Position.deltaX, 
      this.scrollStart + (position*this.delta));
  }
});

/* ------------- combination effects ------------- */

Effect.Fade = function(element) {
  element = $(element);
  var oldOpacity = element.getInlineOpacity();
  var options = Object.extend({
  from: element.getOpacity() || 1.0,
  to:   0.0,
  afterFinishInternal: function(effect) { 
    if(effect.options.to!=0) return;
    effect.element.hide().setStyle({opacity: oldOpacity}); 
  }}, arguments[1] || {});
  return new Effect.Opacity(element,options);
}

Effect.Appear = function(element) {
  element = $(element);
  var options = Object.extend({
  from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
  to:   1.0,
  // force Safari to render floated elements properly
  afterFinishInternal: function(effect) {
    effect.element.forceRerendering();
  },
  beforeSetup: function(effect) {
    effect.element.setOpacity(effect.options.from).show(); 
  }}, arguments[1] || {});
  return new Effect.Opacity(element,options);
}

Effect.Puff = function(element) {
  element = $(element);
  var oldStyle = { 
    opacity: element.getInlineOpacity(), 
    position: element.getStyle('position'),
    top:  element.style.top,
    left: element.style.left,
    width: element.style.width,
    height: element.style.height
  };
  return new Effect.Parallel(
   [ new Effect.Scale(element, 200, 
      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
     Object.extend({ duration: 1.0, 
      beforeSetupInternal: function(effect) {
        Position.absolutize(effect.effects[0].element)
      },
      afterFinishInternal: function(effect) {
         effect.effects[0].element.hide().setStyle(oldStyle); }
     }, arguments[1] || {})
   );
}

Effect.BlindUp = function(element) {
  element = $(element);
  element.makeClipping();
  return new Effect.Scale(element, 0,
    Object.extend({ scaleContent: false, 
      scaleX: false, 
      restoreAfterFinish: true,
      afterFinishInternal: function(effect) {
        effect.element.hide().undoClipping();
      } 
    }, arguments[1] || {})
  );
}

Effect.BlindDown = function(element) {
  element = $(element);
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({ 
    scaleContent: false, 
    scaleX: false,
    scaleFrom: 0,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
    },  
    afterFinishInternal: function(effect) {
      effect.element.undoClipping();
    }
  }, arguments[1] || {}));
}

Effect.SwitchOff = function(element) {
  element = $(element);
  var oldOpacity = element.getInlineOpacity();
  return new Effect.Appear(element, Object.extend({
    duration: 0.4,
    from: 0,
    transition: Effect.Transitions.flicker,
    afterFinishInternal: function(effect) {
      new Effect.Scale(effect.element, 1, { 
        duration: 0.3, scaleFromCenter: true,
        scaleX: false, scaleContent: false, restoreAfterFinish: true,
        beforeSetup: function(effect) { 
          effect.element.makePositioned().makeClipping();
        },
        afterFinishInternal: function(effect) {
          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
        }
      })
    }
  }, arguments[1] || {}));
}

Effect.DropOut = function(element) {
  element = $(element);
  var oldStyle = {
    top: element.getStyle('top'),
    left: element.getStyle('left'),
    opacity: element.getInlineOpacity() };
  return new Effect.Parallel(
    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
    Object.extend(
      { duration: 0.5,
        beforeSetup: function(effect) {
          effect.effects[0].element.makePositioned(); 
        },
        afterFinishInternal: function(effect) {
          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
        } 
      }, arguments[1] || {}));
}

Effect.Shake = function(element) {
  element = $(element);
  var oldStyle = {
    top: element.getStyle('top'),
    left: element.getStyle('left') };
    return new Effect.Move(element, 
      { x:  20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
    new Effect.Move(effect.element,
      { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
        effect.element.undoPositioned().setStyle(oldStyle);
  }}) }}) }}) }}) }}) }});
}

Effect.SlideDown = function(element) {
  element = $(element).cleanWhitespace();
  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
  var oldInnerBottom = element.down().getStyle('bottom');
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({ 
    scaleContent: false, 
    scaleX: false, 
    scaleFrom: window.opera ? 0 : 1,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makePositioned();
      effect.element.down().makePositioned();
      if(window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
    },
    afterUpdateInternal: function(effect) {
      effect.element.down().setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
    },
    afterFinishInternal: function(effect) {
      effect.element.undoClipping().undoPositioned();
      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
    }, arguments[1] || {})
  );
}

Effect.SlideUp = function(element) {
  element = $(element).cleanWhitespace();
  var oldInnerBottom = element.down().getStyle('bottom');
  return new Effect.Scale(element, window.opera ? 0 : 1,
   Object.extend({ scaleContent: false, 
    scaleX: false, 
    scaleMode: 'box',
    scaleFrom: 100,
    restoreAfterFinish: true,
    beforeStartInternal: function(effect) {
      effect.element.makePositioned();
      effect.element.down().makePositioned();
      if(window.opera) effect.element.setStyle({top: ''});
      effect.element.makeClipping().show();
    },  
    afterUpdateInternal: function(effect) {
      effect.element.down().setStyle({bottom:
        (effect.dims[0] - effect.element.clientHeight) + 'px' });
    },
    afterFinishInternal: function(effect) {
      effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
      effect.element.down().undoPositioned();
    }
   }, arguments[1] || {})
  );
}

// Bug in opera makes the TD containing this element expand for a instance after finish 
Effect.Squish = function(element) {
  return new Effect.Scale(element, window.opera ? 1 : 0, { 
    restoreAfterFinish: true,
    beforeSetup: function(effect) {
      effect.element.makeClipping(); 
    },  
    afterFinishInternal: function(effect) {
      effect.element.hide().undoClipping(); 
    }
  });
}

Effect.Grow = function(element) {
  element = $(element);
  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
    scaleTransition: Effect.Transitions.sinoidal,
    opacityTransition: Effect.Transitions.full
  }, arguments[1] || {});
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    height: element.style.height,
    width: element.style.width,
    opacity: element.getInlineOpacity() };

  var dims = element.getDimensions();    
  var initialMoveX, initialMoveY;
  var moveX, moveY;
  
  switch (options.direction) {
    case 'top-left':
      initialMoveX = initialMoveY = moveX = moveY = 0; 
      break;
    case 'top-right':
      initialMoveX = dims.width;
      initialMoveY = moveY = 0;
      moveX = -dims.width;
      break;
    case 'bottom-left':
      initialMoveX = moveX = 0;
      initialMoveY = dims.height;
      moveY = -dims.height;
      break;
    case 'bottom-right':
      initialMoveX = dims.width;
      initialMoveY = dims.height;
      moveX = -dims.width;
      moveY = -dims.height;
      break;
    case 'center':
      initialMoveX = dims.width / 2;
      initialMoveY = dims.height / 2;
      moveX = -dims.width / 2;
      moveY = -dims.height / 2;
      break;
  }
  
  return new Effect.Move(element, {
    x: initialMoveX,
    y: initialMoveY,
    duration: 0.01, 
    beforeSetup: function(effect) {
      effect.element.hide().makeClipping().makePositioned();
    },
    afterFinishInternal: function(effect) {
      new Effect.Parallel(
        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
          new Effect.Scale(effect.element, 100, {
            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
        ], Object.extend({
             beforeSetup: function(effect) {
               effect.effects[0].element.setStyle({height: '0px'}).show(); 
             },
             afterFinishInternal: function(effect) {
               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
             }
           }, options)
      )
    }
  });
}

Effect.Shrink = function(element) {
  element = $(element);
  var options = Object.extend({
    direction: 'center',
    moveTransition: Effect.Transitions.sinoidal,
    scaleTransition: Effect.Transitions.sinoidal,
    opacityTransition: Effect.Transitions.none
  }, arguments[1] || {});
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    height: element.style.height,
    width: element.style.width,
    opacity: element.getInlineOpacity() };

  var dims = element.getDimensions();
  var moveX, moveY;
  
  switch (options.direction) {
    case 'top-left':
      moveX = moveY = 0;
      break;
    case 'top-right':
      moveX = dims.width;
      moveY = 0;
      break;
    case 'bottom-left':
      moveX = 0;
      moveY = dims.height;
      break;
    case 'bottom-right':
      moveX = dims.width;
      moveY = dims.height;
      break;
    case 'center':  
      moveX = dims.width / 2;
      moveY = dims.height / 2;
      break;
  }
  
  return new Effect.Parallel(
    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
    ], Object.extend({            
         beforeStartInternal: function(effect) {
           effect.effects[0].element.makePositioned().makeClipping(); 
         },
         afterFinishInternal: function(effect) {
           effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
       }, options)
  );
}

Effect.Pulsate = function(element) {
  element = $(element);
  var options    = arguments[1] || {};
  var oldOpacity = element.getInlineOpacity();
  var transition = options.transition || Effect.Transitions.sinoidal;
  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
  reverser.bind(transition);
  return new Effect.Opacity(element, 
    Object.extend(Object.extend({  duration: 2.0, from: 0,
      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
    }, options), {transition: reverser}));
}

Effect.Fold = function(element) {
  element = $(element);
  var oldStyle = {
    top: element.style.top,
    left: element.style.left,
    width: element.style.width,
    height: element.style.height };
  element.makeClipping();
  return new Effect.Scale(element, 5, Object.extend({   
    scaleContent: false,
    scaleX: false,
    afterFinishInternal: function(effect) {
    new Effect.Scale(element, 1, { 
      scaleContent: false, 
      scaleY: false,
      afterFinishInternal: function(effect) {
        effect.element.hide().undoClipping().setStyle(oldStyle);
      } });
  }}, arguments[1] || {}));
};

Effect.Morph = Class.create();
Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    if(!this.element) throw(Effect._elementDoesNotExistError);
    var options = Object.extend({
      style: {}
    }, arguments[1] || {});
    if (typeof options.style == 'string') {
      if(options.style.indexOf(':') == -1) {
        var cssText = '', selector = '.' + options.style;
        $A(document.styleSheets).reverse().each(function(styleSheet) {
          if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
          else if (styleSheet.rules) cssRules = styleSheet.rules;
          $A(cssRules).reverse().each(function(rule) {
            if (selector == rule.selectorText) {
              cssText = rule.style.cssText;
              throw $break;
            }
          });
          if (cssText) throw $break;
        });
        this.style = cssText.parseStyle();
        options.afterFinishInternal = function(effect){
          effect.element.addClassName(effect.options.style);
          effect.transforms.each(function(transform) {
            if(transform.style != 'opacity')
              effect.element.style[transform.style] = '';
          });
        }
      } else this.style = options.style.parseStyle();
    } else this.style = $H(options.style)
    this.start(options);
  },
  setup: function(){
    function parseColor(color){
      if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
      color = color.parseColor();
      return $R(0,2).map(function(i){
        return parseInt( color.slice(i*2+1,i*2+3), 16 ) 
      });
    }
    this.transforms = this.style.map(function(pair){
      var property = pair[0], value = pair[1], unit = null;

      if(value.parseColor('#zzzzzz') != '#zzzzzz') {
        value = value.parseColor();
        unit  = 'color';
      } else if(property == 'opacity') {
        value = parseFloat(value);
        if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
          this.element.setStyle({zoom: 1});
      } else if(Element.CSS_LENGTH.test(value)) {
          var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
          value = parseFloat(components[1]);
          unit = (components.length == 3) ? components[2] : null;
      }

      var originalValue = this.element.getStyle(property);
      return { 
        style: property.camelize(), 
        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
        targetValue: unit=='color' ? parseColor(value) : value,
        unit: unit
      };
    }.bind(this)).reject(function(transform){
      return (
        (transform.originalValue == transform.targetValue) ||
        (
          transform.unit != 'color' &&
          (isNaN(transform.originalValue) || isNaN(transform.targetValue))
        )
      )
    });
  },
  update: function(position) {
    var style = {}, transform, i = this.transforms.length;
    while(i--)
      style[(transform = this.transforms[i]).style] = 
        transform.unit=='color' ? '#'+
          (Math.round(transform.originalValue[0]+
            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
          (Math.round(transform.originalValue[1]+
            (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
          (Math.round(transform.originalValue[2]+
            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
        transform.originalValue + Math.round(
          ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit;
    this.element.setStyle(style, true);
  }
});

Effect.Transform = Class.create();
Object.extend(Effect.Transform.prototype, {
  initialize: function(tracks){
    this.tracks  = [];
    this.options = arguments[1] || {};
    this.addTracks(tracks);
  },
  addTracks: function(tracks){
    tracks.each(function(track){
      var data = $H(track).values().first();
      this.tracks.push($H({
        ids:     $H(track).keys().first(),
        effect:  Effect.Morph,
        options: { style: data }
      }));
    }.bind(this));
    return this;
  },
  play: function(){
    return new Effect.Parallel(
      this.tracks.map(function(track){
        var elements = [$(track.ids) || $$(track.ids)].flatten();
        return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
      }).flatten(),
      this.options
    );
  }
});

Element.CSS_PROPERTIES = $w(
  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
  'fontSize fontWeight height left letterSpacing lineHeight ' +
  'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
  'right textIndent top width wordSpacing zIndex');
  
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;

String.prototype.parseStyle = function(){
  var element = document.createElement('div');
  element.innerHTML = '<div style="' + this + '"></div>';
  var style = element.childNodes[0].style, styleRules = $H();
  
  Element.CSS_PROPERTIES.each(function(property){
    if(style[property]) styleRules[property] = style[property]; 
  });
  if(Prototype.Browser.IE && this.indexOf('opacity') > -1) {
    styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
  }
  return styleRules;
};

Element.morph = function(element, style) {
  new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {}));
  return element;
};

['getInlineOpacity','forceRerendering','setContentZoom',
 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( 
  function(f) { Element.Methods[f] = Element[f]; }
);

Element.Methods.visualEffect = function(element, effect, options) {
  s = effect.dasherize().camelize();
  effect_class = s.charAt(0).toUpperCase() + s.substring(1);
  new Effect[effect_class](element, options);
  return $(element);
};

Element.addMethods();// JavaScript Document
/* gVerifFrom */
GVerifForm = Class.create();
GVerifForm.prototype = {
		initialize: function(conteneur,ancre,fermeture_animee) {
			this.erreur ="";
			this.conteneur = $(conteneur)
			this.ancre = ancre;
			this.fermeture_animee = fermeture_animee;
			this.ligne_intro = '<span class="titre_verif_form">INFORMATIONS MAL SAISIES</span><br/><span class="intro_verif_form">Les informations suivantes sont manquantes ou erron&#233;es :</span>';
			this.liste = "";
			this.conteneur_verif = new Array;
		},
		ecrire: function(){
			this.conteneur.innerHTML = "<div>" + this.ligne_intro + this.liste + "</div>";
		},
		supprimer: function(){
			this.conteneur.innerHTML = ''
		},
		affiche: function(){
			return (this.conteneur.innerHTML == '') ? false : true
		},
		add:function(element){
			this.conteneur_verif.push(element);
		},
		traitement:function(element){
			var traitement = $A(this.conteneur_verif);
			var liste = "";
			traitement.each(function(element){
				if(element.traitement()!="")
				{
					switch(element.type)
					{
						case "select":
							liste += "<li>Veuillez "+element.intitule+".</li>";
						break;
						case "radio":
							liste += "<li>Veuillez "+element.intitule+".</li>";
						break;
						case "condition":
							liste += "<li>"+element.intitule+".</li>";
						break;
                        case "date":
                            liste += "<li>Le champ "+element.intitule+" "+element.traitement()+"</li>";
						break;
						default:
							liste += "<li>Le champ "+element.intitule+" est"+element.traitement()+"</li>";
						break;
					}
					element.changeStyle(true)
				}
			});
			// si erreur
			if(liste!="")
			{
				this.liste = "<ul>"+liste+"</ul>";

				if(this.affiche())
				{
					Element.setStyle(this.conteneur,{height:'auto'});
					this.ecrire();
				}
				else
				{
					//defixer la taille pour que la liste ne prenne pas toute sa place initiale
					this.ecrire()
					new Effect.BlindDown(this.conteneur);
				}
				// test "ancre"
				if(this.ancre!="")
				{
					Element.versPosition(this.ancre)
				}

				return false
			}
			else
			{
				if(this.affiche() && this.fermeture_animee)
				{
					Element.fixeElement(this.conteneur)
					this.supprimer();
					Effect.BlindUp(this.conteneur);
				}
				this.supprimer();
				return true
			}
		}
};
/* /gVerifFrom */

/* VerifFormTxt */
VerifFormTxt = Class.create();
VerifFormTxt.prototype = {
	initialize: function(element,intitule,obligatoire,taille_min,taille_max,carac_autorise,type) {
		this.element = $(element);
		this.intitule = intitule;
		this.valeur = $F(this.element);
		this.obligatoire = obligatoire;
		this.type=type;
		this.taille_min = taille_min;
		this.taille_max = (taille_max=='max') ? this.element.maxLength : taille_max;
		this.regex = null;
		switch (carac_autorise)
		{
			case "chiffre":
				this.carac_autorise = "0123456789";
			break;
			case "nombre":
				this.carac_autorise = "0123456789., -";
			break;
			case "date":
				this.carac_autorise = "0123456789/";
			break;
			case "tel":
				this.carac_autorise = "0123456789. -";
			break;
			case "alpha":
				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzÃ©Ã¨ÃªÃ«Ã´Ã¶Ã®Ã¯Ã Ã¢Ã¤Ã»Ã¼Ã§";
				break;
			case "alphachiffre":
				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzÃ©Ã¨ÃªÃ«Ã´Ã¶Ã®Ã¯Ã Ã¢Ã¤Ã»Ã¼Ã§0123456789";
			break;
			case "alphanombre":
				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzÃ©Ã¨ÃªÃ«Ã´Ã¶Ã®Ã¯Ã Ã¢Ã¤Ã»Ã¼Ã§0123456789., -";
			break;
			case "alpha_2":
				this.carac_autorise = "abcdefghijklmnopqrstuvwxyzÃ©Ã¨ÃªÃ«Ã´Ã¶Ã®Ã¯Ã Ã¢Ã¤Ã»Ã¼Ã§0123456789.,- '()â‚¬$Â£%[]{}&=+@?!/Â°;:*~_â€™Â§ÂµÂ¤#|`\\^Â²";
			break;
			default:
				this.carac_autorise = "";
			break;
		}
		this.type = type;
	},
	changeStyle: function(change){
		if(change)
		{
			Element.addClassName(this.element,"verif_form_erreur")
		}
		else
		{
			Element.removeClassName(this.element,"verif_form_erreur")
		}
	},
	traitement: function(){
		this.changeStyle(false)
		switch (this.type)
		{
			/* texte */
			case "texte" :
				return this.verification()
			break;

			/* email */
			case "email" :
				this.regex = /^[a-z0-9_.-]+@[a-z0-9_.-]+\.([a-z]{2,4})$/;
				return this.verification()
			break;

			/* date */
			case "date" :
				this.regex = /^([0123])([0123456789])\/([01])([0123456789])\/([012])([0123456789])([0123456789])([0123456789])$/;
				return this.verification()
			break;

			/* defaut */
			default:
				return ""
			break;
		}
	},
	verification: function(){
		var valeur_t = this.valeur.toLowerCase();
		if (valeur_t.length==0) {
			if(this.obligatoire) return " obligatoire - taille : "+this.taille_min+((this.taille_min!=this.taille_max)?" &#224; "+this.taille_max:"")+" caract&#232;res."
		}
		else {
			if (this.taille_min==this.taille_max&&valeur_t.length!=this.taille_min) return " de taille incorrecte - taille : "+this.taille_max+" caract&#232;res."
			if (this.taille_max!=0 && valeur_t.length>this.taille_max) return " trop long - taille maximum : "+this.taille_max+" caract&#232;res."
			if (valeur_t.length<this.taille_min) return " trop court - taille minimum : "+this.taille_min+" caract&#232;res."
		}

		if (this.carac_autorise=="") return "" // si rien ï¿½ vï¿½rifier renvoi ok

		for (var i=0;i<valeur_t.length;i++) {
			if (this.carac_autorise.indexOf(valeur_t.charAt(i))==-1 && valeur_t.charAt(i)!="\n" && escape(valeur_t.charAt(i))!="%0D" ) {
				return " mal renseign&#233; - caract&#232;re non autoris&#233; : "+valeur_t.charAt(i)+".";
			}
		}

		if(this.regex != null)
		{
			if(!this.regex.test(valeur_t)&&valeur_t.length!=0) {return " mal renseign&#233;."}
		}
		return ""
	}

};
/* VerifFormTxt */

/* VerifFormSelect */
VerifFormSelect = Class.create();
VerifFormSelect.prototype = {
	initialize: function(element,intitule,obligatoire,value_defaut) {
		this.element = $(element);
		this.intitule = intitule;
		this.valeur = $F(this.element);
		this.obligatoire = obligatoire;
		this.value_defaut = value_defaut
		this.type="select";
	},
	changeStyle: function(change){
		if(change)
		{
			Element.addClassName(this.element,"verif_form_erreur")
		}
		else
		{
			Element.removeClassName(this.element,"verif_form_erreur")
		}
	},
	traitement: function(){
		this.changeStyle(false)
		if(Form.Element.getValue(this.element)==this.value_defaut)
		{return "erreur"}
		return ""
	}
};
/* VerifFormSelect */

/* VerifFormRadio */
VerifFormRadio = Class.create();
VerifFormRadio.prototype = {
	initialize: function(element,intitule,obligatoire,choix) {
		this.element = $(element);
		this.intitule = intitule;
		this.obligatoire = obligatoire;
		this.type="radio";
		this.choix = choix;
	},
	changeStyle: function(change){
		if(change)
		{
			Element.addClassName(this.element,"verif_form_erreur")
		}
		else
		{
			Element.removeClassName(this.element,"verif_form_erreur")
		}
	},
	traitement: function(){
		this.changeStyle(false)
		var enfants = this.element.childNodes;
		var check = false;
		var dd = (this.choix == null)? $A(enfants) : $A(this.choix);
		dd.each(function(element){
			if($(element).type == "radio"){if($(element).checked){check = true}}
			if($(element).type == "checkbox"){if($(element).checked){check = true}}
		});
		if(check){return ""}
		return "erreur"
	}
};
/* VerifFormRadio */

/* VerifFormCondition */
VerifFormCondition = Class.create();
VerifFormCondition.prototype = {
	initialize: function(intitule,elements) {
		this.intitule = intitule;
		this.type="condition";
		this.elements = elements;
	},
	changeStyle: function(change){
		if(this.elements != null)
		{
			for(var i = 0 ; i < this.elements.length ; i++)
			{
				if(change)
				{
					Element.addClassName(this.elements[i],"verif_form_erreur")
				}
				else
				{
					Element.removeClassName(this.elements[i],"verif_form_erreur")
				}
			}
		}
	},
	traitement: function(){
		return "intitule"
	}

};
/* VerifFormCondition */

/* Checkbox_all */
Checkbox_all = Class.create();
Checkbox_all.prototype = {
	initialize: function(checkbox,checkbox_all) {
		this.checkbox = $A(checkbox);
		this.checkbox_all = checkbox_all;
		this.checkboxs = $A(checkbox);
		this.checkboxs.push(checkbox_all);

		for (var i=0 ; i < this.checkbox.length ; i++)
		{
			$(this.checkbox[i]).onclick = this.evt_check.bindAsEventListener(this);
		}

		$(this.checkbox_all).onclick = this.evf_check_all.bindAsEventListener(this);
	},
	evt_check: function(){
		var all_check = true;

		this.checkbox.each(function(element){
			if($(element).checked == false){all_check = false;}
		})

		if(all_check)
			{$(this.checkbox_all).checked = true}
		else
			{$(this.checkbox_all).checked = false}
	},
	evf_check_all: function(){
		if($(this.checkbox_all).checked)
		{
			this.checkboxs.each(function(element){
				$(element).checked = true
			})
		}
		else
		{
			this.checkboxs.each(function(element){
				$(element).checked = false
			})
		}
	}

};
/* Checkbox_all */

/* VerifDate */
VerifFormDate = Class.create();
VerifFormDate.prototype = {
initialize: function(intitule,obligatoire,jour,mois,annee,verif_date) {
    	
        this.intitule = intitule;
		this.obligatoire = obligatoire;
		this.jour = $(jour);
		this.mois = $(mois);
		this.annee = $(annee);
		var date_j = new Date();	
		this.date_aujourdhui = new Date(date_j.getFullYear(),date_j.getMonth(),date_j.getDate());
		this.type="date";
		this.verif_date = verif_date;
		this.date = ($F(this.jour).length == 2 && $F(this.jour) > 0 && $F(this.jour) < 32 && $F(this.mois).length == 2 && $F(this.mois) > 0 && $F(this.mois) < 13 && $F(this.annee).length == 4 && $F(this.annee) > 0  && $F(this.annee) < 2100) ? new Date(eval($F(this.annee)),eval($F(this.mois)-1),eval($F(this.jour))) : null;
	},
	changeStyle: function(change){
		if(change)
		{
			Element.addClassName(this.jour,"verif_form_erreur")
			Element.addClassName(this.mois,"verif_form_erreur")
			Element.addClassName(this.annee,"verif_form_erreur")
		}
		else
		{
			Element.removeClassName(this.jour,"verif_form_erreur")
			Element.removeClassName(this.mois,"verif_form_erreur")
			Element.removeClassName(this.annee,"verif_form_erreur")
		}
	},
	bissextile: function(annee) {
        var bissextile = false;
        if (annee%4 == 0) bissextile = true;
        if (annee%100 == 0) bissextile= false;
        if (annee%400 == 0) bissextile= true;
        return bissextile;
	},
	date_valide:function(){
	    // jour 31
	    if($F(this.jour) == "31" && ($F(this.mois) == "04" || $F(this.mois) == "06" ||$F(this.mois) == "09" ||$F(this.mois) == "11")){
           return false;
        }
        
        // mois fevrier
        if($F(this.mois) == "02" && ($F(this.jour) > 29 || (!this.bissextile($F(this.annee)) && $F(this.jour) == 29))){
          return false;    
        }
        
        return true;    
	},
	traitement: function(){
		this.changeStyle(false)
		
		if(this.obligatoire){
			if(!($F(this.jour).length >= 1 && $F(this.mois).length >= 1 && $F(this.annee).length >= 1)) return "est obligatoire.";
		}
		
		// si un des 3 champs est rempli
		if(($F(this.jour).length >= 1 || $F(this.mois).length >= 1 || $F(this.annee).length >= 1))
		{
			// erreur sur le format de la date
			if(this.date == null){return "est invalide."}
	        
			if(!(this.date_valide())){return "est invalide (date inexistante)."}
			
			if(this.date != null)
			{		
			    switch(this.verif_date){
				    case "avant":
    			        if(this.date.getTime() > this.date_aujourdhui.getTime())
    					{
    						return "doit Ãªtre Ã©gale ou infÃ©rieure Ã  celle d'aujourd'hui.";
    					}
    				break;
    				
    				case "apres":
    			        if(this.date.getTime() < this.date_aujourdhui.getTime())
    					{
    						return "doit Ãªtre Ã©gale ou supÃ©rieure Ã  celle d'aujourd'hui.";
    					}
    				break;
    				
    				default :
    				break; 
				}
			}
		}
		return ""
	}
};
/* VerifDate */
// Copyright (c) 2006 SÃ©bastien Gruhier (http://xilinus.com, http://itseb.com)
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// VERSION 1.3

var Window = Class.create();

Window.keepMultiModalWindow = false;
Window.hasEffectLib = (typeof Effect != 'undefined');
Window.resizeEffectDuration = 0.4;

Window.prototype = {
  // Constructor
  // Available parameters : className, blurClassName, title, minWidth, minHeight, maxWidth, maxHeight, width, height, top, left, bottom, right, resizable, zIndex, opacity, recenterAuto, wiredDrag
  //                        hideEffect, showEffect, showEffectOptions, hideEffectOptions, effectOptions, url, draggable, closable, minimizable, maximizable, parent, onload
  //                        add all callbacks (if you do not use an observer)
  //                        onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
  
  initialize: function() {
    var id;
    var optionIndex = 0;
    // For backward compatibility like win= new Window("id", {...}) instead of win = new Window({id: "id", ...})
    if (arguments.length > 0) {
      if (typeof arguments[0] == "string" ) {
        id = arguments[0];
        optionIndex = 1;
      }
      else
        id = arguments[0] ? arguments[0].id : null;
    }
    
    // Generate unique ID if not specified
    if (!id)
      id = "window_" + new Date().getTime();
      
    if ($(id))
      alert("Window " + id + " is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");

    this.options = Object.extend({
      className:         "dialog",
      blurClassName:     null,
      minWidth:          100, 
      minHeight:         20,
      resizable:         true,
      closable:          true,
      minimizable:       true,
      maximizable:       true,
      draggable:         true,
      userData:          null,
      showEffect:        (Window.hasEffectLib ? Effect.Appear : Element.show),
      hideEffect:        (Window.hasEffectLib ? Effect.Fade : Element.hide),
      showEffectOptions: {},
      hideEffectOptions: {},
      effectOptions:     null,
      parent:            document.body,
      title:             "&nbsp;",
      url:               null,
      onload:            Prototype.emptyFunction,
      width:             200,
      height:            300,
      opacity:           1,
      recenterAuto:      true,
      wiredDrag:         false,
      closeCallback:     null,
      destroyOnClose:    false,
      gridX:             1, 
      gridY:             1      
    }, arguments[optionIndex] || {});
    if (this.options.blurClassName)
      this.options.focusClassName = this.options.className;
      
    if (typeof this.options.top == "undefined" &&  typeof this.options.bottom ==  "undefined") 
      this.options.top = this._round(Math.random()*500, this.options.gridY);
    if (typeof this.options.left == "undefined" &&  typeof this.options.right ==  "undefined") 
      this.options.left = this._round(Math.random()*500, this.options.gridX);

    if (this.options.effectOptions) {
      Object.extend(this.options.hideEffectOptions, this.options.effectOptions);
      Object.extend(this.options.showEffectOptions, this.options.effectOptions);
      if (this.options.showEffect == Element.Appear)
        this.options.showEffectOptions.to = this.options.opacity;
    }
    if (Window.hasEffectLib) {
      if (this.options.showEffect == Effect.Appear)
        this.options.showEffectOptions.to = this.options.opacity;
    
      if (this.options.hideEffect == Effect.Fade)
        this.options.hideEffectOptions.from = this.options.opacity;
    }
    if (this.options.hideEffect == Element.hide)
      this.options.hideEffect = function(){ Element.hide(this.element); if (this.options.destroyOnClose) this.destroy(); }.bind(this)
    
    if (this.options.parent != document.body)  
      this.options.parent = $(this.options.parent);
      
    this.element = this._createWindow(id);       
    this.element.win = this;
    
    // Bind event listener
    this.eventMouseDown = this._initDrag.bindAsEventListener(this);
    this.eventMouseUp   = this._endDrag.bindAsEventListener(this);
    this.eventMouseMove = this._updateDrag.bindAsEventListener(this);
    this.eventOnLoad    = this._getWindowBorderSize.bindAsEventListener(this);
    this.eventMouseDownContent = this.toFront.bindAsEventListener(this);
    this.eventResize = this._recenter.bindAsEventListener(this);
 
    this.topbar = $(this.element.id + "_top");
    this.bottombar = $(this.element.id + "_bottom");
    this.content = $(this.element.id + "_content");
    
    Event.observe(this.topbar, "mousedown", this.eventMouseDown);
    Event.observe(this.bottombar, "mousedown", this.eventMouseDown);
    Event.observe(this.content, "mousedown", this.eventMouseDownContent);
    Event.observe(window, "load", this.eventOnLoad);
    Event.observe(window, "resize", this.eventResize);
    Event.observe(window, "scroll", this.eventResize);
    Event.observe(this.options.parent, "scroll", this.eventResize);
    
    if (this.options.draggable)  {
      var that = this;
      [this.topbar, this.topbar.up().previous(), this.topbar.up().next()].each(function(element) {
        element.observe("mousedown", that.eventMouseDown);
        element.addClassName("top_draggable");
      });
      [this.bottombar.up(), this.bottombar.up().previous(), this.bottombar.up().next()].each(function(element) {
        element.observe("mousedown", that.eventMouseDown);
        element.addClassName("bottom_draggable");
      });
      
    }    
    
    if (this.options.resizable) {
      this.sizer = $(this.element.id + "_sizer");
      Event.observe(this.sizer, "mousedown", this.eventMouseDown);
    }  
    
    this.useLeft = null;
    this.useTop = null;
    if (typeof this.options.left != "undefined") {
      this.element.setStyle({left: parseFloat(this.options.left) + 'px'});
      this.useLeft = true;
    }
    else {
      this.element.setStyle({right: parseFloat(this.options.right) + 'px'});
      this.useLeft = false;
    }
    
    if (typeof this.options.top != "undefined") {
      this.element.setStyle({top: parseFloat(this.options.top) + 'px'});
      this.useTop = true;
    }
    else {
      this.element.setStyle({bottom: parseFloat(this.options.bottom) + 'px'});      
      this.useTop = false;
    }
      
    this.storedLocation = null;
    
    this.setOpacity(this.options.opacity);
    if (this.options.zIndex)
      this.setZIndex(this.options.zIndex)

    if (this.options.destroyOnClose)
      this.setDestroyOnClose(true);

    this._getWindowBorderSize();
    this.width = this.options.width;
    this.height = this.options.height;
    this.visible = false;
    
    this.constraint = false;
    this.constraintPad = {top: 0, left:0, bottom:0, right:0};
    
    if (this.width && this.height)
      this.setSize(this.options.width, this.options.height);
    this.setTitle(this.options.title)
    Windows.register(this);      
  },
  
  // Destructor
  destroy: function() {
    this._notify("onDestroy");
    Event.stopObserving(this.topbar, "mousedown", this.eventMouseDown);
    Event.stopObserving(this.bottombar, "mousedown", this.eventMouseDown);
    Event.stopObserving(this.content, "mousedown", this.eventMouseDownContent);
    
    Event.stopObserving(window, "load", this.eventOnLoad);
    Event.stopObserving(window, "resize", this.eventResize);
    Event.stopObserving(window, "scroll", this.eventResize);
    
    Event.stopObserving(this.content, "load", this.options.onload);

    if (this._oldParent) {
      var content = this.getContent();
      var originalContent = null;
      for(var i = 0; i < content.childNodes.length; i++) {
        originalContent = content.childNodes[i];
        if (originalContent.nodeType == 1) 
          break;
        originalContent = null;
      }
      if (originalContent)
        this._oldParent.appendChild(originalContent);
      this._oldParent = null;
    }

    if (this.sizer)
        Event.stopObserving(this.sizer, "mousedown", this.eventMouseDown);

    if (this.options.url) 
      this.content.src = null

     if(this.iefix) 
      Element.remove(this.iefix);

    Element.remove(this.element);
    Windows.unregister(this);      
  },
    
  // Sets close callback, if it sets, it should return true to be able to close the window.
  setCloseCallback: function(callback) {
    this.options.closeCallback = callback;
  },
  
  // Gets window content
  getContent: function () {
    return this.content;
  },
  
  // Sets the content with an element id
  setContent: function(id, autoresize, autoposition) {
    var element = $(id);
    if (null == element) throw "Unable to find element '" + id + "' in DOM";
    this._oldParent = element.parentNode;

    var d = null;
    var p = null;

    if (autoresize) 
      d = Element.getDimensions(element);
    if (autoposition) 
      p = Position.cumulativeOffset(element);

    var content = this.getContent();
    // Clear HTML (and even iframe)
    this.setHTMLContent("");
    content = this.getContent();
    
    content.appendChild(element);
    element.show();
    if (autoresize) 
      this.setSize(d.width, d.height);
    if (autoposition) 
      this.setLocation(p[1] - this.heightN, p[0] - this.widthW);    
  },
  
  setHTMLContent: function(html) {
    // It was an url (iframe), recreate a div content instead of iframe content
    if (this.options.url) {
      this.content.src = null;
      this.options.url = null;
      
  	  var content ="<div id=\"" + this.getId() + "_content\" class=\"" + this.options.className + "_content\"> </div>";
      $(this.getId() +"_table_content").innerHTML = content;
      
      this.content = $(this.element.id + "_content");
    }
      
    this.getContent().innerHTML = html;
  },
  
  setAjaxContent: function(url, options, showCentered, showModal) {
    this.showFunction = showCentered ? "showCenter" : "show";
    this.showModal = showModal || false;
  
    options = options || {};

    // Clear HTML (and even iframe)
    this.setHTMLContent("");
 
    this.onComplete = options.onComplete;
    if (! this._onCompleteHandler)
      this._onCompleteHandler = this._setAjaxContent.bind(this);
    options.onComplete = this._onCompleteHandler;

    new Ajax.Request(url, options);    
    options.onComplete = this.onComplete;
  },
  
  _setAjaxContent: function(originalRequest) {
    Element.update(this.getContent(), originalRequest.responseText);
    if (this.onComplete)
      this.onComplete(originalRequest);
    this.onComplete = null;
    this[this.showFunction](this.showModal)
  },
  
  setURL: function(url) {
    // Not an url content, change div to iframe
    if (this.options.url) 
      this.content.src = null;
    this.options.url = url;
    var content= "<iframe frameborder='0' name='" + this.getId() + "_content'  id='" + this.getId() + "_content' src='" + url + "' width='" + this.width + "' height='" + this.height + "'> </iframe>";
    $(this.getId() +"_table_content").innerHTML = content;
    
    this.content = $(this.element.id + "_content");
  },

  getURL: function() {
  	return this.options.url ? this.options.url : null;
  },

  refresh: function() {
    if (this.options.url)
	    $(this.element.getAttribute('id') + '_content').src = this.options.url;
  },
  
  // Stores position/size in a cookie, by default named with window id
  setCookie: function(name, expires, path, domain, secure) {
    name = name || this.element.id;
    this.cookie = [name, expires, path, domain, secure];
    
    // Get cookie
    var value = WindowUtilities.getCookie(name)
    // If exists
    if (value) {
      var values = value.split(',');
      var x = values[0].split(':');
      var y = values[1].split(':');

      var w = parseFloat(values[2]), h = parseFloat(values[3]);
      var mini = values[4];
      var maxi = values[5];

      this.setSize(w, h);
      if (mini == "true")
        this.doMinimize = true; // Minimize will be done at onload window event
      else if (maxi == "true")
        this.doMaximize = true; // Maximize will be done at onload window event

      this.useLeft = x[0] == "l";
      this.useTop = y[0] == "t";

      this.element.setStyle(this.useLeft ? {left: x[1]} : {right: x[1]});
      this.element.setStyle(this.useTop ? {top: y[1]} : {bottom: y[1]});
    }
  },
  
  // Gets window ID
  getId: function() {
    return this.element.id;
  },
  
  // Detroys itself when closing 
  setDestroyOnClose: function() {
    this.options.destroyOnClose = true;
  },
  
  setConstraint: function(bool, padding) {
    this.constraint = bool;
    this.constraintPad = Object.extend(this.constraintPad, padding || {});
    // Reset location to apply constraint
    if (this.useTop && this.useLeft)
      this.setLocation(parseFloat(this.element.style.top), parseFloat(this.element.style.left));
  },
  
  // initDrag event

  _initDrag: function(event) {
    // No resize on minimized window
    if (Event.element(event) == this.sizer && this.isMinimized())
      return;

    // No move on maximzed window
    if (Event.element(event) != this.sizer && this.isMaximized())
      return;
      
    if (Prototype.Browser.IE && this.heightN == 0)
      this._getWindowBorderSize();
    
    // Get pointer X,Y
    this.pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
    if (this.options.wiredDrag) 
      this.currentDrag = this._createWiredElement();
    else
      this.currentDrag = this.element;
      
    // Resize
    if (Event.element(event) == this.sizer) {
      this.doResize = true;
      this.widthOrg = this.width;
      this.heightOrg = this.height;
      this.bottomOrg = parseFloat(this.element.getStyle('bottom'));
      this.rightOrg = parseFloat(this.element.getStyle('right'));
      this._notify("onStartResize");
    }
    else {
      this.doResize = false;

      // Check if click on close button, 
      var closeButton = $(this.getId() + '_close');
      if (closeButton && Position.within(closeButton, this.pointer[0], this.pointer[1])) {
        this.currentDrag = null;
        return;
      }

      this.toFront();

      if (! this.options.draggable) 
        return;
      this._notify("onStartMove");
    }    
    // Register global event to capture mouseUp and mouseMove
    Event.observe(document, "mouseup", this.eventMouseUp, false);
    Event.observe(document, "mousemove", this.eventMouseMove, false);
    
    // Add an invisible div to keep catching mouse event over iframes
    WindowUtilities.disableScreen('__invisible__', '__invisible__', this.overlayOpacity);

    // Stop selection while dragging
    document.body.ondrag = function () { return false; };
    document.body.onselectstart = function () { return false; };
    
    this.currentDrag.show();
    Event.stop(event);
  },
  
  _round: function(val, round) {
    return round == 1 ? val  : val = Math.floor(val / round) * round;
  },

  // updateDrag event
  _updateDrag: function(event) {
    var pointer =  [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];  
    var dx = pointer[0] - this.pointer[0];
    var dy = pointer[1] - this.pointer[1];
    
    // Resize case, update width/height
    if (this.doResize) {
      var w = this.widthOrg + dx;
      var h = this.heightOrg + dy;
      
      dx = this.width - this.widthOrg
      dy = this.height - this.heightOrg
      
      // Check if it's a right position, update it to keep upper-left corner at the same position
      if (this.useLeft) 
        w = this._updateWidthConstraint(w)
      else 
        this.currentDrag.setStyle({right: (this.rightOrg -dx) + 'px'});
      // Check if it's a bottom position, update it to keep upper-left corner at the same position
      if (this.useTop) 
        h = this._updateHeightConstraint(h)
      else
        this.currentDrag.setStyle({bottom: (this.bottomOrg -dy) + 'px'});
        
      this.setSize(w , h);
      this._notify("onResize");
    }
    // Move case, update top/left
    else {
      this.pointer = pointer;
      
      if (this.useLeft) {
        var left =  parseFloat(this.currentDrag.getStyle('left')) + dx;
        var newLeft = this._updateLeftConstraint(left);
        // Keep mouse pointer correct
        this.pointer[0] += newLeft-left;
        this.currentDrag.setStyle({left: newLeft + 'px'});
      }
      else 
        this.currentDrag.setStyle({right: parseFloat(this.currentDrag.getStyle('right')) - dx + 'px'});
      
      if (this.useTop) {
        var top =  parseFloat(this.currentDrag.getStyle('top')) + dy;
        var newTop = this._updateTopConstraint(top);
        // Keep mouse pointer correct
        this.pointer[1] += newTop - top;
        this.currentDrag.setStyle({top: newTop + 'px'});
      }
      else 
        this.currentDrag.setStyle({bottom: parseFloat(this.currentDrag.getStyle('bottom')) - dy + 'px'});

      this._notify("onMove");
    }
    if (this.iefix) 
      this._fixIEOverlapping(); 
      
    this._removeStoreLocation();
    Event.stop(event);
  },

   // endDrag callback
   _endDrag: function(event) {
    // Remove temporary div over iframes
     WindowUtilities.enableScreen('__invisible__');
    
    if (this.doResize)
      this._notify("onEndResize");
    else
      this._notify("onEndMove");
    
    // Release event observing
    Event.stopObserving(document, "mouseup", this.eventMouseUp,false);
    Event.stopObserving(document, "mousemove", this.eventMouseMove, false);

    Event.stop(event);
    
    this._hideWiredElement();

    // Store new location/size if need be
    this._saveCookie()
      
    // Restore selection
    document.body.ondrag = null;
    document.body.onselectstart = null;
  },

  _updateLeftConstraint: function(left) {
    if (this.constraint && this.useLeft && this.useTop) {
      var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;

      if (left < this.constraintPad.left)
        left = this.constraintPad.left;
      if (left + this.width + this.widthE + this.widthW > width - this.constraintPad.right) 
        left = width - this.constraintPad.right - this.width - this.widthE - this.widthW;
    }
    return left;
  },
  
  _updateTopConstraint: function(top) {
    if (this.constraint && this.useLeft && this.useTop) {        
      var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
      
      var h = this.height + this.heightN + this.heightS;

      if (top < this.constraintPad.top)
        top = this.constraintPad.top;
      if (top + h > height - this.constraintPad.bottom) 
        top = height - this.constraintPad.bottom - h;
    }
    return top;
  },
  
  _updateWidthConstraint: function(w) {
    if (this.constraint && this.useLeft && this.useTop) {
      var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
      var left =  parseFloat(this.element.getStyle("left"));

      if (left + w + this.widthE + this.widthW > width - this.constraintPad.right) 
        w = width - this.constraintPad.right - left - this.widthE - this.widthW;
    }
    return w;
  },
  
  _updateHeightConstraint: function(h) {
    if (this.constraint && this.useLeft && this.useTop) {
      var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
      var top =  parseFloat(this.element.getStyle("top"));

      if (top + h + this.heightN + this.heightS > height - this.constraintPad.bottom) 
        h = height - this.constraintPad.bottom - top - this.heightN - this.heightS;
    }
    return h;
  },
  
  
  // Creates HTML window code
  _createWindow: function(id) {
    var className = this.options.className;
    var win = document.createElement("div");
    win.setAttribute('id', id);
    win.className = "dialog";

    var content;
    if (this.options.url)
      content= "<iframe frameborder=\"0\" name=\"" + id + "_content\"  id=\"" + id + "_content\" src=\"" + this.options.url + "\"> </iframe>";
    else
      content ="<div id=\"" + id + "_content\" class=\"" +className + "_content\"> </div>";

    var closeDiv = this.options.closable ? "<div class='"+ className +"_close' id='"+ id +"_close' onclick='Windows.close(\""+ id +"\", event)'> </div>" : "";
    var minDiv = this.options.minimizable ? "<div class='"+ className + "_minimize' id='"+ id +"_minimize' onclick='Windows.minimize(\""+ id +"\", event)'> </div>" : "";
    var maxDiv = this.options.maximizable ? "<div class='"+ className + "_maximize' id='"+ id +"_maximize' onclick='Windows.maximize(\""+ id +"\", event)'> </div>" : "";
    var seAttributes = this.options.resizable ? "class='" + className + "_sizer' id='" + id + "_sizer'" : "class='"  + className + "_se'";
    var blank = "../themes/default/blank.gif";
    
    win.innerHTML = closeDiv + minDiv + maxDiv + "\
      <table id='"+ id +"_row1' class=\"top table_window\">\
        <tr>\
          <td class='"+ className +"_nw'></td>\
          <td class='"+ className +"_n'><div id='"+ id +"_top' class='"+ className +"_title title_window'>"+ this.options.title +"</div></td>\
          <td class='"+ className +"_ne'></td>\
        </tr>\
      </table>\
      <table id='"+ id +"_row2' class=\"mid table_window\">\
        <tr>\
          <td class='"+ className +"_w'></td>\
            <td id='"+ id +"_table_content' class='"+ className +"_content' valign='top'>" + content + "</td>\
          <td class='"+ className +"_e'></td>\
        </tr>\
      </table>\
        <table id='"+ id +"_row3' class=\"bot table_window\">\
        <tr>\
          <td class='"+ className +"_sw'></td>\
            <td class='"+ className +"_s'><div id='"+ id +"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
            <td " + seAttributes + "></td>\
        </tr>\
      </table>\
    ";
    Element.hide(win);
    this.options.parent.insertBefore(win, this.options.parent.firstChild);
    Event.observe($(id + "_content"), "load", this.options.onload);
    return win;
  },
  
  
  changeClassName: function(newClassName) {    
    var className = this.options.className;
    var id = this.getId();
    $A(["_close", "_minimize", "_maximize", "_sizer", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
    this._toggleClassName($(id + "_top"), className + "_title", newClassName + "_title");
    $$("#" + id + " td").each(function(td) {td.className = td.className.sub(className,newClassName); });
    this.options.className = newClassName;
  },
  
  _toggleClassName: function(element, oldClassName, newClassName) { 
    if (element) {
      element.removeClassName(oldClassName);
      element.addClassName(newClassName);
    }
  },
  
  // Sets window location
  setLocation: function(top, left) {
    top = this._updateTopConstraint(top);
    left = this._updateLeftConstraint(left);

    var e = this.currentDrag || this.element;
    e.setStyle({top: top + 'px'});
    e.setStyle({left: left + 'px'});

    this.useLeft = true;
    this.useTop = true;
  },
    
  getLocation: function() {
    var location = {};
    if (this.useTop)
      location = Object.extend(location, {top: this.element.getStyle("top")});
    else
      location = Object.extend(location, {bottom: this.element.getStyle("bottom")});
    if (this.useLeft)
      location = Object.extend(location, {left: this.element.getStyle("left")});
    else
      location = Object.extend(location, {right: this.element.getStyle("right")});
    
    return location;
  },
  
  // Gets window size
  getSize: function() {
    return {width: this.width, height: this.height};
  },
    
  // Sets window size
  setSize: function(width, height, useEffect) {    
    width = parseFloat(width);
    height = parseFloat(height);
    
    // Check min and max size
    if (!this.minimized && width < this.options.minWidth)
      width = this.options.minWidth;

    if (!this.minimized && height < this.options.minHeight)
      height = this.options.minHeight;
      
    if (this.options. maxHeight && height > this.options. maxHeight)
      height = this.options. maxHeight;

    if (this.options. maxWidth && width > this.options. maxWidth)
      width = this.options. maxWidth;

    
    if (this.useTop && this.useLeft && Window.hasEffectLib && Effect.ResizeWindow && useEffect) {
      new Effect.ResizeWindow(this, null, null, width, height, {duration: Window.resizeEffectDuration});
    } else {
      this.width = width;
      this.height = height;
      var e = this.currentDrag ? this.currentDrag : this.element;

      e.setStyle({width: width + this.widthW + this.widthE + "px"})
      e.setStyle({height: height  + this.heightN + this.heightS + "px"})

      // Update content size
      if (!this.currentDrag || this.currentDrag == this.element) {
        var content = $(this.element.id + '_content');
        content.setStyle({height: height  + 'px'});
        content.setStyle({width: width  + 'px'});
      }
    }
  },
  
  updateHeight: function() {
    this.setSize(this.width, this.content.scrollHeight, true);
  },
  
  updateWidth: function() {
    this.setSize(this.content.scrollWidth, this.height, true);
  },
  
  // Brings window to front
  toFront: function() {
    if (this.element.style.zIndex < Windows.maxZIndex)  
      this.setZIndex(Windows.maxZIndex + 1);
    if (this.iefix) 
      this._fixIEOverlapping(); 
  },
   
  getBounds: function(insideOnly) {
    if (! this.width || !this.height || !this.visible)  
      this.computeBounds();
    var w = this.width;
    var h = this.height;

    if (!insideOnly) {
      w += this.widthW + this.widthE;
      h += this.heightN + this.heightS;
    }
    var bounds = Object.extend(this.getLocation(), {width: w + "px", height: h + "px"});
    return bounds;
  },
      
  computeBounds: function() {
     if (! this.width || !this.height) {
      var size = WindowUtilities._computeSize(this.content.innerHTML, this.content.id, this.width, this.height, 0, this.options.className)
      if (this.height)
        this.width = size + 5
      else
        this.height = size + 5
    }

    this.setSize(this.width, this.height);
    if (this.centered)
      this._center(this.centerTop, this.centerLeft);    
  },
  
  // Displays window modal state or not
  show: function(modal) {
    this.visible = true;
    if (modal) {
      // Hack for Safari !!
      if (typeof this.overlayOpacity == "undefined") {
        var that = this;
        setTimeout(function() {that.show(modal)}, 10);
        return;
      }
      Windows.addModalWindow(this);
      
      this.modal = true;      
      this.setZIndex(Windows.maxZIndex + 1);
      Windows.unsetOverflow(this);
    }
    else    
      if (!this.element.style.zIndex) 
        this.setZIndex(Windows.maxZIndex + 1);        
      
    // To restore overflow if need be
    if (this.oldStyle)
      this.getContent().setStyle({overflow: this.oldStyle});
      
    this.computeBounds();
    
    this._notify("onBeforeShow");   
    if (this.options.showEffect != Element.show && this.options.showEffectOptions)
      this.options.showEffect(this.element, this.options.showEffectOptions);  
    else
      this.options.showEffect(this.element);  
      
    this._checkIEOverlapping();
    WindowUtilities.focusedWindow = this
    this._notify("onShow");   
  },
  
  // Displays window modal state or not at the center of the page
  showCenter: function(modal, top, left) {
    this.centered = true;
    this.centerTop = top;
    this.centerLeft = left;

    this.show(modal);
  },
  
  isVisible: function() {
    return this.visible;
  },
  
  _center: function(top, left) {    
    var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);    
    var pageSize = WindowUtilities.getPageSize(this.options.parent);    
    if (typeof top == "undefined")
      top = (pageSize.windowHeight - (this.height + this.heightN + this.heightS))/2;
    top += windowScroll.top
    
    if (typeof left == "undefined")
      left = (pageSize.windowWidth - (this.width + this.widthW + this.widthE))/2;
    left += windowScroll.left      
    this.setLocation(top, left);
    this.toFront();
  },
  
  _recenter: function(event) {     
    if (this.centered) {
      var pageSize = WindowUtilities.getPageSize(this.options.parent);
      var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);    

      // Check for this stupid IE that sends dumb events
      if (this.pageSize && this.pageSize.windowWidth == pageSize.windowWidth && this.pageSize.windowHeight == pageSize.windowHeight && 
          this.windowScroll.left == windowScroll.left && this.windowScroll.top == windowScroll.top) 
        return;
      this.pageSize = pageSize;
      this.windowScroll = windowScroll;
      // set height of Overlay to take up whole page and show
      if ($('overlay_modal')) 
        $('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')});
      
      if (this.options.recenterAuto)
        this._center(this.centerTop, this.centerLeft);    
    }
  },
  
  // Hides window
  hide: function() {
    this.visible = false;
    if (this.modal) {
      Windows.removeModalWindow(this);
      Windows.resetOverflow();
    }
    // To avoid bug on scrolling bar
    this.oldStyle = this.getContent().getStyle('overflow') || "auto"
    this.getContent().setStyle({overflow: "hidden"});

    this.options.hideEffect(this.element, this.options.hideEffectOptions);  

     if(this.iefix) 
      this.iefix.hide();

    if (!this.doNotNotifyHide)
      this._notify("onHide");
  },

  close: function() {
    // Asks closeCallback if exists
    if (this.visible) {
      if (this.options.closeCallback && ! this.options.closeCallback(this)) 
        return;

      if (this.options.destroyOnClose) {
        var destroyFunc = this.destroy.bind(this);
        if (this.options.hideEffectOptions.afterFinish) {
          var func = this.options.hideEffectOptions.afterFinish;
          this.options.hideEffectOptions.afterFinish = function() {func();destroyFunc() }
        }
        else 
          this.options.hideEffectOptions.afterFinish = function() {destroyFunc() }
      }
      Windows.updateFocusedWindow();
      
      this.doNotNotifyHide = true;
      this.hide();
      this.doNotNotifyHide = false;
      this._notify("onClose");
    }
  },
  
  minimize: function() {
    if (this.resizing)
      return;
    
    var r2 = $(this.getId() + "_row2");
    
    if (!this.minimized) {
      this.minimized = true;

      var dh = r2.getDimensions().height;
      this.r2Height = dh;
      var h  = this.element.getHeight() - dh;

      if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
        new Effect.ResizeWindow(this, null, null, null, this.height -dh, {duration: Window.resizeEffectDuration});
      } else  {
        this.height -= dh;
        this.element.setStyle({height: h + "px"});
        r2.hide();
      }

      if (! this.useTop) {
        var bottom = parseFloat(this.element.getStyle('bottom'));
        this.element.setStyle({bottom: (bottom + dh) + 'px'});
      }
    } 
    else {      
      this.minimized = false;
      
      var dh = this.r2Height;
      this.r2Height = null;
      if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
        new Effect.ResizeWindow(this, null, null, null, this.height + dh, {duration: Window.resizeEffectDuration});
      }
      else {
        var h  = this.element.getHeight() + dh;
        this.height += dh;
        this.element.setStyle({height: h + "px"})
        r2.show();
      }
      if (! this.useTop) {
        var bottom = parseFloat(this.element.getStyle('bottom'));
        this.element.setStyle({bottom: (bottom - dh) + 'px'});
      }
      this.toFront();
    }
    this._notify("onMinimize");
    
    // Store new location/size if need be
    this._saveCookie()
  },
  
  maximize: function() {
    if (this.isMinimized() || this.resizing)
      return;
  
    if (Prototype.Browser.IE && this.heightN == 0)
      this._getWindowBorderSize();
      
    if (this.storedLocation != null) {
      this._restoreLocation();
      if(this.iefix) 
        this.iefix.hide();
    }
    else {
      this._storeLocation();
      Windows.unsetOverflow(this);
      
      var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
      var pageSize = WindowUtilities.getPageSize(this.options.parent);    
      var left = windowScroll.left;
      var top = windowScroll.top;
      
      if (this.options.parent != document.body) {
        windowScroll =  {top:0, left:0, bottom:0, right:0};
        var dim = this.options.parent.getDimensions();
        pageSize.windowWidth = dim.width;
        pageSize.windowHeight = dim.height;
        top = 0; 
        left = 0;
      }
      
      if (this.constraint) {
        pageSize.windowWidth -= Math.max(0, this.constraintPad.left) + Math.max(0, this.constraintPad.right);
        pageSize.windowHeight -= Math.max(0, this.constraintPad.top) + Math.max(0, this.constraintPad.bottom);
        left +=  Math.max(0, this.constraintPad.left);
        top +=  Math.max(0, this.constraintPad.top);
      }
      
      var width = pageSize.windowWidth - this.widthW - this.widthE;
      var height= pageSize.windowHeight - this.heightN - this.heightS;

      if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
        new Effect.ResizeWindow(this, top, left, width, height, {duration: Window.resizeEffectDuration});
      }
      else {
        this.setSize(width, height);
        this.element.setStyle(this.useLeft ? {left: left} : {right: left});
        this.element.setStyle(this.useTop ? {top: top} : {bottom: top});
      }
        
      this.toFront();
      if (this.iefix) 
        this._fixIEOverlapping(); 
    }
    this._notify("onMaximize");

    // Store new location/size if need be
    this._saveCookie()
  },
  
  isMinimized: function() {
    return this.minimized;
  },
  
  isMaximized: function() {
    return (this.storedLocation != null);
  },
  
  setOpacity: function(opacity) {
    if (Element.setOpacity)
      Element.setOpacity(this.element, opacity);
  },
  
  setZIndex: function(zindex) {
    this.element.setStyle({zIndex: zindex});
    Windows.updateZindex(zindex, this);
  },

  setTitle: function(newTitle) {
    if (!newTitle || newTitle == "") 
      newTitle = "&nbsp;";
      
    Element.update(this.element.id + '_top', newTitle);
  },
   
  getTitle: function() {
    return $(this.element.id + '_top').innerHTML;
  },
  
  setStatusBar: function(element) {
    var statusBar = $(this.getId() + "_bottom");

    if (typeof(element) == "object") {
      if (this.bottombar.firstChild)
        this.bottombar.replaceChild(element, this.bottombar.firstChild);
      else
        this.bottombar.appendChild(element);
    }
    else
      this.bottombar.innerHTML = element;
  },

  _checkIEOverlapping: function() {
    if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (this.element.getStyle('position')=='absolute')) {
        new Insertion.After(this.element.id, '<iframe id="' + this.element.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
        this.iefix = $(this.element.id+'_iefix');
    }
    if(this.iefix) 
      setTimeout(this._fixIEOverlapping.bind(this), 50);
  },

  _fixIEOverlapping: function() {
      Position.clone(this.element, this.iefix);
      this.iefix.style.zIndex = this.element.style.zIndex - 1;
      this.iefix.show();
  },
  
  _getWindowBorderSize: function(event) {
    // Hack to get real window border size!!
    var div = this._createHiddenDiv(this.options.className + "_n")
    this.heightN = Element.getDimensions(div).height;    
    div.parentNode.removeChild(div)

    var div = this._createHiddenDiv(this.options.className + "_s")
    this.heightS = Element.getDimensions(div).height;    
    div.parentNode.removeChild(div)

    var div = this._createHiddenDiv(this.options.className + "_e")
    this.widthE = Element.getDimensions(div).width;    
    div.parentNode.removeChild(div)

    var div = this._createHiddenDiv(this.options.className + "_w")
    this.widthW = Element.getDimensions(div).width;
    div.parentNode.removeChild(div);
    
    var div = document.createElement("div");
    div.className = "overlay_" + this.options.className ;
    document.body.appendChild(div);
    //alert("no timeout:\nopacity: " + div.getStyle("opacity") + "\nwidth: " + document.defaultView.getComputedStyle(div, null).width);
    var that = this;
    
    // Workaround for Safari!!
    setTimeout(function() {that.overlayOpacity = ($(div).getStyle("opacity")); div.parentNode.removeChild(div);}, 10);
    
    // Workaround for IE!!
    if (Prototype.Browser.IE) {
      this.heightS = $(this.getId() +"_row3").getDimensions().height;
      this.heightN = $(this.getId() +"_row1").getDimensions().height;
    }

    // Safari size fix
    if (Prototype.Browser.WebKit && Prototype.Browser.WebKitVersion < 420)
      this.setSize(this.width, this.height);
    if (this.doMaximize)
      this.maximize();
    if (this.doMinimize)
      this.minimize();
  },
 
  _createHiddenDiv: function(className) {
    var objBody = document.body;
    var win = document.createElement("div");
    win.setAttribute('id', this.element.id+ "_tmp");
    win.className = className;
    win.style.display = 'none';
    win.innerHTML = '';
    objBody.insertBefore(win, objBody.firstChild);
    return win;
  },
  
  _storeLocation: function() {
    if (this.storedLocation == null) {
      this.storedLocation = {useTop: this.useTop, useLeft: this.useLeft, 
                             top: this.element.getStyle('top'), bottom: this.element.getStyle('bottom'),
                             left: this.element.getStyle('left'), right: this.element.getStyle('right'),
                             width: this.width, height: this.height };
    }
  },
  
  _restoreLocation: function() {
    if (this.storedLocation != null) {
      this.useLeft = this.storedLocation.useLeft;
      this.useTop = this.storedLocation.useTop;
      
      if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow)
        new Effect.ResizeWindow(this, this.storedLocation.top, this.storedLocation.left, this.storedLocation.width, this.storedLocation.height, {duration: Window.resizeEffectDuration});
      else {
        this.element.setStyle(this.useLeft ? {left: this.storedLocation.left} : {right: this.storedLocation.right});
        this.element.setStyle(this.useTop ? {top: this.storedLocation.top} : {bottom: this.storedLocation.bottom});
        this.setSize(this.storedLocation.width, this.storedLocation.height);
      }
      
      Windows.resetOverflow();
      this._removeStoreLocation();
    }
  },
  
  _removeStoreLocation: function() {
    this.storedLocation = null;
  },
  
  _saveCookie: function() {
    if (this.cookie) {
      var value = "";
      if (this.useLeft)
        value += "l:" +  (this.storedLocation ? this.storedLocation.left : this.element.getStyle('left'))
      else
        value += "r:" + (this.storedLocation ? this.storedLocation.right : this.element.getStyle('right'))
      if (this.useTop)
        value += ",t:" + (this.storedLocation ? this.storedLocation.top : this.element.getStyle('top'))
      else
        value += ",b:" + (this.storedLocation ? this.storedLocation.bottom :this.element.getStyle('bottom'))
        
      value += "," + (this.storedLocation ? this.storedLocation.width : this.width);
      value += "," + (this.storedLocation ? this.storedLocation.height : this.height);
      value += "," + this.isMinimized();
      value += "," + this.isMaximized();
      WindowUtilities.setCookie(value, this.cookie)
    }
  },
  
  _createWiredElement: function() {
    if (! this.wiredElement) {
      if (Prototype.Browser.IE)
        this._getWindowBorderSize();
      var div = document.createElement("div");
      div.className = "wired_frame " + this.options.className + "_wired_frame";
      
      div.style.position = 'absolute';
      this.options.parent.insertBefore(div, this.options.parent.firstChild);
      this.wiredElement = $(div);
    }
    if (this.useLeft) 
      this.wiredElement.setStyle({left: this.element.getStyle('left')});
    else 
      this.wiredElement.setStyle({right: this.element.getStyle('right')});
      
    if (this.useTop) 
      this.wiredElement.setStyle({top: this.element.getStyle('top')});
    else 
      this.wiredElement.setStyle({bottom: this.element.getStyle('bottom')});

    var dim = this.element.getDimensions();
    this.wiredElement.setStyle({width: dim.width + "px", height: dim.height +"px"});

    this.wiredElement.setStyle({zIndex: Windows.maxZIndex+30});
    return this.wiredElement;
  },
  
  _hideWiredElement: function() {
    if (! this.wiredElement || ! this.currentDrag)
      return;
    if (this.currentDrag == this.element) 
      this.currentDrag = null;
    else {
      if (this.useLeft) 
        this.element.setStyle({left: this.currentDrag.getStyle('left')});
      else 
        this.element.setStyle({right: this.currentDrag.getStyle('right')});

      if (this.useTop) 
        this.element.setStyle({top: this.currentDrag.getStyle('top')});
      else 
        this.element.setStyle({bottom: this.currentDrag.getStyle('bottom')});

      this.currentDrag.hide();
      this.currentDrag = null;
      if (this.doResize)
        this.setSize(this.width, this.height);
    } 
  },
  
  _notify: function(eventName) {
    if (this.options[eventName])
      this.options[eventName](this);
    else
      Windows.notify(eventName, this);
  }
};

// Windows containers, register all page windows
var Windows = {
  windows: [],
  modalWindows: [],
  observers: [],
  focusedWindow: null,
  maxZIndex: 0,
  overlayShowEffectOptions: {duration: 0.5},
  overlayHideEffectOptions: {duration: 0.5},

  addObserver: function(observer) {
    this.removeObserver(observer);
    this.observers.push(observer);
  },
  
  removeObserver: function(observer) {  
    this.observers = this.observers.reject( function(o) { return o==observer });
  },
  
  // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
  notify: function(eventName, win) {  
    this.observers.each( function(o) {if(o[eventName]) o[eventName](eventName, win);});
  },

  // Gets window from its id
  getWindow: function(id) {
    return this.windows.detect(function(d) { return d.getId() ==id });
  },

  // Gets the last focused window
  getFocusedWindow: function() {
    return this.focusedWindow;
  },

  updateFocusedWindow: function() {
    this.focusedWindow = this.windows.length >=2 ? this.windows[this.windows.length-2] : null;    
  },
  
  // Registers a new window (called by Windows constructor)
  register: function(win) {
    this.windows.push(win);
  },
    
  // Add a modal window in the stack
  addModalWindow: function(win) {
    // Disable screen if first modal window
    if (this.modalWindows.length == 0) {
      WindowUtilities.disableScreen(win.options.className, 'overlay_modal', win.overlayOpacity, win.getId(), win.options.parent);
    }
    else {
      // Move overlay over all windows
      if (Window.keepMultiModalWindow) {
        $('overlay_modal').style.zIndex = Windows.maxZIndex + 1;
        Windows.maxZIndex += 1;
        WindowUtilities._hideSelect(this.modalWindows.last().getId());
      }
      // Hide current modal window
      else
        this.modalWindows.last().element.hide();
      // Fucking IE select issue
      WindowUtilities._showSelect(win.getId());
    }      
    this.modalWindows.push(win);    
  },
  
  removeModalWindow: function(win) {
    this.modalWindows.pop();
    
    // No more modal windows
    if (this.modalWindows.length == 0)
      WindowUtilities.enableScreen();     
    else {
      if (Window.keepMultiModalWindow) {
        this.modalWindows.last().toFront();
        WindowUtilities._showSelect(this.modalWindows.last().getId());        
      }
      else
        this.modalWindows.last().element.show();
    }
  },
  
  // Registers a new window (called by Windows constructor)
  register: function(win) {
    this.windows.push(win);
  },
  
  // Unregisters a window (called by Windows destructor)
  unregister: function(win) {
    this.windows = this.windows.reject(function(d) { return d==win });
  }, 
  
  // Closes all windows
  closeAll: function() {  
    this.windows.each( function(w) {Windows.close(w.getId())} );
  },
  
  closeAllModalWindows: function() {
    WindowUtilities.enableScreen();     
    this.modalWindows.each( function(win) {if (win) win.close()});    
  },

  // Minimizes a window with its id
  minimize: function(id, event) {
    var win = this.getWindow(id)
    if (win && win.visible)
      win.minimize();
    Event.stop(event);
  },
  
  // Maximizes a window with its id
  maximize: function(id, event) {
    var win = this.getWindow(id)
    if (win && win.visible)
      win.maximize();
    Event.stop(event);
  },

  // Closes a window with its id
  close: function(id, event) {
    var win = this.getWindow(id);
    if (win) 
      win.close();
    if (event)
      Event.stop(event);
  },
  
  blur: function(id) {
    var win = this.getWindow(id);  
    if (!win)
      return;
    if (win.options.blurClassName)
      win.changeClassName(win.options.blurClassName);
    if (this.focusedWindow == win)  
      this.focusedWindow = null;
    win._notify("onBlur");  
  },
  
  focus: function(id) {
    var win = this.getWindow(id);  
    if (!win)
      return;       
    if (this.focusedWindow)
      this.blur(this.focusedWindow.getId())

    if (win.options.focusClassName)
      win.changeClassName(win.options.focusClassName);  
    this.focusedWindow = win;
    win._notify("onFocus");
  },
  
  unsetOverflow: function(except) {    
    this.windows.each(function(d) { d.oldOverflow = d.getContent().getStyle("overflow") || "auto" ; d.getContent().setStyle({overflow: "hidden"}) });
    if (except && except.oldOverflow)
      except.getContent().setStyle({overflow: except.oldOverflow});
  },

  resetOverflow: function() {
    this.windows.each(function(d) { if (d.oldOverflow) d.getContent().setStyle({overflow: d.oldOverflow}) });
  },

  updateZindex: function(zindex, win) { 
    if (zindex > this.maxZIndex) {   
      this.maxZIndex = zindex;    
      if (this.focusedWindow) 
        this.blur(this.focusedWindow.getId())
    }
    this.focusedWindow = win;
    if (this.focusedWindow) 
      this.focus(this.focusedWindow.getId())
  }
};

var Dialog = {
  dialogId: null,
  onCompleteFunc: null,
  callFunc: null, 
  parameters: null, 
    
  confirm: function(content, parameters) {
    // Get Ajax return before
    if (content && typeof content != "string") {
      Dialog._runAjaxRequest(content, parameters, Dialog.confirm);
      return 
    }
    content = content || "";
    
    parameters = parameters || {};
    var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
    var cancelLabel = parameters.cancelLabel ? parameters.cancelLabel : "Cancel";

    // Backward compatibility
    parameters = Object.extend(parameters, parameters.windowParameters || {});
    parameters.windowParameters = parameters.windowParameters || {};

    parameters.className = parameters.className || "alert";

    var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'" 
    var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'" 
    var content = "\
      <div class='" + parameters.className + "_message'>" + content  + "</div>\
        <div class='" + parameters.className + "_buttons'>\
          <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
          <input type='button' value='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "/>\
        </div>\
    ";
    return this._openDialog(content, parameters)
  },
  
  alert: function(content, parameters) {
    // Get Ajax return before
    if (content && typeof content != "string") {
      Dialog._runAjaxRequest(content, parameters, Dialog.alert);
      return 
    }
    content = content || "";
    
    parameters = parameters || {};
    var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";

    // Backward compatibility    
    parameters = Object.extend(parameters, parameters.windowParameters || {});
    parameters.windowParameters = parameters.windowParameters || {};
    
    parameters.className = parameters.className || "alert";
    
    var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'" 
    var content = "\
      <div class='" + parameters.className + "_message'>" + content  + "</div>\
        <div class='" + parameters.className + "_buttons'>\
          <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
        </div>";                  
    return this._openDialog(content, parameters)
  },
  
  info: function(content, parameters) {   
    // Get Ajax return before
    if (content && typeof content != "string") {
      Dialog._runAjaxRequest(content, parameters, Dialog.info);
      return 
    }
    content = content || "";
     
    // Backward compatibility
    parameters = parameters || {};
    parameters = Object.extend(parameters, parameters.windowParameters || {});
    parameters.windowParameters = parameters.windowParameters || {};
    
    parameters.className = parameters.className || "alert";
    
    var content = "<div id='modal_dialog_message' class='" + parameters.className + "_message'>" + content  + "</div>";
    if (parameters.showProgress)
      content += "<div id='modal_dialog_progress' class='" + parameters.className + "_progress'>  </div>";

    parameters.ok = null;
    parameters.cancel = null;
    
    return this._openDialog(content, parameters)
  },
  
  setInfoMessage: function(message) {
    $('modal_dialog_message').update(message);
  },
  
  closeInfo: function() {
    Windows.close(this.dialogId);
  },
  
  _openDialog: function(content, parameters) {
    var className = parameters.className;
    
    if (! parameters.height && ! parameters.width) {
      parameters.width = WindowUtilities.getPageSize(parameters.options.parent || document.body).pageWidth / 2;
    }
    if (parameters.id)
      this.dialogId = parameters.id;
    else { 
      var t = new Date();
      this.dialogId = 'modal_dialog_' + t.getTime();
      parameters.id = this.dialogId;
    }

    // compute height or width if need be
    if (! parameters.height || ! parameters.width) {
      var size = WindowUtilities._computeSize(content, this.dialogId, parameters.width, parameters.height, 5, className)
      if (parameters.height)
        parameters.width = size + 5
      else
        parameters.height = size + 5
    }
    parameters.effectOptions = parameters.effectOptions ;
    parameters.resizable   = parameters.resizable || false;
    parameters.minimizable = parameters.minimizable || false;
    parameters.maximizable = parameters.maximizable ||  false;
    parameters.draggable   = parameters.draggable || false;
    parameters.closable    = parameters.closable || false;
    
    var win = new Window(parameters);
    win.getContent().innerHTML = content;
    
    win.showCenter(true, parameters.top, parameters.left);  
    win.setDestroyOnClose();
    
    win.cancelCallback = parameters.onCancel || parameters.cancel; 
    win.okCallback = parameters.onOk || parameters.ok;
    
    return win;    
  },
  
  _getAjaxContent: function(originalRequest)  {
      Dialog.callFunc(originalRequest.responseText, Dialog.parameters)
  },
  
  _runAjaxRequest: function(message, parameters, callFunc) {
    if (message.options == null)
      message.options = {}  
    Dialog.onCompleteFunc = message.options.onComplete;
    Dialog.parameters = parameters;
    Dialog.callFunc = callFunc;
    
    message.options.onComplete = Dialog._getAjaxContent;
    new Ajax.Request(message.url, message.options);
  },
  
  okCallback: function() {
    var win = Windows.focusedWindow;
    if (!win.okCallback || win.okCallback(win)) {
      // Remove onclick on button
      $$("#" + win.getId()+" input").each(function(element) {element.onclick=null;})
      win.close();
    }
  },

  cancelCallback: function() {
    var win = Windows.focusedWindow;
    // Remove onclick on button
    $$("#" + win.getId()+" input").each(function(element) {element.onclick=null})
    win.close();
    if (win.cancelCallback)
      win.cancelCallback(win);
  }
}
/*
  Based on Lightbox JS: Fullsize Image Overlays 
  by Lokesh Dhakar - http://www.huddletogether.com

  For more information on this script, visit:
  http://huddletogether.com/projects/lightbox/

  Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
  (basically, do anything you want, just leave my name and link)
*/

if (Prototype.Browser.WebKit) {
  var array = navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));
  Prototype.Browser.WebKitVersion = parseFloat(array[1]);
}

var WindowUtilities = {  
  // From dragdrop.js
  getWindowScroll: function(parent) {
    var T, L, W, H;
    parent = parent || document.body;              
    if (parent != document.body) {
      T = parent.scrollTop;
      L = parent.scrollLeft;
      W = parent.scrollWidth;
      H = parent.scrollHeight;
    } 
    else {
      var w = window;
      with (w.document) {
        if (w.document.documentElement && documentElement.scrollTop) {
          T = documentElement.scrollTop;
          L = documentElement.scrollLeft;
        } else if (w.document.body) {
          T = body.scrollTop;
          L = body.scrollLeft;
        }
        if (w.innerWidth) {
          W = w.innerWidth;
          H = w.innerHeight;
        } else if (w.document.documentElement && documentElement.clientWidth) {
          W = documentElement.clientWidth;
          H = documentElement.clientHeight;
        } else {
          W = body.offsetWidth;
          H = body.offsetHeight
        }
      }
    }
    return { top: T, left: L, width: W, height: H };
  }, 
  //
  // getPageSize()
  // Returns array with page width, height and window width, height
  // Core code from - quirksmode.org
  // Edit for Firefox by pHaez
  //
  getPageSize: function(parent){
    parent = parent || document.body;              
    var windowWidth, windowHeight;
    var pageHeight, pageWidth;
    if (parent != document.body) {
      windowWidth = parent.getWidth();
      windowHeight = parent.getHeight();                                
      pageWidth = parent.scrollWidth;
      pageHeight = parent.scrollHeight;                                
    } 
    else {
      var xScroll, yScroll;

      if (window.innerHeight && window.scrollMaxY) {  
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
      } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
      } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
      }


      if (self.innerHeight) {  // all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
      } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
      } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
      }  

      // for small pages with total height less then height of the viewport
      if(yScroll < windowHeight){
        pageHeight = windowHeight;
      } else { 
        pageHeight = yScroll;
      }

      // for small pages with total width less then width of the viewport
      if(xScroll < windowWidth){  
        pageWidth = windowWidth;
      } else {
        pageWidth = xScroll;
      }
    }             
    return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};
  },

  disableScreen: function(className, overlayId, overlayOpacity, contentId, parent) {
    WindowUtilities.initLightbox(overlayId, className, function() {this._disableScreen(className, overlayId, overlayOpacity, contentId)}.bind(this), parent || document.body);
  },

  _disableScreen: function(className, overlayId, overlayOpacity, contentId) {
    // prep objects
    var objOverlay = $(overlayId);

    var pageSize = WindowUtilities.getPageSize(objOverlay.parentNode);

    // Hide select boxes as they will 'peek' through the image in IE, store old value
    if (contentId && Prototype.Browser.IE) {
      WindowUtilities._hideSelect();
      WindowUtilities._showSelect(contentId);
    }  
  
    // set height of Overlay to take up whole page and show
    objOverlay.style.height = (pageSize.pageHeight + 'px');
    objOverlay.style.display = 'none'; 
    if (overlayId == "overlay_modal" && Window.hasEffectLib && Windows.overlayShowEffectOptions) {
      objOverlay.overlayOpacity = overlayOpacity;
      new Effect.Appear(objOverlay, Object.extend({from: 0, to: overlayOpacity}, Windows.overlayShowEffectOptions));
    }
    else
      objOverlay.style.display = "block";
  },
  
  enableScreen: function(id) {
    id = id || 'overlay_modal';
    var objOverlay =  $(id);
    if (objOverlay) {
      // hide lightbox and overlay
      if (id == "overlay_modal" && Window.hasEffectLib && Windows.overlayHideEffectOptions)
        new Effect.Fade(objOverlay, Object.extend({from: objOverlay.overlayOpacity, to:0}, Windows.overlayHideEffectOptions));
      else {
        objOverlay.style.display = 'none';
        objOverlay.parentNode.removeChild(objOverlay);
      }
      
      // make select boxes visible using old value
      if (id != "__invisible__") 
        WindowUtilities._showSelect();
    }
  },

  _hideSelect: function(id) {
    if (Prototype.Browser.IE) {
      id = id ==  null ? "" : "#" + id + " ";
      $$(id + 'select').each(function(element) {
        if (! WindowUtilities.isDefined(element.oldVisibility)) {
          element.oldVisibility = element.style.visibility ? element.style.visibility : "visible";
          element.style.visibility = "hidden";
        }
      });
    }
  },
  
  _showSelect: function(id) {
    if (Prototype.Browser.IE) {
      id = id ==  null ? "" : "#" + id + " ";
      $$(id + 'select').each(function(element) {
        if (WindowUtilities.isDefined(element.oldVisibility)) {
          // Why?? Ask IE
          try {
            element.style.visibility = element.oldVisibility;
          } catch(e) {
            element.style.visibility = "visible";
          }
          element.oldVisibility = null;
        }
        else {
          if (element.style.visibility)
            element.style.visibility = "visible";
        }
      });
    }
  },

  isDefined: function(object) {
    return typeof(object) != "undefined" && object != null;
  },
  
  // initLightbox()
  // Function runs on window load, going through link tags looking for rel="lightbox".
  // These links receive onclick events that enable the lightbox display for their targets.
  // The function also inserts html markup at the top of the page which will be used as a
  // container for the overlay pattern and the inline image.
  initLightbox: function(id, className, doneHandler, parent) {
    // Already done, just update zIndex
    if ($(id)) {
      Element.setStyle(id, {zIndex: Windows.maxZIndex + 1});
      Windows.maxZIndex++;
      doneHandler();
    }
    // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
    else {
      var objOverlay = document.createElement("div");
      objOverlay.setAttribute('id', id);
      objOverlay.className = "overlay_" + className
      objOverlay.style.display = 'none';
      objOverlay.style.position = 'absolute';
      objOverlay.style.top = '0';
      objOverlay.style.left = '0';
      objOverlay.style.zIndex = Windows.maxZIndex + 1;
      Windows.maxZIndex++;
      objOverlay.style.width = '100%';
      parent.insertBefore(objOverlay, parent.firstChild);
      if (Prototype.Browser.WebKit && id == "overlay_modal") {
        setTimeout(function() {doneHandler()}, 10);
      }
      else
        doneHandler();
    }    
  },
  
  setCookie: function(value, parameters) {
    document.cookie= parameters[0] + "=" + escape(value) +
      ((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") +
      ((parameters[2]) ? "; path=" + parameters[2] : "") +
      ((parameters[3]) ? "; domain=" + parameters[3] : "") +
      ((parameters[4]) ? "; secure" : "");
  },

  getCookie: function(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
      begin = dc.indexOf(prefix);
      if (begin != 0) return null;
    } else {
      begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
      end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
  },
    
  _computeSize: function(content, id, width, height, margin, className) {
    var objBody = document.body;
    var tmpObj = document.createElement("div");
    tmpObj.setAttribute('id', id);
    tmpObj.className = className + "_content";

    if (height)
      tmpObj.style.height = height + "px"
    else
      tmpObj.style.width = width + "px"
  
    tmpObj.style.position = 'absolute';
    tmpObj.style.top = '0';
    tmpObj.style.left = '0';
    tmpObj.style.display = 'none';

    tmpObj.innerHTML = content;
    objBody.insertBefore(tmpObj, objBody.firstChild);

    var size;
    if (height)
      size = $(tmpObj).getDimensions().width + margin;
    else
      size = $(tmpObj).getDimensions().height + margin;
    objBody.removeChild(tmpObj);
    return size;
  }  
}

timer_menu_niv_2 = null;
timer_menu_niv_3 = null;
tps_persistance = null;
niv_1_select = null;
niv_2_select = null;

id_nav = null;
id_nav_sous_menus = null;
padding_cote_lien_g = null;
padding_cote_lien_d = null;
id_bt_niv_1_initial = null;
id_bt_niv_2_initial = null;
id_bt_niv_3_initial = null;
class_on_ss_niveau = null;
padding_top_premier_ss_niv_12 = null;
decallage_niv1_sous_menu = 0;

url_off_img_select = null;
source_on = null;

largeur = null;
ss_niveau_on_avec_niv = false;


function evenement_timer_td(){
	//timer_niv_2_3
	$$(".timer_niv_2_3").each(function(td){
		Event.observe(td, "mouseover", desactiv_timer_niv_2_3);
		Event.observe(td, "mouseout", activ_timer_niv_2_3);
	});	
	
	//timer_niv_2_3
	$$(".tab_timer_niv_3 td").each(function(td){
		Event.observe(td, "mouseover", desactiv_timer_niv_3);
		Event.observe(td, "mouseout", activ_timer_niv_3);
	});	
}
Event.observe(window,"load",evenement_timer_td,false)


Navigation = Class.create();
Navigation.prototype = {
	initialize: function()
	{
	},

	setup:function (params) {
		function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
		param_default("padding_cote_lien_g",0);
		param_default("padding_cote_lien_d",0);
	
		this.params = params;
		
		// parametre obligatoire
		tps_persistance = params['tps_persistance']
		id_nav = params['id_nav']
		id_nav_sous_menus = params['id_nav_sous_menus']
		padding_cote_lien_g = params['padding_cote_lien_g']
		padding_cote_lien_d = params['padding_cote_lien_d']
		id_bt_niv_1_initial = params['id_bt_niv_1_initial']
		id_bt_niv_2_initial = params['id_bt_niv_2_initial']
		id_bt_niv_3_initial = params['id_bt_niv_3_initial']
		class_on_ss_niveau = params['class_on_ss_niveau']
		padding_top_premier_ss_niv_12 = params['padding_top_premier_ss_niv_12']
		decallage_niv1_sous_menu = params['decallage_niv1_sous_menu']
		
		// creation niv_1_2
		this.params['niveau'].each(function(niv){
			var niveau = new Niveau_1_2(niv[0],niv[1],niv[2])
			//si niveau 3
			if(niv[3] != null)
			{
				
				var id_niv_parent = niv[1];
				niv[3].each(function(niv){
					//alert(niv[1])
					var niveau_2 = new Niveau_2_3(niv[0],niv[1],niv[2],id_niv_parent)
					//iframe
					//alert(niveau_2.niv_iframe)
					niveau_2.niv_iframe.style.display = 'none';
					niveau_2.niv.style.display ='none'
				});
			}
			//iframe
			if(niveau.niv != null)
			{
				niveau.niv_iframe.style.display = 'none';
				niveau.niv.style.display ='none'
			}
			
		});
		
		// met le niv_2 a on si il n'a pas de sous niveau
		if(id_bt_niv_2_initial != null && id_bt_niv_2_initial != "" && !(ss_niveau_on_avec_niv))
		{
			Element.addClassName(id_bt_niv_2_initial,"on")
		}

		// met le niv_3 a on
		if(id_bt_niv_3_initial != null && id_bt_niv_2_initial != "")
		{
			Element.addClassName(id_bt_niv_3_initial,"on")
		}

		$(id_nav_sous_menus).style.height = 'auto';
		$(id_nav_sous_menus).style.overflow = 'visible';
	}
};

/* niveau 1_2 */
Niveau_1_2 = Class.create();
Niveau_1_2.prototype = {
	initialize: function(id_bouton,id_niv,parametre) {
		this.bouton = $(id_bouton);
		this.niv = id_niv ? $(id_niv) : null;
		//alert(this.niv)
		//alert(this.niv)
		
		//alert(this.niv)
		if(this.niv != null)
		{
		creerIframe(id_niv+'_frame')
		this.niv_iframe = $(id_niv+'_frame')
		}
		this.params = (parametre);
				
		this.img_bouton = this.bouton.firstChild.nodeName == "IMG" ? true : false;
		if(this.img_bouton) this.image = this.bouton.firstChild;
		
		
		// si image bouton
		if(this.img_bouton)
		{
			this.source = this.image.src;
			this.url = this.source.substring(0,this.source.lastIndexOf('.'));
			this.format = this.source.substring(this.source.lastIndexOf('.'),this.source.length);
			this.source_on = this.url+"_on"+this.format;
			
			// bouton initial source a off
			if(id_bt_niv_1_initial == this.bouton.id)
			{
				this.image.src = this.source_on 
			}
		}

		// positionner
		if(this.niv != null)
		{
		this.positionner_redimensionner();
		}
		
		this.bouton.onmouseover = this.onmouseover.bindAsEventListener(this);
		this.bouton.onmouseout = this.onmouseout.bindAsEventListener(this);
	},
	
	// positionnement et redimensionnement
	positionner_redimensionner: function(){
		// position left du bouton par rapport a la nav
		var pos_l_bt = Element.getOffSetPositionLeft(this.bouton,id_nav)
		if(this.params.largeur == null)
		{
			if(Element.getWidth(this.niv) < Element.getWidth(this.bouton))
			{
				/* largeur niveau = largeur bouton */
				largeur = Element.getWidth(this.bouton);
			}
			else
			{
				largeur = Element.getWidth(this.niv)
			}
		}
		if(this.params.largeur){largeur = this.params.largeur;}
		
		// decallage pour le premier element, cas specifique pour intranet-PF
		if(this.params.decallage_marge){largeur = largeur - this.params.decallage_marge;}
		
		if(largeur != null)
		{
			if(browser.isIE)
			{
				var liens = $A(this.niv.childNodes[0].childNodes)
			}
			else
			{
				var liens = $A(this.niv.childNodes[1].childNodes)
				
			}
			liens.each(function(lien){
				if(lien.nodeName == "TR")
				{
					// td
					lien.firstChild.style.width = ppx(largeur);
					
					
					// a -> MERCI IE
					if(browser.isIE55)
					{
						lien.firstChild.firstChild.style.width = ppx(largeur);
						
					}
					if(browser.isIE6x)
					{
						lien.firstChild.firstChild.style.width = ppx(largeur - (padding_cote_lien_g + padding_cote_lien_d))
					}
				}
			});
			
		}
		
		var largeur_niv = Element.getWidth(this.niv)
		
		// iframe
		$(this.niv_iframe).style.width = ppx(largeur_niv)
		$(this.niv_iframe).style.height = ppx(Element.getHeight(this.niv))
		// decallage pour le premier element, cas specifique pour intranet-PF
		if(this.params.decallage_marge){pos_l_bt = pos_l_bt + this.params.decallage_marge;}

		
		// position
		if(this.params.position)
		{
			if(this.params.position == "left"){this.niv.style.left = ppx(pos_l_bt + Element.getWidth(this.bouton)- largeur_niv)}
			if(this.params.position == "right"){this.niv.style.left = ppx(pos_l_bt);}
		}
		else
		{
			if(pos_l_bt + largeur_niv > Element.getWidth(id_nav_sous_menus))
			{
				this.niv.style.left = ppx(pos_l_bt + Element.getWidth(this.bouton)- largeur_niv);
			}
			else
			{
				this.niv.style.left = ppx(pos_l_bt);
			}
		}
		
		// iframe
		$(this.niv_iframe).style.left = this.niv.style.left
		$(this.niv_iframe).style.top = this.niv.style.top
		largeur = null;
	},
	
	//afficher le niveau
	onmouseover: function(evt) {
		// si le il existe le numero du menu (ça veux dire qu'il y a un menu affiche)
		if(niv_1_select != null)
		{
			//on desaffiche son sous menu et on arrete le timer
//		alert(niv_1_select.bouton.id)
			desafficher_niveau_2()
		}
		// niveau_1 selectionne
		niv_1_select = this;
		//si bouton image -> a on
		if(this.img_bouton)
		{
			url_off_img_select = this.source;
			this.image.src = this.source_on;
		}
		// affichage du niveau
		
		// pour safari (flash)
		if(browser.isSafari)
		{
			$$(".no_menu").each(function(element){					
				element.style.visibility='hidden';
			});
		}
		//iframe
		if(this.niv != null)
		{
		$(this.niv_iframe).style.display = 'block';
		$(this.niv).style.display = 'block';
		}
	 	desactiv_timer_niv_2()
   },
   	onmouseout: function(evt) {
		activ_timer_niv_2()
   }
}

/* niveau 2_3 */
Niveau_2_3 = Class.create();
Niveau_2_3.prototype = {
	initialize: function(id_bouton,id_niv,parametre,id_niv_parent) {
		this.bouton = $(id_bouton);
		//alert(id_niv)
		this.niv = id_niv ? $(id_niv) : null;
		//alert(this.niv)
		if(this.niv != null)
		{
			creerIframe(id_niv+'_frame')
			this.niv_iframe = $(id_niv+'_frame')
		}
		//alert(this.niv_iframe)
		this.params = (parametre);
		this.niv_parent = $(id_niv_parent);
		
		// bouton a on
		if(id_bt_niv_2_initial == this.bouton.id)
		{
			ss_niveau_on_avec_niv = true;
			Element.addClassName(this.bouton.id,class_on_ss_niveau)
		}
		// positionner
		if(this.niv != null)
		{
		this.positionner_redimensionner();
		}
		
		this.bouton.onmouseover = this.onmouseover.bindAsEventListener(this);
		this.bouton.onmouseout = this.onmouseout.bindAsEventListener(this);
	},
	
	// positionnement et redimensionnement
	positionner_redimensionner: function(){
		// position left du bouton par rapport a la nav
		var pos_r_niv_parent = Element.getX(this.niv_parent)+Element.getWidth(this.niv_parent);

		if(this.params.largeur == null){largeur = Element.getWidth(this.niv);/*alert(Element.getWidth(this.niv))*/}
		if(this.params.largeur){largeur = this.params.largeur;}

		if(largeur != null)
		{
			if(browser.isIE)
			{
				var liens = $A(this.niv.childNodes[0].childNodes)
			}
			else
			{
				var liens = $A(this.niv.childNodes[1].childNodes)
			}
			liens.each(function(lien){
				if(lien.nodeName == "TR")
				{
					// td
					lien.firstChild.style.width = ppx(largeur);
					
					// a -> MERCI IE
					if(browser.isIE55)
					{
						lien.firstChild.firstChild.style.width = ppx(largeur);
					}
					if(browser.isIE6x)
					{
						lien.firstChild.firstChild.style.width = ppx(largeur - (padding_cote_lien_g + padding_cote_lien_d));
					}
				}
			});
			
		}
		
		var largeur_niv = Element.getWidth(this.niv)
		//alert(largeur_niv)
		
		// iframe
		$(this.niv_iframe).style.width = ppx(largeur_niv)
		$(this.niv_iframe).style.height = ppx(Element.getHeight(this.niv))

		// position
		// X
		if(this.params.position)
		{
			if(this.params.position == "left"){this.niv.style.left = ppx(pos_r_niv_parent - Element.getWidth(this.niv_parent) - largeur_niv);}
			if(this.params.position == "right"){this.niv.style.left = ppx(pos_r_niv_parent);}
		}
		else
		{
			if((pos_r_niv_parent + largeur_niv) > Element.getWidth(id_nav_sous_menus))
			{
				this.niv.style.left = ppx(pos_r_niv_parent - Element.getWidth(this.niv_parent) - largeur_niv);
			}
			else
			{
				this.niv.style.left = ppx(pos_r_niv_parent);
			}
		}
		
		// iframe
		$(this.niv_iframe).style.left = this.niv.style.left

		// Y
		this.niv.style.top = ppx(niveauTop(this.niv_parent,this.bouton.id));
		// iframe
		$(this.niv_iframe).style.top = this.niv.style.top
		largeur = null;
	},
	
	//afficher le niveau
	onmouseover: function(evt) {
		
		desactiv_timer_niv_3()
		// si le il existe le numero du menu (ça veux dire qu'il y a un menu affiche)
		if(niv_2_select != null)
		{
			//on desaffiche son sous menu et on arrete le timer
			desafficher_niveau_3()
		}
		
		// niveau_2 selectionne
		niv_2_select = this;
		
		//si bouton -> a on
		if(id_bt_niv_2_initial != this.bouton.id)
		{
			Element.addClassName(this.bouton.id,class_on_ss_niveau)
		}
		
		// affichage du niveau
		//iframe
		if(this.niv != null)
		{
			$(this.niv_iframe).style.display = 'block';
			$(this.niv).style.display = 'block';
		}
		
		desactiv_timer_niv_3()
		
   },
   	onmouseout: function(evt) {
		activ_timer_niv_3()
   }
}

/*--------------------------------------------------------------------------------------------------------------------------*/
	function niveauTop(id_niveau,id_bouton) {
			var premier = 0
			var niv = $(id_niveau);
			var top = 0;
			if(browser.isIE)
			{
				var liens = $A(niv.childNodes[0].childNodes)
			}
			else
			{
				var liens = $A(niv.childNodes[1].childNodes)
			}
			var id_bouton_trouve = false
			for(var i=0 ; i < liens.length && !id_bouton_trouve ;i++)
			{
				if(liens[i].nodeName == "TR")
				{
					// td
					var td = liens[i].firstChild;

					
					if (td.firstChild.id == id_bouton)
					{ 
						if(Element.hasClassName(td,"premier"))
						{ 
							premier = padding_top_premier_ss_niv_12;
						}

						id_bouton_trouve = true
					}
					else{top += Element.getHeight(td);}
				}
			}
			return (top + premier);


	}
/*--------------------------------------------------------------------------------------------------------------------------*/


function activ_timer_niv_2()
{
	timer_menu_niv_2 = window.setTimeout("desafficher_niveau_2()",tps_persistance)
}

function activ_timer_niv_2_3()
{
	timer_menu_niv_2 = window.setTimeout("desafficher_niveau_2()",tps_persistance)
}

function desactiv_timer_niv_2_3()
{
	if(niv_2_select != null){desafficher_niveau_3()}
	if(timer_menu_niv_2 != null)
	{
		window.clearTimeout(timer_menu_niv_2);
		timer_menu_niv_2 = null;
	}
}


function desactiv_timer_niv_2()
{
	if(timer_menu_niv_2 != null)
	{
		window.clearTimeout(timer_menu_niv_2);
		timer_menu_niv_2 = null;
	}
}

function desafficher_niveau_2()
{
	
	// persistance et rollover
	if(id_bt_niv_1_initial !=  niv_1_select.bouton.id)
	{
		//lien image ou a
		if(url_off_img_select != null)
		{
			niv_1_select.image.src = url_off_img_select;
		}
	}
	if(niv_2_select != null){desafficher_niveau_3()}

	if(niv_1_select.niv)
	{
	// desaffichage du niveau
	niv_1_select.niv.style.display ='none';
	//iframe
	niv_1_select.niv_iframe.style.display = 'none';
	}
	
	// pour safari (flash)
	if(browser.isSafari)
	{
		$$(".no_menu").each(function(element){					
			element.style.visibility='visible';
		});
	}

	niv_1_select = null
}

function activ_timer_niv_3()
{
	activ_timer_niv_2()
	timer_menu_niv_3 = window.setTimeout("desafficher_niveau_3()",tps_persistance)
}

function desactiv_timer_niv_3()
{
	desactiv_timer_niv_2();
	if(timer_menu_niv_3 != null)
	{
		window.clearTimeout(timer_menu_niv_3);
		timer_menu_niv_3 = null;
	}
}

function desafficher_niveau_3()
{
	
	// persistance et rollover
	if(niv_2_select != null)
	{
		if(id_bt_niv_2_initial != niv_2_select.bouton.id)
		{
			Element.removeClassName(niv_2_select.bouton.id,class_on_ss_niveau)
		}
		if(niv_2_select.niv)
		{
		niv_2_select.niv.style.display ='none';
		//iframe
		niv_2_select.niv_iframe.style.display = 'none';
		}

	}
	niv_2_select = null
}

function creerIframe(id)
{
	document.write("<iframe id='"+id+"' class='iframe_menu' frameborder='0' scrolling='no' src='about:blank'></iframe>")	
}/*
 * jQuery JavaScript Library v1.3.1
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
 * Revision: 6158
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})();/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.1
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */

/**
 * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup.
 *
 * The HTML markup that is used to build the carousel can be as simple as...
 *
 *  <div class="carousel">
 *      <ul>
 *          <li><img src="image/1.jpg" alt="1"></li>
 *          <li><img src="image/2.jpg" alt="2"></li>
 *          <li><img src="image/3.jpg" alt="3"></li>
 *      </ul>
 *  </div>
 *
 * As you can see, this snippet is nothing but a simple div containing an unordered list of images.
 * You don't need any special "class" attribute, or a special "css" file for this plugin.
 * I am using a class attribute just for the sake of explanation here.
 *
 * To navigate the elements of the carousel, you need some kind of navigation buttons.
 * For example, you will need a "previous" button to go backward, and a "next" button to go forward.
 * This need not be part of the carousel "div" itself. It can be any element in your page.
 * Lets assume that the following elements in your document can be used as next, and prev buttons...
 *
 * <button class="prev">&lt;&lt;</button>
 * <button class="next">&gt;&gt;</button>
 *
 * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the
 * navigation buttons as options.
 *
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 *
 * That's it, you would have now converted your raw div, into a magnificient carousel.
 *
 * There are quite a few other options that you can use to customize it though.
 * Each will be explained with an example below.
 *
 * @param an options object - You can specify all the options shown below as an options object param.
 *
 * @option btnPrev, btnNext : string - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward.
 *
 * @option btnGo - array - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      btnGo: [".0", ".1", ".2"]
 * });
 * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on
 * the item number within the carousel, you can use this option. Just supply an array of selectors for each element
 * in the carousel. The index of the array represents the index of the element. What i mean is, if the
 * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel
 * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed
 * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding
 * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin.
 * The best part is that, the tab will "slide" based on the provided effect. :-)
 *
 * @option mouseWheel : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      mouseWheel: true
 * });
 * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons.
 * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon.
 * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel
 * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation
 * as well. They complement each other. To use both together, just supply the options required for both as shown below.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      mouseWheel: true
 * });
 *
 * @option auto : number - default is null, meaning autoscroll is disabled by default
 * @example
 * $(".carousel").jCarouselLite({
 *      auto: 800,
 *      speed: 500
 * });
 * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option.
 * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling.
 * Specify this value and magically your carousel will start auto scrolling.
 *
 * @option speed : number - 200 is default
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      speed: 800
 * });
 * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with
 * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect.
 *
 * @option easing : string - no easing effects by default.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      easing: "bounceout"
 * });
 * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified,
 * the carousel will slide based on the provided easing effect.
 *
 * @option vertical : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      vertical: true
 * });
 * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and
 * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will
 * display horizontally. The next and prev items will slide the items from left-right in this case.
 *
 * @option circular : boolean - default is true
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      circular: false
 * });
 * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last
 * element, you will automatically slide to the first element and vice versa. If you set circular to false, then
 * if you click on the "next" button after you reach the last element, you will stay in the last element itself
 * and similarly for "previous" button and first element.
 *
 * @option visible : number - default is 3
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      visible: 4
 * });
 * @desc This specifies the number of items visible at all times within the carousel. The default is 3.
 * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the
 * last item half visible. This gives you the effect of showing the user that there are more images to the right.
 *
 * @option start : number - default is 0
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      start: 2
 * });
 * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel
 * has a start of 0, and so on.
 *
 * @option scrool : number - default is 1
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      scroll: 2
 * });
 * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By
 * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll
 * 2 items when you click the next or previous buttons.
 *
 * @option beforeStart, afterEnd : function - callbacks
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      beforeStart: function(a) {
 *          alert("Before animation starts:" + a);
 *      },
 *      afterEnd: function(a) {
 *          alert("After animation ends:" + a);
 *      }
 * });
 * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can
 * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that
 * are visible at the time of callback.
 *
 *
 * @cat Plugins/Image Gallery
 * @author Ganeshji Marwaha/ganeshread@gmail.com
 */

(function($) {                                          // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
    o = $.extend({
        btnPrev: null,
        btnNext: null,
        btnGo: null,
        mouseWheel: false,
        auto: null,

        speed: 200,
        easing: null,

        vertical: false,
        circular: true,
        visible: 3,
        start: 0,
        scroll: 1,

        beforeStart: null,
        afterEnd: null
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.

    	
    	if($('#tt-cadeaux').is('div')) //Traitement pour l'affichage de la pagination uniquement sur le carrousel des promotions
        {
        	var i=0;
        	$('.carrousel-cadeau li').each(function() {
        		i++;        	
        	});
        	$('.nav-cadeau .pagination').html('page 1/'+i);
        }
    
        var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
        var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;

        if(o.circular) {
            ul.prepend(tLi.slice(tl-v-1+1).clone())
              .append(tLi.slice(0,v).clone());
            o.start += v;
        }

        var li = $("li", ul), itemLength = li.size(), curr = o.start;
        div.css("visibility", "visible");

        li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
        ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
        div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"});

        var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
        var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
        var divSize = liSize * v;                           // size of entire div(total length for just the visible items)

        li.css({width: li.width(), height: li.height()});
        ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));

        div.css(sizeCss, divSize+"px");                     // Width of the DIV. length of visible images

        if(o.btnPrev)
            $(o.btnPrev).click(function() {
                return go(curr-o.scroll);
            });

        if(o.btnNext)
            $(o.btnNext).click(function() {
                return go(curr+o.scroll);
            });

        if(o.btnGo)
            $.each(o.btnGo, function(i, val) {
                $(val).click(function() {
                    return go(o.circular ? o.visible+i : i);
                });
            });

        if(o.mouseWheel && div.mousewheel)
            div.mousewheel(function(e, d) {
                return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
            });

        if(o.auto)
            setInterval(function() {
                go(curr+o.scroll);
            }, o.auto+o.speed);
        
        
        	
        function vis() {
            return li.slice(curr).slice(0,v);
        };

        function go(to) {
            if(!running) {

                if(o.beforeStart)
                    o.beforeStart.call(this, vis());
                if($('#tt-cadeaux').is('div')) //Traitement pour l'affichage de la pagination uniquement sur le carrousel des promotions
                {
                	var nb = $('.nav-cadeau .pagination').html();
                	var n = nb.split('/');
                	var p = n[0].split(' ');
                	var pageenc = parseInt(p[1]);
                	var pagetot = parseInt(n[1]);
	                if(curr<to) 
	                {
	                	//page suivante
	                	if(pageenc<pagetot)
	                	{
	                		$('.nav-cadeau .pagination').html('page '+(pageenc+1)+'/'+pagetot);
	                	}
	                	else
	                	{
	                		$('.nav-cadeau .pagination').html('page 1/'+pagetot);
	                	}
	                }
	                else
	                {
	                	//Page précédente
	                	if(pageenc>1)
	                	{
	                		$('.nav-cadeau .pagination').html('page '+(pageenc-1)+'/'+pagetot);
	                	}
	                	else
	                	{
	                		$('.nav-cadeau .pagination').html('page '+pagetot+'/'+pagetot);
	                	}
	                }
                }
                if(o.circular) {            // If circular we are in first or last, then goto the other end
                    if(to<=o.start-v-1) {           // If first, then goto last
                        ul.css(animCss, -((itemLength-(v*2))*liSize)+"px");
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
                        curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll;
                    } else if(to>=itemLength-v+1) { // If last, then goto first
                        ul.css(animCss, -( (v) * liSize ) + "px" );
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
                        curr = to==itemLength-v+1 ? v+1 : v+o.scroll;
                    } else curr = to;
                } else {                    // If non-circular and to points to first or last, we just return.
                    if(to<0 || to>itemLength-v) return;
                    else curr = to;
                }                           // If neither overrides it, the curr will still be "to" and we can proceed.

                running = true;
                
                ul.animate(
                    animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
                    function() {
                        if(o.afterEnd)
                            o.afterEnd.call(this, vis());
                        running = false;
                    }
                );
                
                // Disable buttons when the carousel reaches the last/first, and enable when not
                if(!o.circular) {
                    $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
                    $( (curr-o.scroll<0 && o.btnPrev)
                        ||
                       (curr+o.scroll > itemLength-v && o.btnNext)
                        ||
                       []
                     ).addClass("disabled");
                }

            }
            return false;
        };
    });
};

function css(el, prop) {
    return parseInt($.css(el[0], prop)) || 0;
};
function width(el) {
    return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
};
function height(el) {
    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
};

})(jQuery);
// jquery compatibilite avec prototype
if(typeof jQuery != "undefined") var $j = jQuery.noConflict();

// tableau des boutons navs;
var bt_nav = [];
var id_bt_select = null;

// loading utilisï¿½ sur chaque page
function loading()
{
/*    //preload_rollover pour la nav
	$$(".rollover_img_nav").each(function(image){
	    bt_nav[image.id] = (new Img_rollover(image));
	});
	if(id_bt_select != null)bt_nav_select(id_bt_select);
	
	//preload_input_value
	$$(".input_value").each(function(input_value){
		new Input_value(input_value)
	});//*/
	
	// compatibilite site
	var compatibilite_site = new Compatibilite_site("compatibilite_site_nomSite",800,["isFirefox","isIE6up","isSafari"]);
	compatibilite_site.setup({});
	
	reinitsifr();
}
//Event.observe(window, 'load', loading, false);
Event.onDOMReady(loading);

function bt_nav_select(id_bouton){
    if($(id_bouton)){
       bt_nav[id_bouton].set_rollover_actif(false);
       bt_nav[id_bouton].set_src_on(); 
    }
}

// XITI
function xiti_no_accent(chaine){
    //"Ã Ã¢Ã¤Ã¡Ã®Ã¯Ã­Ã´Ã¶Ã³Ã¹Ã»Ã¼Ã©Ã¨ÃªÃ«Ã§Ã±","aaaaiiiooouuueeeecn"
    var temp = chaine.replace(/[Ã Ã¢Ã¤Ã¡]/gi,"a");
    temp = temp.replace(/[Ã®Ã¯Ã­]/gi,"i");
    temp = temp.replace(/[Ã´Ã¶Ã³]/gi,"o");
    temp = temp.replace(/[Ã¹Ã»Ã¼]/gi,"u");
    temp = temp.replace(/[Ã©Ã¨ÃªÃ«]/gi,"e");
    temp = temp.replace(/[Ã§]/gi,"c");
    temp = temp.replace(/[Ã±]/gi,"n");
    return temp;
}

function xiti_libelle(libelle){
    var carac_autorises = new RegExp("[^a-z0-9_:~\\\/\-]", "g");
    //libelle sans tag ni espace au debut et a la fin
    libelle = libelle.strip().unescapeHTML();
    //libelle en minuscule et sans accent
    libelle = xiti_no_accent(libelle.toLowerCase())
    //remplacement des mauvais caracteres par _
    libelle = libelle.replace(carac_autorises, "_");
    // remplace _* par _
    libelle = libelle.replace(/_+/gi, "_");
    // remplace le _ en debut de libelle par "" si besoin
    libelle = libelle.replace(/^_/, "");
    // remplace le _ en fin de libelle par "" si besoin
    libelle = libelle.replace(/_$/, "");
    return libelle;
}

// utiliser dans les selects proposant la redirection vers le pdf
function xiti_nom_station_dl(id_select){
    return xiti_libelle($(id_select).options[$(id_select).selectedIndex].innerHTML);
    //return ($(id_select).options[$(id_select).selectedIndex]).innerHTML();
    //return $(id_select).options[0].innerHTML
}
/*select*/
	function select_value (intitule,cible_intitule,valeure,input_id) 
	{
		$(input_id).value=valeure;
		$(cible_intitule).innerHTML=intitule;
	}
	function ecrire_select(list, contmenu, actif, img, monte)
	{
		var rendu ='<table cellpadding="0" cellspacing="0" border="0">' ;
		rendu +='<tr>' ;
		
		if(monte){
			rendu +='<td><div class="rel"><div style="position:absolute;top:-3px; left:0px;"><div id="liste_'+list+'" class="liste">' ;
		} else {
			rendu +='<td><div class="rel"><div style="position:absolute;top:17px; left:0px;"><div id="liste_'+list+'" class="liste">' ;
		}
		
		for (var i=0; i < contmenu[0].length; ++i){
			contmenu[1][i]=contmenu[1][i].replace(/'/,"â€™");
			contmenu[1][i]=contmenu[1][i].replace(/"/,'\"');
			rendu += '<a href="javascript:select_value (\''+contmenu[1][i]+'\',\'liste_'+list+'_cible\',\''+contmenu[0][i]+'\',\'liste_'+list+'_input\');">'+contmenu[1][i]+'</a>';
			
		}
		rendu +='</div></div></div>' ;
		rendu +='<div id="liste_'+list+'_cible" class="actif">'+actif+'</div></td>' ;
		rendu +='<td class="bt"><div id="bouton_'+list+'">'+img+'</div></td>' ;
		rendu +='</tr>' ;
		rendu +='</table>';
		rendu +='<input type="hidden" name="liste_'+list+'" id="liste_'+list+'_input" value="" />';
		// liste deroulante pour le choix des langues
		document.write(rendu);
		if($('liste_'+list)){
			new ListeDeroulante('liste_'+list,'bouton_'+list,'liste_'+list+'_cible', monte);
		}
	}
/*liste_href*/
	function ecrire_liste(list, contmenu, actif, img)
	{
		var rendu ='<table cellpadding="0" cellspacing="0" border="0">' ;
		rendu +='<tr>' ;
		rendu +='<td><div class="rel"><div style="position:absolute;top:-3px; left:0px;"><div id="liste_'+list+'" class="liste">' ;
		for (var i=0; i < contmenu[0].length; ++i){
			contmenu[1][i]=contmenu[1][i].replace(/'/,"â€™");
			contmenu[1][i]=contmenu[1][i].replace(/"/,'\"');
			rendu += '<a href="'+contmenu[0][i]+'">'+contmenu[1][i]+'</a>' ;
		}
		rendu +='</div></div></div>' ;
		rendu +='<div id="liste_'+list+'_cible" class="actif">'+actif+'</div></td>' ;
		rendu +='<td class="bt"><div id="bouton_'+list+'">'+img+'</div></td>' ;
		rendu +='</tr>' ;
		rendu +='</table>';
		// liste deroulante pour le choix des langues
		document.write(rendu);
		if($('liste_'+list)){
			new ListeDeroulante('liste_'+list,'bouton_'+list,'liste_'+list+'_cible');
		}
	}
/*affiche station*/
	var select_bloque = "default" ;
	var reinitsifr_carte_get = true ;
	function affiche(id_bloque) {
		$(select_bloque).className ='hidden_plus';
		select_bloque = id_bloque;
		$(select_bloque).className ='';
		if (reinitsifr_carte_get == true) {
			//reinitsifr_carte () ;
			reinitsifr_carte_get = false ;
		}
	}
	
	function get_lien (lien) {
		window.location.replace(lien);
	}
	
	nom_station = new Array(1);
	nom_station [0] = new Array(2);
	nom_station [1] = new Array(2);
	nom_station [0][0] = "amelielesbains";
	nom_station [1][0] = "amelie-les-bains.html";
	nom_station [0][1] = "bainslesbains";
	nom_station [1][1] = "bains-les-bains.html";
	nom_station [0][2] = "barbotanlesthermes";
	nom_station [1][2] = "barbotan-les-thermes.html";
	nom_station [0][3] = "leboulou";
	nom_station [1][3] = "le-boulou.html";
	nom_station [0][4] = "bourbonlarchambault";
	nom_station [1][4] = "bourbon-l-archambault.html";
	nom_station [0][5] = "cambolesbains";
	nom_station [1][5] = "cambo-les-bains.html";
	nom_station [0][6] = "challesleseaux";
	nom_station [1][6] = "challes-les-eaux.html";
	nom_station [0][7] = "cransaclesthermes";
	nom_station [1][7] = "cransac-les-thermes.html";
	nom_station [0][8] = "eugenielesbains";
	nom_station [1][8] = "eugenie-les-bains.html";
	nom_station [0][9] = "greouxlesbains";
	nom_station [1][9] = "greoux-les-bains.html";
	nom_station [0][10] = "jonzac";
	nom_station [1][10] = "jonzac.html";
	nom_station [0][11] = "lamaloulesbains";
	nom_station [1][11] = "lamalou-les-bains.html";
	nom_station [0][12] = "luxeuillesbains";
	nom_station [1][12] = "luxeuil-les-bains.html";
	nom_station [0][13] = "molitglesbains";
	nom_station [1][13] = "molitg-les-bains.html";
	nom_station [0][14] = "lemontdore";
	nom_station [1][14] = "le-mont-dore.html";
	nom_station [0][15] = "prechacqlesbains";
	nom_station [1][15] = "prechacq-les-bains.html";
	nom_station [0][16] = "laprestelesbains";
	nom_station [1][16] = "la-preste-les-bains.html";
	nom_station [0][17] = "saintamandleseaux";
	nom_station [1][17] = "saint-amand-les-eaux.html";
	nom_station [0][18] = "sainthonorelesbains";
	nom_station [1][18] = "saint-honore-les-bains.html";
	nom_station [0][19] = "saintlaurentlesbains";
	nom_station [1][19] = "saint-laurent-les-bains.html";
	
	function rel_get_aqua (nom_aqua) {
		for (i=0; i<20; i++) {
			if (nom_aqua ==nom_station [0][i]) { get_lien ('/spa/aqua/'+nom_station [1][i]); }
		}
	}
	
	function rel_get_forfait (nom_forfait) {
		for (i=0; i<20; i++) {
			if (nom_forfait ==nom_station [0][i]) {get_lien ('/cures/forfait-decouverte/'+nom_station [1][i]);}
		}
	}
	
	function rel_get_sources (nom_sources) {
		for (i=0; i<20; i++) {
			if (nom_sources ==nom_station [0][i]) {get_lien ('/spa/sources-spas/'+nom_station [1][i]);}
		}
	}
	
	function rel_get_mini (nom_mini) {
		for (i=0; i<20; i++) {
			//if (nom_mini ==nom_station [0][i]) {get_lien ('/cures/mini-cures/'+nom_station [1][i]);}
			if (nom_mini ==nom_station [0][i]) {get_lien ('/cures/stations-thermales/'+nom_station [1][i]);}
		}
	}
	
	function rel_get_cures (nom_cures) {
		for (i=0; i<20; i++) {
			if (nom_cures ==nom_station [0][i]) {get_lien ('/cures/stations-thermales/'+nom_station [1][i]);}
		}
	}
	
	function rel_get_thermalissimo (nom_cures) {
		for (i=0; i<20; i++) {
			if (nom_cures ==nom_station [0][i]) {get_lien ('/spa/thermalissimo/'+nom_station [1][i]);}
		}
	}
	
	


/*affiche ongles*/
	function affiche_ongles(id_bloque) {
		$(select_ongles).className ='hidden_plus';
		$(select_ongles+'_ongl').className ='';
		select_ongles = id_bloque;
		if (id_bloque=='pratiques' && $('googleCarte').innerHTML == '') {
			$('googleCarte').innerHTML = googleCarte ;	
		}
		$(select_ongles).className ='';
		$(select_ongles+'_ongl').className ='on';
		reinitsifr_light();
	}
	
/*
SAV

function affiche_ongles(id_bloque) {
	
		$(select_ongles).className ='hidden_plus';
		$(select_ongles+'_ongl').className ='';
		select_ongles = id_bloque;
		$(select_ongles).className ='';
		$(select_ongles+'_ongl').className ='on';
	}


*/
	
/*affiche select*/
	function affiche_select(id_select, value_test, value_active) {
		if (value_test==value_active) {
			$(id_select).className ='';
		}else{
			$(id_select).className ='hidden';
		}
	}
	

/*clear value*/
	function clear_value (value_id,value_verif) {
		if($(value_id).value==value_verif){$(value_id).value='';}
	}
	

/*select 2 colonne*/
function iniGroups(){
	var dgroup = document.getElementById('dgroup');;
	var ugroup = document.getElementById('ugroup');
	clearListe(dgroup);
	clearListe(ugroup);
	
	for(var i=0;i<dgroups.length;i++){
		if(dgroups[i]!=null){
				dgroup[dgroup.length] = new Option(dgroups[i],i);
		}
	}
	for(var i=0;i<ugroups.length;i++){
		if(ugroups[i]!=null){
				ugroup[ugroup.length] = new Option(ugroups[i],i);
		}
	}
}
function clearListe(select){
	while(select.length>0) { 
		select[select.length-1]=null;
	}
}

function hasSelected(select){
for(var i=0;i<select.length;i++) { 
	if(select[i].selected){
		return true;
	}
}
return false;
}


function AddG(){
	var dgroup = document.getElementById('dgroup');
	var ugroup = document.getElementById('ugroup');
	if(hasSelected(dgroup)){
		for(var i=0;i<dgroup.length;i++){
			if(dgroup[i].selected){
				ugroups[dgroup[i].value]=dgroup[i].text;
				dgroups[dgroup[i].value]=null;
			}
		}
		iniGroups();
	}
}
function DelG(){
	var dgroup = document.getElementById('dgroup');;
	var ugroup = document.getElementById('ugroup');
	if(hasSelected(ugroup)){
		for(var i=0;i<ugroup.length;i++){
			if(ugroup[i].selected){
				dgroups[ugroup[i].value]=ugroup[i].text;
				ugroups[ugroup[i].value]=null;
			}
		}
		iniGroups();
	}
}





// Add some groups to the user groups member select.
function add() {
	var frm = document.frm;
	var ggroup = document.forms[0].elements['ggroup[]'];
	var ugroup = document.forms[0].elements['ugroup[]'];

	// Get the selected groups.
	selected_name = new Array();
	selected_value = new Array();
	var i = 0;
	for (var index = 0; index < ggroup.length; index++) {
		if (ggroup[index].selected) {
			selected_name[i] = ggroup[index].text;
			selected_value[i++] = ggroup[index].value;
		}
	}
	if (selected_value.length == 0) {
		alert("Vous devez sÃ©lectionner un ou plusieurs groupes.");
		return;
	}

	// Add the new groups to the user groups member select.
	for (var i = 0; i < selected_value.length; i++) {
		ugroups[selected_value[i]]=dgroups[selected_value[i]];
		dgroups[selected_value[i]]=null;
	}
iniGroups();	
}

// Remove some group from the user gorups member select.
function del() {
	var frm = document.frm;
	var ugroup = document.forms[0].elements['ugroup[]'];

	// Get the selected groups.
	remove_items = new Array();
	var i = 0;
	for (var index = 0; index < ugroup.length; index++) {
		if (ugroup[index].selected) {
			remove_items[i++] = index;
		}
	}
	if (remove_items.length == 0) {
		alert("Vous devez sÃ©lectionner un ou plusieurs groupes.");
		return;
	}

	// Remove the items from select.
	new_items = new Array();
	var i = 0;
	for (var index = 0; index < ugroup.length; index++) {
		if ( ! in_array(remove_items, index)) {
			new_items[i++] = ugroup[index];
		}
	}
	ugroup.length = 0;
	for (var i = 0; i < new_items.length; i++) {
		ugroup[i] = new Option(new_items[i].text, new_items[i].value);
	}
}

function select_all() {
	var frm = document.frm;
	var ggroup = document.forms[0].elements['ggroup[]'];
	var ugroup = document.forms[0].elements['ugroup[]'];
	//var taille = ugroup.length;
	//alert(ugroup.length)
	//var taille = 74;
	for (var i = 0; i < ugroup.length ; i++) {
		ugroup[i].selected = 1;
		alert(ugroup[i]);
		//alert(document.forms[0].elements['ugroup[]'].options[i].innerHTML+' '+i)
	}
	//alert(ggroup.length)
	for (var j = 0; j < ggroup.length; j++) {
		ggroup[j].selected = 1;
	}
	return 'ok';
	//frm.submit();
}
refname = crefname = document.referrer;
dname = document.location.hostname;
cdname = document.location.href;
motif0 = /.*:\/\//;
motif1 = /\/.*$/;
motif2 = / /;
motif4 = /^[^?]+./;
t1 = dname.replace(motif0, " ");
t2 = t1.replace(motif1, '');
t3 = t2.replace(motif2, '');
dname = t3.toLowerCase();
t1 = refname.replace(motif0, " ");
t2 = t1.replace(motif1, '');
t3 = t2.replace(motif2, '');
refname = t3.toLowerCase();
t1 = crefname.replace(motif4, " ");
t2 = t1.replace(motif0, '');
t3 = t2.replace(motif1, '');
crefname = t3.replace(motif2, '');
t1 = cdname.replace(motif4, " ");
t2 = t1.replace(motif0, '');
t3 = t2.replace(motif1, '');
cdname = t3.replace(motif2, '');
if(dname != refname && refname.length > 0 && dname.length > 0) {
	refname = escape(refname);
	dname = escape(dname);
	crefname = escape(crefname);
	cdname = escape(cdname);
	strg = "<IMG SRC='http://tracking.fastbooking.net/fullorigin.phtml?origin="+refname+"&dname="+dname+"&crefname="+crefname+"&cdname="+cdname+"' height='1' width='1'>";
	document.write(strg);
}
if(dname != refname && dname.length > 0) {
	document.write("<IMG SRC='http://tracking.fastbooking.net/visit.phtml?dname="+dname+"' height='1' width='1' border='0'>");
}/*****
 * Copyright © FASTBOOKING  1999-2007
 * 20/02/2008
 *
 * Please do NOT modify this file
 * Please do NOT use the final IP adress for Fastbooking links:
 *   IP address may be changed at any time
 *
*/

var FBRESA = "http://www.fastbookings.biz/DIRECTORY/";
var FB_nb_day_delay = 7;



// following code is used to optimize booking access and a better client experience
var FB_book_image = new Image();
FB_book_image.src = FBRESA + "trans.gif";
var FB_VERSION= "&version=2";

// Form: show arrival date
// this function to replace the traditional start function
// in this case no update is required every year.
function start() {
	var nbm = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
		
	build_year_select();

	MD = new Date();
		
	nday = MD.getDate();
	aday = MD.getDay();
	amois = MD.getMonth();
	ayear = takeYear(MD);
	cur_year = ayear;
			
	nday += FB_nb_day_delay;

	if(nday > nbm[amois])
	{   		
		nday -= nbm[amois];
		amois++;
		if(amois > 11) { 
			ayear++;
			amois = 0;
		} 
	}
		
	indexDay = nday - 1;
	indexMois = amois;
	indexYear = ayear - cur_year;
		
	if(indexDay < 0 || indexDay > 30)
		indexDay = 0;
	if(indexMois < 0 || indexMois > 11)
		indexMois = 0;
	if(indexYear < 0 || indexYear > 1)
		indexDay = 0;

	document.idForm.fromday.selectedIndex = indexDay;
	document.idForm.frommonth.selectedIndex = indexMois;
	document.idForm.fromyear.selectedIndex = indexYear;

	update_departure();
}

// standard booking function
function hhotelPTC(cname, lg, codeprice, codetrack, cluster)
{
	hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "")
}

// standard promotion function
function hhotelPromo(cname, lg, theme)
{
	hhotelResa(cname, lg, "DYNPROMO", "", "", "", "", theme, "")
}

// reservation promotion function: To show one promotion
function hhotelOnePromo(cname, lg, codeprice, codetrack, cluster)
{
	hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "style=DIRECTPROMO")
}

// reservation page WITHOUT the individual access
function hhotelNegociated(cname, lg, codeprice, codetrack, cluster)
{
	hhotelResa(cname, lg, codeprice, "", "", codetrack, cluster, "", "negociated=1");
}

// Main direct reservation function
function hhotelResaDirect(cname, lg, codeprice, firstroom, codetrack, firstdate)
{
	hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, "", "", "style=DIRECT");
}

// standard search availabilities in a group
function hhotelSearchGroup(cluster, lg, price, nights, title)
{
	hhotelSearch(cluster, lg, price, nights, title, "", "");
}

// standard search availabilities in a group for a partner
function hhotelSearchPartner(cluster, lg, price, codetrack, title)
{
	if (codetrack != "") args = "&from="+codetrack;
	else	args = "";
    hhotelSearch(cluster, lg, price, "", title, "", args);
}

// search by giving the initial date
function hhotelSearchPriceDate(cluster, price, nights, title, firstdate)
{
	// firstdate : format "YYMMDD"
	var args="";
	if (firstdate != "") args = "FirstDate="+firstdate;
	hhotelSearch(cluster, "", price, nights, title, "", args);
}

function hhotelSearchPriceDateTrack(cluster, lg, price, codetrack, nights, title, firstdate)
{
 var args="";
 if (codetrack != "") args = "from="+codetrack;
 if (firstdate != "") args += "&FirstDate="+firstdate;
 hhotelSearch(cluster, lg, price, nights, title, "", args);
}

// search availabilities for selected promotions
function hhotelSearchPromo(cluster, lg, theme)
{
	hhotelSearch(cluster, lg, "", "", "", theme, "");
}

// search availabilities with Extra Field
function hhotelSearchExtra(cluster, lg, price, codetrack, extratitle, extraval, extrashow)
{
	var args = "Extrafield=" + escape(extratitle) + ";" + extraval + ";" + extrashow;
	if (codetrack != "") args += "&from="+codetrack;
	hhotelSearch(cluster, lg, price, "", "", "", args);
}

// go to the cancel reservation page
function hhotelcancel(cname,lg)
{
	var waction = FBRESA + "cancel.phtml?state=77&Hotelnames="+cname;
	if (lg != "") waction += "&langue="+lg;
	window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// go to the extract reservation page
function hhotelExtract(cname, lg)
{   
	var waction = FBRESA + "getresa.phtml?Hotelnames="+cname+"&langue="+lg;
	window.open(waction, 'getresa', 'toolbar=no,width=700,height=300,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes');
   return false;
}

// check interface
function hhotelcheckrates(cname, lg)
{
	var waction = FBRESA + "crs.phtml?clusterName="+cname;
	if (lg != "") waction += "&langue="+lg;
	waction += "&checkPromo=1";
	window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Fidelity program
var FB_code_interface = "";
var FB_profil = "";
function hhotelProfil(code_interface, profil)
{
	FB_code_interface = code_interface;
	FB_profil = profil;
}

// Main standard reservation function
function hhotelResa(cname, lg, codeprice, firstroom, firstdate, codetrack, cluster, theme, args)
{
	var waction = FBRESA+"preresa.phtml?Hotelnames="+cname+FB_VERSION;
	if (lg != "") waction += "&langue="+lg;
	if (firstroom != "") {
		waction += "&FirstRoomName="+firstroom;
		if (codeprice == "")
			codeprice = "DIRECT";
		}
	if (firstdate != "") {
		waction += "&FirstDate="+firstdate;
		if (codeprice == "")
			codeprice = "DIRECT";
		}
	if (codeprice != "") waction += "&FSTBKNGCode="+codeprice;
	if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
	if (cluster != "") waction += "&clustername="+cluster;
	if (theme != "") waction += "&theme="+theme;
	if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;
	if (FB_profil != "") {
		waction += "&code="+FB_code_interface;
		waction += "&profil="+FB_profil;
	}
	waction += "&HTTP_REFERER="+escape(document.location.href);
	window.open(waction,"reservation","toolbar=no,width=400,height=350,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}


// Main Search function
function hhotelSearch(cluster, lg, price, nights, title, theme, args)
{
	var waction = FBRESA + "crs.phtml?clusterName="+cluster;
	if (lg != "") waction += "&langue="+lg;
	if (price != "") waction += "&FSTBKNGCode="+price;
	if (nights != "") waction += "&nights="+nights;
	if (title != "") waction += "&title="+escape(title);
	if (theme != "") waction += "&theme="+theme;
	if (args != "" && (args.indexOf("=")!= -1) ) waction += "&"+args;
	if (FB_profil != "") {
		waction += "&code="+FB_code_interface;
		waction += "&profil="+FB_profil;
	}
	window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Main Search function for Multi Codes
function hhotelSearchMultCode(cluster, lg, clecode, title, codetrack)
{
	var waction = FBRESA + "crs.phtml?clusterName="+cluster;
	if (lg != "") waction += "&langue="+lg;
	if (clecode != "") waction += "&AccessCode="+clecode;
	if (title != "") waction += "&title="+escape(title);
	if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
	waction += "&crossSelling=NO"; // CROSS SELLING DESACTIVATED
	if (FB_profil != "") {
		waction += "&code="+FB_code_interface;
		waction += "&profil="+FB_profil;
	}
	window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// Main Search function for Cross Selling

function hhotelSearchCrossSell(cluster, lg, codetrack, crossSelling)
{
	var waction = FBRESA + "crs.phtml?clusterName="+cluster;
	if (lg != "") waction += "&langue="+lg;
	if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
	if (crossSelling != "") waction += "&crossSelling="+crossSelling;
	if (FB_profil != "") {
		waction += "&code="+FB_code_interface;
		waction += "&profil="+FB_profil;
	}
	window.open(waction,"search","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}

// MAIN AVAILABILITY CHECK 
function hhotelDispopriceFHP(cname, lg, codetrack, year, month, day, nights, currency)
{
	var waction = FBRESA+"dispoprice.phtml?clusterName="+cname+"&Hotelnames="+cname;
	if (lg != "") waction += "&langue="+lg;
	if (codetrack != "") waction += "&FSTBKNGTrackLink="+codetrack;
	if (year != "") waction += "&fromyear="+year;
	if (month != "") waction += "&frommonth="+month;
	if (day != "") waction += "&fromday="+day;
	if (nights != "") waction += "&nbdays="+nights;
	if (currency != "") waction += "&CurrencyLabel="+currency;
	waction += "&showPromotions=3";
	if (FB_profil != "") {
		waction += "&code="+FB_code_interface;
		waction += "&profil="+FB_profil;
	}
	window.open(waction,"reservation","toolbar=no,width=750,height=600,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}


///////////////////////////////////////////////////////////////////////////////////////
// Form functions
// Simple form validation (used for compatibility issues)
function hhotelDispoprice(myForm)
{
	hhotelFormValidation(myForm, 0);
}

// Form validation with control
function hhotelFormValidation(myForm, mandatoryCode){
	if (mandatoryCode == 1 && myForm.AccessCode.value == "") {
		alert("You must type in your code ID");
		return (false);
	}
	var languetype = typeof myForm.action;
	myForm.action = FBRESA + "dispoprice.phtml";
	window.open('','dispoprice', 'toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes');
	myForm.submit();
	return (true);
}

// Form: update the selected hotel name
function hhotelFormUpdateHotelnames(myForm)
{
	menuNum = myForm.HotelList.selectedIndex;
	if (menuNum == null)
		return;
	myForm.Hotelnames.value = myForm.HotelList.options[menuNum].value;
}

// Form: show the cancel page
function hhotelFormCancel(myForm){
	var CName = myForm.Hotelnames.value;
	var languetype = typeof myForm.langue;
	var langue;
	if (languetype == "undefined")
		langue = "";
	else
		langue = myForm.langue.value;
	if (CName == null || CName == 'All' || CName == ''){ alert('Please select a hotel first'); return (false); }
	return hhotelcancel(CName, langue);
}

// Form: show the extract page
function hhotelFormExtract(myForm)
{   
	var CName = myForm.Hotelnames.value;
	var languetype = typeof myForm.langue;
	var langue;
	if (languetype == "undefined")
		langue = "";
	else
		langue = myForm.langue.value;
	if (CName == null || CName == 'All' || CName == ''){ alert('Please select a hotel first'); return (false); }
	return hhotelExtract(CName, langue);
}

// Form: show languages
function hhotelShowLang(lang) 
{
	hhotelShowLang__(this.document, lang);
}

function hhotelShowLangOpener(lang)
{
	hhotelShowLang__(window.opener.document, lang);
	window.close();
}

function hhotelShowLang__(mydoc, lang)
{
	mydoc.idForm.langue.value=lang;

	var imgLang = hhotelLang2Img(lang);
	if (imgLang != "") {
		var formFlag = mydoc.selLgFlag;
		if (formFlag != null)
			mydoc.selLgFlag.src= "fastbooking/flags/"+imgLang+".gif";
		var formFlag = mydoc.selLgTxt;
		if (formFlag != null)
			mydoc.selLgTxt.src= "fastbooking/flags/"+imgLang+"lg.gif";
	}
}

// FastBooking language and image code
var FBLangCode = new Array (
	"uk", "france", "germany", "spain", "portuguese", "italy", "nether", "russian",
	"dansk", "svensk", "islensk", "norsk", "turk", "hungria", "greek", "arab",
	"china", "coreen", "japan","croate","czech","poland");
var FBLangImg = new Array (
	"grandbret", "france", "germany", "spain", "portuguese", "italy", "nether", "russia",
	"denmark", "sweeden", "iceland", "norway", "turkey", "hungary", "greek", "arab",
	"china", "coreen", "japan","croate","czech","poland");

function hhotelLang2Img(lang)
{
	for(i = 0; i < FBLangCode.length; i++) {
		if (FBLangCode[i] == lang)
			break;
	}
	return FBLangImg[i];
}

function hhotelLangSelector()
{
	window.open('fastbooking/flags/langSelector.html', '', 'width=330,height=180');
}


var langcodes = new Array("en", "uk", "fr", "france", "de", "germany", "es", "spain ", "pt", "portuguese", "it", "italy", "nl", "nether", "ja", "japan ", "ko", "coreen", "zh", "china", "ar", "arab", "ru", "russian", "tr", "turk", "el", "greek", "hu", "hungria", "da", "dansk", "sv", "svensk", "is", "islensk", "no", "norsk", "hr", "croate", "cs", "czech", "pl", "poland", "iw", "hebrew");

function selectLang()
{
if(navigator.appName == "Microsoft Internet Explorer") UL = navigator.userLanguage.substring(0, 2);
else if(navigator.appName == "Netscape") UL = navigator.language;
else return;

for(i = 0; i < langcodes.length; i += 2)
	if(UL == langcodes[i])
		break;
		
lang = (i < langcodes.length) ? langcodes[i+1] : "uk";
hhotelShowLang(lang);
}



//
// build year select
function build_year_select() {
		
var cur_date = new Date();
var cur_year = takeYear(cur_date);
	
cur_y = new Option(cur_year, cur_year, true, true);
document.idForm.fromyear.options[0] = cur_y;
if(document.idForm.toyear != null) {
	cur_yb = new Option(cur_year, cur_year, true, true);
	document.idForm.toyear.options[0] = cur_yb;
}
	
next_y = new Option(cur_year + 1, cur_year + 1, false, false);
document.idForm.fromyear.options[1] = next_y;
next_yb = new Option(cur_year + 1, cur_year + 1, false, false);
if(document.idForm.toyear != null) {
	document.idForm.toyear.options[1] = next_yb;
	}
}
	
// check departure date to arrival date + 1 day (every time the arrival date is changed)
function check_departure() {
	
	if(document.idForm.today != null) {
		var nbm = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
		
		var ar_day = parseInt(document.idForm.fromday.value) + 1;
		var ar_month = parseInt(document.idForm.frommonth.value);
		var ar_year = parseInt(document.idForm.fromyear.value);
				
		if(ar_day > nbm[ar_month - 1]) {
			ar_day = 1;
			ar_month += 1;
			if(ar_month > 12) {
				ar_month = 1;
				ar_year += 1;
			}
		}
				
		var cur_date = new Date();
		var cur_year = takeYear(cur_date);
		
		document.idForm.today.selectedIndex = ar_day - 1;
		document.idForm.tomonth.selectedIndex = ar_month - 1;
		document.idForm.toyear.selectedIndex = ar_year - cur_year;
	}
}

// update departure : check 
function update_departure() {
	
	if(document.idForm.today != null) {
		
		var ar_day = parseInt(document.idForm.fromday.value) + 1;
		var ar_month = parseInt(document.idForm.frommonth.value);
		var ar_year = parseInt(document.idForm.fromyear.value);
				
		var de_day = parseInt(document.idForm.today.value) + 1;
		var de_month = parseInt(document.idForm.tomonth.value);
		var de_year = parseInt(document.idForm.toyear.value);
		
		if(de_year < ar_year) {
			check_departure();
		} else {
			if(de_year == ar_year) {
				if(de_month < ar_month) {
					check_departure();
				} else {
					if(de_month == ar_month) {
						if(de_day <= ar_day) {
							check_departure();
						}
					}
				}
			}
		}
				
	}
}

function takeYear(theDate)
{
        x = theDate.getYear();
        var y = x % 100;
        y += (y < 38) ? 2000 : 1900;
        return y;
}

// popup
function popup(url)
{
	window.open(url,"","toolbar=no,width=800,height=550,menubar=no,scrollbars=yes,resizable=yes,alwaysRaised=yes");
}var time = new Date();
var sec = time.getSeconds();
motif0 = /.*:\/\//;
motif1 = /\/.*$/;
motif2 = / /;
refname = document.referrer;
dname = document.location.hostname;
t0 = dname;
t1 = t0.replace(motif0, " ");
t2 = t1.replace(motif1, '');
t3 = t2.replace(motif2, '');
dname = t3.toLowerCase();
escapeddname = escape(dname);
t0 = refname;
t1 = t0.replace(motif0, " ");
t2 = t1.replace(motif1, '');
t3 = t2.replace(motif2, '');
refname = t3.toLowerCase();
if(dname != refname && refname.length > 0 && dname.length > 0) {
	document.write("<IMG SRC='http://secure.fastbooking.com/00000001/032/TRACKING/origin.phtml?sec="+sec+"&origin="+escape(refname)+"&dname="+escapeddname+"' height='1' width='1' border='0'>");
}
if(dname != refname && dname.length > 0) {
	document.write("<IMG SRC='http://secure.fastbooking.com/00000001/032/TRACKING/visit.phtml?sec="+sec+"&dname="+escapeddname+"' height='1' width='1' border='0'>");
}/*
 * cacheImage: a jQuery plugin
 *
 * cacheImage is a simple jQuery plugin for pre-caching images.  The
 * plugin can be used to eliminate flashes of unstyled content (FOUC) and
 * improve perceived page load time.  Callbacks for load, error and abort
 * events are provided.
 *
 * For usage and examples, visit:
 * http://github.com/alexrabarts/jquery-cacheimage
 *
 * Licensed under the MIT:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright (c) 2008 Stateless Systems (http://statelesssystems.com)
 *
 * @author   Alex Rabarts (alexrabarts -at- gmail -dawt- com)
 * @requires jQuery v1.2 or later
 * @version  0.1
 */

 (function ($) {
   $.extend($, {
     cacheImage: function (src, options) {
       if (typeof src === 'object') {
         $.each(src, function () {
           $.cacheImage(String(this), options);
         });
       }

       var image = new Image();

       options = options || {};

       $.each(['load', 'error', 'abort'], function () { // Callbacks
         var e = String(this);
         if (typeof options[e] === 'function') { $(image)[e](options[e]); }
       });

       image.src = src;

       return image;
     }
   });

   $.extend($.fn, {
     cacheImage: function (options) {
       return this.each(function () {
         $.cacheImage(this.src, options);
       });
     }
   });
 })(jQuery);
/*
 * jQuery UI 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
;jQuery.ui || (function($) {

var _remove = $.fn.remove,
	isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);

//Helper functions and ui object
$.ui = {
	version: "1.7.2",

	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
	plugin: {
		add: function(module, option, set) {
			var proto = $.ui[module].prototype;
			for(var i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function(instance, name, args) {
			var set = instance.plugins[name];
			if(!set || !instance.element[0].parentNode) { return; }

			for (var i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}
	},

	contains: function(a, b) {
		return document.compareDocumentPosition
			? a.compareDocumentPosition(b) & 16
			: a !== b && a.contains(b);
	},

	hasScroll: function(el, a) {

		//If overflow is hidden, the element might have extra content, but the user wants to hide it
		if ($(el).css('overflow') == 'hidden') { return false; }

		var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
			has = false;

		if (el[scroll] > 0) { return true; }

		// TODO: determine which cases actually cause this to happen
		// if the element doesn't have the scroll set, see if it's possible to
		// set the scroll
		el[scroll] = 1;
		has = (el[scroll] > 0);
		el[scroll] = 0;
		return has;
	},

	isOverAxis: function(x, reference, size) {
		//Determines when x coordinate is over "b" element axis
		return (x > reference) && (x < (reference + size));
	},

	isOver: function(y, x, top, left, height, width) {
		//Determines when x, y coordinates is over "b" element
		return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
	},

	keyCode: {
		BACKSPACE: 8,
		CAPS_LOCK: 20,
		COMMA: 188,
		CONTROL: 17,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		INSERT: 45,
		LEFT: 37,
		NUMPAD_ADD: 107,
		NUMPAD_DECIMAL: 110,
		NUMPAD_DIVIDE: 111,
		NUMPAD_ENTER: 108,
		NUMPAD_MULTIPLY: 106,
		NUMPAD_SUBTRACT: 109,
		PAGE_DOWN: 34,
		PAGE_UP: 33,
		PERIOD: 190,
		RIGHT: 39,
		SHIFT: 16,
		SPACE: 32,
		TAB: 9,
		UP: 38
	}
};

// WAI-ARIA normalization
if (isFF2) {
	var attr = $.attr,
		removeAttr = $.fn.removeAttr,
		ariaNS = "http://www.w3.org/2005/07/aaa",
		ariaState = /^aria-/,
		ariaRole = /^wairole:/;

	$.attr = function(elem, name, value) {
		var set = value !== undefined;

		return (name == 'role'
			? (set
				? attr.call(this, elem, name, "wairole:" + value)
				: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
			: (ariaState.test(name)
				? (set
					? elem.setAttributeNS(ariaNS,
						name.replace(ariaState, "aaa:"), value)
					: attr.call(this, elem, name.replace(ariaState, "aaa:")))
				: attr.apply(this, arguments)));
	};

	$.fn.removeAttr = function(name) {
		return (ariaState.test(name)
			? this.each(function() {
				this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
			}) : removeAttr.call(this, name));
	};
}

//jQuery plugins
$.fn.extend({
	remove: function() {
		// Safari has a native remove event which actually removes DOM elements,
		// so we have to use triggerHandler instead of trigger (#3037).
		$("*", this).add(this).each(function() {
			$(this).triggerHandler("remove");
		});
		return _remove.apply(this, arguments );
	},

	enableSelection: function() {
		return this
			.attr('unselectable', 'off')
			.css('MozUserSelect', '')
			.unbind('selectstart.ui');
	},

	disableSelection: function() {
		return this
			.attr('unselectable', 'on')
			.css('MozUserSelect', 'none')
			.bind('selectstart.ui', function() { return false; });
	},

	scrollParent: function() {
		var scrollParent;
		if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
			scrollParent = this.parents().filter(function() {
				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		} else {
			scrollParent = this.parents().filter(function() {
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		}

		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
	}
});


//Additional selectors
$.extend($.expr[':'], {
	data: function(elem, i, match) {
		return !!$.data(elem, match[3]);
	},

	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase(),
			tabIndex = $.attr(element, 'tabindex');
		return (/input|select|textarea|button|object/.test(nodeName)
			? !element.disabled
			: 'a' == nodeName || 'area' == nodeName
				? element.href || !isNaN(tabIndex)
				: !isNaN(tabIndex))
			// the element and all of its ancestors must be visible
			// the browser may report that the area is hidden
			&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
	},

	tabbable: function(element) {
		var tabIndex = $.attr(element, 'tabindex');
		return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
	}
});


// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
	function getMethods(type) {
		var methods = $[namespace][plugin][type] || [];
		return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
	}

	var methods = getMethods('getter');
	if (args.length == 1 && typeof args[0] == 'string') {
		methods = methods.concat(getMethods('getterSetter'));
	}
	return ($.inArray(method, methods) != -1);
}

$.widget = function(name, prototype) {
	var namespace = name.split(".")[0];
	name = name.split(".")[1];

	// create plugin method
	$.fn[name] = function(options) {
		var isMethodCall = (typeof options == 'string'),
			args = Array.prototype.slice.call(arguments, 1);

		// prevent calls to internal methods
		if (isMethodCall && options.substring(0, 1) == '_') {
			return this;
		}

		// handle getter methods
		if (isMethodCall && getter(namespace, name, options, args)) {
			var instance = $.data(this[0], name);
			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}

		// handle initialization and non-getter methods
		return this.each(function() {
			var instance = $.data(this, name);

			// constructor
			(!instance && !isMethodCall &&
				$.data(this, name, new $[namespace][name](this, options))._init());

			// method call
			(instance && isMethodCall && $.isFunction(instance[options]) &&
				instance[options].apply(instance, args));
		});
	};

	// create widget constructor
	$[namespace] = $[namespace] || {};
	$[namespace][name] = function(element, options) {
		var self = this;

		this.namespace = namespace;
		this.widgetName = name;
		this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
		this.widgetBaseClass = namespace + '-' + name;

		this.options = $.extend({},
			$.widget.defaults,
			$[namespace][name].defaults,
			$.metadata && $.metadata.get(element)[name],
			options);

		this.element = $(element)
			.bind('setData.' + name, function(event, key, value) {
				if (event.target == element) {
					return self._setData(key, value);
				}
			})
			.bind('getData.' + name, function(event, key) {
				if (event.target == element) {
					return self._getData(key);
				}
			})
			.bind('remove', function() {
				return self.destroy();
			});
	};

	// add widget prototype
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);

	// TODO: merge getter and getterSetter properties from widget prototype
	// and plugin prototype
	$[namespace][name].getterSetter = 'option';
};

$.widget.prototype = {
	_init: function() {},
	destroy: function() {
		this.element.removeData(this.widgetName)
			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
			.removeAttr('aria-disabled');
	},

	option: function(key, value) {
		var options = key,
			self = this;

		if (typeof key == "string") {
			if (value === undefined) {
				return this._getData(key);
			}
			options = {};
			options[key] = value;
		}

		$.each(options, function(key, value) {
			self._setData(key, value);
		});
	},
	_getData: function(key) {
		return this.options[key];
	},
	_setData: function(key, value) {
		this.options[key] = value;

		if (key == 'disabled') {
			this.element
				[value ? 'addClass' : 'removeClass'](
					this.widgetBaseClass + '-disabled' + ' ' +
					this.namespace + '-state-disabled')
				.attr("aria-disabled", value);
		}
	},

	enable: function() {
		this._setData('disabled', false);
	},
	disable: function() {
		this._setData('disabled', true);
	},

	_trigger: function(type, event, data) {
		var callback = this.options[type],
			eventName = (type == this.widgetEventPrefix
				? type : this.widgetEventPrefix + type);

		event = $.Event(event);
		event.type = eventName;

		// copy original event properties over to the new event
		// this would happen if we could call $.event.fix instead of $.Event
		// but we don't have a way to force an event to be fixed multiple times
		if (event.originalEvent) {
			for (var i = $.event.props.length, prop; i;) {
				prop = $.event.props[--i];
				event[prop] = event.originalEvent[prop];
			}
		}

		this.element.trigger(event, data);

		return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
			|| event.isDefaultPrevented());
	}
};

$.widget.defaults = {
	disabled: false
};


/** Mouse Interaction Plugin **/

$.ui.mouse = {
	_mouseInit: function() {
		var self = this;

		this.element
			.bind('mousedown.'+this.widgetName, function(event) {
				return self._mouseDown(event);
			})
			.bind('click.'+this.widgetName, function(event) {
				if(self._preventClickEvent) {
					self._preventClickEvent = false;
					event.stopImmediatePropagation();
					return false;
				}
			});

		// Prevent text selection in IE
		if ($.browser.msie) {
			this._mouseUnselectable = this.element.attr('unselectable');
			this.element.attr('unselectable', 'on');
		}

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);

		// Restore text selection in IE
		($.browser.msie
			&& this.element.attr('unselectable', this._mouseUnselectable));
	},

	_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		// TODO: figure out why we have to use originalEvent
		event.originalEvent = event.originalEvent || {};
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if (!this.mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self.mouseDelayMet = true;
			}, this.options.delay);
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted = (this._mouseStart(event) !== false);
			if (!this._mouseStarted) {
				event.preventDefault();
				return true;
			}
		}

		// these delegates are required to keep context
		this._mouseMoveDelegate = function(event) {
			return self._mouseMove(event);
		};
		this._mouseUpDelegate = function(event) {
			return self._mouseUp(event);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		// preventDefault() is used to prevent the selection of text here -
		// however, in Safari, this causes select boxes not to be selectable
		// anymore, so this fix is needed
		($.browser.safari || event.preventDefault());

		event.originalEvent.mouseHandled = true;
		return true;
	},

	_mouseMove: function(event) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !event.button) {
			return this._mouseUp(event);
		}

		if (this._mouseStarted) {
			this._mouseDrag(event);
			return event.preventDefault();
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted =
				(this._mouseStart(this._mouseDownEvent, event) !== false);
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
		}

		return !this._mouseStarted;
	},

	_mouseUp: function(event) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		if (this._mouseStarted) {
			this._mouseStarted = false;
			this._preventClickEvent = (event.target == this._mouseDownEvent.target);
			this._mouseStop(event);
		}

		return false;
	},

	_mouseDistanceMet: function(event) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function(event) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function(event) {},
	_mouseDrag: function(event) {},
	_mouseStop: function(event) {},
	_mouseCapture: function(event) { return true; }
};

$.ui.mouse.defaults = {
	cancel: null,
	distance: 1,
	delay: 0
};

})(jQuery);
/*
 * jQuery UI Accordion 1.7.2
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.accordion", {

	_init: function() {

		var o = this.options, self = this;
		this.running = 0;

		// if the user set the alwaysOpen option on init
		// then we need to set the collapsible option
		// if they set both on init, collapsible will take priority
		if (o.collapsible == $.ui.accordion.defaults.collapsible &&
			o.alwaysOpen != $.ui.accordion.defaults.alwaysOpen) {
			o.collapsible = !o.alwaysOpen;
		}

		if ( o.navigation ) {
			var current = this.element.find("a").filter(o.navigationFilter);
			if ( current.length ) {
				if ( current.filter(o.header).length ) {
					this.active = current;
				} else {
					this.active = current.parent().parent().prev();
					current.addClass("ui-accordion-content-active");
				}
			}
		}

		this.element.addClass("ui-accordion ui-widget ui-helper-reset");
		
		// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
		if (this.element[0].nodeName == "UL") {
			this.element.children("li").addClass("ui-accordion-li-fix");
		}

		this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
			.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
			.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
			.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
			.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });

		this.headers
			.next()
				.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");

		this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
		this.active.next().addClass('ui-accordion-content-active');

		//Append icon elements
		$("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
		this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);

		// IE7-/Win - Extra vertical space in lists fixed
		if ($.browser.msie) {
			this.element.find('a').css('zoom', '1');
		}

		this.resize();

		//ARIA
		this.element.attr('role','tablist');

		this.headers
			.attr('role','tab')
			.bind('keydown', function(event) { return self._keydown(event); })
			.next()
			.attr('role','tabpanel');

		this.headers
			.not(this.active || "")
			.attr('aria-expanded','false')
			.attr("tabIndex", "-1")
			.next()
			.hide();

		// make sure at least one header is in the tab order
		if (!this.active.length) {
			this.headers.eq(0).attr('tabIndex','0');
		} else {
			this.active
				.attr('aria-expanded','true')
				.attr('tabIndex', '0');
		}

		// only need links in taborder for Safari
		if (!$.browser.safari)
			this.headers.find('a').attr('tabIndex','-1');

		if (o.event) {
			this.headers.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event, this); });
		}

	},

	destroy: function() {
		var o = this.options;

		this.element
			.removeClass("ui-accordion ui-widget ui-helper-reset")
			.removeAttr("role")
			.unbind('.accordion')
			.removeData('accordion');

		this.headers
			.unbind(".accordion")
			.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
			.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");

		this.headers.find("a").removeAttr("tabindex");
		this.headers.children(".ui-icon").remove();
		var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
		if (o.autoHeight || o.fillHeight) {
			contents.css("height", "");
		}
	},
	
	_setData: function(key, value) {
		if(key == 'alwaysOpen') { key = 'collapsible'; value = !value; }
		$.widget.prototype._setData.apply(this, arguments);	
	},

	_keydown: function(event) {

		var o = this.options, keyCode = $.ui.keyCode;

		if (o.disabled || event.altKey || event.ctrlKey)
			return;

		var length = this.headers.length;
		var currentIndex = this.headers.index(event.target);
		var toFocus = false;

		switch(event.keyCode) {
			case keyCode.RIGHT:
			case keyCode.DOWN:
				toFocus = this.headers[(currentIndex + 1) % length];
				break;
			case keyCode.LEFT:
			case keyCode.UP:
				toFocus = this.headers[(currentIndex - 1 + length) % length];
				break;
			case keyCode.SPACE:
			case keyCode.ENTER:
				return this._clickHandler({ target: event.target }, event.target);
		}

		if (toFocus) {
			$(event.target).attr('tabIndex','-1');
			$(toFocus).attr('tabIndex','0');
			toFocus.focus();
			return false;
		}

		return true;

	},

	resize: function() {

		var o = this.options, maxHeight;

		if (o.fillSpace) {
			
			if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
			maxHeight = this.element.parent().height();
			if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
	
			this.headers.each(function() {
				maxHeight -= $(this).outerHeight();
			});

			var maxPadding = 0;
			this.headers.next().each(function() {
				maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
			}).height(Math.max(0, maxHeight - maxPadding))
			.css('overflow', 'auto');

		} else if ( o.autoHeight ) {
			maxHeight = 0;
			this.headers.next().each(function() {
				maxHeight = Math.max(maxHeight, $(this).outerHeight());
			}).height(maxHeight);
		}

	},

	activate: function(index) {
		// call clickHandler with custom event
		var active = this._findActive(index)[0];
		this._clickHandler({ target: active }, active);
	},

	_findActive: function(selector) {
		return selector
			? typeof selector == "number"
				? this.headers.filter(":eq(" + selector + ")")
				: this.headers.not(this.headers.not(selector))
			: selector === false
				? $([])
				: this.headers.filter(":eq(0)");
	},

	_clickHandler: function(event, target) {

		var o = this.options;
		if (o.disabled) return false;

		// called only when using activate(false) to close all parts programmatically
		if (!event.target && o.collapsible) {
			this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
				.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
			this.active.next().addClass('ui-accordion-content-active');
			var toHide = this.active.next(),
				data = {
					options: o,
					newHeader: $([]),
					oldHeader: o.active,
					newContent: $([]),
					oldContent: toHide
				},
				toShow = (this.active = $([]));
			this._toggle(toShow, toHide, data);
			return false;
		}

		// get the click target
		var clicked = $(event.currentTarget || target);
		var clickedIsActive = clicked[0] == this.active[0];

		// if animations are still active, or the active header is the target, ignore click
		if (this.running || (!o.collapsible && clickedIsActive)) {
			return false;
		}

		// switch classes
		this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
			.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
		this.active.next().addClass('ui-accordion-content-active');
		if (!clickedIsActive) {
			clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
				.find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
			clicked.next().addClass('ui-accordion-content-active');
		}

		// find elements to show and hide
		var toShow = clicked.next(),
			toHide = this.active.next(),
			data = {
				options: o,
				newHeader: clickedIsActive && o.collapsible ? $([]) : clicked,
				oldHeader: this.active,
				newContent: clickedIsActive && o.collapsible ? $([]) : toShow.find('> *'),
				oldContent: toHide.find('> *')
			},
			down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );

		this.active = clickedIsActive ? $([]) : clicked;
		this._toggle(toShow, toHide, data, clickedIsActive, down);

		return false;

	},

	_toggle: function(toShow, toHide, data, clickedIsActive, down) {

		var o = this.options, self = this;

		this.toShow = toShow;
		this.toHide = toHide;
		this.data = data;

		var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };

		// trigger changestart event
		this._trigger("changestart", null, this.data);

		// count elements to animate
		this.running = toHide.size() === 0 ? toShow.size() : toHide.size();

		if (o.animated) {

			var animOptions = {};

			if ( o.collapsible && clickedIsActive ) {
				animOptions = {
					toShow: $([]),
					toHide: toHide,
					complete: complete,
					down: down,
					autoHeight: o.autoHeight || o.fillSpace
				};
			} else {
				animOptions = {
					toShow: toShow,
					toHide: toHide,
					complete: complete,
					down: down,
					autoHeight: o.autoHeight || o.fillSpace
				};
			}

			if (!o.proxied) {
				o.proxied = o.animated;
			}

			if (!o.proxiedDuration) {
				o.proxiedDuration = o.duration;
			}

			o.animated = $.isFunction(o.proxied) ?
				o.proxied(animOptions) : o.proxied;

			o.duration = $.isFunction(o.proxiedDuration) ?
				o.proxiedDuration(animOptions) : o.proxiedDuration;

			var animations = $.ui.accordion.animations,
				duration = o.duration,
				easing = o.animated;

			if (!animations[easing]) {
				animations[easing] = function(options) {
					this.slide(options, {
						easing: easing,
						duration: duration || 700
					});
				};
			}

			animations[easing](animOptions);

		} else {

			if (o.collapsible && clickedIsActive) {
				toShow.toggle();
			} else {
				toHide.hide();
				toShow.show();
			}

			complete(true);

		}

		toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1").blur();
		toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();

	},

	_completed: function(cancel) {

		var o = this.options;

		this.running = cancel ? 0 : --this.running;
		if (this.running) return;

		if (o.clearStyle) {
			this.toShow.add(this.toHide).css({
				height: "",
				overflow: ""
			});
		}

		this._trigger('change', null, this.data);
	}

});


$.extend($.ui.accordion, {
	version: "1.7.2",
	defaults: {
		active: null,
		alwaysOpen: true, //deprecated, use collapsible
		animated: 'slide',
		autoHeight: true,
		clearStyle: false,
		collapsible: false,
		event: "click",
		fillSpace: false,
		header: "> li > :first-child,> :not(li):even",
		icons: {
			header: "ui-icon-triangle-1-e",
			headerSelected: "ui-icon-triangle-1-s"
		},
		navigation: false,
		navigationFilter: function() {
			return this.href.toLowerCase() == location.href.toLowerCase();
		}
	},
	animations: {
		slide: function(options, additions) {
			options = $.extend({
				easing: "swing",
				duration: 300
			}, options, additions);
			if ( !options.toHide.size() ) {
				options.toShow.animate({height: "show"}, options);
				return;
			}
			if ( !options.toShow.size() ) {
				options.toHide.animate({height: "hide"}, options);
				return;
			}
			var overflow = options.toShow.css('overflow'),
				percentDone,
				showProps = {},
				hideProps = {},
				fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
				originalWidth;
			// fix width before calculating height of hidden element
			var s = options.toShow;
			originalWidth = s[0].style.width;
			s.width( parseInt(s.parent().width(),10) - parseInt(s.css("paddingLeft"),10) - parseInt(s.css("paddingRight"),10) - (parseInt(s.css("borderLeftWidth"),10) || 0) - (parseInt(s.css("borderRightWidth"),10) || 0) );
			
			$.each(fxAttrs, function(i, prop) {
				hideProps[prop] = 'hide';
				
				var parts = ('' + $.css(options.toShow[0], prop)).match(/^([\d+-.]+)(.*)$/);
				showProps[prop] = {
					value: parts[1],
					unit: parts[2] || 'px'
				};
			});
			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
				step: function(now, settings) {
					// only calculate the percent when animating height
					// IE gets very inconsistent results when animating elements
					// with small values, which is common for padding
					if (settings.prop == 'height') {
						percentDone = (settings.now - settings.start) / (settings.end - settings.start);
					}
					
					options.toShow[0].style[settings.prop] =
						(percentDone * showProps[settings.prop].value) + showProps[settings.prop].unit;
				},
				duration: options.duration,
				easing: options.easing,
				complete: function() {
					if ( !options.autoHeight ) {
						options.toShow.css("height", "");
					}
					options.toShow.css("width", originalWidth);
					options.toShow.css({overflow: overflow});
					options.complete();
				}
			});
		},
		bounceslide: function(options) {
			this.slide(options, {
				easing: options.down ? "easeOutBounce" : "swing",
				duration: options.down ? 1000 : 200
			});
		},
		easeslide: function(options) {
			this.slide(options, {
				easing: "easeinout",
				duration: 700
			});
		}
	}
});

})(jQuery);
ï»¿//$j = jQuery.noConflict();
$j(document).ready(function(){
	//Initialisation du roll over de la nav
	$j('.navigation .hover_nav img').each(function() {
		var ur = $j(this).attr('src');
		if (ur) {		
				var uri = ur.split('_on');
				if(uri.length ==1)
				{
					var u = ur.split('.');
					$j(this).hover(function() {
						$j.cacheImage(u[0]+'_on.gif');
						$j(this).attr('src',u[0]+'_on.gif');
					},
					function() {
						$j(this).attr('src',ur);
					});
				}
		}		
	});
	//Initialisation du Carrousel
	nb = 0;
	//On compte le nombre de LI dispo sur le carrousel pour l'activer ou non
	$j(".carrousel ul li").each(function() {
		nb++;
	});
	if(nb>1)
	{
		$j(".carrousel").jCarouselLite({
	        btnNext: ".bt-next",
	        btnPrev: ".bt-prev",
	        visible: 3,
	        speed: 1000
	    });
	}
	else
	{
		$j('.bt-prev').css('cursor','default');
		$j('.bt-next').css('cursor','default');
	}
	
	//Initialisation Carrousel Offres
	if($j(".carrousel-cadeau").is('div'))
	{
		$j(".carrousel-cadeau").jCarouselLite({
	        btnNext: ".next",
	        btnPrev: ".prev",
	        visible: 1,
	        speed: 1000
	    });

	}

	if($j('#newsletter').is('input'))
	{
		$j('#newsletter').focus(function() {
			$j(this).attr('value','');
		});
		$j('#newsletter').blur(function() {
			if(!$j(this).attr('value'))
			{
				$j(this).attr('value','Saisissez votre e-mail');
			}
		});
	}
	
	//Initialisation des fonctions "onclick" sur le moteur de recherche de la HP
	$j('#form-reservation').submit(function() {
		if($j('#form-reservation #choix_station').attr('value')!='NULL')
		{
			$j(this).attr('action',stations[$j('#form-reservation #choix_station').attr('value')][$j('#form-reservation #choix_sejour').attr('value')]);
		}
		else
		{
			return false;
		}
	});
	$j('#form-reservation #choix_station').change(function() {
		$j('#form-reservation #choix_sejour').removeAttr('disabled');
		$j('#form-reservation #choix_sejour option').remove();
		if(stations[$j(this).attr('value')][1]!="")
		{
			$j('#form-reservation #choix_sejour').append('<option value="1">SÃ©jour SantÃ© : cure et mini-cure thermale</option>');
		}
		if(stations[$j(this).attr('value')][0]!="")
		{
			$j('#form-reservation #choix_sejour').append('<option value="0">SÃ©jour Spa : sÃ©jours et journÃ©es Forme</option>');
		}		
	});
	
	//Initialisation des formulaires Fastbooking Ã  un seul select
	$j('#form-reservation-un').submit(function() {
		if($j('#form-reservation-un select').attr('value')!='NULL')
		{
			$j(this).attr('action',data[$j('#form-reservation-un select').attr('value')][1]);
		}
		else
		{
			return false;
		}
	});
	//Initialisation des formulaires Fastbooking Ã  2 select (Station + type de sÃ©jours)
	$j('#form-reservation-deux').submit(function() {
		if($j('#form-reservation-deux #choix_station').attr('value')!='NULL')
		{
			$j(this).attr('action',data[$j('#form-reservation-deux #choix_station').attr('value')][1][$j('#form-reservation-deux #choix_sejour').attr('value')]);
		}
		else
		{
			return false;
		}		
	});
	
	$j('#form-reservation-deux #choix_station').change(function() {
		$j('#form-reservation-deux #choix_sejour').removeAttr('disabled');
		$j('#form-reservation-deux #choix_sejour option').remove();
		if(data[$j(this).attr('value')][1][1]!="")
		{
			$j('#form-reservation-deux #choix_sejour').append('<option value="1">SÃ©jour SantÃ© : cure et mini-cure thermale</option>');
		}
		if(data[$j(this).attr('value')][1][0]!="")
		{
			$j('#form-reservation-deux #choix_sejour').append('<option value="0">SÃ©jour Spa : sÃ©jours et journÃ©es Forme</option>');
		}		
	});

	//Initialisation des formulaires Fastbooking Ã  2 select (Station + Hotels)
	$j('#form-reservation-deuxh').submit(function() {
		if($j('#form-reservation-deuxh #choix_station').attr('value')!='NULL')
		{
			$j(this).attr('action',$j('#form-reservation-deuxh #choix_sejour').attr('value'));
		}
		else
		{
			return false;
		}		
	});
	
	$j('#form-reservation-deuxh #choix_station').change(function() {
		$j('#form-reservation-deuxh #choix_sejour').removeAttr('disabled');
		$j('#form-reservation-deuxh #choix_sejour option').remove();
		for(var i=0; i<data[$j(this).attr('value')][1].length; i++)
		{
			$j('#form-reservation-deuxh #choix_sejour').append('<option value='+data[$j(this).attr('value')][1][i][1]+'>'+data[$j(this).attr('value')][1][i][0]+'</option>');
		}	
	});
	
	//accordeon bienfaits
	$j("#accordion").accordion({
		autoHeight: false,
		header: '.header-accordeon-bienfaits h2',
		collapsible: true
	});

});
