
(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)},X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);
function selection_lien(id_selection) {
i = objet(id_selection).selectedIndex;
url = objet(id_selection).options[i].value;
parent.location.href = url;
}
function selection_lien2(id_selection) {
url = objet(id_selection).value;
parent.location.href = url;
}
function chiffres(objInput){
var cc    = '';
for(i=0; i < objInput.value.length; i++){
cc = objInput.value.charAt(i);
if( !( ( cc >=0 && cc <= 9 ) || cc == ',' ) || cc == ' ' ) {
objInput.value = objInput.value.slice(0, i);
}
}
}
function chiffres_telephone(objInput){
var cc    = '';
for(i=0; i < objInput.value.length; i++){
cc = objInput.value.charAt(i);
if(!(cc >=0 && cc <= 9) || cc == ' ') {
objInput.value = objInput.value.slice(0, i);
}
}
}
function activation_champ(checkbox, attribut_id){
champInput = 'ContentObjectAttribute_ezstring_data_text_' + attribut_id ;
if(checkbox.checked){
if (window.ie) {
checkbox.form.elements[champInput].readOnly = false;
} else {
checkbox.form.elements[champInput].removeAttribute("readonly");
}
} else {
if (window.ie) {
checkbox.form.elements[champInput].readOnly = true;
} else {
checkbox.form.elements[champInput].setAttribute("readonly","readonly");
}
}
}
function limitText(limitField, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
}
}
function setPaysAcheteur(value)
{
if(value=='France')
{
montre_block("dept");
xajax_setDepartement('cellule_departement','departement','cellule_ville','ville','cellule_cp','code_postal');
xajax_setVille('','cellule_ville','ville','cellule_cp','code_postal');
xajax_setCP('','cellule_cp','code_postal');
}
else
{
cache("dept");
objet("cellule_departement").innerHTML = '<input id="departement" type="hidden" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="0" />';
objet("cellule_ville").innerHTML = '<input id="ville" type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
objet("cellule_cp").innerHTML = '<input id="code_postal" type="text" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
}
function setPaysBien(value)
{
if (value=='FR')
{
montre_block("text_departement_bien");
xajax_setDepartement('cellule_departement_bien','departement','cellule_ville_bien','ville','cellule_CP_bien','code_postal');
xajax_setVille('','cellule_ville_bien','ville','cellule_CP_bien','code_postal');
xajax_setCP('','cellule_CP_bien','code_postal');
}
else
{
cache("text_departement_bien");
objet("cellule_departement_bien").innerHTML = '<input type="hidden" id="departement" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value=""/>';
objet("cellule_ville_bien").innerHTML = '<input type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" id="ville" value="" />';
objet("cellule_CP_bien").innerHTML = '<input type="text" id="code_postal" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
}
function setPaysAnnonce(value)
{
if (value=='France')
{
montre_block("text_departement_bien");
xajax_setDepartement('cellule_departement_bien','AnnonceDepartement','cellule_ville_bien','AnnonceVille','cellule_CP_bien','AnnonceCodePostal');
xajax_setVille('','cellule_ville_bien','AnnonceVille','cellule_CP_bien','AnnonceCodePostal');
xajax_setCP('','cellule_CP_bien','AnnonceCodePostal');
}
else
{
cache("text_departement_bien");
objet("cellule_departement_bien").innerHTML = '<input type="hidden" id="departement" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value=""/>';
objet("cellule_ville_bien").innerHTML = '<input type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" id="ville" value="" />';
objet("cellule_CP_bien").innerHTML = '<input type="text" id="code_postal" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
}
function setPaysVendeur(value)
{
if(value=='France')
{
montre_block("text_departement_vendeur");
xajax_setDepartement('cellule_departement_vendeur','departement','cellule_ville_vendeur','ville','cellule_CP_vendeur','code_postal');
xajax_setVille('','cellule_ville_vendeur','ville','cellule_CP_vendeur','code_postal');
xajax_setCP('','cellule_CP_vendeur','code_postal');
}
else
{
cache("text_departement_vendeur");
objet("cellule_departement_vendeur").innerHTML = '<input id="departement" type="hidden" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="0" />';
objet("cellule_ville_vendeur").innerHTML = '<input id="ville" type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
objet("cellule_CP_vendeur").innerHTML = '<input type="text" id="code_postal" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
}
function setPaysModification(value,id_dept,id_ville,id_cp)
{
if(value=='France')
{
montre_block("dept");
if( $('dept_deuxpoints') ) {montre_block("dept_deuxpoints");}
montre_block("cellule_departement");
xajax_setDepartement('cellule_departement','departement','cellule_ville','ville','cellule_cp','codepostal',id_dept,id_ville,id_cp);
xajax_setVille('','cellule_ville','ville','cellule_cp','codepostal',id_ville,id_cp);
xajax_setCP('','cellule_cp','codepostal',id_cp);
}
else
{
cache("dept");
if( $('dept_deuxpoints') ) {cache("dept_deuxpoints");}
cache("cellule_departement");
if( $('form_edit_annonce') ) {
objet("cellule_departement").innerHTML = '<input id="departement" type="hidden" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_'+id_dept+'" value="" />';
}
else {
objet("cellule_departement").innerHTML = '<input id="departement" type="text" name="ContentObjectAttribute_ezstring_data_text_'+id_dept+'" value="" />';
}
objet("cellule_ville").innerHTML = '<input id="ville" type="text" name="ContentObjectAttribute_ezstring_data_text_'+id_ville+'" value="" />';
objet("cellule_cp").innerHTML = '<input id="codepostal" type="text" name="ContentObjectAttribute_ezstring_data_text_'+id_cp+'" value="" />';
}
}
function popup_to_main_window(href) {
window.opener.location.href = href;
window.close();
}
function open_popup_700x400(url,resizable) {
var resize='no';
var win;
if (resizable) resize = 'yes';
win = window.open(url,"popup","width=700,height=400,resizable="+resize);
win.focus();
return;
}
function open_popup_500x350(url,resizable) {
var resize='no';
var win;
if (resizable) resize = 'yes';
win = window.open(url,"popup","width=500,height=350,resizable="+resize);
win.focus();
return;
}
function checkAllWithNatureCategory( nature_category )
{
jQuery('input.checkall_' + nature_category).attr('checked', jQuery('#checkallstate_' + nature_category).attr('checked'));
}
function cache(nom) {
$(nom).style.display = 'none';
}
function montre_block(nom) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(nom).style.display = 'block';
}
else {
if (document.layers) { // Netscape 4
document.layers[nom].display = 'block';
}
else { // IE 4
document.all[nom].style.display = 'block';
}
}
}
function montre_line(nom) {
$(nom).style.display = 'inline';
}
function changer_fond(nom,nom_class) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(nom).className = nom_class;
}
else {
if (document.layers) { // Netscape 4
document.layers[nom].className = nom_class;
}
else { // IE 4
document.all[nom].className = nom_class;
}
}
}
function objet(nom) {
var obj;
if (document.getElementById) { // DOM3 = IE5, NS6
obj = document.getElementById(nom);
}
else {
if (document.layers) { // Netscape 4
obj = document.layers[nom];
}
else { // IE 4
obj = document.all[nom];
}
}
return obj;
}
function survol_onglet(nom,position) {
var obj = objet(nom)
if(position=='on') {
if(obj.src.indexOf("_on")<0) {
obj.src = obj.src.replace(".jpg","_on.jpg");
}
}
else {
if(obj.src.indexOf("_on")>-1) {
obj.src = obj.src.replace("_on.jpg",".jpg");
}
}
}
function change_search_action(form,value){
form.action = value;
}
function validate_field(form,field){
if(field.value==''){
alert('Veuillez saisir une chaine de recherche');
return false;
}
else{
form.submit();
}
}
function change_onglet(onglet) {
if (onglet==3) {
cache('onglet1');
cache('onglet2');
montre_block('onglet3');
montre_line('onglet1_off');
montre_line('onglet2_off');
montre_line('onglet3_on');
cache('onglet1_on');
cache('onglet2_on');
cache('onglet3_off');
changer_fond('recherche','fond_onglet3');
}
else if (onglet==2) {
cache('onglet1');
montre_block('onglet2');
cache('onglet3');
montre_line('onglet1_off');
montre_line('onglet2_on');
montre_line('onglet3_off');
cache('onglet1_on');
cache('onglet2_off');
cache('onglet3_on');
changer_fond('recherche','fond_onglet2');
}
else {
montre_block('onglet1');
cache('onglet2');
cache('onglet3');
montre_line('onglet1_on');
montre_line('onglet2_off');
montre_line('onglet3_off');
cache('onglet1_off');
cache('onglet2_on');
cache('onglet3_on');
changer_fond('recherche','fond_onglet1');
}
}
function liste_deroulante(nom,nbr) {
var v_type="";
for (i=1; i<=nbr; i++) {
var obj = objet(nom + "_" + i);
if(obj != null && obj.checked) {
var valeur = obj.title;
if(v_type=="") {v_type += valeur;}
else { v_type += ", " + valeur; }
}
}
objet(nom).value = v_type;
}
function desactivation( selection )
{
var selectedOption = jQuery( '#pays option:selected' );
var disable = selection != 'FRANCE' && selection != '#FRANCE' && !selectedOption.hasClass( 'isBeezbeez' ) && !selectedOption.hasClass( 'isMultiCriteriaSearchAvailable' );
for( var i = 1; i < objet( 'formulaire_recherche1' ).elements.length - 1; i++ )
{
objet( 'formulaire_recherche1' ).elements[i].disabled = disable;
}
}
function lien()
{
var selectedOption = jQuery( '#pays option:selected' ),
url = selectedOption.val(),
isBeezBeez = selectedOption.hasClass( 'isBeezbeez' ),
isSearchAvailable = selectedOption.hasClass( 'isMultiCriteriaSearchAvailable' );
desactivation( url );
if( !isBeezBeez && !isSearchAvailable )
{
parent.location.href = url;
}
}
function initialisation(tableau){
for (var i=0; i<tableau.length; i++) {
objet(tableau[i]).checked=1;
}
}
function cmdPrint()
{
window.print();
}
function chargementFormulaireAcheteur()
{
xajax_setDepartement('cellule_departement','departement','cellule_ville','ville','cellule_cp','code_postal');
xajax_setCP('','cellule_cp','code_postal');
}
function chargementFormulaireBien(value)
{
if (value!='FR')
{
cache("text_departement_bien");
objet("cellule_departement_bien").innerHTML = '<input id="departement" type="hidden" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="0" />';
objet("cellule_ville_bien").innerHTML = '<input id="ville" type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
objet("cellule_CP_bien").innerHTML = '<input type="text" id="code_postal" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
else
{
xajax_setDepartement('cellule_departement_bien','departement','cellule_ville_bien','ville','cellule_CP_bien','code_postal');
}
}
function chargementFormulaireVendeur(value1, value2)
{
if(value1!='France')
{
cache("text_departement_bien");
objet("cellule_departement_bien").innerHTML = '';
objet("cellule_ville_bien").innerHTML = '<input type="text" id="AnnonceVille" name="AnnonceVille" value="" />';
objet("cellule_CP_bien").innerHTML = '<input type="text" id="AnnonceCodePostal" name="AnnonceCodePostal" value="" />';
}
else
{
xajax_setDepartement('cellule_departement_bien','AnnonceDepartement','cellule_ville_bien','AnnonceVille','cellule_CP_bien','AnnonceCodePostal');
}
if(value2!='France')
{
cache("text_departement_vendeur");
objet("cellule_departement_vendeur").innerHTML = '<input id="departement" type="hidden" name="powercontent_departement_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="0" />';
objet("cellule_ville_vendeur").innerHTML = '<input id="ville" type="text" name="powercontent_ville_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
objet("cellule_CP_vendeur").innerHTML = '<input type="text" id="code_postal" name="powercontent_code_postal_ContentObjectAttribute_ezstring_data_text_pcattributeid" value="" />';
}
else
{
xajax_setDepartement('cellule_departement_vendeur','departement','cellule_ville_vendeur','ville','cellule_CP_vendeur','code_postal');
}
}
function chargementFormulaireModifierCompte(pays, departement, ville, cp, id_pays, id_departement, id_ville, id_cp)
{
if(pays=='France')
{
montre_block("dept");
if( $('dept_deuxpoints') ) {montre_block("dept_deuxpoints");}
xajax_setDepartement('cellule_departement','departement','cellule_ville','ville','cellule_cp','codepostal',id_departement,id_ville,id_cp,departement);
xajax_setVille(departement,'cellule_ville','ville','cellule_cp','codepostal',id_ville,id_cp,ville);
xajax_setCP(ville,'cellule_cp','codepostal',id_cp, departement);
}
else
{
cache("dept");
if( $('dept_deuxpoints') ) {cache("dept_deuxpoints");}
if( $('form_edit_annonce') ) {
objet("cellule_departement").innerHTML = '';
}
else {
objet("cellule_departement").innerHTML = '<input id="departement" type="hidden" name="ContentObjectAttribute_ezstring_data_text_'+id_departement+'" value="" />';
}
objet("cellule_ville").innerHTML = '<input id="ville" type="text" name="ContentObjectAttribute_ezstring_data_text_'+id_ville+'" value="'+ville+'" />';
objet("cellule_cp").innerHTML = '<input id="codepostal" type="text" name="ContentObjectAttribute_ezstring_data_text_'+id_cp+'" value="'+cp+'" />';
}
}
function chargementPub( pubArray ) {
var idx 				= 0;
var ponderationArray 	= [];
var ponderation			= 0;
var imgPub				= new Array();
for( var i=0; i<pubArray.length; i++ ) {
ponderation = pubArray[i][2]*10;
for( var j=0; j<ponderation; j++ ) {
ponderationArray[idx] = Array( pubArray[i][0], pubArray[i][1] );
idx++;
}
}
randIdx = Math.round(Math.random() * ponderationArray.length);
imgPub = ponderationArray[randIdx];
target = '_self';
if (imgPub[0].contains('http://')) target = '_blank';
document.write('<a href="' + imgPub[0] + '" target="' + target +'"><img src="' + imgPub[1] + '" alt="" /></a>');
}
jQuery( document ).ready( function( )
{
var valid = false;
if( jQuery(".hiddenLinkColorbox").length )
{
jQuery(".hiddenLinkColorbox").colorbox({width:"50%", inline:true, href:"#popupConfirmation"});
}
if( jQuery(".hiddenLinkColorboxLenghtNum").length )
{
jQuery(".hiddenLinkColorboxLenghtNum").colorbox({width:"50%", inline:true, href:"#popupConfirmationLenghtNum"});
}
if( jQuery(".hiddenLinkColorbox").length && jQuery(".hiddenLinkColorboxLenghtNum").length){
if( jQuery('#PublishButtonPopup').length ){
jQuery( '#PublishButtonPopup' ).click(function (){
if( valid )
{
return true;
}
if( jQuery('.ezcca-utilisateur_telephone').val() == lastNumTel ){
return true;
}
if(jQuery('.pays').val() == 'France' && jQuery('.ezcca-utilisateur_telephone').val().length > parseInt(lengthNum))
{
jQuery('.hiddenLinkColorboxLenghtNum').click();
return valid;
}
jQuery('.newNumPopup').html(jQuery('.ezcca-utilisateur_telephone').val());
jQuery('.hiddenLinkColorbox').click();
return valid;
});
}
if(jQuery('#validPopupAction').length){
jQuery( '#validPopupAction' ).click(function (){
valid = true;
jQuery( '#PublishButtonPopup' ).click();
});
}
if(jQuery('#cancelPopupAction').length){
jQuery( '#cancelPopupAction' ).click(function (){
jQuery.colorbox.close()
});
}
if(jQuery('#cancelPopupAction2').length){
jQuery( '#cancelPopupAction2' ).click(function (){
jQuery.colorbox.close()
});
}
}
if( jQuery('#CreateButton').length ){
jQuery('#CreateButton').click(function(){
if(jQuery('#CG').attr('checked')){
ancienPrix = parseFloat(lastPrix);
nouveauPrix = parseFloat(jQuery('.ezcca-annonce_bien_prix').val());
delta = Math.abs(ancienPrix - nouveauPrix);
variationAuth =  ancienPrix * pourcentageAugm / 100;
if( delta > variationAuth )
{
if( valid )
{
return true;
}
else
{
jQuery('.hiddenLinkColorbox').click();
jQuery('.newPrixPopup').html(jQuery('.ezcca-annonce_bien_prix').val());
return valid;
}
}
return true;
}
});
if(jQuery('#validPopupAction').length){
jQuery( '#validPopupAction' ).click(function (){
valid = true;
jQuery( '#CreateButton' ).click();
});
}
if(jQuery('#cancelPopupAction').length){
jQuery( '#cancelPopupAction' ).click(function (){
jQuery.colorbox.close()
});
}
}
if( jQuery('#recherche').length )
{
jQuery('.recherche_bas > input').click(function(){
if( jQuery("#pays").val() != "#FRANCE" && jQuery("#pays option:selected").attr('class') == "" ){
location.href = jQuery("#pays").val();
return false;
}
});
}
});
function timeRemaining(depart,temp,coeff,year,month,day)
{
var now = new Date();
var newyears = new Date(year,month-1,day);
secsSince = Math.round(now.getTime() - newyears.getTime())/1000;
nb_visites = string((secsSince) * temp + depart);
document.compteur.elements["nb_visites"].value = nb_visites;
delai = 1000 * Math.random() * coeff;
timerID = setTimeout("timeRemaining(" + depart + "," + temp + "," + coeff + "," + year + "," + month + "," + day +")", delai);
timerRunning = true;
}
function string(number)
{
var tempnum;
tempnum= Math.round(number)+" ";
tempnum= tempnum.substring(0,tempnum.length-1);
if (tempnum.length >3)
{
tempnum = tempnum.substring(0,tempnum.length-3) + " " + tempnum.substring(tempnum.length-3, 99);
}
if (tempnum.length >7)
{
tempnum = tempnum.substring(0,tempnum.length-7) + " " + tempnum.substring(tempnum.length-7, 99);
}
if (tempnum.length >11)
{
tempnum = tempnum.substring(0,tempnum.length-11) + " " + tempnum.substring(tempnum.length-11, 99);
}
if (tempnum.length == 11)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 10)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 9)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 7)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 6)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 5)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 3)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 2)
{
tempnum = " " + tempnum;
}
if (tempnum.length == 1)
{
tempnum = " " + tempnum;
}
return tempnum;
}
var MooTools={version:"1.11"};function $defined(A){return(A!=undefined);}function $type(B){if(!$defined(B)){return false;}if(B.htmlElement){return"element";
}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace";}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";
case RegExp:return"regexp";case Class:return"class";}if(typeof B.length=="number"){if(B.item){return"collection";}if(B.callee){return"arguments";}}}return A;
}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[B]){var A=arguments[B][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A);
}else{C[E]=A;}}}return C;}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]];}for(var B in A[1]){A[0][B]=A[1][B];}return A[0];};var $native=function(){for(var B=0,A=arguments.length;
B<A;B++){arguments[B].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D];}if(!this[D]){this[D]=$native.generic(D);}}};}};
$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1));};};$native(Function,Array,String,Number);
function $chk(A){return !!(A||A===0);}function $pick(B,A){return $defined(B)?B:A;}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B);}function $time(){return new Date().getTime();
}function $clear(A){clearTimeout(A);clearInterval(A);return null;}var Abstract=function(A){A=A||{};A.extend=$extend;return A;};var Window=new Abstract(window);
var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true;
}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true;}else{if(document.getBoxObjectFor!=null){window.gecko=true;
}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe");
}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true);
}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this;
};$extend(A,this);A.prototype=B;A.constructor=Class;return A;};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];
C[D]=Class.Merge(A,B[D]);}return new Class(C);},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[B]);}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);
if(B!=$type(C)){return D;}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments);};A.parent=C;return A;
case"object":return $merge(C,D);}}return D;};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this;},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this);
}},clearChain:function(){this.chains=[];}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[B]=this.$events[B]||[];
this.$events[B].include(A);}return this;},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})();
},this);}return this;},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A);}return this;}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));
if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A]);}}}return this;
}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this);}},filter:function(D,E){var C=[];for(var B=0,A=this.length;
B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B]);}}return C;},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this);
}return C;},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false;}}return true;},some:function(C,D){for(var B=0,A=this.length;
B<A;B++){if(C.call(D,this[B],B,this)){return true;}}return false;},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B;
}}return -1;},copy:function(D,C){D=D||0;if(D<0){D=this.length+D;}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[B]=this[D++];}return A;},remove:function(C){var B=0;
var A=this.length;while(B<A){if(this[B]===C){this.splice(B,1);A--;}else{B++;}}return this;},contains:function(A,B){return this.indexOf(A,B)!=-1;},associate:function(C){var D={},B=Math.min(this.length,C.length);
for(var A=0;A<B;A++){D[C[A]]=this[A];}return D;},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B]);}return this;},merge:function(C){for(var B=0,A=C.length;
B<A;B++){this.include(C[B]);}return this;},include:function(A){if(!this.contains(A)){this.push(A);}return this;},getRandom:function(){return this[$random(0,this.length-1)]||null;
},getLast:function(){return this[this.length-1]||null;}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A);
}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D);}else{for(var A in C){B.call(D||C,C[A],A);}}}Array.prototype.test=Array.prototype.contains;
String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this);},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);
},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase());
});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},trim:function(){return this.replace(/^\s+|\s+$/g,"");
},clean:function(){return this.replace(/\s{2,}/g," ").trim();},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false;},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return(A)?A.slice(1).hexToRgb(B):false;},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1");
}});Array.extend({rgbToHex:function(D){if(this.length<3){return false;}if(this.length==4&&this[3]==0&&!D){return"transparent";}var B=[];for(var A=0;A<3;
A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C);}return D?B:"#"+B.join("");},hexToRgb:function(C){if(this.length!=3){return false;}var A=[];
for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16));}return C?A:"rgb("+A.join(",")+")";}});Function.extend({create:function(A){var B=this;
A=$merge({bind:B,event:false,"arguments":null,delay:false,periodical:false,attempt:false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments];
}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments);}}else{C=A.arguments||arguments;
}var F=function(){return B.apply($pick(A.bind,B),C);};if(A.delay){return setTimeout(F,A.delay);}if(A.periodical){return setInterval(F,A.periodical);}if(A.attempt){try{return F();
}catch(D){return false;}}return F();};},pass:function(A,B){return this.create({"arguments":A,bind:B});},attempt:function(A,B){return this.create({"arguments":A,bind:B,attempt:true})();
},bind:function(B,A){return this.create({bind:B,"arguments":A});},bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A});
},delay:function(B,C,A){return this.create({delay:B,bind:C,"arguments":A})();},periodical:function(A,C,B){return this.create({periodical:A,bind:C,"arguments":B})();
}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(B,A){return Math.min(A,Math.max(B,this));
},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A;},times:function(B){for(var A=0;A<this;A++){B(A);}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";
var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">";}D=document.createElement(D);}D=$(D);return(!C||!D)?D:D.set(C);}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this;
}});Elements.extend=function(A){for(var B in A){this.prototype[B]=A[B];this[B]=$native.generic(B);}};function $(B){if(!B){return null;}if(B.htmlElement){return Garbage.collect(B);
}if([window,document].contains(B)){return B;}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false;}if(A!="element"){return null;
}if(B.htmlElement){return Garbage.collect(B);}if(["object","embed"].contains(B.tagName.toLowerCase())){return B;}$extend(B,Element.prototype);B.htmlElement=function(){};
return Garbage.collect(B);}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];
switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A);
}}return $$.unique(D);}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue;}var B=$(G[C]);if(B&&!B.$included){B.$included=true;
D.push(B);}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null;}return new Elements(D);};Elements.Multi=function(A){return function(){var D=arguments;
var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false;}B.push(F);}return(G)?$$.unique(B):B;
};};Element.extend=function(A){for(var B in A){HTMLElement.prototype[B]=A[B];Element.prototype[B]=A[B];Element[B]=$native.generic(B);var C=(Array.prototype[B])?B+"Elements":B;
Elements.prototype[C]=Elements.Multi(B);}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B);
}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B);}}return this;},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);
break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this);}else{C.parentNode.insertBefore(this,B);}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);
break;}default:C.appendChild(this);}return this;},injectBefore:function(A){return this.inject(A,"before");},injectAfter:function(A){return this.inject(A,"after");
},injectInside:function(A){return this.inject(A,"bottom");},injectTop:function(A){return this.inject(A,"top");},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B);
});$$(A).inject(this);return this;},remove:function(){return this.parentNode.removeChild(this);},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B;
}B.$events={};for(var A in this.$events){B.$events[A]={keys:$A(this.$events[A].keys),values:$A(this.$events[A].values)};}return B.removeEvents();},replaceWith:function(A){A=$(A);
this.parentNode.replaceChild(A,this);return A;},appendText:function(A){this.appendChild(document.createTextNode(A));return this;},hasClass:function(A){return this.className.contains(A," ");
},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean();}return this;},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();
return this;},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A);},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));
case"float":B=(window.ie)?"styleFloat":"cssFloat";}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px";}break;case"array":A="rgb("+A.join(",")+")";
}this.style[B]=A;return this;},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A;
}return this;},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";
}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")";}this.style.opacity=this.$tmp.opacity=A;
return this;},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity;}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[B].each(function(F){var E=this.getStyle(F);
A.push(parseInt(E)?E:"0px");},this);if(C=="border"){var D=A.every(function(E){return(E==A[0]);});return(D)?A[0]:false;}return A.join(" ");}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E);
},this).join(" ");}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""));
},this).join(" ");}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate());}else{if(this.currentStyle){A=this.currentStyle[C];
}}}if(window.ie){A=Element.fixStyle(C,A,this);}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex();
}).join(" ");}return A;},getStyles:function(){return Element.getMany(this,"getStyle",arguments);},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];
while(B&&$type(B)!="element"){B=B[A];}return $(B);},getPrevious:function(){return this.walk("previous");},getNext:function(){return this.walk("next");},getFirst:function(){return this.walk("next","firstChild");
},getLast:function(){return this.walk("previous","lastChild");},getParent:function(){return $(this.parentNode);},getChildren:function(){return $$(this.childNodes);
},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A);},getProperty:function(D){var B=Element.Properties[D];if(B){return this[B];
}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A);}var C=this.attributes[D];return(C)?C.nodeValue:null;},removeProperty:function(B){var A=Element.Properties[B];
if(A){this[A]="";}else{this.removeAttribute(B);}return this;},getProperties:function(){return Element.getMany(this,"getProperty",arguments);},setProperty:function(C,B){var A=Element.Properties[C];
if(A){this[A]=B;}else{this.setAttribute(C,B);}return this;},setProperties:function(A){return Element.setMany(this,"setProperty",A);},setHTML:function(){this.innerHTML=$A(arguments).join("");
return this;},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B;}else{if(A=="script"){this.setProperty("text",B);
}}return this;}else{this.removeChild(this.firstChild);return this.appendText(B);}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this;
},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText;}else{if(A=="script"){return this.getProperty("text");
}}}else{return this.innerHTML;}}return($pick(this.innerText,this.textContent));},getTag:function(){return this.tagName.toLowerCase();},empty:function(){Garbage.trash(this.getElementsByTagName("*"));
return this.setHTML("");}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A;}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];
var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt();});return D["offset"+E.capitalize()]-C+"px";}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px";
}}return A;};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B);
}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E);});return A;
};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A]);}return B;};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});
Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false);
}else{this.attachEvent("on"+B,A);}return this;},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false);}else{this.detachEvent("on"+B,A);
}return this;}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);
A.$tmp={opacity:1};}return A;},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[B])||!C.$tmp){continue;}if(C.$events){C.fireEvent("trash").removeEvents();
}for(var E in C.$tmp){C.$tmp[E]=null;}for(var F in Element.prototype){C[F]=null;}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null;
}Garbage.elements.remove(null);},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements);}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);
if(window.ie){window.addListener("unload",CollectGarbage);}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C;}this.$extended=true;
C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode;}this.shift=C.shiftKey;
this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3;
}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[B]==this.code){this.key=B;break;}}if(this.type=="keydown"){var A=this.code-111;
if(A>0&&A<13){this.key="f"+A;}}this.key=this.key||String.fromCharCode(this.code).toLowerCase();}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:C.pageX||C.clientX+document.documentElement.scrollLeft,y:C.pageY||C.clientY+document.documentElement.scrollTop};
this.client={x:C.pageX?C.pageX-window.pageXOffset:C.clientX,y:C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);
switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement;
}this.fixRelatedTarget();}}}return this;},stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();
}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;
}return this;}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode;
}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this);}catch(A){this.relatedTarget=this.target;}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;
Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};
this.$events[C]=this.$events[C]||{keys:[],values:[]};if(this.$events[C].keys.contains(B)){return this;}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];
if(D){if(D.add){D.add.call(this,B);}if(D.map){B=D.map;}if(D.type){A=D.type;}}if(!this.addEventListener){B=B.create({bind:this,event:true});}this.$events[C].values.push(B);
return(Element.NativeEvents.contains(A))?this.addListener(A,B):this;},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this;}var F=this.$events[C].keys.indexOf(B);
if(F==-1){return this;}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B);
}if(D.type){C=D.type;}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this;},addEvents:function(A){return Element.setMany(this,"addEvent",A);
},removeEvents:function(A){if(!this.$events){return this;}if(!A){for(var B in this.$events){this.removeEvents(B);}this.$events=null;}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C);
},this);this.$events[A]=null;}}return this;},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({bind:this,delay:A,"arguments":B})();
},this);}return this;},cloneEvents:function(C,A){if(!C.$events){return this;}if(!A){for(var B in C.$events){this.cloneEvents(C,B);}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D);
},this);}}return this;}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(A){A=new Event(A);
if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A);}}},mouseleave:{type:"mouseout",map:function(A){A=new Event(A);
if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A);}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});
Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];
Function.extend({bindWithEvent:function(B,A){return this.create({bind:B,"arguments":A,event:Event});}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A);
}));},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "));});return(C)?B:new Elements(B);},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C);
});return(B)?A:new Elements(A);},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false;}if(!A){return true;
}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);
case"!=":return(G!=D);case"~=":return G.contains(D," ");}return false;});return(E)?C:new Elements(C);}});function $E(A,B){return($(B)||document).getElement(A);
}function $ES(A,B){return($(B)||document).getElementsBySelector(A);}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];
if(E[2]){A.push('[@id="',E[2],'"]');}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]');}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');
break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');
break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]');}}else{A.push("[@",E[4],"]");}}B.push(A.join(""));return B;
},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;
D<C;D++){F.push(A.snapshotItem(D));}return(G)?F:new Elements(F.map($));}},normal:{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);
if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false;}A=[D];}else{A=$A(C.getElementsByTagName(E[1]));}}else{A=$$.shared.getElementsByTagName(A,E[1]);
if(E[2]){A=Elements.filterById(A,E[2],true);}}if(E[3]){A=Elements.filterByClass(A,E[3],true);}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true);
}return A;},getItems:function(A,B,C){return(C)?A:$$.unique(A);}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false;},getElementsByTagName:function(D,C){var E=[];
for(var B=0,A=D.length;B<A;B++){E.extend(D[B].getElementsByTagName(C));}return E;}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];
A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break;}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);
if(!B){break;}C=B;}return $$.shared[$$.shared.method].getItems(C,this,H);},getElement:function(A){return $(this.getElements(A,true)[0]||false);},getElementsBySelector:function(A,E){var D=[];
A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true));}return(E)?D:$$.unique(D);}};Element.extend({getElementById:function(C){var B=document.getElementById(C);
if(!B){return false;}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false;}}return B;},getElementsByClassName:function(A){return this.getElements("."+A);
}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];
$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text));}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break;
}case"textarea":return this.value;}return false;},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"));
},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return ;}var B=function(F){A.push(C+"="+encodeURIComponent(F));
};if($type(E)=="array"){E.each(B);}else{B(E);}});return A.join("&");}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B;},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}};
},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent;}while(B);A.each(function(E){D-=E.scrollLeft||0;
C-=E.scrollTop||0;});return{x:D,y:C};},getTop:function(A){return this.getPosition(A).y;},getLeft:function(A){return this.getPosition(A).x;},getCoordinates:function(B){var A=this.getPosition(B);
var C={width:this.offsetWidth,height:this.offsetHeight,left:A.x,top:A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C;}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);
return ;}var A=function(){if(window.loaded){return ;}window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready");}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A();
}}.periodical(50);}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var C=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+C+'"><\/script>');
$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A();}};}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A);
}}}};window.onDomReady=function(A){return this.addEvent("domready",A);};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth;}if(this.opera){return document.body.clientWidth;
}return document.documentElement.clientWidth;},getHeight:function(){if(this.webkit419){return this.innerHeight;}if(this.opera){return document.body.clientHeight;
}return document.documentElement.clientHeight;},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);
}if(this.webkit){return document.body.scrollWidth;}return document.documentElement.scrollWidth;},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);
}if(this.webkit){return document.body.scrollHeight;}return document.documentElement.scrollHeight;},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft;
},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop;},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}};
},getPosition:function(){return{x:0,y:0};}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2;
},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this);
}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();
this.increase();}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain();}},set:function(A){this.now=A;this.increase();
return this;},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(B,A){return(A-B)*this.delta+B;},start:function(B,A){if(!this.options.wait){this.stop();
}else{if(this.timer){return this;}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);
this.fireEvent("onStart",this.element);return this;},stop:function(A){if(!this.timer){return this;}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element);
}return this;},custom:function(B,A){return this.start(B,A);},clearTimer:function(A){return this.stop(A);}});Fx.Base.implement(new Chain,new Events,new Options);
Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color;}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi;
}return this.Single;},parse:function(C,D,A){if(!A.push){A=[A];}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D);}var B=this.select(D,E);return{from:B.parse(F),to:B.parse(E),css:B};
}};Fx.CSS.Single={parse:function(A){return parseFloat(A);},getNow:function(C,B,A){return A.compute(C,B);},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C);
}return C+A;}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B);});},getNow:function(E,D,C){var A=[];for(var B=0;
B<E.length;B++){A[B]=C.compute(E[B],D[B]);}return A;},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round);}return C.join(A+" ")+A;}};
Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true);},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=Math.round(C.compute(E[B],D[B]));
}return A;},getValue:function(A){return"rgb("+A.join(",")+")";}};Fx.Style=Fx.Base.extend({initialize:function(B,C,A){this.element=$(B);this.property=C;
this.parent(A);},hide:function(){return this.set(0);},setNow:function(){this.now=this.css.getNow(this.from,this.to,this);},set:function(A){this.css=Fx.CSS.select(this.property,A);
return this.parent(this.css.parse(A));},start:function(C,B){if(this.timer&&this.options.wait){return this;}var A=Fx.CSS.parse(this.element,this.property,[C,B]);
this.css=A.css;return this.parent(A.from,A.to);},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property));
}});Element.extend({effect:function(B,A){return new Fx.Style(this,B,A);}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);this.parent(A);
},setNow:function(){for(var A in this.from){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this);}},set:function(C){var A={};this.css={};for(var B in C){this.css[B]=Fx.CSS.select(B,C[B]);
A[B]=this.css[B].parse(C[B]);}return this.parent(A);},start:function(C){if(this.timer&&this.options.wait){return this;}this.now={};this.css={};var E={},D={};
for(var B in C){var A=Fx.CSS.parse(this.element,B,C[B]);E[B]=A.from;D[B]=A.to;this.css[B]=A.css;}return this.parent(E,D);},increase:function(){for(var A in this.now){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A));
}}});Element.extend({effects:function(A){return new Fx.Styles(this,A);}});Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A);
},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this);
}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E]);
}}return this.parent(B);},start:function(D){if(this.timer&&this.options.wait){return this;}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};
for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[B]);A[B]=F.from;H[B]=F.to;C[B]=F.css;}}return this.parent(I,J);},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];
for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D));}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.now=[];
this.element=$(B);this.bound={stop:this.stop.bind(this,false)};this.parent(A);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop);
}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop);}.bind(this));}},setNow:function(){for(var A=0;A<2;
A++){this.now[A]=this.compute(this.from[A],this.to[A]);}},scrollTo:function(B,F){if(this.timer&&this.options.wait){return this;}var D=this.element.getSize();
var C={x:B,y:F};for(var E in D.size){var A=D.scrollSize[E]-D.size[E];if($chk(C[E])){C[E]=($type(C[E])=="number")?C[E].limit(0,A):A;}else{C[E]=D.scroll[E];
}C[E]+=this.options.offset[E];}return this.start([D.scroll.x,D.scroll.y],[C.x,C.y]);},toTop:function(){return this.scrollTo(false,0);},toBottom:function(){return this.scrollTo(false,"full");
},toLeft:function(){return this.scrollTo(0,false);},toRight:function(){return this.scrollTo("full",false);},toElement:function(B){var A=this.element.getPosition(this.options.overflown);
var C=$(B).getPosition(this.options.overflown);return this.scrollTo(C.x-A.x,C.y-A.y);},increase:function(){this.element.scrollTo(this.now[0],this.now[1]);
}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);
this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0);
});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper);}});}},setNow:function(){for(var A=0;
A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A]);}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;
},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},slideIn:function(A){this[A||this.options.mode]();
return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset]);},slideOut:function(A){this[A||this.options.mode]();
return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0]);},hide:function(A){this[A||this.options.mode]();
this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A);
}return this.slideOut(A);},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit);
}});Fx.Transition=function(B,A){A=A||[];if($type(A)!="array"){A=[A];}return $extend(B,{easeIn:function(C){return B(C,A);},easeOut:function(C){return 1-B(1-C,A);
},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2;}});};Fx.Transitions=new Abstract({linear:function(A){return A;}});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);
Fx.Transitions.compat(B);}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B];
});};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6);},Expo:function(A){return Math.pow(2,8*(A-1));},Circ:function(A){return 1-Math.sin(Math.acos(A));
},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2);},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A);},Bounce:function(D){var C;for(var B=0,A=1;
1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3);
}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);});Fx.Transitions.compat(B);
});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);
return this;},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";
this.setHeader("Content-type","application/x-www-form-urlencoded"+B);}if(this.options.initialize){this.options.initialize.call(this);}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return ;
}this.running=false;var A=0;try{A=this.transport.status;}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess();}else{this.onFailure();}this.transport.onreadystatechange=Class.empty;
},isSuccess:function(A){return((A>=200)&&(A<300));},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};
this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain();},onFailure:function(){this.fireEvent("onFailure",this.transport);},setHeader:function(A,B){this.headers[A]=B;
return this;},send:function(A,C){if(this.options.autoCancel){this.cancel();}else{if(this.running){return this;}}this.running=true;if(C&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+C;
C=null;}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close");
}$extend(this.headers,this.options.headers);for(var B in this.headers){try{this.transport.setRequestHeader(B,this.headers[B]);}catch(D){}}this.fireEvent("onRequest");
this.transport.send($pick(C,null));return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;
this.setTransport();this.fireEvent("onCancel");return this;}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(B,A){this.addEvent("onSuccess",this.onComplete);
this.setOptions(A);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;
this.options.method="post";}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");
this.url=B;},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text);}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts();
}this.fireEvent("onComplete",[this.response.text,this.response.xml],20);},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();
break;case"object":A=Object.toQueryString(A);}if(this._method){A=(A)?[this._method,A].join("&"):this._method;}return this.send(this.url,A);},evalScripts:function(){var B,A;
if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){A=this.response.text;}else{A=[];var C=/<script[^>]*>([\s\S]*?)<\/script>/gi;
while((B=C.exec(this.response.text))){A.push(B[1]);}A=A.join("\n");}if(A){(window.execScript)?window.execScript(A):window.setTimeout(A,0);}},getHeader:function(A){try{return this.transport.getResponseHeader(A);
}catch(B){}return null;}});Object.toQueryString=function(B){var C=[];for(var A in B){C.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]));}return C.join("&");
};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request();}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(C,D,B){B=$merge(this.options,B);
D=encodeURIComponent(D);if(B.domain){D+="; domain="+B.domain;}if(B.path){D+="; path="+B.path;}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);
D+="; expires="+A.toGMTString();}if(B.secure){D+="; secure";}document.cookie=C+"="+D;return $extend(B,{key:C,value:D});},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");
return B?decodeURIComponent(B[1]):false;},remove:function(B,A){if($type(B)=="object"){this.set(B.key,"",$merge(B,{duration:-1}));}else{this.set(B,"",$merge(A,{duration:-1}));
}}});var Json={toString:function(C){switch($type(C)){case"string":return'"'+C.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+C.map(Json.toString).join(",")+"]";
case"object":var A=[];for(var B in C){A.push(Json.toString(B)+":"+Json.toString(C[B]));}return"{"+A.join(",")+"}";case"number":if(isFinite(C)){break;}case false:return"null";
}return String(C);},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")");
}};Json.Remote=XHR.extend({initialize:function(B,A){this.url=B;this.addEvent("onSuccess",this.onComplete);this.parent(A);this.setHeader("X-Request","JSON");
},send:function(A){return this.parent(this.url,"json="+Json.toString(A));},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)]);
}});var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};this.setLength();},get:function(A){return(this.hasKey(A))?this.obj[A]:null;},hasKey:function(A){return(A in this.obj);
},set:function(A,B){if(!this.hasKey(A)){this.length++;}this.obj[A]=B;return this;},setLength:function(){this.length=0;for(var A in this.obj){this.length++;
}return this;},remove:function(A){if(this.hasKey(A)){delete this.obj[A];this.length--;}return this;},each:function(A,B){$each(this.obj,A,B);},extend:function(A){$extend(this.obj,A);
return this.setLength();},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength();},empty:function(){this.obj={};
this.length=0;return this;},keys:function(){var A=[];for(var B in this.obj){A.push(B);}return A;},values:function(){var A=[];for(var B in this.obj){A.push(this.obj[B]);
}return A;}});function $H(A){return new Hash(A);}Hash.Cookie=Hash.extend({initialize:function(B,A){this.name=B;this.options=$extend({autoSave:true},A||{});
this.load();},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true;}var A=Json.toString(this.obj);if(A.length>4096){return false;
}Cookie.set(this.name,A,this.options);return true;},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength();}});Hash.Cookie.Methods={};
["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);if(this.options.autoSave){this.save();
}return this;};});Hash.Cookie.implement(Hash.Cookie.Methods);
var Asset = new Abstract({
javascript: function(source, properties){
properties = $merge({
'onload': Class.empty
}, properties);
var script = new Element('script', {'src': source}).addEvents({
'load': properties.onload,
'readystatechange': function(){
if (this.readyState == 'complete') this.fireEvent('load');
}
});
delete properties.onload;
return script.setProperties(properties).inject(document.head);
},
css: function(source, properties){
return new Element('link', $merge({
'rel': 'stylesheet', 'media': 'screen', 'type': 'text/css', 'href': source
}, properties)).inject(document.head);
},
image: function(source, properties){
properties = $merge({
'onload': Class.empty,
'onabort': Class.empty,
'onerror': Class.empty
}, properties);
var image = new Image();
image.src = source;
var element = new Element('img', {'src': source});
['load', 'abort', 'error'].each(function(type){
var event = properties['on' + type];
delete properties['on' + type];
element.addEvent(type, function(){
this.removeEvent(type, arguments.callee);
event.call(this);
});
});
if (image.width && image.height) element.fireEvent('load', element, 1);
return element.setProperties(properties);
},
images: function(sources, options){
options = $merge({
onComplete: Class.empty,
onProgress: Class.empty
}, options);
if (!sources.push) sources = [sources];
var images = [];
var counter = 0;
sources.each(function(source){
var img = new Asset.image(source, {
'onload': function(){
options.onProgress.call(this, counter);
counter++;
if (counter == sources.length) options.onComplete();
}
});
images.push(img);
});
return new Elements(images);
}
});
FontManager = new Class ({
Implements: [Options],
options: {},
initialize: function( params ){
},
changeFontSize: function() {
var ajustFontSize = function( param ) {
newSize = this.fontSize + param.toFloat();
this.fontSize = newSize.round(1).limit(0.5, 2);
setFontSize(this.fontSize);
}.bind(this);
var setFontSize = function( param ) {
document.getElement('body').setStyle('font-size', param + fontUnit);
}.bind(this);
var initFontSize = function( param ) {
this.fontSize = this.fontSizeDefault = 1;
}.bind(this);
fontUnit = 'em';
initFontSize();
$$('.sizeMore').each( function( btn ){
btn.addEvent('click', function(e){
ajustFontSize(+0.1);
});
});
$$('.sizeLess').each( function( btn ){
btn.addEvent('click', function(e){
ajustFontSize(-0.1);
});
});
$$('.sizeRAZ').each( function( btn ){
btn.addEvent('click', function(e){
this.fontSize = this.fontSizeDefault;
setFontSize(this.fontSizeDefault);
}.bind(this));
}.bind(this));
}
});
function lpeGlobal () {
this.initBeezbeezAjax = function initBeezbeezAjax( ) {
if( $('lieu') )	{
var searchInput = $('lieu');
var completIfbeezbeez = function()
{
searchInput.removeEvents();
var country_id = $('pays').getValue(),
selected = $('pays').options[$('pays').selectedIndex],
isBeezBeez = $(selected).hasClass( 'isBeezbeez' ) ? 1 : 0,
isMultiCriteriaSearchAvailable = $(selected).hasClass( 'isMultiCriteriaSearchAvailable' ) ? 1 : 0;
var completer = new Autocompleter.Ajax.Json(searchInput, ezurl + '/ajax/search', {
'multiple': true,
'postVar': 'q',
'postData': {'country': country_id, 'isBeezBeez': isBeezBeez, 'isMultiCriteriaSearchAvailable': isMultiCriteriaSearchAvailable},
'onRequest': function(el) {
el.removeClass('bordure');
el.addClass('loading');
},
'onComplete': function(el) {
el.removeClass('loading');
el.addClass('bordure');
}
});
};
completIfbeezbeez();
$('pays').addEvent('change', function(e){
completIfbeezbeez();
});
}
},
this.initInput = function initInput( ) {
$ES('.clearOnFocus').each( function(elt) {
elt.addEvent('focus', function(e){
elt.value = '';
});
});
};
this.noPasteInput = function noPasteInput() {
$ES('.noPaste').each( function(elt) {
nbglobal = 0;
elt.addEvent('keypress', function(e){
if (elt.value != 'undefined' && elt.value != '') {
nbglobal = elt.value.length;
} else {
nbglobal = 0;
}
});
elt.addEvent('keyup', function(e){
if (elt.value != 'undefined' && elt.value != '') {
nbtest = elt.value.length;
} else {
nbtest = 0;
}
if ((nbtest-nbglobal) > 1) elt.value = '';
});
elt.addEvent('contextmenu', function(e){
e = new Event(e);
e.stop();
});
});
};
this.menuResolutionFix = function menuResolutionFix( level, minResolution ) {
if ( $(level) && screen.width < minResolution ) {
$ES( 'ul', level).each( function(ul) {
ul.addClass('left');
});
}
};
this.disabledMySelection = function disabledMySelection(){
$ES('form.btnSelection').each( function(el) {
var classes = el.getProperty("class").split(' ');
var nodeId = 0;
var typeSelection = 'button';
classes.each( function( classX ) {
if( classX.match(/^nodeId(\[.+\])$/)) {
nodeId = eval(classX.match(/^nodeId(\[.+\])$/)[1])[0];
}
if( classX.match(/^typeSelection(\[.+\])$/)) {
typeSelection = eval(classX.match(/^typeSelection(\[.+\])$/)[1])[0];
}
});
if ( mySelection.contains(nodeId) ) {
el.empty();
switch(typeSelection)
{
case 'button':
newElement = new Element('a', {
'id': 'nodeId[' + nodeId + ']',
'title' : alreadyInMySelection
});
newElement.adopt( new Element('img', {
'src': ezroot + '/extension/' + siteaccess + '/design/' + siteaccess + '/images/bouton_ajout_select.gif',
'alt' : alreadyInMySelection
}));
el.replaceWith( newElement );
break;
case 'button2':
newElement = new Element('a', {
'id': 'nodeId[' + nodeId + ']',
'title' : alreadyInMySelection
});
newElement.adopt( new Element('img', {
'src': ezroot + '/extension/' + siteaccess + '/design/' + siteaccess + '/images/bouton_ajout_select2.gif',
'alt' : alreadyInMySelection
}));
el.replaceWith( newElement );
break;
case 'link':
newElement = new Element('span', {
'id': 'nodeId[' + nodeId + ']',
'class': 'lien_bleu'
});
newElement.setText(shortAlreadyInMySelection);
el.replaceWith( newElement );
break;
case 'link_pi':
newElement = new Element('span', {
'id': 'nodeId[' + nodeId + ']',
'class': 'lien_bleu'
});
newElement.setText(shortAlreadyInMySelection);
el.replaceWith( newElement );
newElement.getParent().setStyle('background', 'url(' + ezroot + '/extension/' + siteaccess + '/design/' + siteaccess + '/images/bouton_ajout_select.gif) no-repeat 0 0' );
break;
}
}
});
}
}; // EOC
var lpe = new lpeGlobal();
function loadContent( url, id ) {
window.addEvent('domready', function(){
var XHRContent = new XHR( {
method: 'get',
onSuccess: function ( responseText ){
$(id).setHTML(responseText);
}
} );
XHRContent.send( url, null );
}); // EODR
};
String.extend({
addSlashes: function(){
return this.replace(/("|'|\\|\0)/g, '\\$1');
},
stripSlashes: function(){
return this.replace(/\\("|'|\\|\0)/g, '$1');
}
});
window.addEvent('domready', function(){
if($('contact')){
var mySlider = new Fx.Slide('corpForm', {duration: 500});
mySlider.slideOut();
testFormContact = false;
$('titre_formulaire_faq').addEvent('click', function(){
if(testFormContact){
mySlider.slideOut();
testFormContact = false;
scrollTo(0,0);
}
else{
$('corpForm').style.display = 'block';
mySlider.slideIn();
testFormContact = true;
setTimeout("scrollToTime(0,parseInt($('titre_formulaire_faq').getPosition()['y'])-20)",500);
}
});
tabSlider = [];
tabTest = [];
$('description_Bottom').style.display = 'none';
for (i=1; i<$('nbQuestion').value; i++) {
tabSlider[i] = new Fx.Slide('reponse'+i, {duration: 500});
tabSlider[i].slideOut();
tabTest[i] = false;
$('question'+i).addEvent('click', function(event){
var event = new Event(event);
if(event.target.id.indexOf("question") == '0'){
if(tabTest[event.target.getElement('input').value]){
tabSlider[event.target.getElement('input').value].slideOut();
tabTest[event.target.getElement('input').value] = false;
srcImage = $('image'+event.target.getElement('input').value).src;
newSrcImage = srcImage.substring(0, $('image'+event.target.getElement('input').value).src.lastIndexOf('/'))+"/book_open.png";
if(parseInt(event.target.getElement('input').value)+1 == parseInt( $('nbQuestion').value) ){
$('description_Bottom').style.display = 'none';
}
}
else{
tabSlider[event.target.getElement('input').value].slideIn();
tabTest[event.target.getElement('input').value] = true;
srcImage = $('image'+event.target.getElement('input').value).src;
newSrcImage = srcImage.substring(0, $('image'+event.target.getElement('input').value).src.lastIndexOf('/'))+"/book.png";
if(parseInt(event.target.getElement('input').value)+1 == parseInt( $('nbQuestion').value) ){
$('description_Bottom').style.display = 'block';
}
}
$('image'+event.target.getElement('input').value).src = newSrcImage;
}
});
}
$('boutonRecherche').addEvent('click', function(){
recherche();
});
$('boutonRechercheStop').addEvent('click', function(){
for (i=1; i<$('nbQuestion').value; i++) {
$('question'+i).style.display = 'block';
}
$('champRechFaq').value = "";
});
$('champRechFaq').addEvent('keydown', function(event){
var event = new Event(event);
if(event.key == 'enter'){
recherche();
}
});
$('champRechFaq').addEvent('click', function(event){
$('champRechFaq').value = "";
});
setTimeout("affSlide()",1000);
}
if($('carousel_content')){
new iCarousel("carousel_content", {
idPrevious: "carousel_previous",
idNext: "carousel_next",
idToggle: "undefined",
item: {
klass: "carousel_item",
size: 86.9
},
animation: {
duration: 200,
amount: 3
}
});
}
});
function recherche(){
for (i=1; i<$('nbQuestion').value; i++) {
$('question'+i).style.display = 'block';
tabSlider[i].slideOut();
tabTest[i] = false;
srcImage = $('image'+i).src;
newSrcImage = srcImage.substring(0, $('image'+i).src.lastIndexOf('/'))+"/book_open.png";
$('image'+i).src = newSrcImage;
strRecherche = texteElement($('reponse'+i)).toLowerCase();
if(strRecherche.indexOf($('champRechFaq').value.toLowerCase()) == '-1'){
$('question'+i).style.display = 'none';
}
}
}
function texteElement(o) {
return (o.innerText) ? o.innerText : (o.textContent) ? o.textContent : "";
}
function affSlide(){
for (i=1; i<$('nbQuestion').value; i++) {
$('reponse'+i).style.display = 'block';
}
}
function scrollToTime(x,y){
scrollTo(x,y);
}
function verifForm( params ) {
this.params					= params;									// Tableau des paramètres
this.form2Verif				= this.params.get('form2Verif');			// Elément du formulaire à contrôler
this.btnSubmit				= this.params.get('btnSubmit');				// Elément du bouton submit de validation
this.addMessageHere			= this.params.get('addMessageHere');		// Ajouter le message d'erreur après l'élément
this.formMsgError			= this.params.get('formMsgError');			// Hash contenant les messages d'erreur
this.valid					= true;										// Le formulaire remplit-il toutes les conditions ?
this.msgError				= new Array();								// Listes des éventuelles erreurs
this.init = function init() {
this.fbConsole("info", "verifForm initialized");
this.btnSubmit.addEvent( "click", function(e) {
this.msgError 	= new Array();
this.valid 		= true;
if ( $('error_list') ) {
$('error_list').remove();
}
$ES('.error', this.form2Verif).each( function(input) {
input.removeClass('error');
});
this.isRequired();
this.isMail();
this.isSameMail();
this.isSamePassword();
this.isChecked();
this.hookTest();
this.submit(e);
}.bind(this));
};
this.isRequired = function isRequired() {
var inputIsRequired		= $ES('.required', this.form2Verif);
inputIsRequired.each( function(input) {
if ( input.value == "" ) {
this.inputError( input, "EMPTY" );
}
}.bind(this));
};
this.isMail = function isMail() {
var inputIsMail		= $ES('input.email', this.form2Verif);
inputIsMail.each( function(input) {
if ( input.value != "" ) {
if ( !input.value.test("^(.+)@(.+)\\.(.+)") ) {
this.inputError( input, "NOTMAIL" );
}
}
}.bind(this));
};
this.isSameMail = function isSameMail() {
var inputIsSameMail		= $ES('input.confirmEmail', this.form2Verif);
if ( inputIsSameMail.length == 2 ) {
if ( inputIsSameMail[0].value.clean() != inputIsSameMail[1].value.clean() ) {
inputIsSameMail[0].addClass('error');
this.inputError( inputIsSameMail[1], "NOTSAMEMAIL" );
}
}
};
this.isSamePassword = function isSamePassword() {
var inputIsSamePassword		= $ES('input.confirmPassword', this.form2Verif);
if ( inputIsSamePassword.length == 2 ) {
if ( inputIsSamePassword[0].value.clean() != inputIsSamePassword[1].value.clean() ) {
inputIsSamePassword[0].addClass('error');
this.inputError( inputIsSamePassword[1], "NOTSAMEPAWD" );
}
}
};
this.isChecked = function isChecked() {
var inputIsChecked		= $ES('.checked', this.form2Verif);
inputIsChecked.each( function(input) {
if ( !input.checked ) {
this.inputError( input, "NOTCHECKED" );
}
}.bind(this));
};
this.hookTest = function hookTest() {
this.fbConsole("warn", "No hookTest");
};
this.hookSubmit = function hookSubmit() {
this.fbConsole("warn", "No hooksubmit");
};
this.inputError = function inputError ( input, suffix ) {
this.valid	= false;
input.addClass('error');
if ( input.id != "" ) {
this.msgError[this.msgError.length]		= input.id + "_" + suffix;
}
else {
this.fbConsole("warn", "No id for input");
}
}
this.fbConsole = function fbConsole ( type, msg ) {
if( typeof console != 'undefined' && typeof console.log != 'undefined' ) {
eval("console."+ type + "(msg);");
}
}
this.submit = function submit( e ) {
if ( this.valid == false  ) {
e = new Event(e);
if ( this.msgError.length > 0 ) {
ul_error 	= new Element('ul');
ul_error.setProperty('id', 'error_list');
ul_error.injectTop( this.addMessageHere );
this.msgError.each(function(item, index){
li	= new Element('li', {} ) ;
ul_error.adopt( li );
msg	= this.formMsgError.get(item);
if ( msg == null ) {
msg = "Error on " + item;
}
li.setText( msg.stripSlashes() );
});
}
else {
this.fbConsole( "warn", "msgError length <= 0");
}
e.stop();
if ( this.params.get('msgErrorRedirect') != null ) {
document.location.href='#' + this.params.get('msgErrorRedirect');
}
}
else {
this.hookSubmit();
}
};
}; // EOC
function loadExtendedVerifForm( verif ) {
verif.fbConsole("info", '"Extended verifForm" initialized"');
verif.isRequired = function extIsRequired() {
var inputIsRequired		= $ES('.required', this.form2Verif);
inputIsRequired.each( function(input) {
if ( input.value == "" || input.value == valeur_ini_cp ) {
this.inputError( input, "EMPTY" );
}
}.bind(this));
};
};
var mooquee = new Class({
initialize: function(element, options) {
this.setOptions({
marHeight: 20,
marWidth: 550, //or 100%...
steps: 1,
speed: 10,
direction: 'left',
pauseOnOver: true
}, options);
this.timer = null;
this.textElement = null;
this.mooqueeElement = element;
this.constructMooquee();
},
constructMooquee: function() {
var el = this.mooqueeElement;
el.setStyles({
'width' : this.options.marWidth
,'height' : this.options.marHeight
});
this.textElement = new Element('div',{
'class' : 'mooquee-text'
,'id' : 'mooquee-text'
}).setHTML(el.innerHTML);
el.setHTML('');
this.textElement.injectInside(el);
this.textElement = $('mooquee-text');
(this.options.direction == 'left') ?  this.textElement.setStyle('left', ( -1 * this.textElement.getCoordinates().width.toInt())) : this.textElement.setStyle('left', el.getCoordinates().width.toInt());
if(this.options.pauseOnOver){this.addMouseEvents();}
this.timer = this.startMooquee.delay(this.options.speed, this);
},
addMouseEvents : function(){
this.textElement.addEvents({
'mouseenter' : function(me){
this.clearTimer();
}.bind(this),
'mouseleave' : function(me){
this.timer = this.startMooquee.delay(this.options.speed, this);
}.bind(this)
});
},
startMooquee: function(){
var pos = this.textElement.getStyle('left').toInt();
this.textElement.setStyle('left', ( pos + ((this.options.direction == 'left') ? -1 * (this.options.steps) : this.options.steps)) + 'px');
this.checkEnd(pos);
this.timer = this.startMooquee.delay(this.options.speed, this);
},
resumeMooquee: function(){
this.stopMooquee();
if(this.options.pauseOnOver){this.addMouseEvents();}
this.timer = this.startMooquee.delay(this.options.speed, this);
},
stopMooquee: function(){
this.clearTimer();
this.textElement.removeEvents();
},
clearTimer: function(){
$clear(this.timer);
},
checkEnd: function(pos){
if(this.options.direction == 'left'){
if(pos < -1 * (this.textElement.getCoordinates().width.toInt())){
this.textElement.setStyle('left', this.mooqueeElement.getCoordinates().width);
}
}
else{
if(pos > this.mooqueeElement.getCoordinates().width.toInt()){
this.textElement.setStyle('left', -1 * (this.textElement.getCoordinates().width.toInt()) );
}
}
},
setDirection: function(dir){
this.options.direction = dir;
}
});
mooquee.implement(new Options);
var obj;
function startMoorquee( marquees ) {
marquees.each(function(marquee, i) {
obj = new mooquee(marquee);
});
}
window.addEvent('domready', function(){
if( typeof console != 'undefined' && typeof console.log != 'undefined' ) {
console.info("domReady begin");
}
fontmanager = new FontManager({ });
fontmanager.changeFontSize();
if($$('.checkAll')){
$$('.checkAll').addEvent('click', function(){
$$('.jsCheck').setProperty('checked', 'checked');
});
}
if($$('.deCheckAll')){
$$('.deCheckAll').addEvent('click', function(){
$$('.jsCheck').setProperty('checked', '');
});
}
new Overlay();
new MultiBox('mb', {descClassName: 'multiBoxDesc', useOverlay: true, offset: {x:0, y:50}});
if ($('icons_share')){
$('icons_share').injectInside($('share_receiver'));
}
if ( $('openC') ) {
var slideElementC = $('slideC');
var slideVarC = new Fx.Slide(slideElementC, {mode: 'horizontal', duration: 500});
slideVarC.hide();
var size = $('slideC').getStyle('margin-left');
$('slideC').setStyle('width', size.substr(1,size.lenght));
$('openC').addEvent('click', function(){
slideVarC.toggle();
});
}
if( typeof(mySelection) != "undefined" && mySelection.length > 0 ) {
lpe.disabledMySelection();
}
if( $('form_acheteur') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('form_acheteur'),
'btnSubmit': 			$('CreateButton'),
'addMessageHere': 		$('formulaire_acheteur'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
verif.hookSubmit = function hookSubmit() {
};
};
if( $('formulairealerte') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('formulairealerte'),
'btnSubmit': 			$('CreateButton'),
'addMessageHere': 		$('formulairealerte'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
verif.hookTest = function hookTest() {
if( !$('format_cp').checked  && !$('format_mail').checked ) {
verif.msgError[verif.msgError.length] = "CHECK_ONE_OF_TWO";
verif.valid = false;
}
};
};
if( $('editform') && $('formulaire_creer_alerte') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('editform'),
'btnSubmit': 			$('PublishButton'),
'addMessageHere': 		$('editform'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
verif.hookTest = function hookTest() {
if( !$('courrier_email').checked  && !$('postal').checked ) {
verif.msgError[verif.msgError.length] = "CHECK_ONE_OF_TWO";
this.valid = false;
}
};
};
if( $('form_tipafriend') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('form_tipafriend'),
'btnSubmit': 			$('SendButton'),
'addMessageHere': 		$('form_tipafriend'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
};
if( $('formulaire_contact') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('formulaire_contact'),
'btnSubmit': 			$('ActionCollectInformation'),
'addMessageHere': 		$('txt_formulaire'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
};
if( $('form_ecrireauvendeur') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('form_ecrireauvendeur'),
'btnSubmit': 			$('ActionCollectInformation'),
'addMessageHere': 		$('form_ecrireauvendeur'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
};
if( $('formulaire_edit_photo') ) {
var paramsVerif = new Hash({
'form2Verif': 			$('formulaire_edit_photo'),
'btnSubmit': 			$('CreateButton'),
'addMessageHere': 		$('formulaire_edit_photo'),
'formMsgError': 		formMsgError,
'msgErrorRedirect':		'top'
});
var verif = new verifForm( paramsVerif );
verif.init();
verif.hookTest = function hookTest() {
if( $('photofile') && (
!$('photofile').value.test( eval('/(.+)\.(' + allowedExtension + ')$/i') ) )
) {
verif.msgError[verif.msgError.length] = "msg_photoinvalide";
this.valid = false;
}
};
};
if ( $('pays') ) {
lpe.initBeezbeezAjax();
}
Slimbox.scanPage();					// SlimBox
startMoorquee($ES('.marquee'));		// Mooquee
lpe.initInput( );
lpe.noPasteInput();	// Pas de copier-coller
lpe.menuResolutionFix( 'menu_level_1-5', 1280);
if( typeof console != 'undefined' && typeof console.log != 'undefined' ) {
console.info("domReady end");
}
}); // EODR
var Autocompleter = {};
Autocompleter.Base = new Class({
options: {
selectMode: true,
minLength: 1,
useSelection: true,
markQuery: true,
inheritWidth: true,
maxChoices: 10,
injectChoice: null,
onSelect: Class.empty,
onShow: Class.empty,
onHide: Class.empty,
customTarget: null,
className: 'autocompleter-choices',
zIndex: 42,
observerOptions: {},
fxOptions: {},
overflown: [],
multiple: false,
separator: ', ',
separatorSplit: /\s*[,;]\s*/,
allowDupes: false
},
initialize: function(el, options) {
this.setOptions(options);
this.element = $(el);
this.build();
this.observer = new Observer(this.element, this.prefetch.bind(this), $merge({
delay: 400
}, this.options.observerOptions));
this.value = this.observer.value;
this.queryValue = null;
},
build: function() {
if ($(this.options.customTarget)) this.choices = this.options.customTarget;
else {
this.choices = new Element('ul', {
'class': this.options.className,
styles: {zIndex: this.options.zIndex}
}).injectInside(document.body);
this.fix = new OverlayFix(this.choices);
}
this.fx = this.choices.effect('opacity', $merge({
wait: false,
duration: 200
}, this.options.fxOptions))
.addEvent('onStart', function() {
if (this.fx.now) return;
this.choices.setStyle('display', '');
this.fix.show();
}.bind(this))
.addEvent('onComplete', function() {
if (this.fx.now) return;
this.choices.setStyle('display', 'none');
this.fix.hide();
}.bind(this)).set(0);
this.element.setProperty('autocomplete', 'off')
.addEvent(window.ie ? 'keydown' : 'keypress', this.onCommand.bindWithEvent(this))
.addEvent('mousedown', this.onCommand.bindWithEvent(this, [true]))
.addEvent('focus', this.toggleFocus.bind(this, [true]))
.addEvent('blur', this.toggleFocus.bind(this, [false]))
.addEvent('trash', this.destroy.bind(this));
},
destroy: function() {
this.choices.remove();
},
toggleFocus: function(state) {
this.focussed = state;
if (!state) this.hideChoices();
},
onCommand: function(e, mouse) {
if (window.ie) {
var range = this.element.createTextRange();
range.collapse(true);
range.moveEnd('textedit');
range.moveStart('textedit');
range.select();
}
if (mouse && this.focussed) this.prefetch();
if (e.key && !e.shift) switch (e.key) {
case 'enter':
if (this.selected && this.visible) {
this.choiceSelect(this.selected);
e.stop();
}return;
case 'up': case 'down':
if (this.observer.value != (this.value || this.queryValue)) this.prefetch();
else if (this.queryValue === null) break;
else if (!this.visible) this.showChoices();
else {
this.choiceOver((e.key == 'up')
? this.selected.getPrevious() || this.choices.getLast()
: this.selected.getNext() || this.choices.getFirst() );
this.setSelection();
}
e.stop();return;
case 'esc':this.hideChoices();return;
}
this.value = false;
},
setSelection: function(finish) {
var input = this.selected.inputValue, value = input;
var start = this.queryValue.length, end = input.length;
if (input.substr(0, start).toLowerCase() != this.queryValue.toLowerCase()) start = 0;
if (this.options.multiple) {
var split = this.options.separator;
value = this.element.value;
start += this.queryIndex;
end += this.queryIndex;
var old = value.substr(this.queryIndex).split(split, 1)[0];
value = value.substr(0, this.queryIndex) + input + value.substr(this.queryIndex + old.length);
if (finish) {
var tokens = value.split(this.options.separator).filter(function(entry) {
return this.test(entry);
}, /[^\s,]+/);
if (!this.options.allowDupes) tokens = [].merge(tokens);
var sep = this.options.separator;
value = tokens.join(sep) + sep;
end = value.length;
}
}
this.value = this.observer.value = this.element.value = value;
this.opted = value;
if (finish || this.selectMode == 'pick') start = end;
this.element.selectRange(start, end);
this.fireEvent('onSelection', [this.element, this.selected, value, input]);
},
hideChoices: function() {
if (!this.visible) return;
this.visible = this.value = false;
this.observer.clear();
this.fx.start(0);
this.fireEvent('onHide', [this.element, this.choices]);
},
showChoices: function() {
if (this.visible || !this.choices.getFirst()) return;
this.visible = true;
var pos = this.element.getCoordinates(this.options.overflown);
this.choices.setStyles({
left: pos.left,
top: pos.bottom
});
if (this.options.inheritWidth) this.choices.setStyle('width', pos.width);
this.fx.start(1);
this.choiceOver(this.choices.getFirst());
this.fireEvent('onShow', [this.element, this.choices]);
},
prefetch: function() {
var value = this.element.value, query = value;
if (this.options.multiple) {
var split = this.options.separatorSplit;
var values = value.split(split);
var index = this.element.getSelectedRange().start;
var toIndex = value.substr(0, index).split(split);
var last = toIndex.length - 1;
index -= toIndex[last].length;
query = values[last];
}
if (query.length < this.options.minLength) {
this.hideChoices();
} else {
if (query === this.queryValue || (this.visible && query == this.selectedValue)) {
if (this.visible) return false;
this.showChoices();
} else {
this.queryValue = query;
this.queryIndex = index;
this.query();
}
}
return true;
},
updateChoices: function(choices) {
this.choices.empty();
this.selected = null;
if (!choices || !choices.length) return;
if (this.options.maxChoices < choices.length) choices.length = this.options.maxChoices;
choices.each(this.options.injectChoice || function(choice, i){
var el = new Element('li').setHTML(this.markQueryValue(choice));
el.inputValue = choice;
this.addChoiceEvents(el).injectInside(this.choices);
}, this);
this.showChoices();
},
choiceOver: function(el) {
if (el instanceof Array) el = el[0]; // Chrome and FF4 fix
if (this.selected) this.selected.removeClass('autocompleter-selected');
this.selected = el.addClass('autocompleter-selected');
},
choiceSelect: function(el) {
this.setSelection(true);
this.hideChoices();
this.fireEvent('onSelect', [this.element], 20);
},
markQueryValue: function(txt) {
return (this.options.markQuery && this.queryValue) ? txt.replace(new RegExp('^(' + this.queryValue.escapeRegExp() + ')', 'i'), '<span class="autocompleter-queried">$1</span>') : txt;
},
addChoiceEvents: function(el) {
return el.addEvents({
mouseover: this.choiceOver.bind(this, [el]),
mousedown: this.choiceSelect.bind(this, [el])
});
}
});
Autocompleter.Base.implement(new Events);
Autocompleter.Base.implement(new Options);
Autocompleter.Local = Autocompleter.Base.extend({
options: {
minLength: 0,
filterTokens : null
},
initialize: function(el, tokens, options) {
this.parent(el, options);
this.tokens = tokens;
if (this.options.filterTokens) this.filterTokens = this.options.filterTokens.bind(this);
},
query: function() {
this.hideChoices();
this.queryValue = this.element.value;
this.updateChoices(this.filterTokens());
},
filterTokens: function(token) {
var regex = new RegExp('^' + this.queryValue.escapeRegExp(), 'i');
return this.tokens.filter(function(token) {
return regex.test(token);
});
}
});
Autocompleter.Ajax = {};
Autocompleter.Ajax.Base = Autocompleter.Base.extend({
options: {
postVar: 'value',
postData: {},
ajaxOptions: {},
onRequest: Class.empty,
onComplete: Class.empty
},
initialize: function(el, url, options) {
this.parent(el, options);
this.ajax = new Ajax(url, $merge({
autoCancel: true
}, this.options.ajaxOptions));
this.ajax.addEvent('onComplete', this.queryResponse.bind(this));
this.ajax.addEvent('onFailure', this.queryResponse.bind(this, [false]));
},
query: function(){
var data = $extend({}, this.options.postData);
data[this.options.postVar] = this.element.value;
this.fireEvent('onRequest', [this.element, this.ajax]);
this.ajax.request(data);
},
queryResponse: function(resp) {
this.value = this.queryValue = this.element.value;
this.selected = false;
this.hideChoices();
this.fireEvent(resp ? 'onComplete' : 'onFailure', [this.element, this.ajax], 20);
}
});
Autocompleter.Ajax.Json = Autocompleter.Ajax.Base.extend({
queryResponse: function(resp) {
this.parent(resp);
var choices = Json.evaluate(resp || false);
if (!choices || !choices.length) return;
this.updateChoices(choices);
}
});
Autocompleter.Ajax.Xhtml = Autocompleter.Ajax.Base.extend({
options: {
parseChoices: null
},
queryResponse: function(resp) {
this.parent(resp);
if (!resp) return;
this.choices.setHTML(resp).getChildren().each(this.options.parseChoices || this.parseChoices, this);
this.showChoices();
},
parseChoices: function(el) {
var value = el.innerHTML;
el.inputValue = value;
el.setHTML(this.markQueryValue(value));
}
});
var OverlayFix = new Class({
initialize: function(el) {
this.element = $(el);
if (window.ie){
this.element.addEvent('trash', this.destroy.bind(this));
this.fix = new Element('iframe', {
properties: {
frameborder: '0',
scrolling: 'no',
src: 'javascript:false;'
},
styles: {
position: 'absolute',
border: 'none',
display: 'none',
filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
}
}).injectAfter(this.element);
}
},
show: function() {
if (this.fix) this.fix.setStyles($extend(
this.element.getCoordinates(), {
display: '',
zIndex: (this.element.getStyle('zIndex') || 1) - 1
}));
return this;
},
hide: function() {
if (this.fix) this.fix.setStyle('display', 'none');
return this;
},
destroy: function() {
this.fix.remove();
}
});
Element.extend ({
getSelectedRange: function() {
if (!window.ie) return {start: this.selectionStart, end: this.selectionEnd};
var pos = {start: 0, end: 0};
var range = this.ownerDocument.selection.createRange();
if (!range || range.parentElement() != this) return pos;
var dup = range.duplicate();
if (this.type == 'text') {
pos.start = 0 - dup.moveStart('character', -100000);
pos.end = pos.start + range.text.length;
} else {
var value = this.value;
var offset = value.length - value.match(/[\n\r]*$/)[0].length;
dup.moveToElementText(this);
dup.setEndPoint('StartToEnd', range);
pos.end = offset - dup.text.length;
dup.setEndPoint('StartToStart', range);
pos.start = offset - dup.text.length;
}
return pos;
},
selectRange: function(start, end) {
if (window.ie) {
var diff = this.value.substr(start, end - start).replace(/\r/g, '').length;
start = this.value.substr(0, start).replace(/\r/g, '').length;
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', start + diff);
range.moveStart('character', start);
range.select();
} else {
this.focus();
this.setSelectionRange(start, end);
}
return this;
}
});
var Observer = new Class({
options: {
periodical: false,
delay: 1000
},
initialize: function(el, onFired, options){
this.setOptions(options);
this.addEvent('onFired', onFired);
this.element = $(el);
this.listener = this.fired.bind(this);
this.value = this.element.getValue();
if (this.options.periodical) this.timer = this.listener.periodical(this.options.periodical);
else this.element.addEvent('keyup', this.listener);
},
fired: function() {
var value = this.element.getValue();
if (this.value == value) return;
this.clear();
this.value = value;
this.timeout = this.fireEvent.delay(this.options.delay, this, ['onFired', [value]]);
},
clear: function() {
$clear(this.timeout);
return this;
}
});
Observer.implement(new Options);
Observer.implement(new Events);
var MultiBox = new Class({
getOptions: function(){
return {
initialWidth: 250,
initialHeight: 250,
container: document.body,
useOverlay: false,
contentColor: '#FFF',
showNumbers: true,
showControls: true,
waitDuration: 2000,
descClassName: false,
descMinWidth: 400,
descMaxWidth: 600,
movieWidth: 400,
movieHeight: 300,
offset: {x:0, y:0},
fixedTop: false,
path: 'files/',
onOpen: Class.empty,
onClose: Class.empty,
openFromLink: true,
relativeToWindow: true
};
},
initialize: function(className, options){
this.setOptions(this.getOptions(), options);
this.openClosePos = {};
this.timer = 0;
this.contentToLoad = {};
this.index = 0;
this.opened = false;
this.contentObj = {};
this.containerDefaults = {};
if(this.options.useOverlay){
this.overlay = new Overlay({container: this.options.container, onClick:this.close.bind(this)});
}
this.content = $$('.'+className);
if(this.options.descClassName){
this.descriptions = $$('.'+this.options.descClassName);
this.descriptions.each(function(el){
el.setStyle('display', 'none');
});
}
this.container = new Element('div').addClass('MultiBoxContainer').injectInside(this.options.container);
this.iframe = new Element('iframe').setProperties({
'id': 'multiBoxIframe',
'name': 'mulitBoxIframe',
'src': 'javascript:void(0);',
'frameborder': 1,
'scrolling': 'no'
}).setStyles({
'position': 'absolute',
'top': -20,
'left': -20,
'width': '115%',
'height': '115%',
'filter': 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)',
'opacity': 0
}).injectInside(this.container);
this.box = new Element('div').addClass('MultiBoxContent').injectInside(this.container);
this.closeButton = new Element('div').addClass('MultiBoxClose').injectInside(this.container).addEvent('click', this.close.bind(this));
this.controlsContainer = new Element('div').addClass('MultiBoxControlsContainer').injectInside(this.container);
this.controls = new Element('div').addClass('MultiBoxControls').injectInside(this.controlsContainer);
this.previousButton = new Element('div').addClass('MultiBoxPrevious').injectInside(this.controls).addEvent('click', this.previous.bind(this));
this.nextButton = new Element('div').addClass('MultiBoxNext').injectInside(this.controls).addEvent('click', this.next.bind(this));
this.title = new Element('div').addClass('MultiBoxTitle').injectInside(this.controls);
this.number = new Element('div').addClass('MultiBoxNumber').injectInside(this.controls);
this.description = new Element('div').addClass('MultiBoxDescription').injectInside(this.controls);
if(this.content.length == 1){
this.title.setStyles({
'margin-left': 0
});
this.description.setStyles({
'margin-left': 0
});
this.previousButton.setStyle('display', 'none');
this.nextButton.setStyle('display', 'none');
this.number.setStyle('display', 'none');
}
new Element('div').setStyle('clear', 'both').injectInside(this.controls);
this.content.each(function(el,i){
el.index = i;
el.addEvent('click', function(e){
new Event(e).stop();
this.open(el);
}.bind(this));
if(el.href.indexOf('#') > -1){
el.content = $(el.href.substr(el.href.indexOf('#')+1));
if(el.content){el.content.setStyle('display','none');}
}
}, this);
this.containerEffects = new Fx.Styles(this.container, {duration: 400, transition: Fx.Transitions.sineInOut});
this.controlEffects = new Fx.Styles(this.controlsContainer, {duration: 300, transition: Fx.Transitions.sineInOut});
this.reset();
},
setContentType: function(link){
var str = link.href.substr(link.href.lastIndexOf('.')+1).toLowerCase();
var contentOptions = {};
if($chk(link.rel)){
var optArr = link.rel.split(',');
optArr.each(function(el){
var ta = el.split(':');
contentOptions[ta[0]] = ta[1];
});
}
if(contentOptions.type != undefined){
str = contentOptions.type;
}
this.contentObj = {};
this.contentObj.url = link.href;
this.contentObj.xH = 0;
if(contentOptions.width){
this.contentObj.width = contentOptions.width;
}else{
this.contentObj.width = this.options.movieWidth;
}
if(contentOptions.height){
this.contentObj.height = contentOptions.height;
}else{
this.contentObj.height = this.options.movieHeight;
}
if(contentOptions.panel){
this.panelPosition = contentOptions.panel;
}else{
this.panelPosition = this.options.panel;
}
switch(str){
case 'jpg':
case 'gif':
case 'png':
this.type = 'image';
break;
case 'swf':
this.type = 'flash';
break;
case 'flv':
this.type = 'flashVideo';
this.contentObj.xH = 70;
break;
case 'mov':
this.type = 'quicktime';
break;
case 'wmv':
this.type = 'windowsMedia';
break;
case 'rv':
case 'rm':
case 'rmvb':
this.type = 'real';
break;
case 'mp3':
this.type = 'flashMp3';
this.contentObj.width = 320;
this.contentObj.height = 70;
break;
case 'element':
this.type = 'htmlelement';
this.elementContent = link.content;
this.elementContent.setStyles({
display: 'block',
opacity: 0
})
if(this.elementContent.getStyle('width') != 'auto'){
this.contentObj.width = this.elementContent.getStyle('width');
}
this.contentObj.height = this.elementContent.getSize().size.y;
this.elementContent.setStyles({
display: 'none',
opacity: 1
})
break;
default:
this.type = 'iframe';
if(contentOptions.ajax){
this.type = 'ajax';
}
break;
}
},
reset: function(){
this.container.setStyles({
'opacity': 0,
'display': 'none'
});
this.controlsContainer.setStyles({
'height': 0
});
this.removeContent();
this.previousButton.removeClass('MultiBoxButtonDisabled');
this.nextButton.removeClass('MultiBoxButtonDisabled');
this.opened = false;
},
getOpenClosePos: function(el){
if (this.options.openFromLink) {
if (el.getFirst()) {
var w = el.getFirst().getCoordinates().width - (this.container.getStyle('border').toInt() * 2);
if (w < 0) {
w = 0
}
var h = el.getFirst().getCoordinates().height - (this.container.getStyle('border').toInt() * 2);
if (h < 0) {
h = 0
}
this.openClosePos = {
width: w,
height: h,
top: el.getFirst().getCoordinates().top,
left: el.getFirst().getCoordinates().left
};
}
else {
var w = el.getCoordinates().width - (this.container.getStyle('border').toInt() * 2);
if (w < 0) {
w = 0
}
var h = el.getCoordinates().height - (this.container.getStyle('border').toInt() * 2);
if (h < 0) {
h = 0
}
this.openClosePos = {
width: w,
height: h,
top: el.getCoordinates().top,
left: el.getCoordinates().left
};
}
}else{
if(this.options.fixedTop){
var top = this.options.fixedTop;
}else{
var top = ((window.getHeight()/2)-(this.options.initialHeight/2)-this.container.getStyle('border').toInt())+this.options.offset.y;
}
this.openClosePos = {
width: this.options.initialWidth,
height: this.options.initialHeight,
top: top,
left: ((window.getWidth()/2)-(this.options.initialWidth/2)-this.container.getStyle('border').toInt())+this.options.offset.x
};
}
return this.openClosePos;
},
open: function(el){
this.options.onOpen();
this.index = this.content.indexOf(el);
this.openId = el.getProperty('id');
if(!this.opened){
this.opened = true;
if(this.options.useOverlay){
this.overlay.show();
}
this.container.setStyles(this.getOpenClosePos(el));
this.container.setStyles({
opacity: 0,
display: 'block'
});
if(this.options.fixedTop){
var top = this.options.fixedTop;
}else{
var top = ((window.getHeight()/2)-(this.options.initialHeight/2)-this.container.getStyle('border').toInt())+this.options.offset.y;
}
this.containerEffects.start({
width: this.options.initialWidth,
height: this.options.initialHeight,
top: top,
left: ((window.getWidth()/2)-(this.options.initialWidth/2)-this.container.getStyle('border').toInt())+this.options.offset.x,
opacity: [0, 1]
});
this.load(this.index);
}else{
if (this.options.showControls) {
this.hideControls();
}
this.getOpenClosePos(this.content[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.index, this).delay(1100);
}
},
getContent: function(index){
this.setContentType(this.content[index]);
var desc = {};
if(this.options.descClassName){
this.descriptions.each(function(el,i){
if(el.hasClass(this.openId)){
desc = el.clone();
}
},this);
}
this.contentToLoad = {
title: this.content[index].title || '&nbsp;',
desc: desc,
number: index+1
};
},
close: function(){
if(this.options.useOverlay){
this.overlay.hide();
}
if (this.options.showControls) {
this.hideControls();
}
this.hideContent();
this.containerEffects.stop();
this.zoomOut.bind(this).delay(500);
this.options.onClose();
},
zoomOut: function(){
this.containerEffects.start({
width: this.openClosePos.width,
height: this.openClosePos.height,
top: this.openClosePos.top,
left: this.openClosePos.left,
opacity: 0
});
this.reset.bind(this).delay(500);
},
load: function(index){
this.box.addClass('MultiBoxLoading');
this.getContent(index);
if(this.type == 'image'){
var xH = this.contentObj.xH;
this.contentObj = new Asset.image(this.content[index].href, {onload: this.resize.bind(this)});
this.contentObj.xH = xH;
}else{
this.resize();
}
},
resize: function(){
if (this.options.fixedTop) {
var top = this.options.fixedTop;
}
else {
var top = ((window.getHeight() / 2) - ((Number(this.contentObj.height) + this.contentObj.xH) / 2) - this.container.getStyle('border').toInt() + window.getScrollTop()) + this.options.offset.y;
}
var left = ((window.getWidth() / 2) - (this.contentObj.width / 2) - this.container.getStyle('border').toInt()) + this.options.offset.x;
if (top < 0) {
top = 0
}
if (left < 0) {
left = 0
}
this.containerEffects.stop();
this.containerEffects.start({
width: this.contentObj.width,
height: Number(this.contentObj.height) + this.contentObj.xH,
top: top,
left: left,
opacity: 1
});
this.timer = this.showContent.bind(this).delay(500);
},
showContent: function(){
this.box.removeClass('MultiBoxLoading');
this.removeContent();
this.contentContainer = new Element('div').setProperties({id: 'MultiBoxContentContainer'}).setStyles({opacity: 0, width: this.contentObj.width+'px', height: (Number(this.contentObj.height)+this.contentObj.xH)+'px'}).injectInside(this.box);
if(this.type == 'image'){
this.contentObj.injectInside(this.contentContainer);
}else if(this.type == 'iframe'){
if(this.contentObj.url.indexOf('/lecteurflv/flv') < 0 ){
new Element('iframe').setProperties({
id: 'iFrame'+new Date().getTime(),
width: this.contentObj.width,
height: this.contentObj.height,
src: this.contentObj.url,
frameborder: 0,
scrolling: 'auto'
}).injectInside(this.contentContainer);
}
else{
new Element('iframe').setProperties({
id: 'iFrame'+new Date().getTime(),
width: this.contentObj.width,
height: this.contentObj.height,
src: this.contentObj.url,
frameborder: 0,
scrolling: 'no'
}).injectInside(this.contentContainer);
}
}else if(this.type == 'htmlelement'){
this.elementContent.clone().setStyle('display','block').injectInside(this.contentContainer);
}else if(this.type == 'ajax'){
new Ajax(this.contentObj.url, {
method: 'get',
update: 'MultiBoxContentContainer',
evalScripts: true,
autoCancel: true
}).request();
}else{
var obj = this.createEmbedObject().injectInside(this.contentContainer);
if(this.str != ''){
$('MultiBoxMediaObject').innerHTML = this.str;
}
}
this.contentEffects = new Fx.Styles(this.contentContainer, {duration: 500, transition: Fx.Transitions.linear});
this.contentEffects.start({
opacity: 1
});
this.title.setHTML(this.contentToLoad.title);
this.number.setHTML(this.contentToLoad.number+' of '+this.content.length);
if (this.options.descClassName) {
if (this.description.getFirst()) {
this.description.getFirst().remove();
}
}
if (this.options.showControls) {
this.timer = this.showControls.bind(this).delay(800);
}
},
hideContent: function(){
this.box.addClass('MultiBoxLoading');
this.contentEffects.start({
opacity: 0
});
this.removeContent.bind(this).delay(500);
},
removeContent: function(){
if($('MultiBoxMediaObject')){
$('MultiBoxMediaObject').empty();
$('MultiBoxMediaObject').remove();
}
if($('MultiBoxContentContainer')){
$('MultiBoxContentContainer').remove();
}
},
showControls: function(){
this.clicked = false;
if(this.container.getStyle('height') != 'auto'){
this.containerDefaults.height = this.container.getStyle('height')
this.containerDefaults.backgroundColor = this.options.contentColor;
}
this.container.setStyles({
'height': 'auto'
});
if(this.contentToLoad.number == 1){
this.previousButton.addClass('MultiBoxPreviousDisabled');
}else{
this.previousButton.removeClass('MultiBoxPreviousDisabled');
}
if(this.contentToLoad.number == this.content.length){
this.nextButton.addClass('MultiBoxNextDisabled');
}else{
this.nextButton.removeClass('MultiBoxNextDisabled');
}
this.controlEffects.start({'height': this.controls.getStyle('height')});
},
hideControls: function(num){
this.controlEffects.start({'height': 0}).chain(function(){
this.container.setStyles(this.containerDefaults);
}.bind(this));
},
showThumbnails: function(){
},
next: function(){
if(this.index < this.content.length-1){
this.index++;
this.openId = this.content[this.index].getProperty('id');
if (this.options.showControls) {
this.hideControls();
}
this.getOpenClosePos(this.content[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.index, this).delay(1100);
}
},
previous: function(){
if(this.index > 0){
this.index--;
this.openId = this.content[this.index].getProperty('id');
if (this.options.showControls) {
this.hideControls();
}
this.getOpenClosePos(this.content[this.index]);
this.timer = this.hideContent.bind(this).delay(500);
this.timer = this.load.pass(this.index, this).delay(1000);
}
},
createEmbedObject: function(){
if(this.type == 'flash'){
var url = this.contentObj.url;
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+this.contentObj.height+'" ';
this.str += 'title="MultiBoxMedia">';
this.str += '<param name="movie" value="'+url+'" />'
this.str += '<param name="quality" value="high" />';
this.str += '<embed src="'+url+'" ';
this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+this.contentObj.height+'"></embed>';
this.str += '</object>';
}
if(this.type == 'flashVideo'){
var url = this.contentObj.url;
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+(Number(this.contentObj.height)+this.contentObj.xH)+'" ';
this.str += 'title="MultiBoxMedia">';
this.str += '<param name="movie" value="'+this.options.path+'flvplayer.swf" />'
this.str += '<param name="quality" value="high" />';
this.str += '<param name="salign" value="TL" />';
this.str += '<param name="scale" value="noScale" />';
this.str += '<param name="FlashVars" value="path='+url+'" />';
this.str += '<embed src="'+this.options.path+'flvplayer.swf" ';
this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+(Number(this.contentObj.height)+this.contentObj.xH)+'"';
this.str += 'salign="TL" ';
this.str += 'scale="noScale" ';
this.str += 'FlashVars="path='+url+'"';
this.str += '></embed>';
this.str += '</object>';
}
if(this.type == 'flashMp3'){
var url = this.contentObj.url;
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" '
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+this.contentObj.height+'" ';
this.str += 'title="MultiBoxMedia">';
this.str += '<param name="movie" value="'+this.options.path+'mp3player.swf" />'
this.str += '<param name="quality" value="high" />';
this.str += '<param name="salign" value="TL" />';
this.str += '<param name="scale" value="noScale" />';
this.str += '<param name="FlashVars" value="path='+url+'" />';
this.str += '<embed src="'+this.options.path+'mp3player.swf" ';
this.str += 'quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ';
this.str += 'width="'+this.contentObj.width+'" ';
this.str += 'height="'+this.contentObj.height+'"';
this.str += 'salign="TL" ';
this.str += 'scale="noScale" ';
this.str += 'FlashVars="path='+url+'"';
this.str += '></embed>';
this.str += '</object>';
}
if(this.type == 'quicktime'){
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object  type="video/quicktime" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"';
this.str += ' width="'+this.contentObj.width+'" height="'+this.contentObj.height+'">';
this.str += '<param name="src" value="'+this.contentObj.url+'" />';
this.str += '<param name="autoplay" value="true" />';
this.str += '<param name="controller" value="true" />';
this.str += '<param name="enablejavascript" value="true" />';
this.str += '<embed src="'+this.contentObj.url+'" autoplay="true" pluginspage="http://www.apple.com/quicktime/download/" width="'+this.contentObj.width+'" height="'+this.contentObj.height+'"></embed>';
this.str += '<object/>';
}
if(this.type == 'windowsMedia'){
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object  type="application/x-oleobject" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"';
this.str += ' width="'+this.contentObj.width+'" height="'+this.contentObj.height+'">';
this.str += '<param name="filename" value="'+this.contentObj.url+'" />';
this.str += '<param name="Showcontrols" value="true" />';
this.str += '<param name="autoStart" value="true" />';
this.str += '<embed type="application/x-mplayer2" src="'+this.contentObj.url+'" Showcontrols="true" autoStart="true" width="'+this.contentObj.width+'" height="'+this.contentObj.height+'"></embed>';
this.str += '<object/>';
}
if(this.type == 'real'){
var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'});
this.str = '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"';
this.str += ' width="'+this.contentObj.width+'" height="'+this.contentObj.height+'">';
this.str += '<param name="src" value="'+this.contentObj.url+'" />';
this.str += '<param name="controls" value="ImageWindow" />';
this.str += '<param name="autostart" value="true" />';
this.str += '<embed src="'+this.contentObj.url+'" controls="ImageWindow" autostart="true" width="'+this.contentObj.width+'" height="'+this.contentObj.height+'"></embed>';
this.str += '<object/>';
}
return obj;
}
});
MultiBox.implement(new Options);
MultiBox.implement(new Events);
var Overlay = new Class({
getOptions: function(){
return {
colour: '#000',
opacity: 0.7,
zIndex: 200,
container: document.body,
onClick: Class.empty
};
},
initialize: function(options){
this.setOptions(this.getOptions(), options);
this.options.container = $(this.options.container);
this.container = new Element('div').setProperty('id', 'OverlayContainer').setStyles({
position: 'absolute',
left: '0px',
top: '0px',
width: '100%',
zIndex: this.options.zIndex
}).injectInside(this.options.container);
this.iframe = new Element('iframe').setProperties({
'id': 'OverlayIframe',
'name': 'OverlayIframe',
'src': 'javascript:void(0);',
'frameborder': 1,
'scrolling': 'no'
}).setStyles({
'position': 'absolute',
'top': 0,
'left': 0,
'width': '100%',
'height': '100%',
'filter': 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)',
'opacity': 0,
'zIndex': 200
}).injectInside(this.container);
this.overlay = new Element('div').setProperty('id', 'Overlay').setStyles({
position: 'absolute',
left: '0px',
top: '0px',
width: '100%',
height: '100%',
zIndex: 200,
backgroundColor: this.options.colour
}).injectInside(this.container);
this.container.addEvent('click', function(){
this.options.onClick();
}.bind(this));
this.fade = new Fx.Style(this.container, 'opacity').set(0);
this.position();
window.addEvent('resize', this.position.bind(this));
},
position: function(){
if(this.options.container == document.body){
var h = window.getScrollHeight()+'px';
this.container.setStyles({top: '0px', height: h});
}else{
var myCoords = this.options.container.getCoordinates();
this.container.setStyles({
top: myCoords.top+'px',
height: myCoords.height+'px',
left: myCoords.left+'px',
width: myCoords.width+'px'
});
}
},
show: function(){
this.fade.start(0,this.options.opacity);
},
hide: function(){
this.fade.start(this.options.opacity,0);
}
});
Overlay.implement(new Options);
var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
var Slimbox = (function() {
var win = window, options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight,
eventKeyDown = keyDown.bindWithEvent(), operaFix = window.opera && (navigator.appVersion >= "9.3"), documentElement = document.documentElement,
preload = {}, preloadPrev = new Image(), preloadNext = new Image(),
overlay, center, image, prevLink, nextLink, bottomContainer, bottom, caption, number,
fxOverlay, fxResize, fxImage, fxBottom;
win.addEvent("domready", function() {
$(document.body).adopt(
$$(
overlay = new Element("div", {id: "lbOverlay"}),
center = new Element("div", {id: "lbCenter"}),
bottomContainer = new Element("div", {id: "lbBottomContainer"})
).setStyle("display", "none")
);
image = new Element("div", {id: "lbImage"}).injectInside(center).adopt(
prevLink = new Element("a", {id: "lbPrevLink", href: "#"}),
nextLink = new Element("a", {id: "lbNextLink", href: "#"})
);
prevLink.onclick = previous;
nextLink.onclick = next;
var closeLink;
bottom = new Element("div", {id: "lbBottom"}).injectInside(bottomContainer).adopt(
closeLink = new Element("a", {id: "lbCloseLink", href: "#"}),
caption = new Element("div", {id: "lbCaption"}),
number = new Element("div", {id: "lbNumber"}),
new Element("div", {styles: {clear: "both"}})
);
closeLink.onclick = overlay.onclick = close;
});
function position() {
var l = win.getScrollLeft(), w = operaFix ? documentElement.clientWidth : win.getWidth();
$$(center, bottomContainer).setStyle("left", l + (w / 2));
if (compatibleOverlay) overlay.setStyles({left: l, top: win.getScrollTop(), width: w, height: win.getHeight()});
}
function setup(open) {
["object", win.ie6 ? "select" : "embed"].forEach(function(tag) {
$each(document.getElementsByTagName(tag), function(el) {
if (open) el._slimbox = el.style.visibility;
el.style.visibility = open ? "hidden" : el._slimbox;
});
});
overlay.style.display = open ? "" : "none";
var fn = open ? "addEvent" : "removeEvent";
win[fn]("scroll", position)[fn]("resize", position);
document[fn]("keydown", eventKeyDown);
}
function keyDown(event) {
var code = event.code;
if (options.closeKeys.contains(code)) close();
else if (options.nextKeys.contains(code)) next();
else if (options.previousKeys.contains(code)) previous();
event.stop();
}
function previous() {
return changeImage(prevImage);
}
function next() {
return changeImage(nextImage);
}
function changeImage(imageIndex) {
if (imageIndex >= 0) {
activeImage = imageIndex;
activeURL = images[imageIndex][0];
prevImage = (activeImage || (options.loop ? images.length : 0)) - 1;
nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1);
stop();
center.className = "lbLoading";
preload = new Image();
preload.onload = animateBox;
preload.src = activeURL;
}
return false;
}
function animateBox() {
center.className = "";
fxImage.set(0);
image.setStyles({width: preload.width, backgroundImage: "url(" + activeURL + ")", display: ""});
$$(image, prevLink, nextLink).setStyle("height", preload.height);
caption.setHTML(images[activeImage][1] || "");
number.setHTML((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length));
if (prevImage >= 0) preloadPrev.src = images[prevImage][0];
if (nextImage >= 0) preloadNext.src = images[nextImage][0];
centerWidth = image.offsetWidth;
centerHeight = image.offsetHeight;
var top = Math.max(0, middle - (centerHeight / 2));
if (center.offsetHeight != centerHeight) {
fxResize.chain(fxResize.start.pass({height: centerHeight, top: top}, fxResize));
}
if (center.offsetWidth != centerWidth) {
fxResize.chain(fxResize.start.pass({width: centerWidth, marginLeft: -centerWidth/2}, fxResize));
}
fxResize.chain(function() {
bottomContainer.setStyles({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""});
fxImage.start(1);
});
fxResize.callChain();
}
function animateCaption() {
if (prevImage >= 0) prevLink.style.display = "";
if (nextImage >= 0) nextLink.style.display = "";
fxBottom.set(-bottom.offsetHeight).start(0);
bottomContainer.style.visibility = "";
}
function stop() {
preload.onload = Class.empty;
preload.src = preloadPrev.src = preloadNext.src = activeURL;
fxResize.clearChain();
fxResize.stop();
fxImage.stop();
fxBottom.stop();
$$(prevLink, nextLink, image, bottomContainer).setStyle("display", "none");
}
function close() {
if (activeImage >= 0) {
stop();
activeImage = prevImage = nextImage = -1;
center.style.display = "none";
fxOverlay.stop().chain(setup).start(0);
}
return false;
}
Element.extend({
slimbox: function(_options, linkMapper) {
$$(this).slimbox(_options, linkMapper);
return this;
}
});
Elements.extend({
slimbox: function(_options, linkMapper, linksFilter) {
linkMapper = linkMapper || function(el) {
return [el.href, el.title];
};
linksFilter = linksFilter || function() {
return true;
};
var links = this;
links.forEach(function(link) {
link.removeEvents("click").addEvent("click", function(event) {
var filteredLinks = links.filter(linksFilter, this);
Slimbox.open(filteredLinks.map(linkMapper), filteredLinks.indexOf(this), _options, this);
event.stop();
}.bindWithEvent(link));
});
return links;
}
});
return {
open: function(_images, startImage, _options, clickedImage) {
options = $extend({
loop: false,				// Allows to navigate between first and last images
overlayOpacity: 0.8,			// 1 is opaque, 0 is completely transparent (change the color in the CSS file)
overlayFadeDuration: 400,		// Duration of the overlay fade-in and fade-out animations (in milliseconds)
resizeDuration: 400,			// Duration of each of the box resize animations (in milliseconds)
resizeTransition: false,		// "false" uses the mootools default transition
initialWidth: 250,			// Initial width of the box (in pixels)
initialHeight: 250,			// Initial height of the box (in pixels)
imageFadeDuration: 400,			// Duration of the image fade-in animation (in milliseconds)
captionAnimationDuration: 400,		// Duration of the caption animation (in milliseconds)
counterText: "Image {x} of {y}",	// Translate or change as you wish
closeKeys: [27, 88, 67],		// Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67)
previousKeys: [37, 80],			// Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80)
nextKeys: [39, 78]			// Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78)
}, _options || {});
fxOverlay = overlay.effect("opacity", {duration: options.overlayFadeDuration});
fxResize = center.effects($extend({duration: options.resizeDuration}, options.resizeTransition ? {transition: options.resizeTransition} : {}));
fxImage = image.effect("opacity", {duration: options.imageFadeDuration, onComplete: animateCaption});
fxBottom = bottom.effect("margin-top", {duration: options.captionAnimationDuration});
if (typeof _images == "string") {
_images = [[_images, startImage]];
startImage = 0;
}
middle = win.getScrollTop() + ((operaFix ? documentElement.clientHeight : win.getHeight()) / 2);
centerWidth = options.initialWidth;
centerHeight = options.initialHeight;
center.setStyles({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2, display: ""});
compatibleOverlay = win.ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed"));
if (compatibleOverlay) overlay.style.position = "absolute";
fxOverlay.set(0).start(options.overlayOpacity);
position();
setup(1);
images = [];
imagesUnique = [];
_images.each(function(item){
if( !imagesUnique.contains(item[0]) ) {
images.include(item);
imagesUnique.include(item[0]);
}
});
startImage = imagesUnique.indexOf(clickedImage.getProperty('href'))
options.loop = options.loop && (images.length > 1);
return changeImage(startImage);
}
};
})();
Slimbox.scanPage = function() {
var links = $$("a").filter(function(el) {
return el.rel && el.rel.test(/^lightbox/i);
});
$$(links).slimbox({
'loop': true,
'showCounter': true,
'counterText': lng_slimbox_counterText
}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
};

