//Google API
if (!window['google']) {
window['google'] = {};
}
if (!window['google']['loader']) {
window['google']['loader'] = {};
google.loader.ServiceBase = 'https://www.google.com/uds';
google.loader.GoogleApisBase = 'https://ajax.googleapis.com/ajax';
google.loader.ApiKey = 'ABQIAAAAYy4uAd-yJ73gGtlEc8Z25BTAfN63XRsMPNTKkIHCiAU3NeET8RSKIqma8dfmNtzq8JOhlPVMNDDUEg';
google.loader.KeyVerified = true;
google.loader.LoadFailure = false;
google.loader.Secure = true;
google.loader.GoogleLocale = 'www.google.com';
google.loader.ClientLocation = {"latitude":48.867,"longitude":2.333,"address":{"city":"Paris","region":"Ile-de-France","country":"France","country_code":"FR"}};
google.loader.AdditionalParams = '';
(function() {var d=void 0,g=null,h=encodeURIComponent,j=window,k=document;function l(a,b){return a.load=b}var m="push",o="replace",p="charAt",r="indexOf",s="ServiceBase",t="name",u="getTime",v="length",w="prototype",x="setTimeout",y="loader",z="substring",A="join",B="toLowerCase";function C(a){if(a in D)return D[a];return D[a]=navigator.userAgent[B]()[r](a)!=-1}var D={};function E(a,b){var c=function(){};c.prototype=b[w];a.S=b[w];a.prototype=new c}
function F(a,b){var c=Array[w].slice.call(arguments,2)||[];return function(){var e=c.concat(Array[w].slice.call(arguments));return a.apply(b,e)}}function G(a){a=Error(a);a.toString=function(){return this.message};return a}function H(a,b){for(var c=a.split(/./),e=j,f=0;f<c[v]-1;f++)e[c[f]]||(e[c[f]]={}),e=e[c[f]];e[c[c[v]-1]]=b}function I(a,b,c){a[b]=c}if(!J)var J=H;if(!K)var K=I;google[y].t={};J("google.loader.callbacks",google[y].t);var L={},M={};google[y].eval={};J("google.loader.eval",google[y].eval);
l(google,function(a,b,c){function e(a){var b=a.split(".");if(b[v]>2)throw G("Module: '"+a+"' not found!");else if(typeof b[1]!="undefined")f=b[0],c.packages=c.packages||[],c.packages[m](b[1])}var f=a,c=c||{};if(a instanceof Array||a&&typeof a=="object"&&typeof a[A]=="function"&&typeof a.reverse=="function")for(var i=0;i<a[v];i++)e(a[i]);else e(a);if(a=L[":"+f]){c&&!c.language&&c.locale&&(c.language=c.locale);if(c&&typeof c.callback=="string"&&(i=c.callback,i.match(/^[[]A-Za-z0-9._]+$/)))i=j.eval(i),
c.callback=i;if((i=c&&c.callback!=g)&&!a.s(b))throw G("Module: '"+f+"' must be loaded before DOM onLoad!");else i?a.m(b,c)?j[x](c.callback,0):a.load(b,c):a.m(b,c)||a.load(b,c)}else throw G("Module: '"+f+"' not found!");});J("google.load",google.load);
google.R=function(a,b){b?(N[v]==0&&(O(j,"load",P),!C("msie")&&!C("safari")&&!C("konqueror")&&C("mozilla")||j.opera?j.addEventListener("DOMContentLoaded",P,!1):C("msie")?k.write("<script defer onreadystatechange='google.loader.domReady()' src=//:></script>"):(C("safari")||C("konqueror"))&&j[x](R,10)),N[m](a)):O(j,"load",a)};J("google.setOnLoadCallback",google.R);
function O(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var e=a["on"+b];a["on"+b]=e!=g?aa([c,e]):c}}function aa(a){return function(){for(var b=0;b<a[v];b++)a[b]()}}var N=[];google[y].L=function(){var a=j.event.srcElement;if(a.readyState=="complete")a.onreadystatechange=g,a.parentNode.removeChild(a),P()};J("google.loader.domReady",google[y].L);var ba={loaded:!0,complete:!0};function R(){ba[k.readyState]?P():N[v]>0&&j[x](R,10)}
function P(){for(var a=0;a<N[v];a++)N[a]();N.length=0}google[y].d=function(a,b,c){if(c){var e;if(a=="script")e=k.createElement("script"),e.type="text/javascript",e.src=b;else if(a=="css")e=k.createElement("link"),e.type="text/css",e.href=b,e.rel="stylesheet";(a=k.getElementsByTagName("head")[0])||(a=k.body.parentNode.appendChild(k.createElement("head")));a.appendChild(e)}else a=="script"?k.write('<script src="'+b+'" type="text/javascript"></script>'):a=="css"&&k.write('<link href="'+b+'" type="text/css" rel="stylesheet"></link>')};
J("google.loader.writeLoadTag",google[y].d);google[y].O=function(a){M=a};J("google.loader.rfm",google[y].O);google[y].Q=function(a){for(var b in a)typeof b=="string"&&b&&b[p](0)==":"&&!L[b]&&(L[b]=new S(b[z](1),a[b]))};J("google.loader.rpl",google[y].Q);google[y].P=function(a){if((a=a.specs)&&a[v])for(var b=0;b<a[v];++b){var c=a[b];typeof c=="string"?L[":"+c]=new T(c):(c=new U(c[t],c.baseSpec,c.customSpecs),L[":"+c[t]]=c)}};J("google.loader.rm",google[y].P);google[y].loaded=function(a){L[":"+a.module].k(a)};
J("google.loader.loaded",google[y].loaded);google[y].K=function(){return"qid="+((new Date)[u]().toString(16)+Math.floor(Math.random()*1E7).toString(16))};J("google.loader.createGuidArg_",google[y].K);H("google_exportSymbol",H);H("google_exportProperty",I);google[y].b={};J("google.loader.themes",google[y].b);google[y].b.A="//www.google.com/cse/style/look/bubblegum.css";K(google[y].b,"BUBBLEGUM",google[y].b.A);google[y].b.C="//www.google.com/cse/style/look/greensky.css";K(google[y].b,"GREENSKY",google[y].b.C);
google[y].b.B="//www.google.com/cse/style/look/espresso.css";K(google[y].b,"ESPRESSO",google[y].b.B);google[y].b.F="//www.google.com/cse/style/look/shiny.css";K(google[y].b,"SHINY",google[y].b.F);google[y].b.D="//www.google.com/cse/style/look/minimalist.css";K(google[y].b,"MINIMALIST",google[y].b.D);function T(a){this.a=a;this.q=[];this.p={};this.i={};this.e={};this.l=!0;this.c=-1}
T[w].g=function(a,b){var c="";b!=d&&(b.language!=d&&(c+="&hl="+h(b.language)),b.nocss!=d&&(c+="&output="+h("nocss="+b.nocss)),b.nooldnames!=d&&(c+="&nooldnames="+h(b.nooldnames)),b.packages!=d&&(c+="&packages="+h(b.packages)),b.callback!=g&&(c+="&async=2"),b.style!=d&&(c+="&style="+h(b.style)),b.other_params!=d&&(c+="&"+b.other_params));if(!this.l){google[this.a]&&google[this.a].JSHash&&(c+="&sig="+h(google[this.a].JSHash));var e=[],f;for(f in this.p)f[p](0)==":"&&e[m](f[z](1));for(f in this.i)f[p](0)==
":"&&this.i[f]&&e[m](f[z](1));c+="&have="+h(e[A](","))}return google[y][s]+"/?file="+this.a+"&v="+a+google[y].AdditionalParams+c};T[w].v=function(a){var b=g;a&&(b=a.packages);var c=g;if(b)if(typeof b=="string")c=[a.packages];else if(b[v]){c=[];for(a=0;a<b[v];a++)typeof b[a]=="string"&&c[m](b[a][o](/^s*|s*$/,"")[B]())}c||(c=["default"]);b=[];for(a=0;a<c[v];a++)this.p[":"+c[a]]||b[m](c[a]);return b};
l(T[w],function(a,b){var c=this.v(b),e=b&&b.callback!=g;if(e)var f=new V(b.callback);for(var i=[],n=c[v]-1;n>=0;n--){var q=c[n];e&&f.G(q);if(this.i[":"+q])c.splice(n,1),e&&this.e[":"+q][m](f);else i[m](q)}if(c[v]){b&&b.packages&&(b.packages=c.sort()[A](","));for(n=0;n<i[v];n++)q=i[n],this.e[":"+q]=[],e&&this.e[":"+q][m](f);if(!b&&M[":"+this.a]!=g&&M[":"+this.a].versions[":"+a]!=g&&!google[y].AdditionalParams&&this.l){c=M[":"+this.a];google[this.a]=google[this.a]||{};for(var Q in c.properties)Q&&Q[p](0)==
":"&&(google[this.a][Q[z](1)]=c.properties[Q]);google[y].d("script",google[y][s]+c.path+c.js,e);c.css&&google[y].d("css",google[y][s]+c.path+c.css,e)}else(!b||!b.autoloaded)&&google[y].d("script",this.g(a,b),e);if(this.l&&(this.l=!1,this.c=(new Date)[u](),this.c%100!=1))this.c=-1;for(n=0;n<i[v];n++)q=i[n],this.i[":"+q]=!0}});
T[w].k=function(a){if(this.c!=-1)W("al_"+this.a,"jl."+((new Date)[u]()-this.c),!0),this.c=-1;this.q=this.q.concat(a.components);google[y][this.a]||(google[y][this.a]={});google[y][this.a].packages=this.q.slice(0);for(var b=0;b<a.components[v];b++){this.p[":"+a.components[b]]=!0;this.i[":"+a.components[b]]=!1;var c=this.e[":"+a.components[b]];if(c){for(var e=0;e<c[v];e++)c[e].J(a.components[b]);delete this.e[":"+a.components[b]]}}};T[w].m=function(a,b){return this.v(b)[v]==0};T[w].s=function(){return!0};
function V(a){this.I=a;this.n={};this.r=0}V[w].G=function(a){this.r++;this.n[":"+a]=!0};V[w].J=function(a){this.n[":"+a]&&(this.n[":"+a]=!1,this.r--,this.r==0&&j[x](this.I,0))};function U(a,b,c){this.name=a;this.H=b;this.o=c;this.u=this.h=!1;this.j=[];google[y].t[this[t]]=F(this.k,this)}E(U,T);l(U[w],function(a,b){var c=b&&b.callback!=g;c?(this.j[m](b.callback),b.callback="google.loader.callbacks."+this[t]):this.h=!0;(!b||!b.autoloaded)&&google[y].d("script",this.g(a,b),c)});U[w].m=function(a,b){return b&&b.callback!=g?this.u:this.h};U[w].k=function(){this.u=!0;for(var a=0;a<this.j[v];a++)j[x](this.j[a],0);this.j=[]};
var X=function(a,b){return a.string?h(a.string)+"="+h(b):a.regex?b[o](/(^.*$)/,a.regex):""};U[w].g=function(a,b){return this.M(this.w(a),a,b)};
U[w].M=function(a,b,c){var e="";a.key&&(e+="&"+X(a.key,google[y].ApiKey));a.version&&(e+="&"+X(a.version,b));b=google[y].Secure&&a.ssl?a.ssl:a.uri;if(c!=g)for(var f in c)a.params[f]?e+="&"+X(a.params[f],c[f]):f=="other_params"?e+="&"+c[f]:f=="base_domain"&&(b="http://"+c[f]+a.uri[z](a.uri[r]("/",7)));google[this[t]]={};b[r]("?")==-1&&e&&(e="?"+e[z](1));return b+e};U[w].s=function(a){return this.w(a).deferred};U[w].w=function(a){if(this.o)for(var b=0;b<this.o[v];++b){var c=this.o[b];if(RegExp(c.pattern).test(a))return c}return this.H};function S(a,b){this.a=a;this.f=b;this.h=!1}E(S,T);l(S[w],function(a,b){this.h=!0;google[y].d("script",this.g(a,b),!1)});S[w].m=function(){return this.h};S[w].k=function(){};S[w].g=function(a,b){if(!this.f.versions[":"+a]){if(this.f.aliases){var c=this.f.aliases[":"+a];c&&(a=c)}if(!this.f.versions[":"+a])throw G("Module: '"+this.a+"' with version '"+a+"' not found!");}return google[y].GoogleApisBase+"/libs/"+this.a+"/"+a+"/"+this.f.versions[":"+a][b&&b.uncompressed?"uncompressed":"compressed"]};
S[w].s=function(){return!1};var Y=!1,Z=[],ca=(new Date)[u](),W=function(a,b,c){Y||(O(j,"unload",da),Y=!0);if(c){if(!google[y].Secure&&(!google[y].Options||google[y].Options.csi===!1))a=a[B]()[o](/[^a-z0-9_.]+/g,"_"),b=b[B]()[o](/[^a-z0-9_.]+/g,"_"),j[x](F($,g,"//gg.google.com/csi?s=uds&v=2&action="+h(a)+"&it="+h(b)),1E4)}else Z[m]("r"+Z[v]+"="+h(a+(b?"|"+b:""))),j[x](da,Z[v]>5?0:15E3)},da=function(){if(Z[v]){var a=google[y][s];a[r]("http:")==0&&(a=a[o](/^http:/,"https:"));$(a+"/stats?"+Z[A]("&")+"&nc="+(new Date)[u]()+"_"+((new Date)[u]()-
ca));Z.length=0}},$=function(a){var b=new Image,c=$.N++;$.z[c]=b;b.onload=b.onerror=function(){delete $.z[c]};b.src=a;b=g};$.z={};$.N=0;H("google.loader.recordStat",W);H("google.loader.createImageForLogging",$);

}) ();google.loader.rm({"specs":[{"name":"books","baseSpec":{"uri":"http://books.google.com/books/api.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}}}},"feeds",{"name":"friendconnect","baseSpec":{"uri":"http://www.google.com/friendconnect/script/friendconnect.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{}}},"spreadsheets","identitytoolkit","gdata","visualization",{"name":"sharing","baseSpec":{"uri":"http://www.google.com/s2/sharing/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{"language":{"string":"hl"}}}},"search",{"name":"maps","baseSpec":{"uri":"http://maps.google.com/maps?fileu003dgoogleapi","ssl":"https://maps-api-ssl.google.com/maps?fileu003dgoogleapi","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"regex":"callbacku003d$1u0026asyncu003d2"},"language":{"string":"hl"}}},"customSpecs":[{"uri":"http://maps.google.com/maps/api/js","ssl":"https://maps-api-ssl.google.com/maps/api/js","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}},"pattern":"^(3|3..*)$"}]},"annotations_v2","wave","orkut",{"name":"annotations","baseSpec":{"uri":"http://www.google.com/reviews/scripts/annotations_bootstrap.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"},"country":{"string":"gl"}}}},"language","earth","ads","elements"]});
google.loader.rfm({":search":{"versions":{":1":"1",":1.0":"1"},"path":"/api/search/1.0/fb730160e72add7b256fbc9b5dc23635/","js":"default+fr.I.js","css":"default.css","properties":{":JSHash":"fb730160e72add7b256fbc9b5dc23635",":NoOldNames":false,":Version":"1.0"}},":language":{"versions":{":1":"1",":1.0":"1"},"path":"/api/language/1.0/4c799b5d9590782ad04064fdda233029/","js":"default+fr.I.js","properties":{":JSHash":"4c799b5d9590782ad04064fdda233029",":Version":"1.0"}},":feeds":{"versions":{":1":"1",":1.0":"1"},"path":"/api/feeds/1.0/ebcc20169bc505865931499d7e9dca8d/","js":"default+fr.I.js","css":"default.css","properties":{":JSHash":"ebcc20169bc505865931499d7e9dca8d",":Version":"1.0"}},":spreadsheets":{"versions":{":0":"1",":0.4":"1"},"path":"/api/spreadsheets/0.4/87ff7219e9f8a8164006cbf28d5e911a/","js":"default.I.js","properties":{":JSHash":"87ff7219e9f8a8164006cbf28d5e911a",":Version":"0.4"}},":wave":{"versions":{":1":"1",":1.0":"1"},"path":"/api/wave/1.0/3b6f7573ff78da6602dda5e09c9025bf/","js":"default.I.js","properties":{":JSHash":"3b6f7573ff78da6602dda5e09c9025bf",":Version":"1.0"}},":annotations":{"versions":{":1":"1",":1.0":"1"},"path":"/api/annotations/1.0/dfca8805c4b6dacbd463750331da710e/","js":"default+fr.I.js","properties":{":JSHash":"dfca8805c4b6dacbd463750331da710e",":Version":"1.0"}},":earth":{"versions":{":1":"1",":1.0":"1"},"path":"/api/earth/1.0/a53f4e87830de2a72937039b5507ebdc/","js":"default.I.js","properties":{":JSHash":"a53f4e87830de2a72937039b5507ebdc",":Version":"1.0"}}});
google.loader.rpl({":scriptaculous":{"versions":{":1.8.3":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.2":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.1":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"}},"aliases":{":1.8":"1.8.3",":1":"1.8.3"}},":yui":{"versions":{":2.6.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.7.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.0r4":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.2r1":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.1":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":3.3.0":{"uncompressed":"build/yui/yui.js","compressed":"build/yui/yui-min.js"}},"aliases":{":3":"3.3.0",":2":"2.8.2r1",":2.7":"2.7.0",":2.8.2":"2.8.2r1",":2.6":"2.6.0",":2.8":"2.8.2r1",":2.8.0":"2.8.0r4",":3.3":"3.3.0"}},":swfobject":{"versions":{":2.1":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"},":2.2":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"}},"aliases":{":2":"2.2"}},":ext-core":{"versions":{":3.1.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"},":3.0.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"}},"aliases":{":3":"3.1.0",":3.0":"3.0.0",":3.1":"3.1.0"}},":webfont":{"versions":{":1.0.2":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.1":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.0":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.6":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.19":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.5":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.18":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.17":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.4":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.16":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.3":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.9":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.12":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.13":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.14":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.15":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.10":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.11":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"}},"aliases":{":1":"1.0.19",":1.0":"1.0.19"}},":mootools":{"versions":{":1.2.3":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.3.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.4":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.3.0":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.5":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"}},"aliases":{":1":"1.1.2",":1.11":"1.1.1",":1.3":"1.3.1",":1.2":"1.2.5",":1.1":"1.1.2"}},":jqueryui":{"versions":{":1.6.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.9":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.7":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.8":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.5":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.11":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.6":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.10":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.4":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"}},"aliases":{":1.8":"1.8.11",":1.7":"1.7.3",":1.6":"1.6.0",":1":"1.8.11",":1.5":"1.5.3",":1.8.3":"1.8.4"}},":chrome-frame":{"versions":{":1.0.2":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.1":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.0":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"}},"aliases":{":1":"1.0.2",":1.0":"1.0.2"}},":jquery":{"versions":{":1.3.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.6":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.4":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"}},"aliases":{":1":"1.5.2",":1.5":"1.5.2",":1.4":"1.4.4",":1.3":"1.3.2",":1.2":"1.2.6"}},":prototype":{"versions":{":1.7.0.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.2":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.1.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.3":{"uncompressed":"prototype.js","compressed":"prototype.js"}},"aliases":{":1.7":"1.7.0.0",":1.6.1":"1.6.1.0",":1":"1.7.0.0",":1.6":"1.6.1.0",":1.7.0":"1.7.0.0",":1.6.0":"1.6.0.3"}},":dojo":{"versions":{":1.2.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.1.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.2":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.6.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.5.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.5.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.2.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"}},"aliases":{":1":"1.6.0",":1.6":"1.6.0",":1.5":"1.5.1",":1.4":"1.4.3",":1.3":"1.3.2",":1.2":"1.2.3",":1.1":"1.1.1"}}});
}


