var image_cliquee=null;var chemin_agrandissement=null;var nb_requetes=0;var tab_images=new Array("accueil_survol.png","projets_survol.png","forum_survol.png","tracker_survol.png","chat_survol.png","xdcc_survol.png","divers_survol.png","chat_survol.png");function declencherRAZ(){setInterval("razNbRequetes()",500);}function precharger(){var c="/theme/"+theme+"/img/";for(var b=0;b<tab_images.length;b++){var a=new Image();a.src=c+tab_images[b];}}function verifStatutUpload(){var a=$("#fichierCle").val();$.ajax({type:"post",data:"key="+a,url:"/utils/statutupload",dataType:"json",success:function(c,d){var b=c;if(b!=false){if(isNaN(b.current)||isNaN(b.current)){$("#texte_progression").html("Initialisation du transfert...");}else{$("#texte_progression").html(Math.round(b.current/b.total*100)+"% chargé");}if(b.done!=1){setTimeout("verifStatutUpload()",600);}}else{setTimeout("verifStatutUpload()",600);}}});}function razNbRequetes(){if(nb_requetes>0){nb_requetes=0;}}function recupCoordGauche(a){var b=0;var c=$("#"+a).get(0);if(c.offsetParent){b=c.offsetLeft;while(c=c.offsetParent){b+=c.offsetLeft;}}return b;}function recupCoordHaut(b){var a=0;var c=$("#"+b).get(0);if(c.offsetParent){a=c.offsetTop;while(c=c.offsetParent){a+=c.offsetTop;}}return a;}var defile_haut;var pos_debut_haut;var pos_courante_haut;function texteDefileHaut(){defile_haut=$("#defilement_haut").get(0);if(defile_haut){if(pos_courante_haut<(-defile_haut.offsetWidth)){pos_courante_haut=pos_debut_haut;}else{pos_courante_haut+=-1;}defile_haut.style.left=pos_courante_haut+"px";}}function demarrerDefilement(){}function afficherSurvol(c){var b=c.src;var a=b.replace(/repos.gif/,"survol.png");c.src=a;}function cacherSurvol(b){var a=b.src;var c=a.replace(/survol.png/,"repos.gif");b.src=c;}function agrandImage(d){image_cliquee=d;var c=d.src;var b=c.replace(/\/vignettes/,"");var a=new Image();a.onerror=function(){var e=$("#agrand_image").get(0);e.style.width="220px";e.style.height="25px";e.style.left=(recupCoordGauche(image_cliquee.id)-40)+"px";e.style.top=(recupCoordHaut(image_cliquee.id)-40)+"px";$("#agrand_image").html("(image agrandie introuvable)");$("#agrand_image").show();};a.onabort=function(){var e=$("#agrand_image").get(0);e.style.width="220px";e.style.height="25px";e.style.left=(recupCoordGauche(image_cliquee.id)-40)+"px";e.style.top=(recupCoordHaut(image_cliquee.id)-40)+"px";$("#agrand_image").html("Chargement interrompu");$("#agrand_image").show();};a.onload=function(){var e=a.width;var f=a.height;var g=$("#agrand_image").get(0);g.style.width=e+"px";g.style.height=f+"px";g.style.left=(recupCoordGauche(image_cliquee.id)-40)+"px";g.style.top=(recupCoordHaut(image_cliquee.id)-40)+"px";$("#agrand_image").html('<img src="'+chemin_agrandissement+'" />');$("#agrand_image").show();};chemin_agrandissement=b;a.src=b;}function fermerAgrand(){$("#agrand_image").hide();}function verifLienDDL(a){var b=$("#"+a.previousElementSibling.id+"").val();$.ajax({data:"lien="+b,type:"POST",url:"/utils/veriflien",dataType:"html",success:function(d,e){var c=d;alert(c);}});}function selectXDCC(a){if(a.selectedIndex!=-1&&a.options[a.selectedIndex].value!=""){document.location.href="/xdcc/"+a.options[a.selectedIndex].value;}}function afficherCommande(c){if(!jQuery.support.cssFloat){var b=document.body.createTextRange();b.moveToElementText(c.previousSibling);b.select();b.execCommand("RemoveFormat");b.execCommand("Copy");alert("Commande copiée dans le presse-papier.\nIl ne vous reste plus qu'à la coller dans votre client IRC");}else{var a=c.innerHTML;alert("Commande à utiliser pour ce pack :\n"+a);}}function insererTag(d,b,k,f){var e=$("#"+d).get(0);var j=e.scrollTop;e.focus();if(!jQuery.support.cssFloat){var m=document.selection.createRange();var c=m.text;}else{var l=e.value.substring(0,e.selectionStart);var c=e.value.substring(e.selectionStart,e.selectionEnd);var h=e.value.substring(e.selectionEnd);}if(f){switch(f){case"lien":k="</lien>";if(c){if(c.indexOf("http://")==0||c.indexOf("https://")==0||c.indexOf("ftp://")==0||c.indexOf("www.")==0){var i=prompt("Quel est le libellé du lien ?")||"";b='<lien url="'+c+'">';c=i;}else{var g=prompt("Quelle est l'url ?");b='<lien url="'+g+'">';}}else{var g=prompt("Quelle est l'url ?")||"";var i=prompt("Quel est le libellé du lien ?")||"";b='<lien url="'+g+'">';c=i;}break;case"image":k="</image>";if(c){if(c.indexOf("http://")==0||c.indexOf("https://")==0||c.indexOf("ftp://")==0||c.indexOf("www.")==0){var a=prompt("Quelle est la légende de l'image ?")||"";b='<image legende="'+a+'">';}}else{var g=prompt("Quelle est l'URL de l'image ?","http://")||"";var a=prompt("Quelle est la légende de l'image ?")||"";b='<image legende="'+a+'">';c=g;}break;}}if(!jQuery.support.cssFloat){m.text=b+c+k;m.moveStart("character",-k.length-c.length);m.moveEnd("character",-k.length);m.select();}else{e.value=l+b+c+k+h;e.focus();e.setSelectionRange(l.length+b.length,l.length+b.length+c.length);}e.scrollTop=j;previsualisation(d,"previsualisation");}function insererListe(a){var b="";while(tmp=prompt("Saisir le contenu d'une puce (si vous voulez arrêter ici, cliquez sur Annuler)")){b+="<puce>"+tmp+"</puce>\n";}if(b!=""){insererTag(a,"<liste>\n"+b,"</liste>");}}function previsualisation(c,b){var d=$("#"+c).val();nb_requetes++;if($("#previsualisation_active").get(0).checked&&d){if(nb_requetes<2){var a="/utils/previsuhtml";if($("#verif_ortho_active").get(0).checked){a+="/1";}$.ajax({data:"texte="+encodeURIComponent(d),type:"POST",url:a,dataType:"html",success:function(f,g){var e=f;$("#"+b).html(e);}});}}}var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="";var k,h,f,j,g,e,d;var b=0;c=Base64._utf8_encode(c);while(b<c.length){k=c.charCodeAt(b++);h=c.charCodeAt(b++);f=c.charCodeAt(b++);j=k>>2;g=((k&3)<<4)|(h>>4);e=((h&15)<<2)|(f>>6);d=f&63;if(isNaN(h)){e=d=64;}else{if(isNaN(f)){d=64;}}a=a+this._keyStr.charAt(j)+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(d);}return a;},decode:function(c){var a="";var k,h,f;var j,g,e,d;var b=0;c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(b<c.length){j=this._keyStr.indexOf(c.charAt(b++));g=this._keyStr.indexOf(c.charAt(b++));e=this._keyStr.indexOf(c.charAt(b++));d=this._keyStr.indexOf(c.charAt(b++));k=(j<<2)|(g>>4);h=((g&15)<<4)|(e>>2);f=((e&3)<<6)|d;a=a+String.fromCharCode(k);if(e!=64){a=a+String.fromCharCode(h);}if(d!=64){a=a+String.fromCharCode(f);}}a=Base64._utf8_decode(a);return a;},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d);}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128);}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128);}}}return a;},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++;}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2;}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3;}}}return b;}};
