// Angers Salsa website
// Main javascript/jQuery routines version: 2.0 beta 2009
// For static and dynamic web pages (urls should always be in absolute path !)
// Written by Médéric Claassen for Angers Salsa website
// ----------------------------------------------------
// ###########################################
// ###### Security pre-loading sections ######
// ###########################################
// avoid all attempt to reload the page into one of it's own embedded (frame/object) pages
if (window !=top ) {top.location=window.location;}
// avoid all attempt to embed the page (frame/object) into another page
if(top!=self) { top.location=self.location; }

// ####################################################
// ###### Global variables and constants section ######
// ####################################################
var ajaxLoader = 'http://angers.salsa.perso.neuf.fr/img/img.ajax-loader.gif';
var blogFeedUrl='http://angers.salsa.perso.neuf.fr/blog/feed';
var emailMask = new RegExp("^[^@]*@[^\\.]*\\.[^\\.][^\\.]+$",'');
var pageUrl = document.location.href;
var qpUrl=pageUrl.replace(/:/g,"%3A"); qpUrl=qpUrl.replace(/\//g,"%2F"); // Quoted printable
var anchorInUrl = pageUrl.replace(/^[^#]*/,''); // If exists: name of anchor in url
var isMouseMoved = false; // become true if the mouse is moved over the document
var isIeNavigator = ( navigator.userAgent.indexOf("MSIE") != -1 );

// Crytpted const
var mailAddr="OcQ8h504kntXYf79QFeCVicNwkUghv9GzZHICGsT";

// ################################
// ###### Functions sections ######
// ################################
//  * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
//  * Digest Algorithm, as defined in RFC 1321.
//  * Copyright (C) Paul Johnston 1999 - 2000.
//  * Updated by Greg Holt 2000 - 2001.
//  * Updated by Michel Chilowicz <michel@netastuces.org> (2000-2002)
//  * Under GPL License
//  * Convert a 32-bit number to a hex string with ls-byte first
var hex_chr="0123456789abcdef";function rhex(num){str="";for(j=0;j<=3;j++){str+=hex_chr.charAt((num>>(j*8+4))&0x0F)+hex_chr.charAt((num>>(j*8))&0x0F);}return str;}function int32toarray(int32){data=new Array();j=0;for(i=0;i<int32.length;i++){for(k=0;k<4;k++){data[j++]=(int32[i]>>(8*k))&255;}}return data;}function str2blks_MD5(str,type){nblk=((str.length+8)>>6)+1;blks=new Array(nblk*16);for(i=0;i<nblk*16;i++){blks[i]=0;}if(type==0){for(i=0;i<str.length;i++){blks[i>>2]|=str[i]<<((i%4)*8);}}else
{for(i=0;i<str.length;i++){blks[i>>2]|=str.charCodeAt(i)<<((i%4)*8);}}blks[i>>2]|=0x80<<((i%4)*8);blks[nblk*16-2]=str.length*8;return blks;}function add(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}function rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt));}function cmn(q,a,b,x,s,t){return add(rol(add(add(a,q),add(x,t)),s),b);}function ff(a,b,c,d,x,s,t){return cmn((b&c)|((~b)&d),a,b,x,s,t);}function gg(a,b,c,d,x,s,t){return cmn((b&d)|(c&(~d)),a,b,x,s,t);}function hh(a,b,c,d,x,s,t){return cmn(b^c^d,a,b,x,s,t);}function ii(a,b,c,d,x,s,t){return cmn(c^(b|(~d)),a,b,x,s,t);}function calcmd5(str,type){x=str2blks_MD5(str,type);a=1732584193;b=-271733879;c=-1732584194;d=271733878;for(i=0;i<x.length;i+=16){olda=a;oldb=b;oldc=c;oldd=d;a=ff(a,b,c,d,x[i+0],7,-680876936);d=ff(d,a,b,c,x[i+1],12,-389564586);c=ff(c,d,a,b,x[i+2],17,606105819);b=ff(b,c,d,a,x[i+3],22,-1044525330);a=ff(a,b,c,d,x[i+4],7,-176418897);d=ff(d,a,b,c,x[i+5],12,1200080426);c=ff(c,d,a,b,x[i+6],17,-1473231341);b=ff(b,c,d,a,x[i+7],22,-45705983);a=ff(a,b,c,d,x[i+8],7,1770035416);d=ff(d,a,b,c,x[i+9],12,-1958414417);c=ff(c,d,a,b,x[i+10],17,-42063);b=ff(b,c,d,a,x[i+11],22,-1990404162);a=ff(a,b,c,d,x[i+12],7,1804603682);d=ff(d,a,b,c,x[i+13],12,-40341101);c=ff(c,d,a,b,x[i+14],17,-1502002290);b=ff(b,c,d,a,x[i+15],22,1236535329);a=gg(a,b,c,d,x[i+1],5,-165796510);d=gg(d,a,b,c,x[i+6],9,-1069501632);c=gg(c,d,a,b,x[i+11],14,643717713);b=gg(b,c,d,a,x[i+0],20,-373897302);a=gg(a,b,c,d,x[i+5],5,-701558691);d=gg(d,a,b,c,x[i+10],9,38016083);c=gg(c,d,a,b,x[i+15],14,-660478335);b=gg(b,c,d,a,x[i+4],20,-405537848);a=gg(a,b,c,d,x[i+9],5,568446438);d=gg(d,a,b,c,x[i+14],9,-1019803690);c=gg(c,d,a,b,x[i+3],14,-187363961);b=gg(b,c,d,a,x[i+8],20,1163531501);a=gg(a,b,c,d,x[i+13],5,-1444681467);d=gg(d,a,b,c,x[i+2],9,-51403784);c=gg(c,d,a,b,x[i+7],14,1735328473);b=gg(b,c,d,a,x[i+12],20,-1926607734);a=hh(a,b,c,d,x[i+5],4,-378558);d=hh(d,a,b,c,x[i+8],11,-2022574463);c=hh(c,d,a,b,x[i+11],16,1839030562);b=hh(b,c,d,a,x[i+14],23,-35309556);a=hh(a,b,c,d,x[i+1],4,-1530992060);d=hh(d,a,b,c,x[i+4],11,1272893353);c=hh(c,d,a,b,x[i+7],16,-155497632);b=hh(b,c,d,a,x[i+10],23,-1094730640);a=hh(a,b,c,d,x[i+13],4,681279174);d=hh(d,a,b,c,x[i+0],11,-358537222);c=hh(c,d,a,b,x[i+3],16,-722521979);b=hh(b,c,d,a,x[i+6],23,76029189);a=hh(a,b,c,d,x[i+9],4,-640364487);d=hh(d,a,b,c,x[i+12],11,-421815835);c=hh(c,d,a,b,x[i+15],16,530742520);b=hh(b,c,d,a,x[i+2],23,-995338651);a=ii(a,b,c,d,x[i+0],6,-198630844);d=ii(d,a,b,c,x[i+7],10,1126891415);c=ii(c,d,a,b,x[i+14],15,-1416354905);b=ii(b,c,d,a,x[i+5],21,-57434055);a=ii(a,b,c,d,x[i+12],6,1700485571);d=ii(d,a,b,c,x[i+3],10,-1894986606);c=ii(c,d,a,b,x[i+10],15,-1051523);b=ii(b,c,d,a,x[i+1],21,-2054922799);a=ii(a,b,c,d,x[i+8],6,1873313359);d=ii(d,a,b,c,x[i+15],10,-30611744);c=ii(c,d,a,b,x[i+6],15,-1560198380);b=ii(b,c,d,a,x[i+13],21,1309151649);a=ii(a,b,c,d,x[i+4],6,-145523070);d=ii(d,a,b,c,x[i+11],10,-1120210379);c=ii(c,d,a,b,x[i+2],15,718787259);b=ii(b,c,d,a,x[i+9],21,-343485551);a=add(a,olda);b=add(b,oldb);c=add(c,oldc);d=add(d,oldd);}int32=new Array(a,b,c,d);return int32toarray(int32);}

// Javascryptor by Michel Chilowicz <michel@netastuces.org>
// Under GNU-GPL Licence (cf http://www.gnu.org)
// examples : strsaved=crypt_text(mytext,mypassword); mytext=decrypt_text(strsaved,mypassword);
values64=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/");function base64_encode(tab){var resultat="";for(i=0;i<tab.length+1;i+=3){if(tab.length<(i+1)){return resultat;}else if(tab.length==(i+1)){resultat+=values64[tab[i]>>2]+values64[(tab[i]<<4)&48]+"==";return resultat;}else if(tab.length==(i+2)){resultat+=values64[tab[i]>>2]+values64[((tab[i]<<4)&48)|(tab[i+1]>>4)]+values64[(tab[i+1]<<2)&60]+"=";return resultat;}else
{resultat+=values64[tab[i]>>2]+values64[((tab[i]<<4)&48)|(tab[i+1]>>4)]+values64[((tab[i+1]<<2)&60)|(tab[i+2]>>6)]+values64[tab[i+2]&63];}}}function base64_filter(text){var resultat="";for(i=0;i<text.length;i++){var ordinal=text.charCodeAt(i);if(((ordinal>47)&&(ordinal<58))||((ordinal>64)&&(ordinal<91))||((ordinal>96)&&(ordinal<123))||(ordinal==43)||(ordinal==47)||(ordinal==61)){resultat+=text.substr(i,1);}}return resultat;}function let2num(let){var ordinal=let;if((ordinal>47)&&(ordinal<58))return(ordinal+4);if((ordinal>64)&&(ordinal<91))return(ordinal-65);if((ordinal>96)&&(ordinal<123))return(ordinal-71);if(ordinal==43)return 62;if(ordinal==47)return 63;if(ordinal==61)return-1;return-1;}function base64_decode(text){var j=0;data=new Array();text=base64_filter(text);for(i=0;i<text.length;i+=4){var car0=let2num(text.charCodeAt(i));var car1=let2num(text.charCodeAt(i+1));var car2=let2num(text.charCodeAt(i+2));var car3=let2num(text.charCodeAt(i+3));if((car0>-1)&&(car1>-1))data[j++]=(car0<<2)|(car1>>4);if((car1>-1)&&(car2>-1))data[j++]=((car1&15)<<4)|(car2>>2);if((car2>-1)&&(car3>-1))data[j++]=((car2&3)<<6)|(car3);}return data;}function encode_text(text){var data=new Array();for(i=0;i<text.length;i++)data[i]=text.charCodeAt(i);return base64_encode(data);}function decode_text(text){var data=new Array();var resultat='';data=base64_decode(text);for(i=0;i<data.length;i++)resultat+=String.fromCharCode(data[i]);return resultat;}function mc4(data,key){var tab1=new Array();var tab2=new Array();var resultat=new Array();for(i=0;i<256;i++){tab1[i]=i;tab2[i]=key[i%(key.length)];}var j=0;for(var i=0;i<256;i++){j=(j+tab1[i]+tab2[j])%256;var temp=tab1[i];tab1[i]=tab1[j];tab1[j]=temp;}i=0;j=0;for(var k=0;k<data.length;k++){i=(i+1)%256;j=(j+tab1[i])%256;var temp=tab1[i];tab1[i]=tab1[j];tab1[j]=temp;resultat[k]=data[k]^tab1[(tab1[i]+tab1[j])%256];}return resultat;}function octet_alea(){return(Math.floor(Math.random()*256));}function crypt_text(text,password){var data=new Array();var key=new Array();var hash=new Array();for(var i=0;i<8;i++){data[i]=0;key[i]=octet_alea();}for(var j=0;j<text.length;j++)data[i+j]=text.charCodeAt(j);for(var j=0;j<password.length;j++)key[i+j]=password.charCodeAt(j);hash=calcmd5(key,0);data=mc4(data,hash);for(var i=0;i<8;i++)data[i]=key[i];resultat=base64_encode(data);return resultat;}function decrypt_text(text,password){var data=new Array();var key=new Array();var hash=new Array();data=base64_decode(text);for(i=0;i<8;i++){key[i]=data[i];}for(j=0;j<password.length;j++)key[i+j]=password.charCodeAt(j);hash=calcmd5(key,0);data=mc4(data,hash);var resultat="";for(i=8;i<data.length;i++)resultat+=String.fromCharCode(data[i]);return resultat;}