//Fonction Truncatable
(function($){$.fn.truncatable=function(options){var defaults={limit:100,more:'...',less:false,hideText:'[read less]'};var options=$.extend(defaults,options);return this.each(function(num){var stringLength=$(this).html().length;if(stringLength>defaults.limit){var splitText=$(this).html().substr(defaults.limit);var splitPoint=splitText.substr(0,1);var whiteSpace=new RegExp(/^s+$/);for(var newLimit=defaults.limit;newLimit<stringLength;newLimit++){var newSplitText=$(this).html().substr(0,newLimit);var newHiddenText=$(this).html().substr(newLimit);var newSplitPoint=newSplitText.slice(-1);if(whiteSpace.test(newSplitPoint)){var hiddenText='<span class="hiddenText_'+num+'" style="display:none">'+newHiddenText+'</span>';var setNewLimit=(newLimit-1);var trunkLink=$('<a>').attr('class','more_'+num+'');$(this).html($(this).html().substr(0,setNewLimit)).append('<a class="more_'+num+'" href="#">'+defaults.more+'<a/> '+hiddenText);$('a.more_'+num).bind('click',function(){$('span.hiddenText_'+num).show();$('a.more_'+num).hide();if(defaults.less==true){$('span.hiddenText_'+num).append('<a class="hide_'+num+'" href="" title="'+defaults.hideText+'">'+defaults.hideText+'</a>');$('a.hide_'+num).bind('click',function(){$('.hiddenText_'+num).hide();$('.more_'+num).show();$('.hide_'+num).empty();return false})}});newLimit=stringLength}}}})}})(jQuery);

