function popData(a,b){jQuery("#"+a).modal({closeHTML:"",containerCss:{backgroundColor:"#ffffff",height:500,padding:20,width:500},overlayClose:true})}function closeEditing(a,b){jQuery.modal.close();if(b!=="xxlee"){var c=jQuery.post(""+eePath+"/getfile.php",{file:a,eData:"save",nData:b},function(b){jQuery("#"+a).html(b);jQuery("#"+a).removeClass("edithoverActive");jQuery("#ed-"+a).fadeOut("slow");jQuery("#ee-"+a).fadeIn("medium");jQuery("#ma-"+a).fadeOut("fast",function(){jQuery("#ma-"+a).remove()})})}else{jQuery("#"+a).removeClass("edithoverActive");jQuery("#ed-"+a).fadeOut("slow");jQuery("#ee-"+a).fadeIn("medium");jQuery("#ma-"+a).fadeOut("medium",function(){jQuery("#ma-"+a).remove()})}}function eeCancel(a){var b=a.split("ex-");var c="#"+b[1];var d=jQuery(c).outerHeight();var e=jQuery(c).outerWidth();jQuery(c).before('<div id="ma-'+b[1]+'" class="emask" style="height:'+d+"px;width:"+e+'px;"></div>');var f=jQuery.post(""+eePath+"/getfile.php",{file:b[1],eData:"cancel"},function(a){jQuery("#"+b[1]).html(a);jQuery("#"+b[1]).removeClass("edithoverActive");jQuery("#ed-"+b[1]).fadeOut("slow");jQuery("#ee-"+b[1]).fadeIn("medium");jQuery("#ma-"+b[1]).fadeOut("fast",function(){jQuery("#ma-"+b[1]).remove()})})}function eeSave(a){var b=a.split("es-");var c=jQuery("#eeta-"+b[1]).val();var d="#"+b[1];var e=jQuery(d).outerHeight();var f=jQuery(d).outerWidth();jQuery(d).before('<div id="ma-'+b[1]+'" class="emask" style="height:'+e+"px;width:"+f+'px;"></div>');var g=jQuery.post(""+eePath+"/getfile.php",{file:b[1],eData:"save",nData:c},function(a){jQuery("#"+b[1]).html(a);jQuery("#"+b[1]).removeClass("edithoverActive");jQuery("#ed-"+b[1]).fadeOut("slow");jQuery("#ee-"+b[1]).fadeIn("medium");jQuery("#ma-"+b[1]).fadeOut("fast",function(){jQuery("#ma-"+b[1]).remove()})})}function editNow(a){var b="#"+a;var c=jQuery(b).outerHeight();var d=jQuery(b).outerWidth();var e=jQuery(b).attr("class");var f=/ee:\S*/i.exec(e);var g=jQuery(window).width()-150;var h=jQuery(window).height()-130;if(f=="ee:wwig"){jQuery(b).before('<div id="ma-'+a+'" class="emask2" style="height:'+c+"px;width:"+d+'px;"></div>');jQuery(b).addClass("edithoverActive");jQuery("#ee-"+a).fadeOut("slow");var i=""+eePath+"/cfk-edit.php?file="+a+"";$.modal('<iframe src="'+i+'" height="'+h+'" width="'+g+'" style="border:0">',{closeHTML:"",containerCss:{backgroundColor:"#ffffff",padding:"0",margin:"0"},escClose:false})}else{jQuery(b).before('<div id="ma-'+a+'" class="emask" style="height:'+c+"px;width:"+d+'px;"></div>');var j=jQuery.post(""+eePath+"/getfile.php",{file:a,height:c,width:d,eType:f,eData:"edit"},function(c){jQuery(b).html(c);jQuery(b).addClass("edithoverActive");jQuery("#ed-"+a).fadeIn("slow");jQuery("#ee-"+a).fadeOut("slow");jQuery("#ma-"+a).fadeOut("fast",function(){jQuery("#ma-"+a).remove()})})}}function unbindEE(){jQuery(".e-ease").each(function(){var a="#"+jQuery(this).attr("id");jQuery(a).removeClass("editactive")});jQuery(".eeClick").remove();jQuery(".eeClickEdit").remove();jQuery(".e-ease").unbind("mouseover");jQuery(".e-ease").unbind("mouseout");jQuery(".e-ease .eeClick").unbind("click");jQuery("#eepages").unbind("change");jQuery("#eehelpt").unbind("click");jQuery("#eeinfot").unbind("click");jQuery("#eeinclo").unbind("click");jQuery("#eesave").unbind("click");jQuery("#eecancel").unbind("click")}function bindEE(){jQuery("#eepages").bind("change",function(){if(jQuery(this).val()!==null){location=jQuery(this).val()}});jQuery("#eehelpt").bind("click",function(){jQuery("#eeinfo").slideUp("normal");jQuery("#eefiles").slideUp("normal");jQuery("#eehelp").slideToggle("normal")});jQuery("#eeinfot").bind("click",function(){jQuery("#eehelp").slideUp("normal");jQuery("#eefiles").slideUp("normal");jQuery("#eeinfo").slideToggle("normal")});jQuery("#eefilest").bind("click",function(){jQuery("#eehelp").slideUp("normal");jQuery("#eeinfo").slideUp("normal");jQuery("#eefiles").slideToggle("normal")});jQuery(".e-ease").dblclick(function(){editNow(this.id)});jQuery("#eeinclo").bind("click",function(){eeLogoutCheck()});jQuery(".e-ease").each(function(){var a="#"+jQuery(this).attr("id");jQuery(a).addClass("editactive");$(".e-button").show();jQuery(a).before('<div class="eeClick" id="ee-'+jQuery(this).attr("id")+'"><img src="'+eePath+'/img/page_edit.png" alt="click to edit" title="click to edit"/> <span>Edition</span></div>');jQuery(a).before('<div class="eeClickEdit" style="display:none;" id="ed-'+jQuery(this).attr("id")+'"><div class="eesave" id="es-'+jQuery(this).attr("id")+'"><img src="'+eePath+'/img/page_save.png" alt="save" title="save"/><span> OK</span></div><div class="eecancel" id="ex-'+jQuery(this).attr("id")+'"><img src="'+eePath+'/img/page_delete.png" alt="cancel" title="cancel"/><span> Annul</span></div></div>')});jQuery(".eeClick").bind("click",function(){var a=jQuery(this).attr("id").split("ee-");editNow(a[1])});$(".e-ease").dblclick(function(){editNow(this.id)});jQuery(".e-ease").bind("mouseover",function(){var a="#"+jQuery(this).attr("id");jQuery(a).addClass("edithover")});jQuery(".e-ease").bind("mouseout",function(){var a="#"+jQuery(this).attr("id");jQuery(a).removeClass("edithover")});url=location.href.split("/");var a=url.pop();jQuery("#eepages option").each(function(){if(jQuery(this).val()===a){jQuery(this).attr({selected:"selected"})}});jQuery(".eesave").bind("click",function(){eeSave(jQuery(this).attr("id"))});jQuery(".eecancel").bind("click",function(){eeCancel(jQuery(this).attr("id"))})}function eeLive(){function a(){jQuery("#eepanel").animate({top:"0"},"slow",function(){jQuery("#eepanelWrap").fadeIn("fast");bindEE();$(".non").css("display","block");$(".paging h1:contains('oui')").css("color","green");$(".paging h1:contains('non')").css("color","red");$(".description").css("top","90px");$(".description h2").css("top","0px");$(".description h3").css("top","30px");$(".bloc_g").mouseover(function(){$(".description",this).stop().animate({top:"90px"},200);$(".description h2",this).stop().animate({top:"0px"},200);$(".description h3",this).stop().animate({top:"30px"},200)});$(".bloc_g").mouseout(function(){$(".description",this).stop().animate({top:"90px"},200);$(".description h2",this).stop().animate({top:"0px"},200);$(".description h3",this).stop().animate({top:"30px"},200)});$("div.bloc_g").unbind("click")})}jQuery.post(""+eePath+"/eepanel.php?val="+Math.random(),function(b){jQuery("body").prepend(b);a()})}function doLogin(a){jQuery("#eesbt").attr({disabled:"disabled"});var b=jQuery("#username").val();var c=jQuery("#password").val();jQuery.post(eePath+"/loginnow.php?password="+c+"&username="+b,function(a){if(a==="fail"){jQuery(".warning").css({display:"block"});jQuery("#eesbt").removeAttr("disabled")}else{jQuery(".warning").html("Welcome back, loading editEase now, please wait a moment");jQuery(".warning").addClass("success");jQuery(".warning").css({display:"block"});eeLive();jQuery.modal.close();jQuery("#eesbt").removeAttr("disabled");jQuery(".warning").html('Your "username" or "password" don\'t appear to be valid.  Please try again.');jQuery(".warning").removeClass("success");jQuery(".warning").css({display:"none"})}});return false}function eelogout(){jQuery("#eepanel").remove();jQuery.get(""+eePath+"/sess-destroy.php?killsession=true");unbindEE();$("h1 .e-button").css("display","none");$(".non").css("display","none");$(".description").css("top","180px");$(".description h2").css("top","180px");$(".description h3").css("top","180px");$(".bloc_g").mouseover(function(){$(".description",this).stop().animate({top:"0px"},200);$(".description h2",this).stop().animate({top:"0px"},200);$(".description h3",this).stop().animate({top:"18px"},200)});$(".bloc_g").mouseout(function(){$(".description",this).stop().animate({top:"180px"},150);$(".description h2",this).stop().animate({top:"180px"},150);$(".description h3",this).stop().animate({top:"180px"},"fast")})}function eeLogoutCheck(){var a='<div id="eelogout" style="display:none;"><div class="customDialog"><a class="modalCloseImg simplemodal-close" title="Close"></a><h2>Logout</h2><button type="submit" class="simplemodal-close">  NON  </button> <button type="submit" onclick="eelogout();" class="simplemodal-close"> OUI  </button></div></div>';jQuery("body").append(a);jQuery("#eelogout").modal({closeHTML:"",containerCss:{backgroundColor:"#ffffff",height:150,padding:10,scroll:"none",width:305},overlayClose:true})}function loginModal(){jQuery("#eelogin").modal({closeHTML:"",containerCss:{backgroundColor:"#ffffff",height:180,padding:10,scroll:"none",width:305},overlayClose:true})}jQuery.fn.editease=function(a,b){if(b==undefined){eePath="/_ee"}else{eePath=b}if(a==undefined){var a="Admin"}jQuery("head").append('<link rel="stylesheet" type="text/css" media="all" href="'+eePath+'/editease.css">');if(a=="undefined"){var a="Admin"}var c='<a href="javascript:void(0)" onclick="loginModal()" class="eelgn" title="Se logger pour modifier"><span>'+a+'</span><img src="http://static.xlrproject.net/ico_70.png" align="absbottom" /></a><div id="eelogin" style="display:none;"><a class="modalCloseImg simplemodal-close" title="Close"></a><div class="customDialog"><h2>Login</h2><div class="text"><form action="javascript:void(0)" method="post" onsubmit="return doLogin(\'login\');" id="loginform"><fieldset><span class="warning">"log" ou "pass" invalide.  Try agaaain.</span><label for="username">Login</label><input type="text" name="username" id="username" maxlength="100" value=""/><label for="password">Pass</label><input type="password" name="password" id="password" maxlength="100" value=""/><button type="submit" id="eesbt">  LOGIN  </button></fieldset></form></div></div></div>';jQuery(this).append(c);jQuery.post(""+eePath+"/session.php",function(a){if(jQuery.trim(a)==="eeloggedin"){eeLive()}});jQuery.post(""+eePath+"/_eeInstall.php?deleteMe=1",function(a){if(a=="delete"){alert("For security you really should delete the _eeInstall.php file.")}})};(function(a){var b=a.browser.msie&&parseInt(a.browser.version)==6&&typeof window["XMLHttpRequest"]!="object",c=null,d=[];a.modal=function(b,c){return a.modal.impl.init(b,c)};a.modal.close=function(){a.modal.impl.close()};a.fn.modal=function(b){return a.modal.impl.init(this,b)};a.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:200,minWidth:300,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1e3,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,persist:false,onOpen:null,onShow:null,onClose:null};a.modal.impl={o:null,d:{},init:function(b,d){var e=this;if(e.d.data){return false}c=a.browser.msie&&!a.boxModel;e.o=a.extend({},a.modal.defaults,d);e.zIndex=e.o.zIndex;e.occb=false;if(typeof b=="object"){b=b instanceof jQuery?b:a(b);if(b.parent().parent().size()>0){e.d.parentNode=b.parent();if(!e.o.persist){e.d.orig=b.clone(true)}}}else if(typeof b=="string"||typeof b=="number"){b=a("<div></div>").html(b)}else{alert("SimpleModal Error: Unsupported data type: "+typeof b);return e}e.create(b);b=null;e.open();if(a.isFunction(e.o.onShow)){e.o.onShow.apply(e,[e.d])}return e},create:function(e){var f=this;d=f.getDimensions();if(b){f.d.iframe=a('<iframe src="javascript:false;"></iframe>').css(a.extend(f.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:d[0],width:d[1],zIndex:f.o.zIndex,top:0,left:0})).appendTo(f.o.appendTo)}f.d.overlay=a("<div></div>").attr("id",f.o.overlayId).addClass("simplemodal-overlay").css(a.extend(f.o.overlayCss,{display:"none",opacity:f.o.opacity/100,height:d[0],width:d[1],position:"fixed",left:0,top:0,zIndex:f.o.zIndex+1})).appendTo(f.o.appendTo);f.d.container=a("<div></div>").attr("id",f.o.containerId).addClass("simplemodal-container").css(a.extend(f.o.containerCss,{display:"none",position:"fixed",zIndex:f.o.zIndex+2})).append(f.o.close&&f.o.closeHTML?a(f.o.closeHTML).addClass(f.o.closeClass):"").appendTo(f.o.appendTo);f.d.wrap=a("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(f.d.container);f.d.data=e.attr("id",e.attr("id")||f.o.dataId).addClass("simplemodal-data").css(a.extend(f.o.dataCss,{display:"none"})).appendTo("body");e=null;f.setContainerDimensions();f.d.data.appendTo(f.d.wrap);if(b||c){f.fixIE()}},bindEvents:function(){var e=this;a("."+e.o.closeClass).bind("click.simplemodal",function(a){a.preventDefault();e.close()});if(e.o.close&&e.o.overlayClose){e.d.overlay.bind("click.simplemodal",function(a){a.preventDefault();e.close()})}a(document).bind("keydown.simplemodal",function(a){if(e.o.focus&&a.keyCode==9){e.watchTab(a)}else if(e.o.close&&e.o.escClose&&a.keyCode==27){a.preventDefault();e.close()}});a(window).bind("resize.simplemodal",function(){d=e.getDimensions();e.setContainerDimensions(true);if(b||c){e.fixIE()}else{e.d.iframe&&e.d.iframe.css({height:d[0],width:d[1]});e.d.overlay.css({height:d[0],width:d[1]})}})},unbindEvents:function(){a("."+this.o.closeClass).unbind("click.simplemodal");a(document).unbind("keydown.simplemodal");a(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var b=this,c=b.o.position;a.each([b.d.iframe||null,b.d.overlay,b.d.container],function(a,b){if(b){var d="document.body.clientHeight",e="document.body.clientWidth",f="document.body.scrollHeight",g="document.body.scrollLeft",h="document.body.scrollTop",i="document.body.scrollWidth",j="document.documentElement.clientHeight",k="document.documentElement.clientWidth",l="document.documentElement.scrollLeft",m="document.documentElement.scrollTop",n=b[0].style;n.position="absolute";if(a<2){n.removeExpression("height");n.removeExpression("width");n.setExpression("height",""+f+" > "+d+" ? "+f+" : "+d+' + "px"');n.setExpression("width",""+i+" > "+e+" ? "+i+" : "+e+' + "px"')}else{var o,q;if(c&&c.constructor==Array){var r=c[0]?typeof c[0]=="number"?c[0].toString():c[0].replace(/px/,""):b.css("top").replace(/px/,"");o=r.indexOf("%")==-1?r+" + (t = "+m+" ? "+m+" : "+h+') + "px"':parseInt(r.replace(/%/,""))+" * (("+j+" || "+d+") / 100) + (t = "+m+" ? "+m+" : "+h+') + "px"';if(c[1]){var s=typeof c[1]=="number"?c[1].toString():c[1].replace(/px/,"");q=s.indexOf("%")==-1?s+" + (t = "+l+" ? "+l+" : "+g+') + "px"':parseInt(s.replace(/%/,""))+" * (("+k+" || "+e+") / 100) + (t = "+l+" ? "+l+" : "+g+') + "px"'}}else{o="("+j+" || "+d+") / 2 - (this.offsetHeight / 2) + (t = "+m+" ? "+m+" : "+h+') + "px"';q="("+k+" || "+e+") / 2 - (this.offsetWidth / 2) + (t = "+l+" ? "+l+" : "+g+') + "px"'}n.removeExpression("top");n.removeExpression("left");n.setExpression("top",o);n.setExpression("left",q)}}})},focus:function(b){var c=this,d=b||"first";var e=a(":input:enabled:visible:"+d,c.d.wrap);e.length>0?e.focus():c.d.wrap.focus()},getDimensions:function(){var b=a(window);var c=a.browser.opera&&a.browser.version>"9.5"&&a.fn.jquery<="1.2.6"?document.documentElement["clientHeight"]:a.browser.opera&&a.browser.version<"9.5"&&a.fn.jquery>"1.2.6"?window.innerHeight:b.height();return[c,b.width()]},getVal:function(a){return a=="auto"?0:a.indexOf("%")>0?a:parseInt(a.replace(/px/,""))},setContainerDimensions:function(a){var b=this;if(!a||a&&b.o.autoResize){var c=b.getVal(b.d.container.css("height")),e=b.getVal(b.d.container.css("width")),f=b.d.data.outerHeight(true),g=b.d.data.outerWidth(true);var h=b.o.maxHeight&&b.o.maxHeight<d[0]?b.o.maxHeight:d[0],i=b.o.maxWidth&&b.o.maxWidth<d[1]?b.o.maxWidth:d[1];if(!c){if(!f){c=b.o.minHeight}else{if(f>h){c=h}else if(f<b.o.minHeight){c=b.o.minHeight}else{c=f}}}else{c=c>h?h:c}if(!e){if(!g){e=b.o.minWidth}else{if(g>i){e=i}else if(g<b.o.minWidth){e=b.o.minWidth}else{e=g}}}else{e=e>i?i:e}b.d.container.css({height:c,width:e});if(f>c||g>e){b.d.wrap.css({overflow:"auto"})}}if(b.o.autoPosition){b.setPosition()}},setPosition:function(){var a=this,b,c,e=d[0]/2-a.d.container.outerHeight(true)/2,f=d[1]/2-a.d.container.outerWidth(true)/2;if(a.o.position&&Object.prototype.toString.call(a.o.position)==="[object Array]"){b=a.o.position[0]||e;c=a.o.position[1]||f}else{b=e;c=f}a.d.container.css({left:c,top:b})},watchTab:function(b){var c=this;if(a(b.target).parents(".simplemodal-container").length>0){c.inputs=a(":input:enabled:visible:first, :input:enabled:visible:last",c.d.data[0]);if(!b.shiftKey&&b.target==c.inputs[c.inputs.length-1]||b.shiftKey&&b.target==c.inputs[0]||c.inputs.length==0){b.preventDefault();var d=b.shiftKey?"last":"first";setTimeout(function(){c.focus(d)},10)}}else{b.preventDefault();setTimeout(function(){c.focus()},10)}},open:function(){var b=this;b.d.iframe&&b.d.iframe.show();if(a.isFunction(b.o.onOpen)){b.o.onOpen.apply(b,[b.d])}else{b.d.overlay.show();b.d.container.show();b.d.data.show()}b.focus();b.bindEvents()},close:function(){var b=this;if(!b.d.data){return false}b.unbindEvents();if(a.isFunction(b.o.onClose)&&!b.occb){b.occb=true;b.o.onClose.apply(b,[b.d])}else{if(b.d.parentNode){if(b.o.persist){b.d.data.hide().appendTo(b.d.parentNode)}else{b.d.data.hide().remove();b.d.orig.appendTo(b.d.parentNode)}}else{b.d.data.hide().remove()}b.d.container.hide().remove();b.d.overlay.hide().remove();b.d.iframe&&b.d.iframe.hide().remove();b.d={}}}}})(jQuery)