//  * jQuery UI 1.7.1
//  * 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
//  * core:
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},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}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.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 j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;

//  * jQuery UI Dialog 1.7.1
//  * 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/Dialog
//  * Depends:
//  *  ui.core.js
//  *  ui.draggable.js
//  *  ui.resizable.js
(function($){var setDataSwitch={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},uiDialogClasses='ui-dialog '+'ui-widget '+'ui-widget-content '+'ui-corner-all ';$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr('title');var self=this,options=this.options,title=options.title||this.originalTitle||'&nbsp;',titleId=$.ui.dialog.getTitleId(this.element),uiDialog=(this.uiDialog=$('<div/>')).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({position:'absolute',overflow:'hidden',zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).keydown(function(event){(options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&self.close(event));}).attr({role:'dialog','aria-labelledby':titleId}).mousedown(function(event){self.moveToTop(false,event);}),uiDialogContent=this.element.show().removeAttr('title').addClass('ui-dialog-content '+'ui-widget-content').appendTo(uiDialog),uiDialogTitlebar=(this.uiDialogTitlebar=$('<div></div>')).addClass('ui-dialog-titlebar '+'ui-widget-header '+'ui-corner-all '+'ui-helper-clearfix').prependTo(uiDialog),uiDialogTitlebarClose=$('<a href="#"/>').addClass('ui-dialog-titlebar-close '+'ui-corner-all').attr('role','button').hover(function(){uiDialogTitlebarClose.addClass('ui-state-hover');},function(){uiDialogTitlebarClose.removeClass('ui-state-hover');}).focus(function(){uiDialogTitlebarClose.addClass('ui-state-focus');}).blur(function(){uiDialogTitlebarClose.removeClass('ui-state-focus');}).mousedown(function(ev){ev.stopPropagation();}).click(function(event){self.close(event);return false;}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(this.uiDialogTitlebarCloseText=$('<span/>')).addClass('ui-icon '+'ui-icon-closethick').text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$('<span/>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar);uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();(options.draggable&&$.fn.draggable&&this._makeDraggable());(options.resizable&&$.fn.resizable&&this._makeResizable());this._createButtons(options.buttons);this._isOpen=false;(options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe());(options.autoOpen&&this.open());},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind('.dialog').removeData('dialog').removeClass('ui-dialog-content ui-widget-content').hide().appendTo('body');this.uiDialog.remove();(this.originalTitle&&this.element.attr('title',this.originalTitle));},close:function(event){var self=this;if(false===self._trigger('beforeclose',event)){return;}(self.overlay&&self.overlay.destroy());self.uiDialog.unbind('keypress.ui-dialog');(self.options.hide?self.uiDialog.hide(self.options.hide,function(){self._trigger('close',event);}):self.uiDialog.hide()&&self._trigger('close',event));$.ui.dialog.overlay.resize();self._isOpen=false;},isOpen:function(){return this._isOpen;},moveToTop:function(force,event){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger('focus',event);}if(this.options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=this.options.zIndex;}(this.overlay&&this.overlay.$el.css('z-index',$.ui.dialog.overlay.maxZ=++$.ui.dialog.maxZ));var saveScroll={scrollTop:this.element.attr('scrollTop'),scrollLeft:this.element.attr('scrollLeft')};this.uiDialog.css('z-index',++$.ui.dialog.maxZ);this.element.attr(saveScroll);this._trigger('focus',event);},open:function(){if(this._isOpen){return;}var options=this.options,uiDialog=this.uiDialog;this.overlay=options.modal?new $.ui.dialog.overlay(this):null;(uiDialog.next().length&&uiDialog.appendTo('body'));this._size();this._position(options.position);uiDialog.show(options.show);this.moveToTop(true);(options.modal&&uiDialog.bind('keypress.ui-dialog',function(event){if(event.keyCode!=$.ui.keyCode.TAB){return;}var tabbables=$(':tabbable',this),first=tabbables.filter(':first')[0],last=tabbables.filter(':last')[0];if(event.target==last&&!event.shiftKey){setTimeout(function(){first.focus();},1);}else if(event.target==first&&event.shiftKey){setTimeout(function(){last.focus();},1);}}));$([]).add(uiDialog.find('.ui-dialog-content :tabbable:first')).add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first')).add(uiDialog).filter(':first').focus();this._trigger('open');this._isOpen=true;},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$('<div></div>').addClass('ui-dialog-buttonpane '+'ui-widget-content '+'ui-helper-clearfix');this.uiDialog.find('.ui-dialog-buttonpane').remove();(typeof buttons=='object'&&buttons!==null&&$.each(buttons,function(){return!(hasButtons=true);}));if(hasButtons){$.each(buttons,function(name,fn){$('<button type="button"></button>').addClass('ui-state-default '+'ui-corner-all').text(name).click(function(){fn.apply(self.element[0],arguments);}).hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');}).focus(function(){$(this).addClass('ui-state-focus');}).blur(function(){$(this).removeClass('ui-state-focus');}).appendTo(uiDialogButtonPane);});uiDialogButtonPane.appendTo(this.uiDialog);}},_makeDraggable:function(){var self=this,options=this.options,heightBeforeDrag;this.uiDialog.draggable({cancel:'.ui-dialog-content',handle:'.ui-dialog-titlebar',containment:'document',start:function(){heightBeforeDrag=options.height;$(this).height($(this).height()).addClass("ui-dialog-dragging");(options.dragStart&&options.dragStart.apply(self.element[0],arguments));},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments));},stop:function(){$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);(options.dragStop&&options.dragStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}});},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=this.options,resizeHandles=typeof handles=='string'?handles:'n,e,s,w,se,sw,ne,nw';this.uiDialog.resizable({cancel:'.ui-dialog-content',alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){$(this).addClass("ui-dialog-resizing");(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments));},resize:function(){(options.resize&&options.resize.apply(self.element[0],arguments));},handles:resizeHandles,stop:function(){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize();}}).find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');},_position:function(pos){var wnd=$(window),doc=$(document),pTop=doc.scrollTop(),pLeft=doc.scrollLeft(),minTop=pTop;if($.inArray(pos,['center','top','right','bottom','left'])>=0){pos=[pos=='right'||pos=='left'?pos:'center',pos=='top'||pos=='bottom'?pos:'middle'];}if(pos.constructor!=Array){pos=['center','middle'];}if(pos[0].constructor==Number){pLeft+=pos[0];}else{switch(pos[0]){case'left':pLeft+=0;break;case'right':pLeft+=wnd.width()-this.uiDialog.outerWidth();break;default:case'center':pLeft+=(wnd.width()-this.uiDialog.outerWidth())/2;}}if(pos[1].constructor==Number){pTop+=pos[1];}else{switch(pos[1]){case'top':pTop+=0;break;case'bottom':pTop+=wnd.height()-this.uiDialog.outerHeight();break;default:case'middle':pTop+=(wnd.height()-this.uiDialog.outerHeight())/2;}}pTop=Math.max(pTop,minTop);this.uiDialog.css({top:pTop,left:pLeft});},_setData:function(key,value){(setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value));switch(key){case"buttons":this._createButtons(value);break;case"closeText":this.uiDialogTitlebarCloseText.text(value);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(uiDialogClasses+value);break;case"draggable":(value?this._makeDraggable():this.uiDialog.draggable('destroy'));break;case"height":this.uiDialog.height(value);break;case"position":this._position(value);break;case"resizable":var uiDialog=this.uiDialog,isResizable=this.uiDialog.is(':data(resizable)');(isResizable&&!value&&uiDialog.resizable('destroy'));(isResizable&&typeof value=='string'&&uiDialog.resizable('option','handles',value));(isResizable||this._makeResizable(value));break;case"title":$(".ui-dialog-title",this.uiDialogTitlebar).html(value||'&nbsp;');break;case"width":this.uiDialog.width(value);break;}$.widget.prototype._setData.apply(this,arguments);},_size:function(){var options=this.options;this.element.css({height:0,minHeight:0,width:'auto'});var nonContentHeight=this.uiDialog.css({height:'auto',width:options.width}).height();this.element.css({minHeight:Math.max(options.minHeight-nonContentHeight,0),height:options.height=='auto'?'auto':Math.max(options.height-nonContentHeight,0)});}});$.extend($.ui.dialog,{version:"1.7.1",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:'close',dialogClass:'',draggable:true,hide:null,height:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:'center',resizable:true,show:null,stack:true,title:'',width:300,zIndex:1000},getter:'isOpen',uuid:0,maxZ:0,getTitleId:function($el){return'ui-dialog-title-'+($el.attr('id')||++this.uuid);},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog);}});$.extend($.ui.dialog.overlay,{instances:[],maxZ:0,events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(event){return event+'.dialog-overlay';}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){$(document).bind($.ui.dialog.overlay.events,function(event){var dialogZ=$(event.target).parents('.ui-dialog').css('zIndex')||0;return(dialogZ>$.ui.dialog.overlay.maxZ);});},1);$(document).bind('keydown.dialog-overlay',function(event){(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode==$.ui.keyCode.ESCAPE&&dialog.close(event));});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);}var $el=$('<div></div>').appendTo(document.body).addClass('ui-widget-overlay').css({width:this.width(),height:this.height()});(dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe());this.instances.push($el);return $el;},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);if(this.instances.length===0){$([document,window]).unbind('.dialog-overlay');}$el.remove();},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight){return $(window).height()+'px';}else{return scrollHeight+'px';}}else{return $(document).height()+'px';}},width:function(){if($.browser.msie&&$.browser.version<7){var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(scrollWidth<offsetWidth){return $(window).width()+'px';}else{return scrollWidth+'px';}}else{return $(document).width()+'px';}},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this);});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()});}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el);}});})(jQuery);