$(function() {
	
	/*
	jQuery('#diapo_savoirplus ul').addClass('jcarousel-skin-tango2');
	jQuery('#diapo_savoirplus ul').addClass('jcarousel-skin-tango');

	jQuery('#diapo_savoirplus ul').wrap('<div class="jcarousel-skin-tango2" />');

	jQuery('#actualites ul').addClass('jcarousel-skin-tango');
	jQuery('#diapo_decouvrir ul').addClass('jcarousel-skin-tango_actu');
    
	jQuery('.jcarousel-skin-tango').jcarousel();
    jQuery('.jcarousel-skin-tango2').jcarousel();
    jQuery('.jcarousel-skin-tango_actu').jcarousel();
	*/

	jQuery('#diapo_savoirplus ul').addClass('jcarousel-skin-tango');
	jQuery('#diapo_savoirplus').addClass('jcarousel-skin-tango2');
	jQuery('#diapo_decouvrir ul').addClass('jcarousel-skin-tango2');
	jQuery('#actualites ul').addClass('jcarousel-skin-tango_actu');
    jQuery('.jcarousel-skin-tango').jcarousel();
    jQuery('.jcarousel-skin-tango2').jcarousel();
    //jQuery('.jcarousel-skin-tango_actu').jcarousel();

});

/***** DIAPORAMA ACTUALITES *****/
function mycarousel_initCallback(carousel)
{
       
       // Disable autoscrolling if the user clicks the prev or next button.
       carousel.buttonNext.bind('click', function() {
               carousel.startAuto(0);
       });
       
       carousel.buttonPrev.bind('click', function() {
               carousel.startAuto(0);
       });
       
       // Pause autoscrolling if the user moves with the cursor over the clip.
       carousel.clip.hover(function() {
               carousel.stopAuto();
       }, function() {
               carousel.startAuto();
       });
};

