function lettre(){if(document.formlettre.email.value.length<1||document.formlettre.email.value=="Tapez votre email ici..."){window.alert("Veuillez entrer votre adresse email\ndans le champ du formulaire, merci.");document.formlettre.email.focus();return false}}
function no_accent(a){var b="",l=["\u00e0","\u00e1","\u00e2","\u00e3","\u00e4","\u00e7","\u00e8","\u00e9","\u00ea","\u00eb","\u00ec","\u00ed","\u00ee","\u00ef","\u00f1","\u00f2","\u00f3","\u00f4","\u00f5","\u00f6","\u00f9","\u00fa","\u00fb","\u00fc","\u00fd","\u00ff","\u00c0","\u00c1","\u00c2","\u00c3","\u00c4","\u00c7","\u00c8","\u00c9","\u00ca","\u00cb","\u00cc","\u00cd","\u00ce","\u00cf","\u00d1","\u00d2","\u00d3","\u00d4","\u00d5","\u00d6","\u00d9","\u00da","\u00db","\u00dc","\u00dd"],d=["a","a","a","a","a","c","e","e","e","e","i","i","i","i","n","o","o","o","o","o","u","u","u","u","y","y","A","A","A","A","A","C","E","E","E","E","I","I","I","I","N","O","O","O","O","O","U","U","U","U","Y"];if(a&&a!="")b=preg_replace(l,d,a);return b}function replaceImage(a,b){a.onload=null;a.src=b}function testEntier(a){return a==parseInt(a,10)?true:false}
function testDate(a,b,l){var d;d=0;valeurJour=a.toString();valeurMois=b.toString();valeurAnnee=l.toString();if(!testEntier(valeurJour)||valeurJour.length!=2)d=1;if(!testEntier(valeurMois)||valeurMois.length!=2)d=1;if(!testEntier(valeurAnnee)||valeurAnnee.length!=4)d=1;if(valeurJour>[31,valeurAnnee%4==0?29:28,31,30,31,30,31,31,30,31,30,31][valeurMois-1])d=1;return d==0?true:false}
function testCalendrier(){if(testDate(document.cal.elements.jour.value,document.cal.elements.mois.value,document.cal.elements.annee.value))return true;else{window.alert("Veuillez verifier la date qui ne semble pas correcte, merci.");return false}}function verifmail(){var a=document.getElementById("form_???").mail;if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a.value)||a.value.length<7){alert("Votre adresse E-mail ne semble pas valide !");a.focus();return false}}
function login(){if(document.formlogin.email.value=="Tapez votre email"||document.formlogin.email.value==""){window.alert("Veuillez entrer votre email, merci.");document.formlogin.email.focus();return false}else if(document.formlogin.pass.value=="00000000"||document.formlogin.pass.value==""){window.alert("Veuillez entrer votre mot de passe, merci.");document.formlogin.pass.focus();document.getElementById("inf").innerHTML='<a href="./?action=abonne&service=password" target="_parent">Retrouver votre mot de passe ?</a>';return false}}function Submit_Form(){document.getElementById("valider").disabled=true;document.getElementById("submitmess").innerHTML='<img src="images/waiting.gif" border="0">'}
function test_poids(){if(isNaN(document.bilan_poids.Age.value)||document.bilan_poids.Age.value<18||document.bilan_poids.Age.value>70){alert("Votre age doit \u00eatre compris en 18 et 70 ans.");document.bilan_poids.Age.focus();return false}if(isNaN(document.bilan_poids.Taille.value)||document.bilan_poids.Taille.value<130||document.bilan_poids.Taille.value>220){alert("Votre taille doit \u00eatre comprise en 130 et 220 cm.");document.bilan_poids.Taille.focus();return false}if(isNaN(document.bilan_poids.Poids.value)||document.bilan_poids.Poids.value<35||document.bilan_poids.Poids.value>180){alert("Votre poids doit \u00eatre compris en 35 et 180 kg.");document.bilan_poids.Poids.focus();return false}if(document.bilan_poids.tta.value!="-----------------"&&(isNaN(document.bilan_poids.tta.value)||document.bilan_poids.tta.value<45||document.bilan_poids.tta.value>140)){alert("Votre tour de taille doit \u00eatre compris en 45 et 140 cm.");document.bilan_poids.tta.focus();return false}if(document.bilan_poids.tha.value!="-----------------"&&(isNaN(document.bilan_poids.tha.value)||document.bilan_poids.tha.value<50||document.bilan_poids.tha.value>150)){alert("Votre tour de hanches doit \u00eatre compris en 50 et 150 cm.");document.bilan_poids.tha.focus();return false}}
function test_calories(){if(isNaN(document.bilan_calories.Age.value)||document.bilan_calories.Age.value<18||document.bilan_calories.Age.value>70){alert("Votre age doit \u00eatre compris en 18 et 70 ans.");document.bilan_calories.Age.focus();return false}if(isNaN(document.bilan_calories.Taille.value)||document.bilan_calories.Taille.value<130||document.bilan_calories.Taille.value>220){alert("Votre taille doit \u00eatre comprise en 130 et 220 cm.");document.bilan_calories.Taille.focus();return false}if(isNaN(document.bilan_calories.Poids.value)||document.bilan_calories.Poids.value<35||document.bilan_calories.Poids.value>180){alert("Votre poids doit \u00eatre compris en 35 et 180 kg.");document.bilan_poids.Poids.focus();return false}}function montre_cache(a){if(document.getElementById){a=document.getElementById(a).style;a.display=a.display=="block"?"none":"block";return false}else return true}
function Calcultemps(){if(document.calculNAP.dureeA.options[0].selected==true){totalA=6;A=0.25}if(document.calculNAP.dureeA.options[1].selected==true){totalA=7;A=0.292}if(document.calculNAP.dureeA.options[2].selected==true){totalA=8;A=0.333}if(document.calculNAP.dureeA.options[3].selected==true){totalA=9;A=0.375}if(document.calculNAP.dureeA.options[4].selected==true){totalA=10;A=0.417}if(document.calculNAP.dureeA.options[5].selected==true){totalA=11;A=0.458}if(document.calculNAP.dureeA.options[6].selected==true){totalA=12;A=0.5}if(document.calculNAP.dureeA.options[7].selected==true){totalA=13;A=0.542}if(document.calculNAP.dureeA.options[8].selected==true){totalA=14;A=0.583}if(document.calculNAP.dureeA.options[9].selected==true){totalA=15;A=0.625}if(document.calculNAP.dureeA.options[10].selected==true){totalA=16;A=0.667}if(document.calculNAP.dureeA.options[11].selected==true){totalA=17;A=0.708}if(document.calculNAP.dureeA.options[12].selected==true){totalA=18;A=0.75}if(document.calculNAP.dureeB.options[0].selected==true)B=totalB=0;if(document.calculNAP.dureeB.options[1].selected==true){totalB=1;B=0.062}if(document.calculNAP.dureeB.options[2].selected==true){totalB=2;B=0.125}if(document.calculNAP.dureeB.options[3].selected==true){totalB=3;B=0.188}if(document.calculNAP.dureeB.options[4].selected==true){totalB=4;B=0.25}if(document.calculNAP.dureeB.options[5].selected==true){totalB=5;B=0.313}if(document.calculNAP.dureeB.options[6].selected==true){totalB=6;B=0.375}if(document.calculNAP.dureeB.options[7].selected==true){totalB=7;B=0.437}if(document.calculNAP.dureeB.options[8].selected==true){totalB=8;B=0.5}if(document.calculNAP.dureeB.options[9].selected==true){totalB=9;B=0.563}if(document.calculNAP.dureeB.options[10].selected==true){totalB=10;B=0.62}if(document.calculNAP.dureeB.options[11].selected==true){totalB=11;B=0.688}if(document.calculNAP.dureeB.options[12].selected==true){totalB=12;B=0.75}if(document.calculNAP.dureeB.options[13].selected==true){totalB=13;B=0.812}if(document.calculNAP.dureeB.options[14].selected==true){totalB=14;B=0.875}if(document.calculNAP.dureeB.options[15].selected==true){totalB=15;B=0.937}if(document.calculNAP.dureeB.options[16].selected==true){totalB=16;B=1}if(document.calculNAP.dureeB.options[17].selected==true){totalB=17;B=1.062}if(document.calculNAP.dureeB.options[18].selected==true){totalB=18;B=1.125}if(document.calculNAP.dureeC.options[0].selected==true)C=totalC=0;if(document.calculNAP.dureeC.options[1].selected==true){totalC=1;C=0.092}if(document.calculNAP.dureeC.options[2].selected==true){totalC=2;C=0.183}if(document.calculNAP.dureeC.options[3].selected==true){totalC=3;C=0.276}if(document.calculNAP.dureeC.options[4].selected==true){totalC=4;C=0.368}if(document.calculNAP.dureeC.options[5].selected==true){totalC=5;C=0.46}if(document.calculNAP.dureeC.options[6].selected==true){totalC=6;C=0.552}if(document.calculNAP.dureeC.options[7].selected==true){totalC=7;C=0.644}if(document.calculNAP.dureeC.options[8].selected==true){totalC=8;C=0.736}if(document.calculNAP.dureeC.options[9].selected==true){totalC=9;C=0.828}if(document.calculNAP.dureeC.options[10].selected==true){totalC=10;C=0.92}if(document.calculNAP.dureeC.options[11].selected==true){totalC=11;C=1.012}if(document.calculNAP.dureeC.options[12].selected==true){totalC=12;C=1.104}if(document.calculNAP.dureeC.options[13].selected==true){totalC=13;C=1.196}if(document.calculNAP.dureeC.options[14].selected==true){totalC=14;C=1.288}if(document.calculNAP.dureeC.options[15].selected==true){totalC=15;C=1.38}if(document.calculNAP.dureeC.options[16].selected==true){totalC=16;C=1.472}if(document.calculNAP.dureeC.options[17].selected==true){totalC=17;C=1.564}if(document.calculNAP.dureeC.options[18].selected==true){totalC=18;C=1.656}if(document.calculNAP.dureeD.options[0].selected==true)D=totalD=0;if(document.calculNAP.dureeD.options[1].selected==true){totalD=1;D=0.125}if(document.calculNAP.dureeD.options[2].selected==true){totalD=2;D=0.25}if(document.calculNAP.dureeD.options[3].selected==true){totalD=3;D=0.375}if(document.calculNAP.dureeD.options[4].selected==true){totalD=4;D=0.5}if(document.calculNAP.dureeD.options[5].selected==true){totalD=5;D=0.625}if(document.calculNAP.dureeD.options[6].selected==true){totalD=6;D=0.75}if(document.calculNAP.dureeD.options[7].selected==true){totalD=7;D=0.875}if(document.calculNAP.dureeD.options[8].selected==true){totalD=8;D=1}if(document.calculNAP.dureeD.options[9].selected==true){totalD=9;D=1.125}if(document.calculNAP.dureeD.options[10].selected==true){totalD=10;D=1.25}if(document.calculNAP.dureeD.options[11].selected==true){totalD=11;D=1.375}if(document.calculNAP.dureeD.options[12].selected==true){totalD=12;D=1.5}if(document.calculNAP.dureeD.options[13].selected==true){totalD=13;D=1.625}if(document.calculNAP.dureeD.options[14].selected==true){totalD=14;D=1.75}if(document.calculNAP.dureeD.options[15].selected==true){totalD=15;D=1.875}if(document.calculNAP.dureeD.options[16].selected==true){totalD=16;D=2}if(document.calculNAP.dureeD.options[17].selected==true){totalD=17;D=2.125}if(document.calculNAP.dureeD.options[18].selected==true){totalD=18;D=2.25}if(document.calculNAP.dureeE.options[0].selected==true)E=totalE=0;if(document.calculNAP.dureeE.options[1].selected==true){totalE=1;E=0.146}if(document.calculNAP.dureeE.options[2].selected==true){totalE=2;E=0.292}if(document.calculNAP.dureeE.options[3].selected==true){totalE=3;E=0.437}if(document.calculNAP.dureeE.options[4].selected==true){totalE=4;E=0.583}if(document.calculNAP.dureeE.options[5].selected==true){totalE=5;E=0.729}if(document.calculNAP.dureeE.options[6].selected==true){totalE=6;E=0.875}if(document.calculNAP.dureeE.options[7].selected==true){totalE=7;E=1.021}if(document.calculNAP.dureeE.options[8].selected==true){totalE=8;E=1.166}if(document.calculNAP.dureeE.options[9].selected==true){totalE=9;E=1.312}if(document.calculNAP.dureeE.options[10].selected==true){totalE=10;E=1.458}if(document.calculNAP.dureeE.options[11].selected==true){totalE=11;E=1.604}if(document.calculNAP.dureeE.options[12].selected==true){totalE=12;E=1.75}if(document.calculNAP.dureeF.options[0].selected==true)F=totalF=0;if(document.calculNAP.dureeF.options[1].selected==true){totalF=1;F=0.208}if(document.calculNAP.dureeF.options[2].selected==true){totalF=2;F=0.416}if(document.calculNAP.dureeF.options[3].selected==true){totalF=3;F=0.624}if(document.calculNAP.dureeF.options[4].selected==true){totalF=4;F=0.832}if(document.calculNAP.dureeF.options[5].selected==true){totalF=5;F=1.042}if(document.calculNAP.dureeF.options[6].selected==true){totalF=6;F=1.25}if(document.calculNAP.dureeF.options[7].selected==true){totalF=7;F=1.458}if(document.calculNAP.dureeF.options[8].selected==true){totalF=8;F=1.66}if(document.calculNAP.dureeF.options[9].selected==true){totalF=9;F=1.868}if(document.calculNAP.dureeF.options[10].selected==true){totalF=10;F=2.08}totaltemps=totalA+totalB+totalC+totalD+totalE+totalF;if(totalF>=2)F-=-0.3;NAP=A- -B- -C- -D- -E- -F;NAP=Math.round(NAP*1E3)/1E3;DEJ=Math.round(document.calculNAP.DER.value*NAP);document.calculNAP.verifietemps.value=totaltemps;if(totaltemps==24){montre_cache("pluscal");document.calculNAP.depjour.value=DEJ;document.calculNAP.nap.value=NAP}else document.calculNAP.depjour.value="????"}
function verif_profil_alimentaire(){if(document.profil_alimentaire.pa1.value==""){window.alert("Pr\u00e9cisez votre consommation de th\u00e9, tisane");document.profil_alimentaire.pa1.focus();return false}if(document.profil_alimentaire.pa2.value==""){window.alert("Pr\u00e9cisez votre consommation de caf\u00e9");document.profil_alimentaire.pa2.focus();return false}if(document.profil_alimentaire.pa3.value==""){window.alert("Pr\u00e9cisez votre consommation de lait");document.profil_alimentaire.pa3.focus();return false}if(document.profil_alimentaire.pa4.value==""){window.alert("Pr\u00e9cisez votre consommation de vin");document.profil_alimentaire.pa4.focus();return false}if(document.profil_alimentaire.pa5.value==""){window.alert("Pr\u00e9cisez votre consommation d'ap\u00e9ritifs, alcools forts");document.profil_alimentaire.pa5.focus();return false}if(document.profil_alimentaire.pa6.value==""){window.alert("Pr\u00e9cisez votre consommation de soupe et bouillon de l\u00e9gumes");document.profil_alimentaire.pa6.focus();return false}if(document.profil_alimentaire.pa7.value==""){window.alert("Pr\u00e9cisez votre consommation de boissons sucr\u00e9es, sodas, jus de fruits");document.profil_alimentaire.pa7.focus();return false}if(document.profil_alimentaire.pa8.value==""){window.alert("Pr\u00e9cisez votre consommation de p\u00e2tes, riz, pommes de terre, l\u00e9gumes secs");document.profil_alimentaire.pa8.focus();return false}if(document.profil_alimentaire.pa9.value==""){window.alert("Pr\u00e9cisez votre consommation de l\u00e9gumes, crudit\u00e9s");document.profil_alimentaire.pa9.focus();return false}if(document.profil_alimentaire.pa10.value==""){window.alert("Pr\u00e9cisez votre consommation de fruits, compotes");document.profil_alimentaire.pa10.focus();return false}if(document.profil_alimentaire.pa11.value==""){window.alert("Pr\u00e9cisez votre consommation de quiches, pizzas, feuillet\u00e9s, tourtes");document.profil_alimentaire.pa11.focus();return false}if(document.profil_alimentaire.pa12.value==""){window.alert("Pr\u00e9cisez votre consommation de fromage");document.profil_alimentaire.pa12.focus();return false}if(document.profil_alimentaire.pa13.value==""){window.alert("Pr\u00e9cisez votre consommation de charcuteries, pat\u00e9s, saucissons");document.profil_alimentaire.pa13.focus();return false}if(document.profil_alimentaire.pa14.value==""){window.alert("Pr\u00e9cisez votre consommation de viandes, volailles, jambon, oeufs");document.profil_alimentaire.pa14.focus();return false}if(document.profil_alimentaire.pa15.value==""){window.alert("Pr\u00e9cisez votre consommation de poissons, crustac\u00e9s, coquillages");document.profil_alimentaire.pa15.focus();return false}if(document.profil_alimentaire.pa16.value==""){window.alert("Pr\u00e9cisez votre consommation de plats cuisin\u00e9s ou en sauce (maison ou du commerce)");document.profil_alimentaire.pa16.focus();return false}if(document.profil_alimentaire.pa17.value==""){window.alert("Pr\u00e9cisez votre consommation de snacks, barres, biscuits, g\u00e4teaux secs, chocolat");document.profil_alimentaire.pa17.focus();return false}if(document.profil_alimentaire.pa18.value==""){window.alert("Pr\u00e9cisez votre consommation de p\u00e2tisseries, viennoiseries");document.profil_alimentaire.pa18.focus();return false}if(document.profil_alimentaire.pa19.value==""){window.alert("Pr\u00e9cisez votre consommation de produits laitiers frais, desserts lact\u00e9s");document.profil_alimentaire.pa19.focus();return false}if(document.profil_alimentaire.pa20.value==""){window.alert("Pr\u00e9cisez votre consommation de pains, biscottes, c\u00e9r\u00e9ales");document.profil_alimentaire.pa20.focus();return false}}var Behaviour={list:[],register:function(a){Behaviour.list.push(a)},start:function(){Behaviour.addLoadEvent(function(){Behaviour.apply()})},apply:function(){for(h=0;sheet=Behaviour.list[h];h++)for(selector in sheet)if(list=document.getElementsBySelector(selector))for(i=0;element=list[i];i++)sheet[selector](element)},addLoadEvent:function(a){var b=window.onload;window.onload=typeof window.onload!="function"?a:function(){b();a()}}};Behaviour.start();function getAllChildren(a){return a.all?a.all:a.getElementsByTagName("*")}
document.getElementsBySelector=function(a){if(!document.getElementsByTagName)return[];a=a.split(" ");for(var b=Array(document),l=0;l<a.length;l++){token=a[l].replace(/^\s+/,"").replace(/\s+$/,"");if(token.indexOf("#")>-1){var d=token.split("#"),g=d[0];b=document.getElementById(d[1]);if(g&&b.nodeName.toLowerCase()!=g)return[];b=Array(b)}else if(token.indexOf(".")>-1){d=token.split(".");g=d[0];var s=d[1];g||(g="*");d=[];for(var m=0,r=0;r<b.length;r++){var n;n=g=="*"?getAllChildren(b[r]):b[r].getElementsByTagName(g);for(var u=0;u<n.length;u++)d[m++]=n[u]}b=[];for(m=g=0;m<d.length;m++)if(d[m].className&&d[m].className.match(RegExp("\\b"+s+"\\b")))b[g++]=d[m]}else if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){g=RegExp.$1;var J=RegExp.$2;s=RegExp.$3;var v=RegExp.$4;g||(g="*");d=[];for(r=m=0;r<b.length;r++){n=g=="*"?getAllChildren(b[r]):b[r].getElementsByTagName(g);for(u=0;u<n.length;u++)d[m++]=n[u]}b=[];g=0;switch(s){case"=":s=function(e){return e.getAttribute(J)==v};break;case"~":s=function(e){return e.getAttribute(J).match(RegExp("\\b"+v+"\\b"))};break;case"|":s=function(e){return e.getAttribute(J).match(RegExp("^"+v+"-?"))};break;case"^":s=function(e){return e.getAttribute(J).indexOf(v)==0};break;case"$":s=function(e){return e.getAttribute(J).lastIndexOf(v)==e.getAttribute(J).length-v.length};break;case"*":s=function(e){return e.getAttribute(J).indexOf(v)>-1};break;default:s=function(e){return e.getAttribute(J)}}b=[];for(m=g=0;m<d.length;m++)if(s(d[m]))b[g++]=d[m]}else{if(!b[0])return;g=token;d=[];for(r=m=0;r<b.length;r++){n=b[r].getElementsByTagName(g);for(u=0;u<n.length;u++)d[m++]=n[u]}b=d}}return b};var xmlhttp;if(!xmlhttp&&typeof XMLHttpRequest!="undefined")try{xmlhttp=new XMLHttpRequest}catch(e$$13){xmlhttp=false}function myXMLHttpRequest(){var a;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(l){a=false}}if(!a&&typeof XMLHttpRequest!="undefined")try{a=new XMLHttpRequest}catch(d){a=false;alert("couldn't create xmlhttp object")}return a}
function sndReq(a,b,l,d){document.getElementById("unit_ul"+b).innerHTML='<div class="loading"></div>';xmlhttp.open("get","rpr.php?j="+a+"&q="+b+"&t="+l+"&c="+d);xmlhttp.onreadystatechange=handleResponse;xmlhttp.send(null)}function handleResponse(){if(xmlhttp.readyState==4)if(xmlhttp.status==200){var a=xmlhttp.responseText,b=[];if(a.indexOf("|")!=-1){b=a.split("|");changeText(b[0],b[1])}}}
function changeText(a,b){var l=document.all?1:0,d=0;if(parseInt(navigator.appVersion)>=5)d=1;if(d)document.getElementById(a).innerHTML=b;else if(l)document.all[a].innerHTML=b}var ratingAction={"a.rater":function(a){a.onclick=function(){var b=this.href.replace(/.*\?(.*)/,"$1").split("&"),l=[];for(j=0;j<b.length;j++){var d=b[j].replace(/(.*)=.*/,"$1"),g=b[j].replace(/.*=(.*)/,"$1");l[d]=g}sndReq(l.j,l.q,l.t,l.c);return false}}};Behaviour.register(ratingAction);(function(a){a.organicTabs=function(b,l){var d=this;d.$el=a(b);d.$nav=d.$el.find(".nav");d.init=function(){d.options=a.extend({},a.organicTabs.defaultOptions,l);a(".hide").css({position:"relative",top:0,left:0,display:"none"});d.$nav.delegate("li > a","click",function(){var g=d.$el.find("a.current").attr("href").substring(1),s=a(this),m=s.attr("href").substring(1),r=d.$el.find(".list-wrap"),n=r.height();r.height(n);m!=g&&d.$el.find(":animated").length==0&&d.$el.find("#"+g).fadeOut(d.options.speed,function(){d.$el.find("#"+m).fadeIn(d.options.speed);var u=d.$el.find("#"+m).height();r.animate({height:u});d.$el.find(".nav li a").removeClass("current");s.addClass("current")});return false})};d.init()};a.organicTabs.defaultOptions={speed:300};a.fn.organicTabs=function(b){return this.each(function(){new a.organicTabs(this,b)})}})(jQuery);(function(a){function b(d){var g=d||window.event,s=[].slice.call(arguments,1),m=0,r=0,n=0;d=a.event.fix(g);d.type="mousewheel";if(d.wheelDelta)m=d.wheelDelta/120;if(d.detail)m=-d.detail/3;n=m;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){n=0;r=-1*m}if(g.wheelDeltaY!==undefined)n=g.wheelDeltaY/120;if(g.wheelDeltaX!==undefined)r=-1*g.wheelDeltaX/120;s.unshift(d,m,r,n);return a.event.handle.apply(this,s)}var l=["DOMMouseScroll","mousewheel"];a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var d=l.length;d;)this.addEventListener(l[--d],b,false);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var d=l.length;d;)this.removeEventListener(l[--d],b,false);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}})})(jQuery);(function(a){var b,l,d,g,s,m,r,n,u,J,v=0,e={},x=[],G=0,f={},H=[],P=null,N=new Image,o=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,q=/[^\.]\.(swf)\s*$/i,y,Q=1,O=0,L="",M,I,z=false,T=a.extend(a("<div/>")[0],{prop:0}),Y=a.browser.msie&&a.browser.version<7&&!window.XMLHttpRequest,Z=function(){l.hide();N.onerror=N.onload=null;P&&P.abort();b.empty()},aa=function(){if(false===e.onError(x,v,e)){l.hide();z=false}else{e.titleShow=false;e.width="auto";e.height="auto";b.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');V()}},X=function(){var c=x[v],k,w,K,U,ba,R;Z();e=a.extend({},a.fn.fancybox.defaults,typeof a(c).data("fancybox")=="undefined"?e:a(c).data("fancybox"));R=e.onStart(x,v,e);if(R===false)z=false;else{if(typeof R=="object")e=a.extend(e,R);K=e.title||(c.nodeName?a(c).attr("title"):c.title)||"";if(c.nodeName&&!e.orig)e.orig=a(c).children("img:first").length?a(c).children("img:first"):a(c);if(K===""&&e.orig&&e.titleFromAlt)K=e.orig.attr("alt");k=e.href||(c.nodeName?a(c).attr("href"):c.href)||null;if(/^(?:javascript)/i.test(k)||k=="#")k=null;if(e.type){w=e.type;if(!k)k=e.content}else if(e.content)w="html";else if(k)w=k.match(o)?"image":k.match(q)?"swf":a(c).hasClass("iframe")?"iframe":k.indexOf("#")===0?"inline":"ajax";if(w){if(w=="inline"){c=k.substr(k.indexOf("#"));w=a(c).length>0?"inline":"ajax"}e.type=w;e.href=k;e.title=K;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);b.css("padding",e.padding+e.margin);a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(m.children())});switch(w){case"html":b.html(e.content);V();break;case"inline":if(a(c).parent().is("#fancybox-content")===true){z=false;break}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(c)).bind("fancybox-cleanup",function(){a(this).replaceWith(m.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(b.children())});a(c).appendTo(b);V();break;case"image":z=false;a.fancybox.showActivity();N=new Image;N.onerror=function(){aa()};N.onload=function(){z=true;N.onerror=N.onload=null;e.width=N.width;e.height=N.height;a("<img />").attr({id:"fancybox-img",src:N.src,alt:e.title}).appendTo(b);ca()};N.src=k;break;case"swf":e.scrolling="no";U='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+k+'"></param>';ba="";a.each(e.swf,function(S,W){U+='<param name="'+S+'" value="'+W+'"></param>';ba+=" "+S+'="'+W+'"'});U+='<embed src="'+k+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+ba+"></embed></object>";b.html(U);V();break;case"ajax":z=false;a.fancybox.showActivity();e.ajax.win=e.ajax.success;P=a.ajax(a.extend({},e.ajax,{url:k,data:e.ajax.data||{},error:function(S){S.status>0&&aa()},success:function(S,W,da){if((typeof da=="object"?da:P).status==200){if(typeof e.ajax.win=="function"){R=e.ajax.win(k,S,W,da);if(R===false){l.hide();return}else if(typeof R=="string"||typeof R=="object")S=R}b.html(S);V()}}}));break;case"iframe":ca()}}else aa()}},V=function(){var c=e.width,k=e.height;c=c.toString().indexOf("%")>-1?parseInt((a(window).width()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";k=k.toString().indexOf("%")>-1?parseInt((a(window).height()-e.margin*2)*parseFloat(k)/100,10)+"px":k=="auto"?"auto":k+"px";b.wrapInner('<div style="width:'+c+";height:"+k+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=b.width();e.height=b.height();ca()},ca=function(){var c,k;l.hide();if(g.is(":visible")&&false===f.onCleanup(H,G,f)){a.event.trigger("fancybox-cancel");z=false}else{z=true;a(m.add(d)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");g.is(":visible")&&f.titlePosition!=="outside"&&g.css("height",g.height());H=x;G=v;f=e;if(f.overlayShow){d.css({"background-color":f.overlayColor,opacity:f.overlayOpacity,cursor:f.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!d.is(":visible")){Y&&a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});d.show()}}else d.hide();I=ia();L=f.title||"";O=0;n.empty().removeAttr("style").removeClass();if(f.titleShow!==false){L=c=a.isFunction(f.titleFormat)?f.titleFormat(L,H,G,f):L&&L.length?f.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+L+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+f.titlePosition+'">'+L+"</div>":false;if(!(!L||L==="")){n.addClass("fancybox-title-"+f.titlePosition).html(L).appendTo("body").show();switch(f.titlePosition){case"inside":n.css({width:I.width-f.padding*2,marginLeft:f.padding,marginRight:f.padding});O=n.outerHeight(true);n.appendTo(s);I.height+=O;break;case"over":n.css({marginLeft:f.padding,width:I.width-f.padding*2,bottom:f.padding}).appendTo(s);break;case"float":n.css("left",parseInt((n.width()-I.width-40)/2,10)*-1).appendTo(g);break;default:n.css({width:I.width-f.padding*2,paddingLeft:f.padding,paddingRight:f.padding}).appendTo(g)}}}n.hide();if(g.is(":visible")){a(r.add(u).add(J)).hide();c=g.position();M={top:c.top,left:c.left,width:g.width(),height:g.height()};k=M.width==I.width&&M.height==I.height;m.fadeTo(f.changeFade,0.3,function(){var w=function(){m.html(b.contents()).fadeTo(f.changeFade,1,ea)};a.event.trigger("fancybox-change");m.empty().removeAttr("filter").css({"border-width":f.padding,width:I.width-f.padding*2,height:e.autoDimensions?"auto":I.height-O-f.padding*2});if(k)w();else{T.prop=0;a(T).animate({prop:1},{duration:f.changeSpeed,easing:f.easingChange,step:fa,complete:w})}})}else{g.removeAttr("style");m.css("border-width",f.padding);if(f.transitionIn=="elastic"){M=ha();m.html(b.contents());g.show();if(f.opacity)I.opacity=0;T.prop=0;a(T).animate({prop:1},{duration:f.speedIn,easing:f.easingIn,step:fa,complete:ea})}else{f.titlePosition=="inside"&&O>0&&n.show();m.css({width:I.width-f.padding*2,height:e.autoDimensions?"auto":I.height-O-f.padding*2}).html(b.contents());g.css(I).fadeIn(f.transitionIn=="none"?0:f.speedIn,ea)}}}},ja=function(){if(f.enableEscapeButton||f.enableKeyboardNav)a(document).bind("keydown.fb",function(c){if(c.keyCode==27&&f.enableEscapeButton){c.preventDefault();a.fancybox.close()}else if((c.keyCode==37||c.keyCode==39)&&f.enableKeyboardNav&&c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.target.tagName!=="SELECT"){c.preventDefault();a.fancybox[c.keyCode==37?"prev":"next"]()}});if(f.showNavArrows){if(f.cyclic&&H.length>1||G!==0)u.show();if(f.cyclic&&H.length>1||G!=H.length-1)J.show()}else{u.hide();J.hide()}},ea=function(){if(!a.support.opacity){m.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}e.autoDimensions&&m.css("height","auto");g.css("height","auto");L&&L.length&&n.show();f.showCloseButton&&r.show();ja();f.hideOnContentClick&&m.bind("click",a.fancybox.close);f.hideOnOverlayClick&&d.bind("click",a.fancybox.close);a(window).bind("resize.fb",a.fancybox.resize);f.centerOnScroll&&a(window).bind("scroll.fb",a.fancybox.center);if(f.type=="iframe")a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(a.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+f.href+'"></iframe>').appendTo(m);g.show();z=false;a.fancybox.center();f.onComplete(H,G,f);var c,k;if(H.length-1>G){c=H[G+1].href;if(typeof c!=="undefined"&&c.match(o)){k=new Image;k.src=c}}if(G>0){c=H[G-1].href;if(typeof c!=="undefined"&&c.match(o)){k=new Image;k.src=c}}},fa=function(c){var k={width:parseInt(M.width+(I.width-M.width)*c,10),height:parseInt(M.height+(I.height-M.height)*c,10),top:parseInt(M.top+(I.top-M.top)*c,10),left:parseInt(M.left+(I.left-M.left)*c,10)};if(typeof I.opacity!=="undefined")k.opacity=c<0.5?0.5:c;g.css(k);m.css({width:k.width-f.padding*2,height:k.height-O*c-f.padding*2})},ga=function(){return[a(window).width()-f.margin*2,a(window).height()-f.margin*2,a(document).scrollLeft()+f.margin,a(document).scrollTop()+f.margin]},ia=function(){var c=ga(),k={},w=f.autoScale,K=f.padding*2;k.width=f.width.toString().indexOf("%")>-1?parseInt(c[0]*parseFloat(f.width)/100,10):f.width+K;k.height=f.height.toString().indexOf("%")>-1?parseInt(c[1]*parseFloat(f.height)/100,10):f.height+K;if(w&&(k.width>c[0]||k.height>c[1]))if(e.type=="image"||e.type=="swf"){w=f.width/f.height;if(k.width>c[0]){k.width=c[0];k.height=parseInt((k.width-K)/w+K,10)}if(k.height>c[1]){k.height=c[1];k.width=parseInt((k.height-K)*w+K,10)}}else{k.width=Math.min(k.width,c[0]);k.height=Math.min(k.height,c[1])}k.top=parseInt(Math.max(c[3]-20,c[3]+(c[1]-k.height-40)*0.5),10);k.left=parseInt(Math.max(c[2]-20,c[2]+(c[0]-k.width-40)*0.5),10);return k},ha=function(){var c=e.orig?a(e.orig):false,k={};if(c&&c.length){k=c.offset();k.top+=parseInt(c.css("paddingTop"),10)||0;k.left+=parseInt(c.css("paddingLeft"),10)||0;k.top+=parseInt(c.css("border-top-width"),10)||0;k.left+=parseInt(c.css("border-left-width"),10)||0;k.width=c.width();k.height=c.height();k={width:k.width+f.padding*2,height:k.height+f.padding*2,top:k.top-f.padding-20,left:k.left-f.padding-20}}else{c=ga();k={width:f.padding*2,height:f.padding*2,top:parseInt(c[3]+c[1]*0.5,10),left:parseInt(c[2]+c[0]*0.5,10)}}return k},ka=function(){if(l.is(":visible")){a("div",l).css("top",Q*-40+"px");Q=(Q+1)%12}else clearInterval(y)};a.fn.fancybox=function(c){if(!a(this).length)return this;a(this).data("fancybox",a.extend({},c,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(k){k.preventDefault();if(!z){z=true;a(this).blur();x=[];v=0;k=a(this).attr("rel")||"";if(!k||k==""||k==="nofollow")x.push(this);else{x=a("a[rel="+k+"], area[rel="+k+"]");v=x.index(this)}X()}});return this};a.fancybox=function(c,k){var w;if(!z){z=true;w=typeof k!=="undefined"?k:{};x=[];v=parseInt(w.index,10)||0;if(a.isArray(c)){for(var K=0,U=c.length;K<U;K++)if(typeof c[K]=="object")a(c[K]).data("fancybox",a.extend({},w,c[K]));else c[K]=a({}).data("fancybox",a.extend({content:c[K]},w));x=jQuery.merge(x,c)}else{if(typeof c=="object")a(c).data("fancybox",a.extend({},w,c));else c=a({}).data("fancybox",a.extend({content:c},w));x.push(c)}if(v>x.length||v<0)v=0;X()}};a.fancybox.showActivity=function(){clearInterval(y);l.show();y=setInterval(ka,66)};a.fancybox.hideActivity=function(){l.hide()};a.fancybox.next=function(){return a.fancybox.pos(G+1)};a.fancybox.prev=function(){return a.fancybox.pos(G-1)};a.fancybox.pos=function(c){if(!z){c=parseInt(c);x=H;if(c>-1&&c<H.length){v=c;X()}else if(f.cyclic&&H.length>1){v=c>=H.length?0:H.length-1;X()}}};a.fancybox.cancel=function(){if(!z){z=true;a.event.trigger("fancybox-cancel");Z();e.onCancel(x,v,e);z=false}};a.fancybox.close=function(){function c(){d.fadeOut("fast");n.empty().hide();g.hide();a.event.trigger("fancybox-cleanup");m.empty();f.onClosed(H,G,f);H=e=[];G=v=0;f=e={};z=false}if(!(z||g.is(":hidden"))){z=true;if(f&&false===f.onCleanup(H,G,f))z=false;else{Z();a(r.add(u).add(J)).hide();a(m.add(d)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");m.find("iframe").attr("src",Y&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");f.titlePosition!=="inside"&&n.empty();g.stop();if(f.transitionOut=="elastic"){M=ha();var k=g.position();I={top:k.top,left:k.left,width:g.width(),height:g.height()};if(f.opacity)I.opacity=1;n.empty().hide();T.prop=1;a(T).animate({prop:0},{duration:f.speedOut,easing:f.easingOut,step:fa,complete:c})}else g.fadeOut(f.transitionOut=="none"?0:f.speedOut,c)}}};a.fancybox.resize=function(){d.is(":visible")&&d.css("height",a(document).height());a.fancybox.center(true)};a.fancybox.center=function(c){var k,w;if(!z){w=c===true?1:0;k=ga();!w&&(g.width()>k[0]||g.height()>k[1])||g.stop().animate({top:parseInt(Math.max(k[3]-20,k[3]+(k[1]-m.height()-40)*0.5-f.padding)),left:parseInt(Math.max(k[2]-20,k[2]+(k[0]-m.width()-40)*0.5-f.padding))},typeof c=="number"?c:200)}};a.fancybox.init=function(){if(!a("#fancybox-wrap").length){a("body").append(b=a('<div id="fancybox-tmp"></div>'),l=a('<div id="fancybox-loading"><div></div></div>'),d=a('<div id="fancybox-overlay"></div>'),g=a('<div id="fancybox-wrap"></div>'));s=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(g);s.append(m=a('<div id="fancybox-content"></div>'),r=a('<a id="fancybox-close"></a>'),n=a('<div id="fancybox-title"></div>'),u=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),J=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));r.click(a.fancybox.close);l.click(a.fancybox.cancel);u.click(function(c){c.preventDefault();a.fancybox.prev()});J.click(function(c){c.preventDefault();a.fancybox.next()});a.fn.mousewheel&&g.bind("mousewheel.fb",function(c,k){if(z)c.preventDefault();else if(a(c.target).get(0).clientHeight==0||a(c.target).get(0).scrollHeight===a(c.target).get(0).clientHeight){c.preventDefault();a.fancybox[k>0?"prev":"next"]()}});a.support.opacity||g.addClass("fancybox-ie");if(Y){l.addClass("fancybox-ie6");g.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(s)}}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery);(function(a){a.fn.extend({gcomplete:function(b){var l=a(this);if(l.get(0).tagName.toLowerCase()=="input"&&l.attr("type")=="text"){var d,g,s,m={style:"default",url:"http://google.com/complete/search",query_key:"q",param:{output:"json"},limit:10,cycle:500,effect:false,oneword:false,callbackUseOnlyString:false,parseFunc:function(o){return o[1]}},r=function(){clearInterval(s);d.param[d.query_key]="";v();a.browser.mozilla?l.unbind("keypress",P):l.unbind("keydown",P);if(typeof l.mousewheel=="function"){l.unbind("mousedown",H);a(window).unbind("mousewheel",N)}},n=function(){var o=l.val();if(o.length>0&&o.replace(/ +$/,"")!=d.param[d.query_key].replace(/ +$/,""))a:{var q={};d.param[d.query_key]=o;for(var y in d.param)q[y]=d.param[y];if(f("oneword")){q[d.query_key]=o.split(" ").pop();if(!q[d.query_key]){v();break a}}if(f("callbackUseOnlyString")){o=a("#__gcompleteaccess");y=[];var Q="abcdefghij".split(""),O=(new Date).getTime().toString().split("");y.push(Q[Math.floor(Math.random()*Q.length)]);for(var L=0,M=O.length;L<M;L++)y.push(Q[O[L]]);y="gcompletef"+y.join("");q.callback=y;window[y]=u;o.size()>0?o.attr("src",d.url+"?"+a.param(q)):a("<script />").attr("type","text/javascript").attr("id","__gcompleteaccess").attr("src",d.url+"?"+a.param(q)).appendTo("body")}else a.get(d.url,q,u,"jsonp")}else o.length<=0&&v()},u=function(o){try{var q=f("parseFunc")(o);q.length>0?J(q):v()}catch(y){r()}},J=function(o){if(o){g.empty();var q;q=f("limit");for(var y=0,Q=Math.min(o.length,q);y<Q;y++){q=a("<dl />").appendTo(g);if(typeof o[y]=="string"){q.append(a("<dt />").text(o[y]));q.data("text",o[y])}else{q.append(a("<dt />").text(o[y][0]));q.append(a("<dd />").text(o[y][1]));q.data("text",o[y][0])}q.hover(function(){e(this)},function(){a(this).removeClass("over").removeAttr("rel")}).mousedown(function(){e(this);x()})}}f("effect")&&g.css("display")=="none"?g.fadeIn(300):g.show()},v=function(){f("effect")?g.fadeOut(100):g.hide()},e=function(o){var q=g.find("dl");a(q).removeClass("over").removeAttr("rel");a(o).addClass("over").attr("rel","select")},x=function(){var o=g.find("dl[rel=select]");if(o.size()){if(f("oneword")){var q=l.val().split(" ");q.pop();q.push(o.data("text"));q.push("");l.val(q.join(" "))}else l.val(o.data("text"));return true}return false},G=function(o){var q=Number(o.replace("px",""));return isNaN(o)?1:q},f=function(o){if(d.hasOwnProperty(o))return d[o];return null},H=function(o){switch(o.button){case 1:if(!a.browser.msie&&x())return false;break;case 4:if(a.browser.msie&&x())return false}return true},P=function(o){var q=g.find("dl[rel=select]");switch(o.keyCode){case 27:r();break;case 38:e(q.prev().size()?q.prev():g.find("dl:last"));return false;case 40:e(q.next().size()?q.next():g.find("dl:first"));return false;case 13:if(x())return false}return true},N=function(o,q){if(g.find("dl").size()){o=g.find("dl[rel=select]");q=q<0;o.size()?e(q?o.next().size()?o.next():g.find("dl:first"):o.prev().size()?o.prev():g.find("dl:last")):e(q?g.find("dl:first"):g.find("dl:last"))}return false};(function(o){d=o||{};for(var q in m)d.hasOwnProperty(q)||(d[q]=m[q]);d.param[d.query_key]="";l.data("_gcomp",d)})(b);g=a("<div />").addClass("gcomplete-"+f("style")+"-box").css({position:"absolute",left:l.position().left,top:function(){var o=l.position().top+l.height();o+=G(l.css("margin-top"))+G(l.css("padding-top"))+G(l.css("border-top-width"))+G(l.css("padding-bottom"))+G(l.css("border-bottom-width"));return o}(),"z-index":"9999"}).insertAfter(l);g.hide();l.focus(function(){s=setInterval(n,f("cycle"));a.browser.mozilla?l.keypress(P):l.keydown(P);if(typeof l.mousewheel=="function"){l.mousedown(H);a(window).mousewheel(N)}});l.blur(function(){r()})}return l}})})(jQuery);(function(a){a.fn.tinyTips=function(b,l){if(b==="null")b="light";var d=b+"Tip",g='<div class="'+d+'"><div class="content"></div><div class="bottom">&nbsp;</div></div>',s,m;a(this).hover(function(){a("body").append(g);var r="div."+d;s=a(r);s.hide();if(l==="title")var n=a(this).attr("title");else if(l!=="title")n=l;a(r+" .content").html(n);m=a(this).attr("title");a(this).attr("title","");r=s.height()+5;n=s.width()/2-a(this).width()/2;var u=a(this).offset();u.top-=r;u.left-=n;s.css("position","absolute").css("z-index","1000");s.css(u).fadeIn(300)},function(){a(this).attr("title",m);s.fadeOut(300,function(){a(this).remove()})})}})(jQuery);(function(a){a.fn.easySlider=function(b){b=a.extend({prevId:"prevBtn",prevText:"Previous",nextId:"nextBtn",nextText:"Next",controlsShow:true,controlsBefore:"",controlsAfter:"",controlsFade:true,firstId:"firstBtn",firstText:"First",firstShow:false,lastId:"lastBtn",lastText:"Last",lastShow:false,vertical:false,speed:800,auto:false,pause:2E3,continuous:false},b);this.each(function(){function l(J,v){var e=n;switch(J){case"next":n=e>=r?b.continuous?0:r:n+1;break;case"prev":n=n<=0?b.continuous?r:0:n-1;break;case"first":n=0;break;case"last":n=r}e=Math.abs(e-n);var x=e*b.speed;if(b.vertical){p=n*m*-1;a("ul",d).animate({marginTop:p},x)}else{p=n*s*-1;a("ul",d).animate({marginLeft:p},x)}if(!b.continuous&&b.controlsFade){if(n==r){a("a","#"+b.nextId).hide();a("a","#"+b.lastId).hide()}else{a("a","#"+b.nextId).show();a("a","#"+b.lastId).show()}if(n==0){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}else{a("a","#"+b.prevId).show();a("a","#"+b.firstId).show()}}v&&clearTimeout(u);if(b.auto&&J=="next"&&!v)u=setTimeout(function(){l("next",false)},e*b.speed+b.pause)}var d=a(this),g=a("li",d).length,s=a("li",d).width(),m=a("li",d).height();d.width(s);d.height(m);d.css("overflow","hidden");var r=g-1,n=0;a("ul",d).css("width",g*s);b.vertical||a("li",d).css("float","left");if(b.controlsShow){g=b.controlsBefore;if(b.firstShow)g+='<span id="'+b.firstId+'" title="D\u00e9but"><a href="javascript:void(0);">'+b.firstText+"</a></span>";g+=' <span id="'+b.prevId+'"><a href="javascript:void(0);" title="Pr\u00e9c\u00e9dent">'+b.prevText+"</a></span>";g+=' <span id="'+b.nextId+'"><a href="javascript:void(0);" title="Suivant">'+b.nextText+"</a></span>";if(b.lastShow)g+=' <span id="'+b.lastId+'" title="Fin"><a href="javascript:void(0);">'+b.lastText+"</a></span>";g+=b.controlsAfter;a(d).after(g)}a("a","#"+b.nextId).click(function(){l("next",true)});a("a","#"+b.prevId).click(function(){l("prev",true)});a("a","#"+b.firstId).click(function(){l("first",true)});a("a","#"+b.lastId).click(function(){l("last",true)});var u;if(b.auto)u=setTimeout(function(){l("next",false)},b.pause);if(!b.continuous&&b.controlsFade){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}})}})(jQuery);var liveSearchReq=false,t=null,liveSearchLast="",isIE=false;if(window.XMLHttpRequest)liveSearchReq=new XMLHttpRequest;function liveSearchInit(){if(navigator.userAgent.indexOf("Safari")>0)document.getElementById("livesearch").addEventListener("keydown",liveSearchKeyPress,false);else if(navigator.product=="Gecko"){document.getElementById("livesearch").addEventListener("keypress",liveSearchKeyPress,false);document.getElementById("livesearch").addEventListener("blur",liveSearchHideDelayed,false)}else{document.getElementById("livesearch").attachEvent("onkeydown",liveSearchKeyPress);isIE=true}document.getElementById("livesearch").setAttribute("autocomplete","off")}function liveSearchHideDelayed(){window.setTimeout("liveSearchHide()",400)}function liveSearchHide(){document.getElementById("LSResult").style.display="none";var a=document.getElementById("LSHighlight");a&&a.removeAttribute("id")}
function liveSearchKeyPress(a){if(a.keyCode==40){if(highlight=document.getElementById("LSHighlight")){highlight.removeAttribute("id");highlight=highlight.nextSibling}else highlight=document.getElementById("LSShadow").firstChild.firstChild;highlight&&highlight.setAttribute("id","LSHighlight");isIE||a.preventDefault()}else if(a.keyCode==38){if(highlight=document.getElementById("LSHighlight")){highlight.removeAttribute("id");highlight=highlight.previousSibling}else highlight=document.getElementById("LSResult").firstChild.firstChild.lastChild;highlight&&highlight.setAttribute("id","LSHighlight");isIE||a.preventDefault()}else if(a.keyCode==27){(highlight=document.getElementById("LSHighlight"))&&highlight.removeAttribute("id");document.getElementById("LSResult").style.display="none"}else if(a.keyCode==8&&isIE)liveSearchStart();else if(a.keyCode==13)return liveSearchSubmit()}function liveSearchStart(){t&&window.clearTimeout(t);t=window.setTimeout("liveSearchDoSearch()",200)}
function liveSearchDoSearch(){if(typeof liveSearchRoot=="undefined")liveSearchRoot="";if(typeof liveSearchRootSubDir=="undefined")liveSearchRootSubDir="";liveSearchParams2=typeof liveSearchParams=="undefined"?"":"&"+liveSearchParams;if(liveSearchLast!=document.forms.searchform.q.value){liveSearchReq&&liveSearchReq.readyState<4&&liveSearchReq.abort();if(document.forms.searchform.q.value==""){liveSearchHide();liveSearchLast="";return false}if(!window.XMLHttpRequest)if(window.ActiveXObject)liveSearchReq=new ActiveXObject("Microsoft.XMLHTTP");liveSearchReq.onreadystatechange=liveSearchProcessReqChange;liveSearchReq.open("GET",liveSearchRoot+"/tabcal.php?q="+document.forms.searchform.q.value+"&source="+document.forms.searchform.source.value+liveSearchParams2);liveSearchLast=document.forms.searchform.q.value;liveSearchReq.send(null)}}
function liveSearchProcessReqChange(){if(liveSearchReq.readyState==4){document.getElementById("LSResult").style.display="block";document.getElementById("LSShadow").innerHTML=liveSearchReq.responseText}}function liveSearchSubmit(){var a=document.getElementById("LSHighlight");if(a&&a.firstChild){window.location=a.firstChild.nextSibling.getAttribute("href");return false}else return true}
function preview(a){var b=$("previewComment");if(!b){var l=$("bx_foo");b=document.createElement("div");b.id="previewComment";b.className="post_content";b=l.parentNode.insertBefore(b,l.nextSibling)}b.innerHTML=a.responseText}
function previewSubmit(){var a=document.getElementById("name").value,b=document.getElementById("email").value,l=document.getElementById("openid_url").value,d=document.forms.bx_foo.comments.value;if(typeof g=="undefined")var g="/";body="mail="+encodeURIComponent(b)+"&uri="+encodeURIComponent(l)+"&text="+encodeURIComponent(d)+"&name="+encodeURIComponent(a);new ajax(g+"inc/bx/php/preview.php",{postBody:body,method:"post",onComplete:preview});return false}
function prepareCommentSubmit(){var a=document.getElementById("bx_plugins_blog_all"),b=document.getElementById("bx_plugins_hidden_submit_replacement");a.name="foo";a.disabled=true;a.value="Sending ...";b.name="bx[plugins][blog][_all]";return true};