//  * jQuery UI Resizable 1.7.1
//  * 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/Resizables
//  * Depends:
//  *  ui.core.js
(function($){$.widget("ui.resizable",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||'ui-resizable-helper':null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css('position'))&&$.browser.opera)this.element.css({position:'relative',top:'auto',left:'auto'});this.element.wrap($('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css('position'),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css('top'),left:this.element.css('left')}));this.element=this.element.parent().data("resizable",this.element.data('resizable'));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css('resize');this.originalElement.css('resize','none');this._proportionallyResizeElements.push(this.originalElement.css({position:'static',zoom:1,display:'block'}));this.originalElement.css({margin:this.originalElement.css('margin')});this._proportionallyResize();}this.handles=o.handles||(!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'});if(this.handles.constructor==String){if(this.handles=='all')this.handles='n,e,s,w,se,sw,ne,nw';var n=this.handles.split(",");this.handles={};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),hname='ui-resizable-'+handle;var axis=$('<div class="ui-resizable-handle '+hname+'"></div>');if(/sw|se|ne|nw/.test(handle))axis.css({zIndex:++o.zIndex});if('se'==handle){axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');};this.handles[handle]='.ui-resizable-'+handle;this.element.append(axis);}}this._renderAxis=function(target){target=target||this.element;for(var i in this.handles){if(this.handles[i].constructor==String)this.handles[i]=$(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var axis=$(this.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");target.css(padPos,padWrapper);this._proportionallyResize();}if(!$(this.handles[i]).length)continue;}};this._renderAxis(this.element);this._handles=$('.ui-resizable-handle',this.element).disableSelection();this._handles.mouseover(function(){if(!self.resizing){if(this.className)var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");self._handles.show();},function(){if(!self.resizing){$(this).addClass("ui-resizable-autohide");self._handles.hide();}});}this._mouseInit();},destroy:function(){this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};if(this.elementIsWrapper){_destroy(this.element);var wrapper=this.element;wrapper.parent().append(this.originalElement.css({position:wrapper.css('position'),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css('top'),left:wrapper.css('left')})).end().remove();}this.originalElement.css('resize',this.originalResizeStyle);_destroy(this.originalElement);},_mouseCapture:function(event){var handle=false;for(var i in this.handles){if($(this.handles[i])[0]==event.target)handle=true;}return this.options.disabled||!!handle;},_mouseStart:function(event){var o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;this.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){el.css({position:'absolute',top:iniPos.top,left:iniPos.left});}if($.browser.opera&&(/relative/).test(el.css('position')))el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var cursor=$('.ui-resizable-'+this.axis).css('cursor');$('body').css('cursor',cursor=='auto'?this.axis+'-resize':cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[event,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(this._aspectRatio||event.shiftKey)data=this._updateRatio(data,event);data=this._respectSize(data,event);this._propagate("resize",event);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length)this._proportionallyResize();this._updateCache(data);this._trigger('resize',event,this.ui());return false;},_mouseStop:function(event){this.resizing=false;var o=this.options,self=this;if(this._helper){var pr=this._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)this.element.css($.extend(s,{top:top,left:left}));self.helper.height(self.size.height);self.helper.width(self.size.width);if(this._helper&&!o.animate)this._proportionallyResize();}$('body').css('cursor','auto');this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper)this.helper.remove();return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(isNumber(data.left))this.position.left=data.left;if(isNumber(data.top))this.position.top=data.top;if(isNumber(data.height))this.size.height=data.height;if(isNumber(data.width))this.size.width=data.width;},_updateRatio:function(data,event){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*this.aspectRatio);else if(data.width)data.height=(csize.width/this.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;}if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}return data;},_respectSize:function(data,event){var el=this.helper,o=this.options,pRatio=this._aspectRatio||event.shiftKey,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height);if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data;},_proportionallyResize:function(){var o=this.options;if(!this._proportionallyResizeElements.length)return;var element=this.helper||this.element;for(var i=0;i<this._proportionallyResizeElements.length;i++){var prel=this._proportionallyResizeElements[i];if(!this.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];this.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});}if($.browser.msie&&!(!($(element).is(':hidden')||$(element).parents(':hidden').length)))continue;prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0});};},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+pxyoffset,height:this.element.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx,dy){return{width:this.originalSize.width+dx};},w:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!="resize"&&this._trigger(n,event,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}}));$.extend($.ui.resizable,{version:"1.7.1",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});$.ui.plugin.add("resizable","alsoResize",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options;_store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parseInt($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)});});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}else{$.each(o.alsoResize,function(exp,c){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0)style[prop]=sum||null;});if(/relative/.test(el.css('position'))&&$.browser.opera){self._revertToRelativePosition=true;el.css({position:'absolute',top:'auto',left:'auto'});}el.css(style);});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(event,ui){var self=$(this).data("resizable");if(self._revertToRelativePosition&&$.browser.opera){self._revertToRelativePosition=false;el.css({position:'relative'});}$(this).removeData("resizable-alsoresize-start");}});$.ui.plugin.add("resizable","animate",{stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var pr=self._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr&&pr.length)$(pr[0]).css({width:data.width,height:data.height});self._updateCache(data);self._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}else{var element=$(ce),p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name));});self.containerOffset=element.offset();self.containerPosition=element.position();self.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=self._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&(/static/).test(ce.css('position')))cop=co;if(cp.left<(self._helper?co.left:0)){self.size.width=self.size.width+(self._helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio)self.size.height=self.size.width/o.aspectRatio;self.position.left=o.helper?co.left:0;}if(cp.top<(self._helper?co.top:0)){self.size.height=self.size.height+(self._helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=self._helper?co.top:0;}self.offset.left=self.parentData.left+self.position.left;self.offset.top=self.parentData.top+self.position.top;var woset=Math.abs((self._helper?self.offset.left-cop.left:(self.offset.left-cop.left))+self.sizeDiff.width),hoset=Math.abs((self._helper?self.offset.top-cop.top:(self.offset.top-co.top))+self.sizeDiff.height);var isParent=self.containerElement.get(0)==self.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(self.containerElement.css('position'));if(isParent&&isOffsetRelative)woset-=self.parentData.left;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/self.aspectRatio;}if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*self.aspectRatio;}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options,cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.outerWidth()-self.sizeDiff.width,h=helper.outerHeight()-self.sizeDiff.height;if(self._helper&&!o.animate&&(/relative/).test(ce.css('position')))$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});if(self._helper&&!o.animate&&(/static/).test(ce.css('position')))$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}});$.ui.plugin.add("resizable","ghost",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size;self.ghost=self.originalElement.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","grid",{resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||event.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.height-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;}else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;}else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox;}}});var num=function(v){return parseInt(v,10)||0;};var isNumber=function(value){return!isNaN(parseInt(value,10));};})(jQuery);

//  * jQuery UI Draggable 1.7.1
//  * 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/Draggables
//  * Depends:
//  *	ui.core.js 
(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))this.element[0].style.position='relative';(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit();},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"+" ui-draggable-dragging"+" ui-draggable-disabled");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))return false;this.handle=this._getHandle(event);if(!this.handle)return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)this._adjustOffsetFromHelper(o.cursorAt);if(o.containment)this._setContainment();this._trigger("start",event);this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();this._trigger('drag',event,ui);this.position=ui.position;}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){self._trigger("stop",event);self._clear();});}else{this._trigger("stop",event);this._clear();}return false;},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce)return;var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};}}));$.extend($.ui.draggable,{version:"1.7.1",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);});$(group).each(function(i){this.style.zIndex=o.stack.min+i;});this[0].style.zIndex=o.stack.min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);

//  * jQuery UI Tabs 1.7.1
//  * 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/Tabs
//  * Depends:
//  *  ui.core.js
(function($){$.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable;}this._tabify(true);},_setData:function(key,value){if(key=='selected'){if(this.options.collapsible&&value==this.options.selected){return;}this.select(value);}else{this.options[key]=value;if(key=='deselectable'){this.options.collapsible=value;}this._tabify();}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},_sanitizeSelector:function(hash){return hash.replace(/:/g,'\\:');},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||'ui-tabs-'+$.data(this.list[0]));return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)));},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)};},_cleanup:function(){this.lis.filter('.ui-state-processing').removeClass('ui-state-processing').find('span:data(label.tabs)').each(function(){var el=$(this);el.html(el.data('label.tabs')).removeData('label.tabs');});},_tabify:function(init){this.list=this.element.children('ul:first');this.lis=$('li:has(a[href])',this.list);this.anchors=this.lis.map(function(){return $('a',this)[0];});this.panels=$([]);var self=this,o=this.options;var fragmentId=/^#.+/;this.anchors.each(function(i,a){var href=$(a).attr('href');var hrefBase=href.split('#')[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split('#')[0]||(baseEl=$('base')[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href;}if(fragmentId.test(href)){self.panels=self.panels.add(self._sanitizeSelector(href));}else if(href!='#'){$.data(a,'href.tabs',href);$.data(a,'load.tabs',href.replace(/#.*$/,''));var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom').insertAfter(self.panels[i-1]||self.list);$panel.data('destroy.tabs',true);}self.panels=self.panels.add($panel);}else{o.disabled.push(i);}});if(init){this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');this.lis.addClass('ui-state-default ui-corner-top');this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');if(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false;}});}if(typeof o.selected!='number'&&o.cookie){o.selected=parseInt(self._cookie(),10);}if(typeof o.selected!='number'&&this.lis.filter('.ui-tabs-selected').length){o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}o.selected=o.selected||0;}else if(o.selected===null){o.selected=-1;}o.selected=((o.selected>=0&&this.anchors[o.selected])||o.selected<0)?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter('.ui-state-disabled'),function(n,i){return self.lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1);}this.panels.addClass('ui-tabs-hide');this.lis.removeClass('ui-tabs-selected ui-state-active');if(o.selected>=0&&this.anchors.length){this.panels.eq(o.selected).removeClass('ui-tabs-hide');this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');self.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[o.selected],self.panels[o.selected]));});this.load(o.selected);}$(window).bind('unload',function(){self.lis.add(self.anchors).unbind('.tabs');self.lis=self.anchors=self.panels=null;});}else{o.selected=this.lis.index(this.lis.filter('.ui-tabs-selected'));}this.element[o.collapsible?'addClass':'removeClass']('ui-tabs-collapsible');if(o.cookie){this._cookie(o.selected,o.cookie);}for(var i=0,li;(li=this.lis[i]);i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass('ui-tabs-selected')?'addClass':'removeClass']('ui-state-disabled');}if(o.cache===false){this.anchors.removeData('cache.tabs');}this.lis.add(this.anchors).unbind('.tabs');if(o.event!='mouseover'){var addState=function(state,el){if(el.is(':not(.ui-state-disabled)')){el.addClass('ui-state-'+state);}};var removeState=function(state,el){el.removeClass('ui-state-'+state);};this.lis.bind('mouseover.tabs',function(){addState('hover',$(this));});this.lis.bind('mouseout.tabs',function(){removeState('hover',$(this));});this.anchors.bind('focus.tabs',function(){addState('focus',$(this).closest('li'));});this.anchors.bind('blur.tabs',function(){removeState('focus',$(this).closest('li'));});}var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1];}else{hideFx=showFx=o.fx;}}function resetStyle($el,fx){$el.css({display:''});if($.browser.msie&&fx.opacity){$el[0].style.removeAttribute('filter');}}var showTab=showFx?function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.hide().removeClass('ui-tabs-hide').animate(showFx,showFx.duration||'normal',function(){resetStyle($show,showFx);self._trigger('show',null,self._ui(clicked,$show[0]));});}:function(clicked,$show){$(clicked).closest('li').removeClass('ui-state-default').addClass('ui-tabs-selected ui-state-active');$show.removeClass('ui-tabs-hide');self._trigger('show',null,self._ui(clicked,$show[0]));};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||'normal',function(){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');resetStyle($hide,hideFx);self.element.dequeue("tabs");});}:function(clicked,$hide,$show){self.lis.removeClass('ui-tabs-selected ui-state-active').addClass('ui-state-default');$hide.addClass('ui-tabs-hide');self.element.dequeue("tabs");};this.anchors.bind(o.event+'.tabs',function(){var el=this,$li=$(this).closest('li'),$hide=self.panels.filter(':not(.ui-tabs-hide)'),$show=$(self._sanitizeSelector(this.hash));if(($li.hasClass('ui-tabs-selected')&&!o.collapsible)||$li.hasClass('ui-state-disabled')||$li.hasClass('ui-state-processing')||self._trigger('select',null,self._ui(this,$show[0]))===false){this.blur();return false;}o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass('ui-tabs-selected')){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie);}self.element.queue("tabs",function(){hideTab(el,$hide);}).dequeue("tabs");this.blur();return false;}else if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie);}self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));this.blur();return false;}}if(o.cookie){self._cookie(o.selected,o.cookie);}if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide);});}self.element.queue("tabs",function(){showTab(el,$show);});self.load(self.anchors.index(this));}else{throw'jQuery UI Tabs: Mismatching fragment identifier.';}if($.browser.msie){this.blur();}});this.anchors.bind('click.tabs',function(){return false;});},destroy:function(){var o=this.options;this.abort();this.element.unbind('.tabs').removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible').removeData('tabs');this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');this.anchors.each(function(){var href=$.data(this,'href.tabs');if(href){this.href=href;}var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.lis.unbind('.tabs').add(this.panels).each(function(){if($.data(this,'destroy.tabs')){$(this).remove();}else{$(this).removeClass(['ui-state-default','ui-corner-top','ui-tabs-selected','ui-state-active','ui-state-hover','ui-state-focus','ui-state-disabled','ui-tabs-panel','ui-widget-content','ui-corner-bottom','ui-tabs-hide'].join(' '));}});if(o.cookie){this._cookie(null,o.cookie);}},add:function(url,label,index){if(index===undefined){index=this.anchors.length;}var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf('#')?url.replace('#',''):this._tabId($('a',$li)[0]);$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs',true);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).data('destroy.tabs',true);}$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode);}else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index]);}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n;});this._tabify();if(this.anchors.length==1){$li.addClass('ui-tabs-selected ui-state-active');$panel.removeClass('ui-tabs-hide');this.element.queue("tabs",function(){self._trigger('show',null,self._ui(self.anchors[0],self.panels[0]));});this.load(0);}this._trigger('add',null,this._ui(this.anchors[index],this.panels[index]));},remove:function(index){var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass('ui-tabs-selected')&&this.anchors.length>1){this.select(index+(index+1<this.anchors.length?1:-1));}o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n;});this._tabify();this._trigger('remove',null,this._ui($li.find('a')[0],$panel[0]));},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1){return;}this.lis.eq(index).removeClass('ui-state-disabled');o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this._trigger('enable',null,this._ui(this.anchors[index],this.panels[index]));},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass('ui-state-disabled');o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this._ui(this.anchors[index],this.panels[index]));}},select:function(index){if(typeof index=='string'){index=this.anchors.index(this.anchors.filter('[href$='+index+']'));}else if(index===null){index=-1;}if(index==-1&&this.options.collapsible){index=this.options.selected;}this.anchors.eq(index).trigger(this.options.event+'.tabs');},load:function(index){var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,'load.tabs');this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,'cache.tabs')){this.element.dequeue("tabs");return;}this.lis.eq(index).addClass('ui-state-processing');if(o.spinner){var span=$('span',a);span.data('label.tabs',span.html()).html(o.spinner);}this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,'cache.tabs',true);}self._trigger('load',null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s);}catch(e){}self.element.dequeue("tabs");}}));},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr;}this._cleanup();},url:function(index,url){this.anchors.eq(index).removeData('cache.tabs').data('load.tabs',url);},length:function(){return this.anchors.length;}});$.extend($.ui.tabs,{version:'1.7.1',getter:'length',defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:'click',fx:null,idPrefix:'ui-tabs-',panelTemplate:'<div></div>',spinner:'<em>Loading&#8230;</em>',tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t<self.anchors.length?t:0);},ms);if(e){e.stopPropagation();}});var stop=self._unrotate||(self._unrotate=!continuing?function(e){if(e.clientX){self.rotate(null);}}:function(e){t=o.selected;rotate();});if(ms){this.element.bind('tabsshow',rotate);this.anchors.bind(o.event+'.tabs',stop);rotate();}else{clearTimeout(self.rotation);this.element.unbind('tabsshow',rotate);this.anchors.unbind(o.event+'.tabs',stop);delete this._rotate;delete this._unrotate;}}});})(jQuery);

// ThickBox Functions (thanks to Cody Lindley)
//  * Thickbox 3.1 - One Box To Rule Them All.
//  * By Cody Lindley (http://www.codylindley.com)
//  * Copyright (c) 2007 cody lindley
//  * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
//  !!! Patched Version by Jamie Thompson - Fixes IE7 Positioning Issues !!!
//  !!! http://jamazon.co.uk/web/2008/03/17/thickbox-31-ie7-positioning-bug/ !!!
//  additional note by Médéric Claassen when using livequery with thickbox :
//  1. After creating with livequery on the fly an "a id='new_target' class='thickbox'" tag, always do this : tb_init('#new_target'); !!
//  2. Ie bug fix : do note use modal mode in livequery thickbox bounded windows !!

var tb_pathToImage = "http://angers.salsa.perso.neuf.fr/img/img.loadinganimation.gif";
/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
jQuery.browser.msie6=jQuery.browser.msie&&/MSIE 6\.0/i.test(window.navigator.userAgent)&&!/MSIE 7\.0/i.test(window.navigator.userAgent);jQuery(document).ready(function(){tb_init('a.thickbox, area.thickbox, input.thickbox');imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){jQuery(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;}).removeClass('thickbox');}function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click(tb_remove);}}if(tb_detectMacXFF()){jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{jQuery("#TB_overlay").addClass("TB_overlayBG");}if(caption===null){caption="";}jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");jQuery('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=jQuery("a[@rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;jQuery("#TB_window").append("<img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/>"+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Fermer'>fermer</a> ou échap</div>");jQuery("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;}jQuery("#TB_prev").click(goPrev);}if(!(TB_NextHTML==="")){function goNext(){jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;}jQuery("#TB_next").click(goNext);}document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();jQuery("#TB_load").remove();jQuery("#TB_Image").click(tb_remove);jQuery("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');jQuery("#TB_iframeContent").remove();if(params['modal']!="true"){jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Fermer'>fermer</a> ou échap</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>");}}else{if(jQuery("#TB_window").css("display")!="block"){if(params['modal']!="true"){jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>fermer</a> ou échap</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");}}else{jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";jQuery("#TB_ajaxContent")[0].scrollTop=0;jQuery("#TB_ajaxWindowTitle").html(caption);}}jQuery("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){jQuery("#TB_ajaxContent").append(jQuery('#'+params['inlineId']).children());jQuery("#TB_window").unload(function(){jQuery('#'+params['inlineId']).append(jQuery("#TB_ajaxContent").children());});tb_position();jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){tb_position();if(jQuery.browser.safari){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}}else{jQuery("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();jQuery("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");jQuery("#TB_window").css({display:"block"});});}}if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}if(keycode==27){tb_remove();}};}}catch(e){}}function tb_showIframe(){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"});}function tb_remove(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});jQuery("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){jQuery("body","html").css({height:"auto",width:"auto"});jQuery("html").css("overflow","");}document.onkeydown="";document.onkeyup="";return false;}function tb_position(){jQuery("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie6)){jQuery("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}}function tb_parseQuery(query){var Params={};if(!query){return Params;}var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}return Params;}function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}}

// innerfade function (thanks to Torsten Baldes)
// http://medienfreunde.com/lab/innerfade/
// jquery.innerfade.js
// Datum: 2008-02-14
// Firma: Medienfreunde Hofmann & Baldes GbR
// Author: Torsten Baldes
// Mail: t.baldes@medienfreunde.com
// Web: http://medienfreunde.com
// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/
// and Ralf S. Engelschall http://trainofthoughts.org/
// =========================================================
//  *
//  *  <ul id="news">
//  *      <li>content 1</li>
//  *      <li>content 2</li>
//  *      <li>content 3</li>
//  *  </ul>
//  *
//  *  $('#news').innerfade({
//  *    animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'),
//  *    speed: Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'),
//  *    timeout: Time between the fades in milliseconds (Default: '2000'),
//  *    type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'),
//  *    containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
//  *    runningclass: CSS-Class which the container get’s applied (Default: 'innerfade'),
//  *    children: optional children selector (Default: null)
//  *  });
//  *
// =========================================================
// **** remove Opacity-Filter in ie ****

function removeFilter(element){if(element.style.removeAttribute){element.style.removeAttribute('filter');}}(function($){jQuery.fn.innerfade=function(options){return this.each(function(){jQuery.innerfade(this,options);});};jQuery.innerfade=function(container,options){var settings={'animationtype':'fade','speed':'normal','type':'sequence','timeout':2000,'containerheight':'auto','runningclass':'innerfade','children':null};if(options){jQuery.extend(settings,options);}if(settings.children===null){var elements=jQuery(container).children();}else{var elements=jQuery(container).children(settings.children);}if(elements.length>1){jQuery(container).css('position','relative').css('height',settings.containerheight).addClass(settings.runningclass);for(var i=0;i<elements.length;i++){jQuery(elements[i]).css('z-index',String(elements.length-i)).css('position','absolute').hide();}if(settings.type=="sequence"){setTimeout(function(){jQuery.innerfade.next(elements,settings,1,0);},settings.timeout);jQuery(elements[0]).show();}else if(settings.type=="random"){var last=Math.floor(Math.random()*(elements.length));setTimeout(function(){do{current=Math.floor(Math.random()*(elements.length));}while(last==current);jQuery.innerfade.next(elements,settings,current,last);},settings.timeout);jQuery(elements[last]).show();}else if(settings.type=='random_start'){settings.type='sequence';var current=Math.floor(Math.random()*(elements.length));setTimeout(function(){jQuery.innerfade.next(elements,settings,(current+1)%elements.length,current);},settings.timeout);jQuery(elements[current]).show();}else{alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');}}};jQuery.innerfade.next=function(elements,settings,current,last){if(settings.animationtype=='slide'){jQuery(elements[last]).slideUp(settings.speed);jQuery(elements[current]).slideDown(settings.speed);}else if(settings.animationtype=='fade'){jQuery(elements[last]).fadeOut(settings.speed);jQuery(elements[current]).fadeIn(settings.speed,function(){removeFilter(jQuery(this)[0]);});}else{alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');}if(settings.type=="sequence"){if((current+1)<elements.length){current=current+1;last=current-1;}else{current=0;last=elements.length-1;}}else if(settings.type=="random"){last=current;while(current==last){current=Math.floor(Math.random()*elements.length);}}else{alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');}setTimeout((function(){jQuery.innerfade.next(elements,settings,current,last);}),settings.timeout);};})(jQuery);

// jFeed : jQuery feed parser plugin
// * Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
// * Dual licensed under the MIT (MIT-license.txt)
// * and GPL (GPL-license.txt) licenses.
function JFeed(xml){if(xml){this.parse(xml);}}function JAtom(xml){this._parse(xml);}function JRss(xml){this._parse(xml);}jQuery.getFeed=function(options,callback){options=$.extend({url:null,data:null,success:null},options);if(options.url){jQuery.ajax({type:'GET',url:options.url,data:options.data,dataType:'xml',success:function(xml){var feed=new JFeed(xml);if($.isFunction(options.success)){options.success(feed);}}});}};JFeed.prototype={type:'',version:'',title:'',link:'',description:'',parse:function(xml){var feedClass;if(jQuery('channel',xml).length==1){this.type='rss';feedClass=new JRss(xml);}else if(jQuery('feed',xml).length==1){this.type='atom';feedClass=new JAtom(xml);}if(feedClass){$.extend(this,feedClass);}}};function JFeedItem(){}JFeedItem.prototype={title:'',link:'',description:'',updated:'',id:''};JAtom.prototype={_parse:function(xml){var channel=jQuery('feed',xml).eq(0);this.version='1.0';this.title=jQuery(channel).find('title:first').text();this.link=jQuery(channel).find('link:first').attr('href');this.description=jQuery(channel).find('subtitle:first').text();this.language=jQuery(channel).attr('xml:lang');this.updated=jQuery(channel).find('updated:first').text();this.items=new Array();var feed=this;jQuery('entry',xml).each(function(){var item=new JFeedItem();item.title=jQuery(this).find('title').eq(0).text();item.link=jQuery(this).find('link').eq(0).attr('href');item.description=jQuery(this).find('content').eq(0).text();item.updated=jQuery(this).find('updated').eq(0).text();item.id=jQuery(this).find('id').eq(0).text();feed.items.push(item);});}};JRss.prototype={_parse:function(xml){if(jQuery('rss',xml).length===0){this.version='1.0';}else{this.version=jQuery('rss',xml).eq(0).attr('version');}var channel=jQuery('channel',xml).eq(0);this.title=jQuery(channel).find('title:first').text();this.link=jQuery(channel).find('link:first').text();this.description=jQuery(channel).find('description:first').text();this.language=jQuery(channel).find('language:first').text();this.updated=jQuery(channel).find('lastBuildDate:first').text();this.items=new Array();var feed=this;jQuery('item',xml).each(function(){var item=new JFeedItem();item.title=jQuery(this).find('title').eq(0).text();item.link=jQuery(this).find('link').eq(0).text();item.description=jQuery(this).find('description').eq(0).text();item.updated=jQuery(this).find('pubDate').eq(0).text();item.id=jQuery(this).find('guid').eq(0).text();feed.items.push(item);});}};

// Image preview, script powered by jQuery (http://www.jquery.com)
// written by Alen Grakalic (http://cssglobe.com) and adapted by Médéric Claassen
// use rounded bordered windows of jQuery-UI with 'ui-corner-all' class (added by Médéric)
// for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
this.imagePreview=function(){var yOffset=10;var xOffset=10;jQuery("a.preview").livequery(function(){jQuery(this).css({'text-decoration':"none"}).children("img").css({border:"none"});});jQuery("a.preview").livequery(function(){var aUrl=this.href;var endUrl=aUrl.substring(aUrl.length-3,aUrl.length-0);var targetImg;if((endUrl=="png")||(endUrl=="jpg")||(endUrl=="gif")){targetImg=jQuery(this).find("img:first").attr("src");}this.t=this.title;jQuery(this).hover(function(e){this.title="";var c=(this.t!=="")?"<br/><span class='ui-corner-all'>"+this.t+"</span>":"";jQuery("body").append("<p id='actualpreview' class='ui-corner-all' style='position:absolute; z-index:100;'><img src='"+targetImg+"' alt='Image preview' />"+c+"</p>");jQuery("#actualpreview").css("top",(e.pageY+yOffset)+"px").css("left",(Math.floor(e.pageX/2)+xOffset)+"px").fadeIn("fast");},function(){this.title=this.t;jQuery("#actualpreview").remove();});});jQuery("a.preview").livequery('mousemove',function(e){jQuery("#actualpreview").css("top",(e.pageY+yOffset)+"px").css("left",(Math.floor(e.pageX/2)+xOffset)+"px");});};

// imgMagnetize: Create a magnet effect whith img element when pointing in/out it
// Author: Mederic Claassen. Licence: GPL. Implemented whith livequery calls
// $(selector).imgMagnetize([rate(default=0.90]);
jQuery.fn.imgMagnetize=function(rate){if(typeof(rate)=='undefined'){rate=0.90;}jQuery(this).livequery(function(){jQuery(this).each(function(){var fwidth=jQuery(this).css("width");var imgnewdim=Math.floor(fwidth.substring(0,fwidth.indexOf("px"))*rate);var swidth=imgnewdim+"px";var fheight=jQuery(this).css("height");imgnewdim=Math.floor(fheight.substring(0,fheight.indexOf("px"))*rate);var sheight=imgnewdim+"px";jQuery(this).attr({firstwidth:fwidth,firstheight:fheight}).css({width:swidth,height:sheight}).parents("a:first").css({"text-decoration":'none',border:'none'});if(!jQuery(this).hasClass("magnet")){jQuery(this).addClass("magnet");}});});jQuery(this).livequery(function(){jQuery(this).hover(function(){var swidth=jQuery(this).css("width");var sheight=jQuery(this).css("height");var fwidth=jQuery(this).attr("firstwidth");var fheight=jQuery(this).attr("firstheight");jQuery(this).attr({secondwidth:swidth,secondheight:sheight}).css({width:fwidth,height:fheight});},function(){var swidth=jQuery(this).attr("secondwidth");var sheight=jQuery(this).attr("secondheight");jQuery(this).css({width:swidth,height:sheight}).removeAttr("secondwidth").removeAttr("secondheight");});});return this;};

// panelInit & panelSlide: Build a block pannel with the div container given in selector,
// bound it the a tag whitch name should be 'selector_handle' so that,
// clicking onto that handle make the panel slide down, up, right or left
// Author: Mederic Claassen. Licence: GPL
// $(#selector).panelInit("left");
// $(#selector).panelSlide("left");
jQuery.fn.panelInit=function(){if(jQuery(this).hasClass('rounded')){jQuery(this).addClass("ui-widget-content ui-corner-all");}var panelId='#'+jQuery(this).attr('id');var handleId=jQuery(panelId+'_handle');if(jQuery(handleId).text().length){var handleText=jQuery(handleId).text();}else
{if(jQuery(handleId).attr("title").length){handleText=jQuery(handleId).attr("title");}else
{if(jQuery(panelId).attr("title").length){handleText=jQuery(panelId).attr("title");}else
{handleText=jQuery(panelId).attr("id");}}}var handleTitle;if(jQuery(handleId).attr("title").length){handleTitle=jQuery(handleId).attr("title");}else
{handleTitle=handleText;}if((handleTitle.indexOf("Montrer")==-1)&&(handleTitle.indexOf("montrer")==-1)){handleTitle=handleTitle+": montrer";}jQuery(handleId).addClass("slidehandle").attr({"alt":"poignée","href":"#"}).attr("title",handleTitle).each(function(){if(jQuery(this).hasClass('ui-style')){jQuery(this).html("<span class='ui-icon ui-icon-carat-1-s left'></span>"+handleText);}else{jQuery(this).addClass('button').html('<span>'+handleText+'</span>');}});return this;};jQuery.fn.panelSlide=function(duration){if(duration==='undefined'){duration=1000;}var handleId='#'+jQuery(this).attr("id");var panelId=handleId.substring(0,handleId.length-7);var isVisible;isVisible=jQuery(panelId).is(':visible');jQuery(panelId).slideToggle(duration);var btnTitle=jQuery(handleId).attr("title");var newTitle;if(isVisible===true){newTitle=btnTitle.replace("cacher","montrer");newTitle=newTitle.replace("Cacher","Montrer");}else
{newTitle=btnTitle.replace("montrer","cacher");newTitle=newTitle.replace("Montrer","Cacher");}jQuery(handleId).attr({title:newTitle});return this;};

// Wait function
// (thanks to http://docs.jquery.com/Cookbook/wait)
jQuery.fn.wait = function(time, type) {
  time = time || 1000;
  type = type || "fx";
  return this.queue(type, function() {
    var self = this;
    setTimeout(function() {
      jQuery(self).dequeue();
    }, time);
  });
};

// Typewriter function
// (thanks to http://www.jquery.info/spip.php?article19)
jQuery.fn.typewriter = function(opt,callback) {
  var i=0;
  var typeone = function(self, text, content) {
    if (text.length > 0) {
      i=i+1;
      var next = text.match(/(\s*(<[^>]*>)?)*(&.*?;|.?)/)[0];
      text = text.substr(next.length);
      jQuery(self).html(content+next);
      setTimeout(function(){
        typeone(self, text, content+next);
      }, opt['delay']);
      if(text.length===0) { return; }
    }
  };
  this.livequery(function() {
    opt = opt || { 'delay': 125 };
    typeone(this, jQuery(this).html(), '');
  });
  return this;
};

// Load container or class entity from extra webpage of the site
// Written by Médéric Claassen
// jQuery(selector).ajaxImport(url, container, sorryPhrase, alink(boolean));
jQuery.fn.ajaxImport = function(url, container, sorryPhrase, alink) {
  var phraseOut = sorryPhrase;
  if ( alink === true ) { phraseOut += " (<a href=\""+url+"\">accès direct</a>)."; }
  try {
    jQuery(this).load(url+' '+container);
  }
  catch(e) {
    if ( phraseOut.length ) { jQuery(this).html(phraseOut); }
  }
  return this;
};

// Make this element become an invisible (closed) dialog;
// Need New jQuery-UI 1.7.1 feature
jQuery.fn.initDialog = function(dialogWidth) {
  jQuery(this).each(function () {
    var elementId = jQuery(this).attr('id');
    jQuery("a[href='#"+elementId+"']").each(function() {
      jQuery(this).addClass('opendialog');
      var contentHtml = jQuery(this).html();
      jQuery(this).html("<span class='ui-icon ui-icon-newwin left'></span>"+contentHtml);
    });
    var dialogTitle = jQuery('a.opendialog:first').attr('title');
    if ( typeof(dialogWidth) == 'undefined' ) { dialogWidth = 460 ; }
    var modalMode;
    if ( jQuery(this).hasClass('modal') ) { modalMode = true; } else { modalMode = false; }
    jQuery(this).dialog({
      autoOpen: false,
      width: dialogWidth,
      title: dialogTitle,
      buttons: { 'Ok': function() { jQuery(this).dialog("close"); } },
      modal: modalMode,
      draggable: true,
      resizable: true
    });
    return this;
  });
};

// Open dialog targeted in jQuery(this) href;
// Need New jQuery-UI 1.7.1 feature and livequery
jQuery.fn.openDialog = function() {
  jQuery(this).each(function () {
    var targetDialog = jQuery(this).attr('href');
    jQuery(targetDialog).dialog('open');
    return false;
  });
};

// Get in pageUrl the value of the parameter given in queryStringName
function getQueryString(queryStringName) {
  // Get whole query String
  var mask1 = new RegExp("\\?.*$", "g");
  var queryStringValue = mask1.exec(pageUrl);
  if ( queryStringValue == null ) { return ''; }

  // Get name=value
  var mask2 = new RegExp('\\?'+queryStringName+'=[^&]*');
  queryStringValue = mask2.exec(queryStringValue);
  if ( queryStringValue == null ) { return ''; }

  // Get value
  var mask3 = new RegExp('[^=]*$');
  queryStringValue = mask3.exec(queryStringValue);
  if ( queryStringValue == null ) {
    return '';
  } else {
    return queryStringValue;
  }
};

// Get the days diff between today and litteral date given
function getDayDiff(eventfeed) {
  var eventDateMask = new RegExp('[0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4}');
  var twoNumMask = new RegExp('^[0-9]{1,2}');
  var fourNumMask = new RegExp('[0-9]{2,4}$');

  if ( eventDateMask.test(eventfeed) ) {

    var dateNumber = eventDateMask.exec(eventfeed).toString(); // 14/02/2009

    var eventDay = parseInt(twoNumMask.exec(dateNumber),10); // 14

    dateNumber = dateNumber.replace(/^[0-9]*\//,''); // 02/2009
    var eventMonth = parseInt(twoNumMask.exec(dateNumber),10)-1; // 01

    var eventYear = parseInt(fourNumMask.exec(dateNumber),10); // 2009
    if ( eventYear < 100 ) { eventYear+= 2000; }

    var eventDate = new Date(eventYear, eventMonth, eventDay);
    var fullNow = new Date();
    var Now = new Date(fullNow.getFullYear(), fullNow.getMonth(), fullNow.getDate() );

    return Math.ceil(Date.parse(eventDate)/86400000) - Math.ceil(Date.parse(Now)/86400000);
  } else {
    return -999;
  }
};

jQuery(document).ready(function(){

//   jQuery.noConflict();

  // ===== General features for Angers Salsa website =====
  jQuery("#asheader")  // load div id=headerfeeds containing common header divs
    .ajaxImport('http://angers.salsa.perso.neuf.fr/as.common.html?load=true','#headerfeeds','',false);

  jQuery("#mainmenufeed") // load extra menu from as.sitemap.html in 'mainmenufeed' div loaded from as.common.html
    .livequery(function(){
      jQuery(this).ajaxImport('http://angers.salsa.perso.neuf.fr/as.sitemap.html', '#smoothmenu','', false);
    });

  // ===== Common footer features for Angers Salsa no-partner pages =====
//   jQuery("#asfooter").load('http://angers.salsa.perso.neuf.fr/info/as.info.php #footerfeeds'); // execute php code for stat usage
  jQuery("#asfooter").load('http://angers.salsa.perso.neuf.fr/as.common.html?load=true #footerfeeds'); // load div id=footerfeeds containing divs

  jQuery("a.w3c")
    .livequery(function(){ // set HTML validator href pointing to the url of this page
      jQuery(this).attr({
        href:"http://validator.w3.org/check?uri="+qpUrl
      });
    });

  jQuery("a.w3c_css").livequery(function(){ // set CSS validator href pointing to the url of this page
    jQuery(this).attr({
      href:"http://jigsaw.w3.org/css-validator/validator?uri="+qpUrl.replace(/#.*$/g,"")+"&profile=css3&usermedium=all&warning=no&lang=fr"
    });
  });

  // On page load, hide each .onhovershow element
  jQuery(".onhovershow").each(function() {
    jQuery(this).hide();
  });

  jQuery("#submenu")
    .bind("mouseenter",function() { jQuery(this).children(".onhovershow").fadeIn("fast"); })
    .bind("mouseleave",function() { jQuery(this).children(".onhovershow").fadeOut("fast"); });

  // ===== Ajax feeds =====
  if ( jQuery('#blogfonctionnement_feed').length ) {
    jQuery('#blogfonctionnement_feed')
    .html(' <img id="loading" src="'+ajaxLoader+'" alt="chargement" title="chargement" />')
    .ajaxImport(
      'http://angers.salsa.perso.neuf.fr/blog/fonctionnement/comment-utiliser-le-blog-angers-salsa',
      '#content',
      "Impossible d'incorporer les données.",
      true
    );
  }

  if ( jQuery('#pourquoiunblog_feed').length ) {
    jQuery('#pourquoiunblog_feed')
    .html(' <img id="loading" src="'+ajaxLoader+'" alt="chargement" title="chargement" />')
    .ajaxImport(
      'http://angers.salsa.perso.neuf.fr/blog/fonctionnement/pourquoi_un_blog_angers_salsa',
      '#content',
      "Impossible d'incorporer les données.",
      true
    );
  }

  jQuery("#inaglance").each(function() {
    jQuery(this).css({display:'none'}).before(' <img id="loading" src="'+ajaxLoader+'" alt="chargement" title="chargement" />');
    try { // 1. Load last blog exerpts entries for futures events (20 max)
      jQuery.getFeed({
        url: blogFeedUrl,
        success: function(feed) {
          jQuery("#loading").remove();
          jQuery("#inaglance").show(1000);
          for (var i = 0; i < feed.items.length && i < 20; i++) {
            var blogFeedEntries = '';
            var item = feed.items[i];
            var eventBegin = 0;
            var eventEnd = item.description.indexOf('\012'); // = \r
            if ( eventEnd != -1 ) {
              var eventWhenWhere = item.description.substr(eventBegin,eventEnd);
              var DiffDay = getDayDiff(eventWhenWhere);
              if ( DiffDay >= 0 ) {
                if ( DiffDay == 0 ) { var todayMarkup = " today'"; } else { todayMarkup = "'"; }
                var eventDesc = item.description.substr(eventEnd+1,item.description.length);
                blogFeedEntries += "<p><span class='blogfeed" + todayMarkup + ">" + eventWhenWhere +
                "</span><br /><span class='blogexcerpt'><q>" + eventDesc + "</q> [<a href='" + item.link + "' title='Voir le billet complet sur le blog Angers Salsa'>plus...</a>]</span></p>";
                jQuery("#bloglookout").append(blogFeedEntries).children('p:last').hide().wait(800).show(1000);
              }
            }
          }

        jQuery("#eventlookout") // 2. Load titles events which are on as.evenements.html static page
          .css({display:'none'}) // load eventfeed silently first
          .ajaxImport(
            'http://angers.salsa.perso.neuf.fr/as.evenements.html',
            '.eventfeed',
            '',
            false
            );

        jQuery('p.eventfeed').livequery(function() { // callback to smoothly reveal eventlookout
          jQuery(this).css({display:'none'});
          jQuery('#eventlookout').css({display:'block'});
          jQuery(this).each(function() {
            var DiffDay = getDayDiff(jQuery(this).text());
            if ( DiffDay < 0 ) { // Dont show old event
              jQuery(this).remove();
            } else {
              if ( DiffDay == 0 ) { jQuery(this).addClass('today'); }
              // switch (DiffDay) {
              // case 0: var addNote = "";
              // break;
              // case 1: var addNote = '';
              // break;
              // default : var addNote = '';
              // break;
              // }
              jQuery(this).append(" [<a href='http://angers.salsa.perso.neuf.fr/as.evenements.html#' title='Voir le post-it sur la page des Soirées hebdo'>plus...</a>]</p>").wait(800).show(1000);
            }
          });
        });
        }
      });
    }
    catch(e) {
      jQuery("#loading").remove();
    }
  });

  // Update the evenement.html page by erasing old event
  jQuery('#postit ul li').each(function() {
    if ( getDayDiff(jQuery(this).find('p.eventfeed:first').text()) < 0 ) { jQuery(this).remove(); }
  });

  imagePreview(); // on pageload, load subfunction

  // Thickbox init
  tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox
  imgLoader = new Image();// preload image
  imgLoader.src = tb_pathToImage;

  jQuery('.dialog').livequery(function() { jQuery(this).initDialog(); });
  jQuery('a.opendialog').livequery('click', function() { jQuery(this).openDialog(); });

  jQuery('body').mouseenter(function () {  
    if ( ! isMouseMoved ) { // run the function only once
      jQuery("a.mainmailto").livequery(function () {
        var visible_text=decrypt_text(mailAddr,'afrolatino');
        if ( ! jQuery(this).text().length ) { jQuery(this).text(visible_text); }
        jQuery(this).attr("href","mailto:"+visible_text).attr("title",visible_text);
        isMouseMoved = true;
      });
    }
  });

  jQuery('#innerpostit')
      .each(function() {
        var innerPostItContent = '';
        var postItEntryNumber = jQuery('p.eventfeed').size();
        for (var i = 0; i < postItEntryNumber; i++) {
          innerPostItContent += '<em>-> ' + jQuery('p.eventfeed').eq(i).text() + '</em>'; // flèche: &#x2570;
        }
        jQuery(this).html(innerPostItContent);
      })
      .innerfade({
        animationtype: 'slide',
        speed: 2000,
        timeout: 5000,
        type: 'random',
        containerheight: '1em',
        runningclass: 'innerpostit'
        });

  // Main menu features
  jQuery("#headercontainer ul.smooth").livequery(function () { // make menu smooth
    jQuery("#headercontainer .smooth ul").css({display: "none"}); // Opera Fix
    jQuery("#headercontainer .smooth li").hover(
      function(){ // on mouse over
        jQuery(this).find('ul:first')
          .css({visibility: "visible", display: "none"})
          .show("normal");
      },
      function(){ // on mouse out
        jQuery(this).find('ul:first').css({visibility: "hidden"});
      })
      .each(function () {
        if ( jQuery(this).children("ul").length === 0 )
        { jQuery(this).children("a[href='#']").addClass("unavailable"); }
      });
    });

  jQuery('#bg_maincontainer_middle.sitemap li a').each(function() {
    var linkTitle = jQuery(this).attr('title');
    if ( linkTitle != '' ) { jQuery(this).after(" <span class='link-more'>- "+linkTitle+'</span>'); }
  });

  // <a class="unavailable"> -> Set title to "Non disponible"
  jQuery("a.unavailable").livequery(function () {
    jQuery(this).attr({title:"Non disponible"}).css({color:"#666666", "font-style":"italic"});
    });

  // Pannels layers features
  // bind each slidepanel container witch its '_handle' id anchor which must be present in document
  jQuery("*.slidepanel").livequery(function () { jQuery(this).panelInit();});
  // Hide/show panel container with left sliding on anchor handler click event
  jQuery("a.slidehandle").livequery('click',function () { jQuery(this).panelSlide(1000);});
  // bind each 'leftslide' panel container witch its '_handle' id anchor which must be present in document

  // Apply a 'magnet effect' for all class magnet images
  jQuery('img.magnet').imgMagnetize();

  // Provide a underline border for links not containing img
  jQuery('ul.ui-tabs-nav li a').livequery(function() { jQuery(this).addClass('hoveroff'); });
  jQuery('a img').livequery(function() { jQuery(this).parent().addClass('hoveroff'); });

  jQuery(".tab").tabs({ fx: { opacity: 'toggle' } });

  // reveal: Hide the parent element of the anchor targeted by href of each a class=reveal
  // 1. click on <a href="item1" class="reveal"></a> do:
  //    - toggle view of parent element of anchor witch name is item1
  // 2. click on <a href="item1_list" class="reveal"></a> do:
  //    - hide all element of class="list"
  //    - toggle view of parent element of anchor witch name is item1
  // Author: Mederic Claassen - Licence: GPL - Implemented with livequery
  // require wait() (provided by http://docs.jquery.com/Cookbook/wait)
  jQuery("a.reveal[href*='#']").livequery(function() {  // init
      var anchorId=jQuery(this).attr('href');
      var anchorPos=anchorId.indexOf('#');
      // 1.   Retrieve values from '#memberId[0]?_familyId' mask in href sanchor
      // 1.1. Define familyId
      var familyPos=anchorId.indexOf('_');
      var familyId;
      if ( familyPos != -1 ) {
        familyId=anchorId.substring(familyPos,anchorId.length);
      } else {
        familyId='';
        familyPos=anchorId.length;
      }
      // 1.2. Define memberId
      var memberId=anchorId.substring(anchorPos+1,familyPos);

      // 1.3. For jQuery selector, drop # from anchorId down : #anchorId -> anchorId
      anchorId=anchorId.substring(anchorPos+1,anchorId.length);

      // 2.   Set parent container's id and class of that <a> anchor targeted by href
      jQuery('a[name*='+anchorId+']')
        .parent().each(function() {
          // 2.1. Set it a id if it has not got yet
          if ( jQuery(this).attr('id') === '' ) { jQuery(this).attr('id',memberId+'0'+familyId); }
          // 2.2. Add it 'familyId' class if hasn't got
          if ( ( familyId !== '' ) && ( ! jQuery(this).hasClass(familyId) ) ) { jQuery(this).addClass(familyId.substring(1,familyId.length)); }
        })
        .css({display:'none'}); //  2.3. Hide it
  });
  jQuery("a.reveal[href*='#']")
    .livequery('click', function(){
    var anchorId=jQuery(this).attr('href');
    var anchorPos=anchorId.indexOf('#');
    anchorId=anchorId.substring(anchorPos+1,anchorId.length);
    var parentId=jQuery('a[name*='+anchorId+']').parent().attr('id');
    var familyPos=anchorId.indexOf('_');
    var Pause=1;
    if ( familyPos != -1 ) {
      var familyId=anchorId.substring(familyPos+1,anchorId.length);
      jQuery('.'+familyId).each(function() { // first: hide all other opened elements of the same family as parent of anchor (with class='familyId')
        if ( ( jQuery(this).css('display') != 'none' ) && ( jQuery(this).attr('id') != parentId ) ) {
          jQuery(this).hide("normal");
          Pause=800; // create a short pause before next opening element
        }
      });
    }
    // toggle the element which anchor's parent is targeted in href and play video if default autoplay=1
    jQuery('#'+parentId).wait(Pause).toggle("normal");
  });

  jQuery('#headercontainer #smoothmenu ul li a').livequery(function() {
    jQuery(this).addClass('bordered ui-corner-all');
  });

  jQuery('.inbox').livequery(function() { jQuery(this).addClass("ui-corner-all"); });

  // Table enhancing with jquery-ui
  jQuery("table.rounded").livequery(function(){
    jQuery(this).addClass("ui-widget-content ui-corner-all").removeAttr('border');
    var cellpadding = jQuery(this).attr('cellpadding');
    if ( ( cellpadding == '' ) || ( cellpadding > 2 ) ) { jQuery(this).attr('cellpadding', 2); };
    var cellspacing = jQuery(this).attr('cellspacing');
    if ( ( cellspacing == '' ) || ( cellspacing <  5 ) ) { jQuery(this).attr('cellspacing', 10); };
  });

  // ----------- General emailme.com Form effects -----------
  // Warning: because of id tag, one emailme.com form a page max !
  // Note: emailmeform.com provides old fashion name rather than id tag
  jQuery('fieldset,input,button,textarea,select').addClass("bordered ui-corner-all");

  // -------------------- Form dialogs init --------------------
  jQuery("*[id$='_form']").each(function() {
    var formTitle;
    switch (jQuery(this).attr('id')) {
      case 'contact_form':
      formTitle='Envoyer un email';
      break;
      case 'blogsignin_form':
      formTitle="S'inscrire comme rédacteur des webzine et blog";
      break;
      case 'mailing-list_signin_form':
      formTitle="S'inscrire à la mailing-list";
      break;
      case 'commentform':
      formTitle="Ecrire un mot...";
      break;
    }
    jQuery(this).dialog({
      autoOpen: false,
      width: 480,
      title: formTitle,
      buttons: {
        'Annuler': function() { jQuery(this).dialog("close"); }
      },
      modal: true
    });
  });

  // -------------------- Open + working form dialogs --------------------
  jQuery("a[href$='_form']").click(function () {
    var targetForm = jQuery(jQuery(this).attr('href')); // .replace(/^[^#]*/g,'')
    var contactName = jQuery(this).attr('title');
    jQuery("input[type='submit']").attr('disabled','disabled');

    targetForm
    .dialog('open') // should be open before making field active, otherwise ie bugs
    .each(function() {
      jQuery(this).find('input.useragent').attr('value',navigator.userAgent);
      jQuery(this).find('input.platform').attr('value',navigator.platform);
      var firstField = jQuery(this).find('input:first');
      if ( firstField.attr('readonly') ) { // for the contacts.html page
        firstField.attr('value',contactName);
        document.getElementById(jQuery(this).find('input:eq(1)').attr('id')).focus();
      } else {
        document.getElementById(firstField.attr('id')).focus();
      }
    })
    // .dialog('option', 'stack', true) // enable forcing to front
    // .dialog('option', 'stack', false) // disable forcing to front
    .hover(
      function(){ jQuery(this).addClass("ui-state-hover"); },
      function(){ jQuery(this).removeClass("ui-state-hover"); })
    .mousedown(function(){ jQuery(this).addClass("ui-state-active"); })
    .mouseup(function(){ jQuery(this).removeClass("ui-state-active"); });
    return false; // for not propagating to other event (clear button)
    }); // end of opendialog

  jQuery("#clear").click(function() { // specific to emailmeform.com
    jQuery("#Turing, form *[name*='FieldData']").each(function() {
      if ( ! jQuery(this).attr('readonly') ) { jQuery(this).val(''); }
    });
    jQuery('form *').removeClass('label_highlight field_error');
    jQuery(this).parents('form').each(function() {
      var activeFieldData = jQuery("form *[name*='FieldData']:first").attr('id');
      while ( jQuery(activeFieldData).attr('readonly') == 'readonly' ) {
        activeFieldData = jQuery(activeFieldData).next("form *[name*='FieldData']").attr('id');
      }
      document.getElementById(activeFieldData).focus();
    });
    jQuery("input[name='Submit']").attr('disabled','disabled');
  });

  jQuery("form input.field_required,textarea.field_required").blur(function() {
    // var formId = jQuery(this).attr('id');
    var FieldData = jQuery(this).attr('value');
      if ( FieldData == '' ) {
        jQuery(this).addClass('field_error').parent('td').prev('td').addClass('label_highlight'); // emailmeform
        jQuery(this).addClass('field_error').parent('p').find('label').addClass('label_highlight'); // wordpress
      } else {
        // something in the field
        if ( jQuery(this).hasClass('field_emailtype') ) {
          // field is an email type
          if ( ! ( emailMask.test(FieldData) ) ) {
            // regex test with email mask
            jQuery(this).addClass('field_error').parent('td').prev('td').addClass('label_highlight'); // emailmeform
            jQuery(this).addClass('field_error').parent('p').find('label').addClass('label_highlight'); // wordpress
          } else {
            jQuery(this).removeClass('field_error').parent('td').prev('td').removeClass('label_highlight'); // emailmeform
            jQuery(this).removeClass('field_error').parent('p').find('label').removeClass('label_highlight'); // wordpress
          }
        } else {
          // field is not an email type
          jQuery(this).removeClass('field_error').parent('td').prev('td').removeClass('label_highlight'); // emailmeform
          jQuery(this).removeClass('field_error').parent('p').find('label').removeClass('label_highlight'); // wordpress
        }
      }
      if ( jQuery(this).parents('form').find('*').hasClass('field_error') ) {
        jQuery("input[type='submit']").attr('disabled','disabled');
      } else {
        jQuery("input[type='submit']").removeAttr('disabled');
      }
  });

  jQuery('.captcha_refresh') // Click refresh all img of the page whitch are provided by emailmeform.com
    .click(function() {
      jQuery("img[src^='http://www.emailmeform.com/turing.php']").each(function() {
          jQuery(this).attr('src','http://www.emailmeform.com/turing.php?'+(new Date()).getMilliseconds());
      });
      return false;
    });
  // End of form dialog functionalities

  // ----------- auto-open dialog functionality -----------
  // ( comming back from sending via emailmefrom.com )
  jQuery('.message_onload').each(function() {
    var messageId = jQuery(this).attr('id').replace(/^#/,'');
    if ( getQueryString(messageId) == 'true' ) {
      var messageTitle;
      switch (messageId) {
        // Site moving notification...
        case 'from-googlepages':
        messageTitle = 'Redirection par googlepages.com&nbsp;&nbsp;';
        break;
        case 'mail_sent':
        messageTitle = 'Information envoyée';
        break;
        case 'blog_out':
        messageTitle = 'Maintenance partielle du site';
        break;
        case 'blogsignin_sent':
        messageTitle = "Demande d'inscription envoyée";
        break;
        case 'mailing-list_signin_sent':
        messageTitle = "Demande d'inscription envoyée";
        break;
        case 'recomail_sent':
        messageTitle = 'Email de recommandation envoyée';
        break;
      }
      jQuery(this).dialog({
        autoOpen: true,
        width: 480,
        title: messageTitle,
        buttons: {
          'Ok': function() {
            jQuery(this).dialog("close");
            document.location.href = pageUrl.replace(/\?.*$/,'');
          }
        },
        modal: true
      });
    } else {
      jQuery(this).remove();
    }
  });

  // Auto click on each anchor item inside url
  if ( anchorInUrl != '' ) {
      var anchorMask = new RegExp('^#[^#]*');
      var remainAnchor = anchorInUrl;
      var anchorText;
      var activeAnchor = anchorMask.exec(remainAnchor);
      while ( activeAnchor != null ) {
        // Note : avec livequery : ne semble pas fonctionner
        // jQuery('a[href=\''+activeAnchor+'\']:first').livequery(function() { jQuery(this).click(); });
        jQuery('a[href=\''+activeAnchor+'\']:first').click();
        remainAnchor = remainAnchor.replace(activeAnchor,'');
        activeAnchor = anchorMask.exec(remainAnchor);
        }
      }

  if ( jQuery('#maincontainer').hasClass('dynamic') ) {
  // ******************* Webzine-blog section *******************
    var addonTitle=''; // in #logofeed h1 which should be corrected into dynamic pages (blog)
    var highlight=''; // h1 title which should be corrected into dynamic pages (blog)
    // ## Hacks for title enhancement into blog pages
    if ( ( jQuery("#maincontainer.blogpost").length ) || ( jQuery("#maincontainer.blogcat").length ) || ( jQuery("#maincontainer.blogtag").length ) ) {
      addonTitle = ": le blog !";
      highlight = 'Blog Angers Salsa';
    } else {
      if ( jQuery("#maincontainer.webzine").length ) {
        addonTitle=": le webzine !";
        highlight = 'Webzine Angers Salsa';
      } else {
        if ( jQuery("#maincontainer.fonctionnement").length ) {
          addonTitle=": fonctionnement";
          highlight = 'Fonctionnement du site';
        } else {
          if ( jQuery("#maincontainer.livredor").length ) {
          addonTitle=": le livre d'or";
          highlight = "Livre d'or du site";
          } else {
            if ( jQuery("#maincontainer.error404").length ) {
              addonTitle=": page introuvable !";
              highlight = 'Page introuvable';
            } else {
              if ( ( jQuery("#maincontainer.archiveday").length ) || ( jQuery("#maincontainer.archivemonth").length ) || ( jQuery("#maincontainer.archiveyear").length ) ) {
                addonTitle = ": le blog !";
                highlight = 'Archives du Blog';
              } else {
                addonTitle = ": le blog !";
                highlight = 'Archives du Blog';
              }
            }
          }
        }
      }
    }

    jQuery("#logofeed h1").livequery(function(){
      var blogTitle=jQuery(this).html();
      var newBlogTitle=blogTitle.replace("Angers Salsa","Angers Salsa"+addonTitle);
      jQuery(this).html(newBlogTitle);
      jQuery(".typewriter").typewriter();
    });

    if ( ( highlight == 'Blog Angers Salsa' ) || ( highlight == 'Webzine Angers Salsa' ) || ( highlight == "Livre d'or du site" ) ) {
      var entryTitle = jQuery('#content').find('h2:first');
      if ( jQuery('h1.highlight:first').text() == '' ) {
        jQuery('h1.highlight:first').html(entryTitle.html());
        entryTitle.remove();
      }
    }

    jQuery('#post-248').each(function() { // single post of guestbook
      var introduction = jQuery(this).find('p').text();
      jQuery('h1.highlight:first').after("<div class='welcome screenonly'><p>"+introduction+"</p></div>");
      jQuery(this).remove();
    });

    // comment enhancement => move author and date creation to the right into a 'wraper-data div'
    jQuery('.comment-author.vcard').each(function() {
      var authorEditing = jQuery(this).find('cite.fn').text();
      var timeEditingDiv = jQuery(this).parent().find('div.commentmetadata');
      var timeEditing = timeEditingDiv.find('a:first').html().replace(/ *à.*$/,'');
      jQuery(this).removeClass('vcard').find('.says').remove();

      if ( timeEditing != '' ) { // prevents from wordpress upgrades...
        jQuery(this).replaceWith("<div id='writer-data-wrapper'><div class='writer-data'> "
          + timeEditing + " par " + authorEditing + " </div></div>");
        timeEditingDiv.remove();
      }
    });

    // Hack to remove empty navigation div
    if ( jQuery('div.navigation:first').text().replace(/[^a-zA-Z0-9]/g,'') == '' ) { jQuery('div.navigation').remove(); }

    // Hack for footer enhancement into blog pages
    jQuery('#asfooter a.w3c').livequery(function(){
      jQuery(this).replaceWith("propulsé par <a href='http://www.wordpress-fr.net' onclick='window.open(this.href); return false;' title='Moteur de blog'>Wordpress</a>");
    });

    jQuery('#content,#sidebar,#respond').livequery(function() { jQuery(this).addClass("bordered ui-corner-all"); });
    jQuery('.post').livequery(function() { jQuery(this).addClass("ui-widget-content ui-corner-all"); });

    // // Hack to be sure that height of 'bg_maincontainer_middle' div is either equal to 'content' div or 'sidebar' one
    // if ( jQuery('#sidebar').length ) {
    //   var contentHeight = jQuery('#content').height();
    //   var sidebarHeight = jQuery('#sidebar').height();
    //   var subHeaderHeight = jQuery('#sub-header').height();
    //   if ( contentHeight > sidebarHeight ) {
    //     jQuery('#bg_maincontainer_middle').css('height',contentHeight + subHeaderHeight);
    //   } else {
    //     jQuery('#bg_maincontainer_middle').css('height',sidebarHeight + subHeaderHeight);
    //   }
    // }
  // End of Webzine-blog section

  } else { // for static pages only:
  // Typewriter effect :
  jQuery(".typewriter").typewriter();
  }

  // Hacks for browser compliance
  // Alert if Internet Explorer
  if ( isIeNavigator ) {
    // Fix note: do note use modal mode in livequery thickbox bounded windows !!
    // 1. Insert a disclaimer div for inviting user to use Firefox intead of Ie
    jQuery('#ie-disclaimer-wraper').html("<p><a href='#TB_inline?height=170&amp;width=480&amp;inlineId=ie-disclaimer&amp;modal=false' class='thickbox'>Vous utilisez Internet Explorer : le webmaster a un message pour vous !</a></p><div id='ie-disclaimer' class='hidden'><p><q>Votre navigateur n'est pas entièrement compatible avec les standards du web et les bibliothèques jQuery abondamment utilisées sur ce site !</q></p><p><q>Malgré nos efforts pour s'adapter aux lacunes persistantes de ce navigateur, nous vous recommandons d'utiliser un navigateur moderne, sécurisé, libre et gratuit comme <a href='http://www.mozilla-europe.org/fr/firefox/' onclick='window.open(this.href); return false;'>Firefox</a> accompagné de ses extensions anti-pub <a href='http://adblockplus.org/fr/' onclick='window.open(this.href); return false;'>Adblock Plus</a> et anti-supercookie <a href='https://addons.mozilla.org/fr/firefox/addon/6623' onclick='window.open(this.href); return false;'>BetterPrivacy</a></q></p><p class='textright'><q>Médéric Claassen,<br />webmaster du site Angers Salsa</q></p></div>");
    tb_init('#ie-disclaimer-wraper a.thickbox');

    // 2. Modify feed_lookout div to be opened by Thickbox rather than modal jQuery-UI modal...
    jQuery('#feed_lookout').livequery(function() {
      jQuery(this).removeClass('dialog modal');
    });
    jQuery("a[href$='feed_lookout']").livequery(function() {
      jQuery(this).removeClass('opendialog').addClass('thickbox').attr('href','#TB_inline?height=580&amp;width=464&amp;inlineId=feed_lookout&amp;modal=false');
      tb_init(this);
    });
    // 3. Enable display of ie bugs messages...
    jQuery('.ie-only').livequery(function() { jQuery(this).removeClass('ie-only'); });
  }

  if ( ! jQuery.support.boxModel ) { // New v2.3 feature (see: http://docs.jquery.com/Utilities/jQuery.support)
    // 1. ul tags: exchange ul margin-left and ul padding-left. For information, see:
    // W3C box model: see https://developer.mozilla.org/fr/Indentation_homog%C3%A8ne_des_listes 
    // https://developer.mozilla.org/fr/Indentation_homog%C3%A8ne_des_listes
    // http://www.w3.org/TR/CSS2/box.html
    jQuery("ul").livequery(function(){ // browser is IE type
      jQuery(this).each(function() {
        var ulPaddingLeft=jQuery(this).css("padding-left"); 
        var ulMarginLeft=jQuery(this).css("margin-left");
        jQuery(this).css({"padding-left":ulMarginLeft,"margin-left":ulPaddingLeft});
      });
    });
    // 2. div tags: recalculate heights and widths
    // * @license You can use it free of charge for private and commercial websites.
    // *      You can't sell this code.
    // *      You have to leave the @license and the @author name and website even in minified (or similar) js files
    // *      Thanks.
    // *  @name fixBoxModel
    // *  @type jQuery
    // *  @cat Plugins/Fixes
    // *  @author Alessandro Coscia (*/php_staff [/\] ya hoo [-] it || http://www.programmatorephp.it/jquery)
    jQuery('div').livequery(function() {
      widthDiff = jQuery(this).outerWidth() - jQuery(this).width();
      heightDiff = jQuery(this).outerHeight() - jQuery(this).height();
      jQuery(this).width(jQuery(this).outerWidth() + widthDiff);
      jQuery(this).height(jQuery(this).outerHeight() + heightDiff);
    });
  } // end of hack for browser compliance

});