google.load("feeds", "1");
google.setOnLoadCallback(showFeed);
function showFeed() {
	var url_xml = $('input[name="Url_actu_xml"]').val();
	var feed = new google.feeds.Feed(url_xml);
	feed.setNumEntries(10); 
	feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT); 
	
	feed.load(function(result) {
		if (!result.error) {
		
			$('#actualites ul').addClass('jcarousel-skin-tango_actu');
			$('#actualites ul').empty();
	
			var total = result.feed.entries.length;
			for (var i = 0; i < result.feed.entries.length; i++) {
				var entry = result.feed.entries[i];
				var enclosure = entry.xmlNode.getElementsByTagName("enclosure")[0].getAttribute("url");
				var actu = 	"<li>" 
					+	"<div class="titre"><span>"+(i+1)+"/"+total+"</span>" + entry.title + "</div>"
					+   "<img src="+ enclosure +" width="570" alt="" + entry.title + "">"
					+   "<a href=""+entry.link+""><div class="desc">" + entry.contentSnippet + "</div></a>";
				$("#actualites ul").append(actu);	
			}
		} else {
			$('#actualites ul').addClass('jcarousel-skin-tango_actu');
			$('#actualites ul').empty();
			var actu = 	"<li>" 
					+	"<div class="titre">Erreur</div>"
					+   "<a href="#"><div class="desc">Erreur lors du chargement des actualit�s</div></a>";
			$("#actualites ul").append(actu);
		
		}
		
		//Limite du nombre de caract�res du titre
		$('.jcarousel-skin-tango_actu .titre').truncatable({limit: 60, more: '' });
		//Limite du nombre de caract�res du r�sum�
		$('.jcarousel-skin-tango_actu .desc').truncatable({limit: 90, more: '' });
		
		$('.jcarousel-skin-tango_actu').jcarousel({
			auto: 4,
			animation: 2000,
			wrap: 'circular',
			size: total,
			scroll: 1,
			easing: null,
			initCallback: mycarousel_initCallback
		}); 		
		
		var textAccueil = $('#actualites ul li .titre'),
	widthTxtAccueil = textAccueil.width();
	heightTxtAccueil = textAccueil.height();
	if(widthTxtAccueil > 519) {
		textAccueil.addClass('ligne2')
		$('.ligne2').css({width: 520});
	}
	if($.browser.msie && $.browser.version < 8.0 && widthTxtAccueil > 487) {
		textAccueil.addClass('ligne2')
	}
	});
}

/*
$(document).ready(function(){

	$.get("http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?",{q: "http://comexposiumv2.comexposium-admin.com/content/view/rss/5480", num: "10"},
	function(data) {
		console.log(data);
		if (data.responseStatus == 200) {
			getActualites(data);
		}
  	}, "xml");
});

function getActualites(data)
{	
	feeds = data.responseData.feed;
	if (!feeds) {
		return false;
	}


	$('#actualites ul').addClass('jcarousel-skin-tango_actu');
	$('#actualites ul').empty();
	
	var total = feeds.entries.length;
	
	$.each(feeds.entries,function(i,item){
		var actu = 	"<li>" 
				+	"<div class="titre"><span>"+(i+1)+"/"+total+"</span>" + item.title + "</div>"
                +   "<img src="+ item.enclosure +" width="570" alt="">"
                +   "<a href=""+item.link+""><div class="desc">" + item.contentSnippet + "</div></a>";
		$("#actualites ul").append(actu);
	});
	
	//Limite du nombre de caract�res du titre
	$('.jcarousel-skin-tango_actu .titre').truncatable({limit: 60, more: '' });
	//Limite du nombre de caract�res du r�sum�
	$('.jcarousel-skin-tango_actu .desc').truncatable({limit: 90, more: '' });
	$('.jcarousel-skin-tango_actu').jcarousel();
}
*/
/***** FIN DIAPORAMA ACTUALITES *****/
$(function () {
	$('#ui-datepicker-div').live("mouseover", function () {
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').show();
		$('#liste_recherche #crit_dates, #liste_salons #crit_dates').show();
		$('.bloc_tete form .tabs ul li a[rel="crit_dates"]').addClass('hover');
	});
	$('#ui-datepicker-div').live("mouseout", function () {
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').hide();
		$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
		$('.bloc_tete form .tabs ul li a[rel="crit_dates"]').removeClass('hover');
		
	});
});
$(function() {
function megaHoverOver(){
		$(this).find(".navigation_niv_2").show();
		$(this).find('a:eq(0)').addClass('hover');
	}
	function megaHoverOut(){ 
	  $(this).find(".navigation_niv_2").hide();
	  $(this).find('a:eq(0)').removeClass('hover');
	}
var config = {    
		 sensitivity: 1,
		 interval: 10,    
		 over: megaHoverOver,  
		 timeout: 10,   
		 out: megaHoverOut
	};
	$("ul.navigation_niv_1 li").hoverIntent(config);
	
	
	
$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').hide();
$('#liste_recherche #crit_themes, #liste_salons #crit_themes').hide();
$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').hide();
	
	$('#liste_recherche .bloc_tete form .tabs ul li a, #liste_salons .bloc_tete form .tabs ul li a').mouseover(function(){
		var rel = $(this).attr("rel");
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').show();
		$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
		$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').hide();
		$('#liste_recherche #crit_themes, #liste_salons #crit_themes').hide();
		$(".bloc_tete form .tabs ul li a").removeClass('hover');
		
		if(rel == "crit_dates"){	
			$('#'+rel).show();
			$(this).addClass('hover');
		}else if(rel == "crit_lieux"){
			$('#'+rel).show();
			$(this).addClass('hover');
		}else if(rel == "crit_themes"){
			$('#'+rel).show();
			$(this).addClass('hover');
		}
	});
	
	$('#liste_recherche #crit_dates, #liste_salons #crit_dates').mouseover(function(){
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').show();
		$(this).show();	
		$('.bloc_tete form .tabs ul li a[rel="crit_dates"]').addClass('hover');
	});
	
	$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').mouseover(function(){
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').show();
		$(this).show();		
		$('.bloc_tete form .tabs ul li a[rel="crit_lieux"]').addClass('hover');														
	});
	
	$('#liste_recherche #crit_themes, #liste_salons #crit_themes').mouseover(function(){
		$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').show();
		$(this).show();	
		$('.bloc_tete form .tabs ul li a[rel="crit_themes"]').addClass('hover');															
	});
	
	
	$('#crit_dates').mouseout(function(){
		$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').hide();
$('#liste_recherche #crit_themes, #liste_salons #crit_themes').hide();
$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').hide();
		$(".bloc_tete form .tabs ul li a").removeClass('hover');
	});
	$('#crit_lieux').mouseout(function(){
$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').hide();
$('#liste_recherche #crit_themes, #liste_salons #crit_themes').hide();
$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').hide();
		$(".bloc_tete form .tabs ul li a").removeClass('hover');
	});
	$('#crit_themes').mouseout(function(){
$('#liste_recherche #crit_dates, #liste_salons #crit_dates').hide();
$('#liste_recherche #crit_lieux, #liste_salons #crit_lieux').hide();
$('#liste_recherche #crit_themes, #liste_salons #crit_themes').hide();
$('#liste_recherche .criteres_tabs, #liste_salons .criteres_tabs').hide();
		$(".bloc_tete form .tabs ul li a").removeClass('hover');
	});
	
	/*
	$("input[name='(keyword)']").val('Mots cles (ex:"Foire")');
	$("input[name='(keyword)']").toggleVal();


	*/
	var defaultTextValue='ex: "Foire"';
$("input[name='(keyword)']").val(defaultTextValue);
$("input[name='(keyword)']").toggleVal();
$('#search_header form').submit(function(){
												if($("input[name='(keyword)']").val()== defaultTextValue ){
													$("input[name='(keyword)']").val("");
												}});
	


$('#top_path ul li:last').addClass('last');
$('li.navigation_5422').addClass('last');



$('li.navigation_5480, li.navigation_5561').hide();
var textH1 = $('#page .Layout_1 #zone_content h1'),
	widthTxt = textH1.width();
$('<span></span>').prependTo(textH1);

if(widthTxt > 519) {
	textH1.addClass('ligne2')
}
if($.browser.msie && $.browser.version < 8.0 && widthTxt > 487) {
	textH1.addClass('ligne2');
}
var textH2 = $('.salon .bloc_tete .titre h2'),
	widthTxt2 = textH2.width();
$('<span></span>').prependTo(textH2);
if(widthTxt2 > 519) {
	textH2.addClass('ligne2')
}
if($.browser.msie && $.browser.version < 8.0 && widthTxt2 > 487) {
	textH2.addClass('ligne2')
}
var textH3 = $('.salon .mauve h3');
$('<span></span>').prependTo(textH3);

var textLSH2 = $('#liste_salons .bloc_tete h2');
$('<span></span>').prependTo(textLSH2);

var textLRH2 = $('#liste_recherche .bloc_tete h2');
$('<span></span>').prependTo(textLRH2);

$('#diapo_savoirplus ul').addClass('jcarousel-skin-tango');
$('#diapo_decouvrir ul').addClass('jcarousel-skin-tango2');
$('#actualites ul').addClass('jcarousel-skin-tango_actu');

var textFH3 = $('.salon .fushia h3');
$('<span></span>').prependTo(textFH3);

var textRAH2 = $('#recherche_avancee .bloc_tete h2');
$('<span></span>').prependTo(textRAH2);

/*
$('#recherche_avancee .crit_keyword input').val("ex: Foire");
$("#recherche_avancee .crit_keyword input").toggleVal();
*/
var defaultTextValue='ex: "Foire"';
$('#recherche_avancee .crit_keyword input').val(defaultTextValue);
$('#recherche_avancee .crit_keyword input').toggleVal();
$('#recherche_avancee form').submit(function(){
												if($('#recherche_avancee .crit_keyword input').val()== defaultTextValue ){
													$('#recherche_avancee .crit_keyword input').val("");
												}});
												

$('#crit_lieux .tiers fieldset#europe').parent().css('width','204px');
$('#crit_lieux .tiers fieldset#amerique').parent().css('width','160px');
$('#crit_lieux .tiers fieldset#afrique').parent().css('width','164px');


$('#recherche_avancee fieldset#crit_lieux .quart fieldset#europe').parent().css('width','170px');
$('#recherche_avancee fieldset#crit_lieux .quart fieldset#amerique').parent().css('width','100px');
$('#recherche_avancee fieldset#crit_lieux .quart fieldset#afrique').parent().css('width','100px');
$('#recherche_avancee fieldset#crit_lieux .quart fieldset#asie').parent().css('width','160px');


});
$(document).ready(function(){
	
	if($('.pagination .current').html() == "1"){
		$('.pagination .current').css('padding-left','123px');
		}
	$('#liste_salons hr').last().css('background','url("/extension/comexposiumsites/design/comexposiumv2/images/css/bg_etoile.gif") no-repeat scroll center bottom transparent');
	$('#liste_salons hr').last().css('height','17px');
	$('#liste_salons hr').last().css('margin','0 0 18px');
	$('.pagination .next a .text').html('Suivant');
	$('.pagination .previous a .text').html('Pr&eacute;c&eacute;dent');
	
	
	//englobe l'image du titre dans une div
	$('.salon .bloc_tete .titre img').wrap('<div style= "height: 209px;margin-bottom: 7px;overflow: hidden;">');
	
	var tailleLogoFicheSalon = 209 - parseInt($('.salon .bloc_tete .titre img').height());
    var tailleLogoFicheSalonCentrer = parseInt(tailleLogoFicheSalon / 2);
	if(tailleLogoFicheSalonCentrer > 0) $('.salon .bloc_tete .titre img').css('marginTop',tailleLogoFicheSalonCentrer);

	
	$('.salon .bloc_tete .infos span:last').css('font-weight','bold'); 

	$('#liste_salons .bloc_tete form .crit_public input[type=checkbox]').prettyCheckboxes();
	$('#liste_salons #crit_lieux .tiers fieldset input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	$('#liste_salons #crit_themes .tiers input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	
	$('#liste_recherche .bloc_tete form .crit_public input[type=checkbox]').prettyCheckboxes();
	$('#liste_recherche #crit_lieux .tiers fieldset input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	$('#liste_recherche #crit_themes .tiers input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	
	$('#recherche_avancee .crit_public input[type=checkbox]').prettyCheckboxes();
	$('#recherche_avancee fieldset#crit_themes .tiers input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	$('#recherche_avancee fieldset#crit_lieux .quart input[type=checkbox]').prettyCheckboxes({'display':'inline'});
	
	
	/* French initialisation for the jQuery UI date picker plugin. */
	/* Written by Keith Wood (kbwood{at}iinet.com.au) and St�phane Nahmani (sholby@sholby.net). */
	jQuery(function($){
	$.datepicker.regional['fr'] = {
		closeText: 'Fermer',
		prevText: '&#x3c;Pr�c',
		nextText: 'Suiv&#x3e;',
		currentText: 'Courant',
		monthNames: ['Janvier','F�vrier','Mars','Avril','Mai','Juin',
		'Juillet','Ao�t','Septembre','Octobre','Novembre','D�cembre'],
		monthNamesShort: ['Jan','F�v','Mar','Avr','Mai','Jun',
		'Jul','Ao�','Sep','Oct','Nov','D�c'],
		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
		weekHeader: 'Sm',
		dateFormat: 'dd/mm/yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['fr']);
});
	
	
	$( "#datepicker_from" ).datepicker();
	//$("#datepicker_from").datepicker($.datepicker.regional['fr']);
	$( "#datepicker_to" ).datepicker();
	//$("#datepicker_to").datepicker($.datepicker.regional['fr']);
	
	//Descendre article info sous diaporama
	$(".bloc_article .article_info" ).insertAfter($(".bloc_article .border-top-left"));
	var layHeight = $('.Layout_1 ').height();
$('#zone_content').css('height',layHeight);
$('#zone2').css('height',layHeight);
if($.browser.msie && $.browser.version == 6.0) {
	//$("#zone2").insertAfter($("#zone_content"));
	//$("#zone2").css('float','left');
}
	

var oldButton = $("div.search input.button");
    var newButton = oldButton.clone();

    newButton.attr("type", "submit");
    newButton.attr("id", "newSubmit");
    newButton.insertBefore(oldButton);
    oldButton.remove();
    newButton.attr("id", "Submit");
$("div.search input.button").removeAttr('src').val('').addClass('bg');
$("div.search input.button").hover(function () {
	$(this).addClass("bgHover");
}, function () {
	$(this).removeClass("bgHover");
});		
});
if($.browser.msie && $.browser.version == 6.0) {
	/**
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
* Version: 0.0.7a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
*
* Example usage:
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
**/

/*
PLEASE READ:
Absolutely everything in this script is SILLY.  I know this.  IE's rendering of certain pixels doesn't make sense, so neither does this code!
*/

var DD_belatedPNG = {

	ns: 'DD_belatedPNG',
	imgSize: {},
	
	createVmlNameSpace: function() { /* enable VML */
		if (document.namespaces && !document.namespaces[this.ns]) {
		  document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
		}
		if (window.attachEvent) {
			window.attachEvent('onbeforeunload', function() {
				DD_belatedPNG = null;
			});
		}
	},
	
	createVmlStyleSheet: function() { /* style VML, enable behaviors */
		/*
			Just in case lots of other developers have added
			lots of other stylesheets using document.createStyleSheet
			and hit the 31-limit mark, let's not use that method!
			further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
		*/
		var style = document.createElement('style');
		document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild);
		var styleSheet = style.styleSheet;
		styleSheet.addRule(this.ns + '\:*', '{behavior:url(#default#VML)}');
		styleSheet.addRule(this.ns + '\:shape', 'position:absolute;');
		styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */
		this.styleSheet = styleSheet;
	},
	
	readPropertyChange: function() {
		var el = event.srcElement;
		if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) {
			DD_belatedPNG.applyVML(el);
		}
		if (event.propertyName == 'style.display') {
			var display = (el.currentStyle.display == 'none') ? 'none' : 'block';
			for (var v in el.vml) {
				el.vml[v].shape.style.display = display;
			}
		}
		if (event.propertyName.search('filter') != -1) {
			DD_belatedPNG.vmlOpacity(el);
		}
	},
	
	vmlOpacity: function(el) {
		if (el.currentStyle.filter.search('lpha') != -1) {
			var trans = el.currentStyle.filter;
			trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
			el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */
			el.vml.image.fill.opacity = trans; /* complete guesswork */
		}
	},
	
	handlePseudoHover: function(el) {
		setTimeout(function() { /* wouldn't work as intended without setTimeout */
			DD_belatedPNG.applyVML(el);
		}, 1);
	},
	
	/**
	* This is the method to use in a document.
	* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'
	**/
	fix: function(selector) {
		var selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */
		for (var i=0; i<selectors.length; i++) {
			this.styleSheet.addRule(selectors[i], 'behavior:expression(DD_belatedPNG.fixPng(this))'); /* seems to execute the function without adding it to the stylesheet - interesting... */
		}
	},
	
	applyVML: function(el) {
		el.runtimeStyle.cssText = '';
		this.vmlFill(el);
		this.vmlOffsets(el);
		this.vmlOpacity(el);
		if (el.isImg) {
			this.copyImageBorders(el);
		}
	},
	
	attachHandlers: function(el) {
		var self = this;
		var handlers = {resize: 'vmlOffsets', move: 'vmlOffsets'};
		if (el.nodeName == 'A') {
			var moreForAs = {mouseleave: 'handlePseudoHover', mouseenter: 'handlePseudoHover', focus: 'handlePseudoHover', blur: 'handlePseudoHover'};
			for (var a in moreForAs) {
				handlers[a] = moreForAs[a];
			}
		}
		for (var h in handlers) {
			el.attachEvent('on' + h, function() {
				self[handlers[h]](el);
			});
		}
		el.attachEvent('onpropertychange', this.readPropertyChange);
	},
	
	giveLayout: function(el) {
		el.style.zoom = 1;
		if (el.currentStyle.position == 'static') {
			el.style.position = 'relative';
		}
	},
	
	copyImageBorders: function(el) {
		var styles = {'borderStyle':true, 'borderWidth':true, 'borderColor':true};
		for (var s in styles) {
			el.vml.color.shape.style[s] = el.currentStyle[s];
		}
	},
	
	vmlFill: function(el) {
		if (!el.currentStyle) {
			return;
		} else {
			var elStyle = el.currentStyle;
		}
		for (var v in el.vml) {
			el.vml[v].shape.style.zIndex = elStyle.zIndex;
		}
		el.runtimeStyle.backgroundColor = '';
		el.runtimeStyle.backgroundImage = '';
		var noColor = (elStyle.backgroundColor == 'transparent');
		var noImg = true;
		if (elStyle.backgroundImage != 'none' || el.isImg) {
			if (!el.isImg) {
				el.vmlBg = elStyle.backgroundImage;
				el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
			}
			else {
				el.vmlBg = el.src;
			}
			var lib = this;
			if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */
				var img = document.createElement('img');
				lib.imgSize[el.vmlBg] = img;
				img.className = lib.ns + '_sizeFinder';
				img.runtimeStyle.cssText = 'behavior:none; position:absolute; left:-10000px; top:-10000px; border:none;'; /* make sure to set behavior to none to prevent accidental matching of the helper elements! */
				img.attachEvent('onload', function() {
					this.width = this.offsetWidth; /* weird cache-busting requirement! */
					this.height = this.offsetHeight;
					lib.vmlOffsets(el);
				});
				img.src = el.vmlBg;
				img.removeAttribute('width');
				img.removeAttribute('height');
				document.body.insertBefore(img, document.body.firstChild);
			}
			el.vml.image.fill.src = el.vmlBg;
			noImg = false;
		}
		el.vml.image.fill.on = !noImg;
		el.vml.image.fill.color = 'none';
		el.vml.color.shape.style.backgroundColor = elStyle.backgroundColor;
		el.runtimeStyle.backgroundImage = 'none';
		el.runtimeStyle.backgroundColor = 'transparent';
	},
	
	/* IE can't figure out what do when the offsetLeft and the clientLeft add up to 1, and the VML ends up getting fuzzy... so we have to push/enlarge things by 1 pixel and then clip off the excess */
	vmlOffsets: function(el) {
		var thisStyle = el.currentStyle;
		var size = {'W':el.clientWidth+1, 'H':el.clientHeight+1, 'w':this.imgSize[el.vmlBg].width, 'h':this.imgSize[el.vmlBg].height, 'L':el.offsetLeft, 'T':el.offsetTop, 'bLW':el.clientLeft, 'bTW':el.clientTop};
		var fudge = (size.L + size.bLW == 1) ? 1 : 0;
		
		/* vml shape, left, top, width, height, origin */
		var makeVisible = function(vml, l, t, w, h, o) {
			vml.coordsize = w+','+h;
			vml.coordorigin = o+','+o;
			vml.path = 'm0,0l'+w+',0l'+w+','+h+'l0,'+h+' xe';
			vml.style.width = w + 'px';
			vml.style.height = h + 'px';
			vml.style.left = l + 'px';
			vml.style.top = t + 'px';
		};
		makeVisible(el.vml.color.shape, (size.L + (el.isImg ? 0 : size.bLW)), (size.T + (el.isImg ? 0 : size.bTW)), (size.W-1), (size.H-1), 0);
		makeVisible(el.vml.image.shape, (size.L + size.bLW), (size.T + size.bTW), (size.W), (size.H), 1);
		
		var bg = {'X':0, 'Y':0};
		var figurePercentage = function(axis, position) {
			var fraction = true;
			switch(position) {
				case 'left':
				case 'top':
					bg[axis] = 0;
					break;
				case 'center':
					bg[axis] = .5;
					break;
				case 'right':
				case 'bottom':
					bg[axis] = 1;
					break;
				default:
					if (position.search('%') != -1) {
						bg[axis] = parseInt(position)*.01;
					}
					else {
						fraction = false;
					}
			}
			var horz = (axis == 'X');
			bg[axis] = Math.ceil(fraction ? ( (size[horz?'W': 'H'] * bg[axis]) - (size[horz?'w': 'h'] * bg[axis]) ) : parseInt(position));
			if (bg[axis] == 0) {
				bg[axis]++;
			}
		};
		for (var b in bg) {
			figurePercentage(b, thisStyle['backgroundPosition'+b]);
		}
		
		el.vml.image.fill.position = (bg.X/size.W) + ',' + (bg.Y/size.H);
		
		var bgR = thisStyle.backgroundRepeat;
		var dC = {'T':1, 'R':size.W+fudge, 'B':size.H, 'L':1+fudge}; /* these are defaults for repeat of any kind */
		var altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'W'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'H'} };
		if (bgR != 'repeat') {
			var c = {'T':(bg.Y), 'R':(bg.X+size.w), 'B':(bg.Y+size.h), 'L':(bg.X)}; /* these are defaults for no-repeat - clips down to the image location */
			if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x or repeat-y */
				var v = bgR.split('repeat-')[1].toUpperCase();
				c[altC[v].b1] = 1;
				c[altC[v].b2] = size[altC[v].d];
			}
			if (c.B > size.H) {
				c.B = size.H;
			}
			el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)';
		}
		else {
			el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)';
		}
	},
	
	fixPng: function(el) {
		el.style.behavior = 'none';
		if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */
			return;
		}
		el.isImg = false;
		if (el.nodeName == 'IMG') {
			if(el.src.toLowerCase().search(/.png$/) != -1) {
				el.isImg = true;
				el.style.visibility = 'hidden';
			}
			else {
				return;
			}
		}
		else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) {
			return;
		}
		var lib = DD_belatedPNG;
		el.vml = {color: {}, image: {}};
		var els = {shape: {}, fill: {}};
		for (var r in el.vml) {
			for (var e in els) {
				var nodeStr = lib.ns + ':' + e;
				el.vml[r][e] = document.createElement(nodeStr);
			}
			el.vml[r].shape.stroked = false;
			el.vml[r].shape.appendChild(el.vml[r].fill);
			el.parentNode.insertBefore(el.vml[r].shape, el);
		}
		el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */
		el.vml.image.fill.type = 'tile'; /* Ze magic!! Makes image show up. */
		el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */
		
		lib.attachHandlers(el);
		
		lib.giveLayout(el);
		lib.giveLayout(el.offsetParent);
		
		/* set up element */
		lib.applyVML(el);
	}
	
};
try {
	document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */
} catch(r) {}
DD_belatedPNG.createVmlNameSpace();
DD_belatedPNG.createVmlStyleSheet();
DD_belatedPNG.fix('img, #header, #zone7, .content_top, ul.ariane li, .qsm, ul.liens_right a, a.btn_enews, .video a, #sitemap, #sitemap ul li, #footer, .jcarousel-skin-tango_actu .jcarousel-next-horizontal, .jcarousel-skin-tango_actu .jcarousel-prev-horizontal, #page .Layout_1 #zone2 a.btn_billets, li.block-quicklink-5461 a, #page .Layout_1 #zone2 a.btn_groupes, li.block-quicklink-5462 a, #block-4ad730452946fabd4351a776108a240a, #block-a384bafe3cadfce325a2931896732418, #block-db85bfb04b095c7f351dfbb90cbf4841, #block-a384bafe3cadfce325a2931896732418, #block-8cac3251d571f81500b84d91d65adf79, #block-f39539b5778458c995f0e2c6c3206678, #block-1ff93ecafb1ee27c58a7a42d2432e9ef, li.block-quicklink-5504, #page .Layout_1 #zone2 a.btn_enews, li.block-quicklink-5504 a, #page .Layout_1 #zone2 a.btn_violet, .border-bottom-right ul.navigation_block li.navigation_rubric a, .border-bottom-right ul.navigation_block li.navigation_article a, #page .Layout_1 #zone_content h1, #page .Layout_1 #zone_content h1 span, .salon .mauve h3, .salon .mauve h3 span, li.block-quicklink-5511 a, .salon .bloc_tete .titre h2, .salon .bloc_tete .titre h2 span, #zone4 #block-a2bcd78cfe83de965265ede3090a0695 a, #liste_salons .bloc_tete h2, #liste_salons .bloc_tete h2 span, #zone5 #block-1b1556bfadc5164faa775260f0e38d87 a');
}
