function Animator(options){this.setOptions(options);var _this=this;this.timerDelegate=function(){_this.onTimerEvent()};this.subjects=[];this.target=0;this.state=0;this.lastTime=null;};Animator.prototype={setOptions:function(options){this.options=Animator.applyDefaults({interval:20,duration:400,onComplete:function(){},onStep:function(){},transition:Animator.tx.easeInOut},options);},seekTo:function(to){this.seekFromTo(this.state,to);},seekFromTo:function(from,to){this.target=Math.max(0,Math.min(1,to));this.state=Math.max(0,Math.min(1,from));this.lastTime=new Date().getTime();if(!this.intervalId){this.intervalId=window.setInterval(this.timerDelegate,this.options.interval);}},jumpTo:function(to){this.target=this.state=Math.max(0,Math.min(1,to));this.propagate();},toggle:function(){this.seekTo(1-this.target);},addSubject:function(subject){this.subjects[this.subjects.length]=subject;return this;},clearSubjects:function(){this.subjects=[];},propagate:function(){var value=this.options.transition(this.state);for(var i=0;i<this.subjects.length;i++){if(this.subjects[i].setState){this.subjects[i].setState(value);}else{this.subjects[i](value);}}},onTimerEvent:function(){var now=new Date().getTime();var timePassed=now-this.lastTime;this.lastTime=now;var movement=(timePassed/this.options.duration)*(this.state<this.target?1:-1);if(Math.abs(movement)>=Math.abs(this.state-this.target)){this.state=this.target;}else{this.state+=movement;}
try{this.propagate();}finally{this.options.onStep.call(this);if(this.target==this.state){window.clearInterval(this.intervalId);this.intervalId=null;this.options.onComplete.call(this);}}},play:function(){this.seekFromTo(0,1)},reverse:function(){this.seekFromTo(1,0)},inspect:function(){var str="#<Animator:\n";for(var i=0;i<this.subjects.length;i++){str+=this.subjects[i].inspect();}
str+=">";return str;}}
Animator.applyDefaults=function(defaults,prefs){prefs=prefs||{};var prop,result={};for(prop in defaults)result[prop]=prefs[prop]!==undefined?prefs[prop]:defaults[prop];return result;}
Animator.makeArray=function(o){if(o==null)return[];if(!o.length)return[o];var result=[];for(var i=0;i<o.length;i++)result[i]=o[i];return result;}
Animator.camelize=function(string){var oStringList=string.split('-');if(oStringList.length==1)return oStringList[0];var camelizedString=string.indexOf('-')==0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i<len;i++){var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}
return camelizedString;}
Animator.apply=function(el,style,options){if(style instanceof Array){return new Animator(options).addSubject(new CSSStyleSubject(el,style[0],style[1]));}
return new Animator(options).addSubject(new CSSStyleSubject(el,style));}
Animator.makeEaseIn=function(a){return function(state){return Math.pow(state,a*2);}}
Animator.makeEaseOut=function(a){return function(state){return 1-Math.pow(1-state,a*2);}}
Animator.makeElastic=function(bounces){return function(state){state=Animator.tx.easeInOut(state);return((1-Math.cos(state*Math.PI*bounces))*(1-state))+state;}}
Animator.makeADSR=function(attackEnd,decayEnd,sustainEnd,sustainLevel){if(sustainLevel==null)sustainLevel=0.5;return function(state){if(state<attackEnd){return state/attackEnd;}
if(state<decayEnd){return 1-((state-attackEnd)/(decayEnd-attackEnd)*(1-sustainLevel));}
if(state<sustainEnd){return sustainLevel;}
return sustainLevel*(1-((state-sustainEnd)/(1-sustainEnd)));}}
Animator.makeBounce=function(bounces){var fn=Animator.makeElastic(bounces);return function(state){state=fn(state);return state<=1?state:2-state;}}
Animator.tx={easeInOut:function(pos){return((-Math.cos(pos*Math.PI)/2)+0.5);},linear:function(x){return x;},easeIn:Animator.makeEaseIn(1.5),easeOut:Animator.makeEaseOut(1.5),strongEaseIn:Animator.makeEaseIn(2.5),strongEaseOut:Animator.makeEaseOut(2.5),elastic:Animator.makeElastic(1),veryElastic:Animator.makeElastic(3),bouncy:Animator.makeBounce(1),veryBouncy:Animator.makeBounce(3)}
function NumericalStyleSubject(els,property,from,to,units){this.els=Animator.makeArray(els);if(property=='opacity'&&window.ActiveXObject){this.property='filter';}else{this.property=Animator.camelize(property);}
this.from=parseFloat(from);this.to=parseFloat(to);this.units=units!=null?units:'px';}
NumericalStyleSubject.prototype={setState:function(state){var style=this.getStyle(state);var visibility=(this.property=='opacity'&&state==0)?'hidden':'';var j=0;for(var i=0;i<this.els.length;i++){try{this.els[i].style[this.property]=style;}catch(e){if(this.property!='fontWeight')throw e;}
if(j++>20)return;}},getStyle:function(state){state=this.from+((this.to-this.from)*state);if(this.property=='filter')return"alpha(opacity="+Math.round(state*100)+")";if(this.property=='opacity')return state;return Math.round(state)+this.units;},inspect:function(){return"\t"+this.property+"("+this.from+this.units+" to "+this.to+this.units+")\n";}}
function ColorStyleSubject(els,property,from,to){this.els=Animator.makeArray(els);this.property=Animator.camelize(property);this.to=this.expandColor(to);this.from=this.expandColor(from);this.origFrom=from;this.origTo=to;}
ColorStyleSubject.prototype={expandColor:function(color){var hexColor,red,green,blue;hexColor=ColorStyleSubject.parseColor(color);if(hexColor){red=parseInt(hexColor.slice(1,3),16);green=parseInt(hexColor.slice(3,5),16);blue=parseInt(hexColor.slice(5,7),16);return[red,green,blue]}
if(window.DEBUG){alert("Invalid colour: '"+color+"'");}},getValueForState:function(color,state){return Math.round(this.from[color]+((this.to[color]-this.from[color])*state));},setState:function(state){var color='#'
+ColorStyleSubject.toColorPart(this.getValueForState(0,state))
+ColorStyleSubject.toColorPart(this.getValueForState(1,state))
+ColorStyleSubject.toColorPart(this.getValueForState(2,state));for(var i=0;i<this.els.length;i++){this.els[i].style[this.property]=color;}},inspect:function(){return"\t"+this.property+"("+this.origFrom+" to "+this.origTo+")\n";}}
ColorStyleSubject.parseColor=function(string){var color='#',match;if(match=ColorStyleSubject.parseColor.rgbRe.exec(string)){var part;for(var i=1;i<=3;i++){part=Math.max(0,Math.min(255,parseInt(match[i])));color+=ColorStyleSubject.toColorPart(part);}
return color;}
if(match=ColorStyleSubject.parseColor.hexRe.exec(string)){if(match[1].length==3){for(var i=0;i<3;i++){color+=match[1].charAt(i)+match[1].charAt(i);}
return color;}
return'#'+match[1];}
return false;}
ColorStyleSubject.toColorPart=function(number){if(number>255)number=255;var digits=number.toString(16);if(number<16)return'0'+digits;return digits;}
ColorStyleSubject.parseColor.rgbRe=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;ColorStyleSubject.parseColor.hexRe=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function DiscreteStyleSubject(els,property,from,to,threshold){this.els=Animator.makeArray(els);this.property=Animator.camelize(property);this.from=from;this.to=to;this.threshold=threshold||0.5;}
DiscreteStyleSubject.prototype={setState:function(state){var j=0;for(var i=0;i<this.els.length;i++){this.els[i].style[this.property]=state<=this.threshold?this.from:this.to;}},inspect:function(){return"\t"+this.property+"("+this.from+" to "+this.to+" @ "+this.threshold+")\n";}}
function CSSStyleSubject(els,style1,style2){els=Animator.makeArray(els);this.subjects=[];if(els.length==0)return;var prop,toStyle,fromStyle;if(style2){fromStyle=this.parseStyle(style1,els[0]);toStyle=this.parseStyle(style2,els[0]);}else{toStyle=this.parseStyle(style1,els[0]);fromStyle={};for(prop in toStyle){fromStyle[prop]=CSSStyleSubject.getStyle(els[0],prop);}}
var prop;for(prop in fromStyle){if(fromStyle[prop]==toStyle[prop]){delete fromStyle[prop];delete toStyle[prop];}}
var prop,units,match,type,from,to;for(prop in fromStyle){var fromProp=String(fromStyle[prop]);var toProp=String(toStyle[prop]);if(toStyle[prop]==null){if(window.DEBUG)alert("No to style provided for '"+prop+'"');continue;}
if(from=ColorStyleSubject.parseColor(fromProp)){to=ColorStyleSubject.parseColor(toProp);type=ColorStyleSubject;}else if(fromProp.match(CSSStyleSubject.numericalRe)&&toProp.match(CSSStyleSubject.numericalRe)){from=parseFloat(fromProp);to=parseFloat(toProp);type=NumericalStyleSubject;match=CSSStyleSubject.numericalRe.exec(fromProp);var reResult=CSSStyleSubject.numericalRe.exec(toProp);if(match[1]!=null){units=match[1];}else if(reResult[1]!=null){units=reResult[1];}else{units=reResult;}}else if(fromProp.match(CSSStyleSubject.discreteRe)&&toProp.match(CSSStyleSubject.discreteRe)){from=fromProp;to=toProp;type=DiscreteStyleSubject;units=0;}else{if(window.DEBUG){alert("Unrecognised format for value of "
+prop+": '"+fromStyle[prop]+"'");}
continue;}
this.subjects[this.subjects.length]=new type(els,prop,from,to,units);}}
CSSStyleSubject.prototype={parseStyle:function(style,el){var rtn={};if(style.indexOf(":")!=-1){var styles=style.split(";");for(var i=0;i<styles.length;i++){var parts=CSSStyleSubject.ruleRe.exec(styles[i]);if(parts){rtn[parts[1]]=parts[2];}}}
else{var prop,value,oldClass;oldClass=el.className;el.className=style;for(var i=0;i<CSSStyleSubject.cssProperties.length;i++){prop=CSSStyleSubject.cssProperties[i];value=CSSStyleSubject.getStyle(el,prop);if(value!=null){rtn[prop]=value;}}
el.className=oldClass;}
return rtn;},setState:function(state){for(var i=0;i<this.subjects.length;i++){this.subjects[i].setState(state);}},inspect:function(){var str="";for(var i=0;i<this.subjects.length;i++){str+=this.subjects[i].inspect();}
return str;}}
CSSStyleSubject.getStyle=function(el,property){var style;if(document.defaultView&&document.defaultView.getComputedStyle){style=document.defaultView.getComputedStyle(el,"").getPropertyValue(property);if(style){return style;}}
property=Animator.camelize(property);if(el.currentStyle){style=el.currentStyle[property];}
return style||el.style[property]}
CSSStyleSubject.ruleRe=/^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;CSSStyleSubject.numericalRe=/^-?\d+(?:\.\d+)?(%|[a-zA-Z]{2})?$/;CSSStyleSubject.discreteRe=/^\w+$/;CSSStyleSubject.cssProperties=['azimuth','background','background-attachment','background-color','background-image','background-position','background-repeat','border-collapse','border-color','border-spacing','border-style','border-top','border-top-color','border-right-color','border-bottom-color','border-left-color','border-top-style','border-right-style','border-bottom-style','border-left-style','border-top-width','border-right-width','border-bottom-width','border-left-width','border-width','bottom','clear','clip','color','content','cursor','direction','display','elevation','empty-cells','css-float','font','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','height','left','letter-spacing','line-height','list-style','list-style-image','list-style-position','list-style-type','margin','margin-top','margin-right','margin-bottom','margin-left','max-height','max-width','min-height','min-width','orphans','outline','outline-color','outline-style','outline-width','overflow','padding','padding-top','padding-right','padding-bottom','padding-left','pause','position','right','size','table-layout','text-align','text-decoration','text-indent','text-shadow','text-transform','top','vertical-align','visibility','white-space','width','word-spacing','z-index','opacity','outline-offset','overflow-x','overflow-y'];function AnimatorChain(animators,options){this.animators=animators;this.setOptions(options);for(var i=0;i<this.animators.length;i++){this.listenTo(this.animators[i]);}
this.forwards=false;this.current=0;}
AnimatorChain.prototype={setOptions:function(options){this.options=Animator.applyDefaults({resetOnPlay:true},options);},play:function(){this.forwards=true;this.current=-1;if(this.options.resetOnPlay){for(var i=0;i<this.animators.length;i++){this.animators[i].jumpTo(0);}}
this.advance();},reverse:function(){this.forwards=false;this.current=this.animators.length;if(this.options.resetOnPlay){for(var i=0;i<this.animators.length;i++){this.animators[i].jumpTo(1);}}
this.advance();},toggle:function(){if(this.forwards){this.seekTo(0);}else{this.seekTo(1);}},listenTo:function(animator){var oldOnComplete=animator.options.onComplete;var _this=this;animator.options.onComplete=function(){if(oldOnComplete)oldOnComplete.call(animator);_this.advance();}},advance:function(){if(this.forwards){if(this.animators[this.current+1]==null)return;this.current++;this.animators[this.current].play();}else{if(this.animators[this.current-1]==null)return;this.current--;this.animators[this.current].reverse();}},seekTo:function(target){if(target<=0){this.forwards=false;this.animators[this.current].seekTo(0);}else{this.forwards=true;this.animators[this.current].seekTo(1);}}}
function Accordion(options){this.setOptions(options);var selected=this.options.initialSection,current;if(this.options.rememberance){current=document.location.hash.substring(1);}
this.rememberanceTexts=[];this.ans=[];var _this=this;for(var i=0;i<this.options.sections.length;i++){var el=this.options.sections[i];var an=new Animator(this.options.animatorOptions);var from=this.options.from+(this.options.shift*i);var to=this.options.to+(this.options.shift*i);an.addSubject(new NumericalStyleSubject(el,this.options.property,from,to,this.options.units));an.jumpTo(0);var activator=this.options.getActivator(el);activator.index=i;activator.onclick=function(){_this.show(this.index)};this.ans[this.ans.length]=an;this.rememberanceTexts[i]=activator.innerHTML.replace(/\s/g,"");if(this.rememberanceTexts[i]===current){selected=i;}}
this.show(selected);}
Accordion.prototype={setOptions:function(options){this.options=Object.extend({sections:null,getActivator:function(el){return document.getElementById(el.getAttribute("activator"))},shift:0,initialSection:0,rememberance:true,animatorOptions:{}},options||{});},show:function(section){for(var i=0;i<this.ans.length;i++){this.ans[i].seekTo(i>section?1:0);}
if(this.options.rememberance){document.location.hash=this.rememberanceTexts[section];}}}
var Cookies=Class.create({initialize:function(path,domain){this.path=path||'/';this.domain=domain||null;},set:function(key,value,days){if(typeof key!='string'){throw"Invalid key";}
if(typeof value!='string'&&typeof value!='number'){throw"Invalid value";}
if(days&&typeof days!='number'){throw"Invalid expiration time";}
var setValue=key+'='+escape(new String(value));if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var setExpiration="; expires="+date.toGMTString();}else var setExpiration="";var setPath='; path='+escape(this.path);var setDomain=(this.domain)?'; domain='+escape(this.domain):'';var cookieString=setValue+setExpiration+setPath+setDomain;document.cookie=cookieString;},get:function(key){var keyEquals=key+"=";var value=false;document.cookie.split(';').invoke('strip').each(function(s){if(s.startsWith(keyEquals)){value=unescape(s.substring(keyEquals.length,s.length));throw $break;}});return value;},clear:function(key){this.set(key,'',-1);},clearAll:function(){document.cookie.split(';').collect(function(s){return s.split('=').first().strip();}).each(function(key){this.clear(key);}.bind(this));}});var JsonCookies=Class.create(Cookies,{});JsonCookies.addMethods({set:function($super,key,value,days){switch(typeof value){case'undefined':case'function':case'unknown':throw"Invalid value type";break;case'boolean':case'string':case'number':value=String(value.toString());break;}
$super(key,Object.toJSON(value),days);},get:function($super,key){var value=$super(key);return(value)?value.evalJSON():false;}});
var window_loaded={'window_contact':false,'window_conn':false};var chat_list=new Array();var chat_notice_list=new Array();var login_list=new Hash();var photo_list=new Array();var photo_url=new Hash();var current_window=null;var conn_data=null;var current_status=null;var user_id='';var login='unknown';var msg_lastid='0';var max_chat=5;var need_auth=false;var abo=0;var cookie=new JsonCookies();var pollmax=15;var pollmin=4;var polldelay=15;var msg='<a href="/rencontre/recherche.php?mode=ficheid&idfiche=#{id}">#{login}</a> ';var mail='<a href="/rencontre/recherche.php?mode=ficheid&idfiche=#{id}"><img src="/contact/img/enveloppe.gif" title="Laisser un message" border=0></a> ';var chat='<a href="#" onclick="new_chat(#{id},\'#{login}\',\'create\'); window_switch(\'window_chat#{id}\'); return false;"><img src="/contact/img/chat.gif" title="Démarrer une conversation" border=0></a> ';var contact='<a href="#" onclick="addcontact(#{id});"><img src="/contact/img/carnet.gif" title="Ajouter à votre carnet d\'adresse" border=0></a>';var sexe='<img src="/contact/img/#{sexe}.gif" alt="#{sexe}"> ';var age='#{age} ';var ville='#{ville} ';var status='Vous êtes actuellement : #{txt_status}<p>'
+'<a class="status" href="#" onclick="set_status(\'#{tok_status1}\');">Passer en mode : #{txt_status1}</a><br>'
+'<a class="status" href="#" onclick="set_status(\'#{tok_status2}\');">Passer en mode : #{txt_status2}</a></p>';var statusAbo='Vous êtes actuellement : En-ligne<p>'
+'Les abonnés peuvent changer leur statut en \'hors ligne\' ou \'en ligne (contacts)\'.<p>'
+'<a href="/paiement/services.php">Cliquez-ici</a> pour découvrir nos offres d\'abonnement.';var chatWindow='<div class="window window_chat hidden" id="window_chat#{id}">\n'
+'<div class="window_title">'
+'<div class="photo_div">'
+'<img id="photo_chat#{id}" border="0" class="photo_img" src="/rencontre/img/photoFemme.jpg">'
+'</div>'
+'<div class="window_chat_title">Conversation avec #{login}</div></div>\n'
+'<div id="chat#{id}_content" class="window_chat_content"></div>\n'
+'<div class="window_chat_input">'
+'<form name="chat#{id}" onsubmit="sendmsg(#{id},$(\'chat#{id}_input\').value); $(\'chat#{id}_input\').value = \'\'; return false;">'
+'<img class="chat_icon" src="/contact/img/comments.png"> <input id="chat#{id}_input" type="text" class="chat_input" name="chat157722_input">'
+'</div></div>\n';var chatAbo='<div class="window window_chat hidden" id="window_chat#{id}">\n'
+'<div class="window_title">Conversation avec #{login}</div>\n'
+'<div id="chat#{id}_content" class="window_chat_content" style="padding: 8px;">'
+'L\'initiation de conversations privées est réservée aux abonnés.<br><br> <a href="/paiement/services.php">Cliquez-ici</a> pour découvrir nos'
+' offres d\'abonnement.';+'</div>\n'
+'</div></div>\n';var chatmsg='<div class="#{way}_row">\n'
+'<div class="timestamp">#{time}</div>\n'
+'#{who}\n'
+'</div>\n'
+'<div class="message_#{way}" style="background-color:%textbackgroundcolor{0.75}%;">\n'
+'#{msg}<br />\n'
+'</div>';var chatButton='<div class="button_right" id="button_chat#{id}">#{login} <img id="close_chat#{id}" src="/contact/img/close.png" alt="fermer"></div>\n';var chatNoticeTemplate=new Template('<div id="window_chat_notice#{id}" class="window window_chat_notice">'+
'<div class="window_what_notice_title">  <img style="float: right" id="close_notice#{id}" src="/contact/img/close.png" alt="fermer"></div>'+
'<div class="window_chat_notice_content">'+
'<div class="photo_div">'+
'<img id="photo#{id}" border="0" class="photo_img" src="/rencontre/img/photoFemme.jpg">'+
'</div>'+
'<div style="padding-left: 60px;"><b>#{login}</b> souhaite commencer une discussion avec vous.</div>Cliquez sur cette fenêtre pour discuter avec elle/lui.'+
'</div></div>');var connTemplate=new Template(msg+age+sexe+ville+mail+contact+chat);var visibleTemplate=new Template(msg+mail+chat);var invisibleTemplate=new Template(msg+mail);var statusTemplate=new Template(status);var statusAboTemplate=new Template(statusAbo);var chatTemplate=new Template(chatmsg);var chatWindowTemplate=new Template(chatWindow);var chatAboTemplate=new Template(chatAbo);var chatButtonTemplate=new Template(chatButton);var button_window_template=new Template('<div id="button_#{name}" class="button_#{position} #{class}">#{caption}</div>');var button_link_template=new Template('<div id="button_#{name}" class="button_#{position} #{class}">#{caption}</div>');var tooltip_template=new Template('<div id="tooltip_#{name}" class="tooltip">#{tooltip}</div>');var myButtons=[{'type':'window','position':'left','name':'contact','caption':"Vos contacts"},{'type':'window','position':'left','name':'conn','caption':"Membres en ligne"},{'type':'link','position':'left','name':'carnet','caption':'<img src="/contact/img/book_open.png" alt="Carnet d\'adresses">','link':"window.location='/rencontre/recherche.php?mode=carnet';",'tooltip':'Carnet d\'adresses'},{'type':'link','position':'left','name':'message','caption':'<img src="/contact/img/email.png" alt="Messagerie">','link':"window.location='/rencontre/recherche.php?mode=lecture';",'tooltip':'Messagerie'},{'type':'link','position':'left','name':'ovb','caption':'<img src="/contact/img/calendar.png" alt="Sorties">','link':"window.location='/sortir/index.php';",'tooltip':'Sorties'},{'type':'link','position':'left','name':'chat','caption':'<img src="/contact/img/user_comment.png" alt="Chat">','link':"window.open('/chat2/fenetre.php','chat2','width=760,height=600,resizable=yes,scrollbars=no,menubar=no,toolbar=no,location=no,directories=no');",'tooltip':'Lancer le chat'},{'type':'window','position':'right','name':'help','caption':'<img src="/contact/img/help.png" alt="Aide">'},{'type':'window','position':'right','name':'status','caption':'Chargement...','class':'loading'}];var connectButtons=[{'type':'window','position':'left','name':'connect','caption':"Connectez-vous !"},{'type':'link','position':'left','name':'or','caption':'ou','link':""},{'type':'link','position':'left','name':'register','caption':'Inscrivez-vous gratuitement','link':"window.location='/gestion/inscriptionv2.php';"}];function make_bar(){var scroll_right_button='<div class="button_right" id="button_scroll_right">&gt;</div>';var scroll_left_button='<div class="button_right" id="button_scroll_left" >&lt;</div>';var chatbar='<div id="chat_bar"></div>';myButtons.each(function(button){add_button(button);});$('contact_bar').insert(chatbar);}
function add_button(button){switch(button['type']){case'window':$('contact_bar').insert(button_window_template.evaluate(button));Event.observe('button_'+button['name'],'click',function(event){window_switch('window_'+button['name']);});break;case'link':$('contact_bar').insert(button_link_template.evaluate(button));$('contact_bar').insert(tooltip_template.evaluate(button));Event.observe('button_'+button['name'],'click',function(event){eval(button['link']);});Event.observe('button_'+button['name'],'mouseover',function(event){tooltip_show('tooltip_'+button['name']);});Event.observe('button_'+button['name'],'mouseout',function(event){tooltip_hide('tooltip_'+button['name']);});break;default:}
Event.observe('button_'+button['name'],'mouseover',button_hover);Event.observe('button_'+button['name'],'mouseout',button_out);}
function scroll_chat_bar(dir){if(current_window!=null){window_switch(current_window);}
$('chat_bar').scrollLeft+=dir;window_redraw();}
function window_init(){Event.observe(window,'resize',window_redraw);make_bar();get_connect();chat_persist();window_redraw();setTimeout(pollmsg,3000);var ka=new PeriodicalExecuter(keepalive,80);var bl=new PeriodicalExecuter(blink,1);var cr=new PeriodicalExecuter(function(e){window_reload('window_contact');},180);}
var wl=new Event.observe(window,'load',window_init);function window_redraw(){$('window_conn').style.left=getElementX('button_conn')+"px";$('window_contact').style.left=getElementX('button_contact')+"px";$('window_status').style.left=getElementX('button_status')+$('button_status').getWidth()-$('window_status').getWidth()+"px";$('window_help').style.left=getElementX('button_help')+$('button_help').getWidth()-$('window_help').getWidth()+"px";$('tooltip_ovb').style.left=getElementX('button_ovb')+15+"px";$('tooltip_chat').style.left=getElementX('button_chat')+15+"px";$('tooltip_carnet').style.left=getElementX('button_carnet')+15+"px";$('tooltip_message').style.left=getElementX('button_message')+15+"px";if(need_auth==true){$('window_connect').style.left=getElementX('button_connect')+"px";}
chat_list.each(function(id){$('window_chat'+id).style.left=getElementX('button_chat'+id)+$('button_chat'+id).getWidth()-$('window_chat'+id).getWidth()+"px";});chat_notice_list.each(function(id){$('window_chat_notice'+id).style.left=getElementX('button_chat'+id)+$('button_chat'+id).getWidth()-$('window_chat_notice'+id).getWidth()+"px";});}
function window_switch(id){if(current_window!=null){$(current_window).addClassName("hidden");if(id==current_window){current_window=null;return true;}}
$(id).removeClassName('hidden');current_window=id;window_load(id);return true;}
function window_reload(id){if(window_loaded[id]==false){return 1;}
switch(id){case'window_contact':$('visible').addClassName('loading');$('visible').update("Chargement en cours...");$('invisible').addClassName('loading');$('invisible').update("Chargement en cours...");window_loaded[id]=false;window_load(id);break;case'window_conn':$('conn_list').addClassName('loading');$('conn_list').update("Chargement en cours...");window_loaded[id]=false;window_load(id);break;default:return 0;}}
function window_load(id){if(window_loaded[id]==true){return 1;}
switch(id){case'window_contact':var req=new Ajax.Request('/contact/services.php?service=contacts',{method:'get',requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']=='contacts'){var html='';json['data']['visible'].each(function(line){html+=visibleTemplate.evaluate(line)+"<br>";});if(html!=''){$('visible').removeClassName('loading');$('visible').update(html);}else{$('visible').update("Pas de contacts visibles");}
html='';json['data']['invisible'].each(function(line){html+=invisibleTemplate.evaluate(line)+"<br>";});$('invisible').removeClassName('loading');$('invisible').update(html);}}});break;case'window_conn':$('quicksearch_who').selectedIndex=0;$('quicksearch_where').selectedIndex=0;$('quicksearch_age').selectedIndex=0;if(abo==0){$('quicksearch_who').disabled=true;$('quicksearch_where').disabled=true;$('quicksearch_age').disabled=true;$('quicksearch').insert(tooltip_template.evaluate({name:'form',tooltip:"Les fonctions de tri sont réservées aux abonnés"}));Event.observe('quicksearch','mouseover',function(event){tooltip_show('tooltip_form');});Event.observe('quicksearch','mouseout',function(event){tooltip_hide('tooltip_form');});$('tooltip_form').style.left=getElementX('button_conn')+1+"px";$('tooltip_form').style.bottom="460px";}
var req=new Ajax.Request('/contact/services.php?service=conn',{method:'get',requestHeaders:{Accept:'application/json'},onSuccess:function(transport){conn_data=transport.responseText.evalJSON(true);if(conn_data['message']=='conn'){var html='';conn_data['data'].each(function(line){html+=connTemplate.evaluate(line)+"<br>";});if(html!=''){$('conn_list').removeClassName('loading');$('conn_list').update(html);}else{$('conn_list').update("Pas de personnes visibles");}}}});break;default:return 0;}
window_loaded[id]=true;return 1;}
function update_conn(){if((window_loaded['windows_conn']==false)||(conn_data==null)){return 0;}
var who=$('quicksearch_who').options[$('quicksearch_who').selectedIndex].value;var where=parseInt($('quicksearch_where').options[$('quicksearch_where').selectedIndex].value);var age=$('quicksearch_age').options[$('quicksearch_age').selectedIndex].value;var data1=new Array();var data2=new Array();var data3=new Array();switch(who){case'1':conn_data['data'].each(function(line){if(line['sexe']=='homme'){data1.push(line);}});break;case'2':conn_data['data'].each(function(line){if(line['sexe']=='femme'){data1.push(line);}});break;case'3':default:data1=conn_data['data'];}
switch(age){case'1':data1.each(function(line){if(line['age']<=30){data2.push(line);}});break;case'2':data1.each(function(line){if((line['age']>=30)&&(line['age']<=40)){data2.push(line);}});break;case'3':data1.each(function(line){if((line['age']>=40)&&(line['age']<=50)){data2.push(line);}});break;case'4':data1.each(function(line){if((line['age']>=50)&&(line['age']<=60)){data2.push(line);}});break;case'5':data1.each(function(line){if(line['age']>=60){data2.push(line);}});break;default:data2=data1;}
if(where>100){var region=where-100;data2.each(function(line){if(line['region']==region){data3.push(line);}});}else if(where>0){var country=where;data2.each(function(line){if(line['pays']==country){data3.push(line);}});}else{data3=data2;}
var html='';data3.each(function(line){html+=connTemplate.evaluate(line)+"<br>";});if(html!=''){$('conn_list').update(html);}else{$('conn_list').update("Pas de résultat");}}
function addcontact(id){var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'addcontact','id':id},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']!='OK'){}else{window_reload('window_contact');}}});}
function get_connect(){var req=new Ajax.Request('/contact/services.php?service=connect',{method:'get',requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']=='OK'){current_status=json['status'];login=json['login'];user_id=json['user_id'];abo=json['abo'];update_status(current_status);}else if(json['message']=='NEED_AUTH'){need_auth=true;connectButtons.each(function(button){add_button(button);});$('button_status').update("Statut");$('window_status_content').update("Connectez-vous et modifier votre statut");$('visible').update('Connectez-vous pour afficher vos contacts');$('invisible').update('Connectez-vous pour afficher vos contacts');$('conn_list').update('Connectez-vous pour découvrir la liste des membres en ligne');window_redraw();}else{}}});}
function update_status(status){var txt_status;var tok_status1;var tok_status2;var txt_status1;var txt_status2;var img_status;if(status=='visible'){txt_status='En ligne';img_status='<img src="/contact/img/status_online.png" alt="">';tok_status1='visible_contact';txt_status1='En ligne (contact)';tok_status2='invisible';txt_status2='Hors ligne';}else if(status=='invisible'){txt_status='Hors ligne';img_status='<img src="/contact/img/status_offline.png" alt="">';tok_status1='visible';txt_status1='En ligne';tok_status2='visible_contact';txt_status2='En ligne (contact)';}else if(status=='visible_contact'){txt_status='En ligne (contact)';img_status='<img src="/contact/img/status_busy.png" alt="">';tok_status1='visible';txt_status1='En ligne';tok_status2='invisible';txt_status2='Hors ligne';}
$('button_status').removeClassName('loading');$('button_status').update(img_status+" "+txt_status);var param={'txt_status':txt_status,'tok_status1':tok_status1,'txt_status1':txt_status1,'tok_status2':tok_status2,'txt_status2':txt_status2};if(abo==1){$('window_status_content').update(statusTemplate.evaluate(param));}else{$('window_status_content').update(statusAboTemplate.evaluate(param));}}
function set_status(new_status){var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'setstatus','status':new_status},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']!='NEED_AUTH'){current_status=json['message'];update_status(current_status);window_redraw();}}});}
function sendmsg(id,msg){if(current_status=='invisible'){msg="Vous êtes actuellement en mode hors ligne, ce message ne peut être remis.";var chat_content='chat'+id+'_content';$(chat_content).update($(chat_content).innerHTML+chatTemplate.evaluate({'who':login,'msg':msg,'way':'outgoing','time':get_time()}));$(chat_content).scrollTop=$(chat_content).scrollHeight-$(chat_content).style.height;return 1;}
if(msg.length>180){msg=msg.substr(0,180);}
var fmsg=filtre_smilies(msg);var chat_content='chat'+id+'_content';$(chat_content).update($(chat_content).innerHTML+chatTemplate.evaluate({'who':login,'msg':fmsg,'way':'outgoing','time':get_time()}));$(chat_content).scrollTop=$(chat_content).scrollHeight-$(chat_content).style.height;sendmsg_service(id,msg);}
function sendmsg_service(id,msg){var req=new Ajax.Request('/contact/services.php',{method:'post',parameters:{'service':'sendmsg','dest':id,'msg':msg},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']=='BLACKLIST'){msg="Cette personne ne souhaite plus recevoir de messages de votre part.";var chat_content='chat'+id+'_content';$(chat_content).update($(chat_content).innerHTML+chatTemplate.evaluate({'who':'administrateur','msg':msg,'way':'incoming','time':get_time()}));$(chat_content).scrollTop=$(chat_content).scrollHeight-$(chat_content).style.height;}else if(json['message']=='BLACKLIST_BY_YOU'){msg="Vous avez mis cette personne en liste noire, vous ne pouvez plus discuter avec elle.";var chat_content='chat'+id+'_content';$(chat_content).update($(chat_content).innerHTML+chatTemplate.evaluate({'who':'administrateur','msg':msg,'way':'incoming','time':get_time()}));$(chat_content).scrollTop=$(chat_content).scrollHeight-$(chat_content).style.height;}}});}
function pollmsg(){if(current_status=='invisible'){return 0;}
var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'pollmsg','lastid':msg_lastid,ts:unix_timestamp()},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']!='NO_MSG'){json['data'].each(function(line){if(line['auteur']==user_id){var chatid=line['dest'];}else{var chatid=line['auteur'];}
if(line['id']>msg_lastid){msg_lastid=line['id'];}
if(chat_list.indexOf(parseInt(chatid))==-1){new_chat(chatid,"...","receive");}
var chat_content='chat'+chatid+'_content';var way='incoming';if(chatid==user_id){way='outgoing';}
$(chat_content).update($(chat_content).innerHTML+chatTemplate.evaluate({'who':login_list.get(chatid),'msg':filtre_smilies(line['message']),'way':way,'time':line['time']}));$(chat_content).scrollTop=$(chat_content).scrollHeight-$(chat_content).style.height;if(current_window!='window_chat'+chatid){blink_start('button_chat'+chatid);}
polldelay=pollmin;setTimeout(pollmsg,polldelay*1000);});}else{if(polldelay<pollmax){polldelay+=2;}
if(polldelay>pollmax){polldelay=pollmax;}
setTimeout(pollmsg,polldelay*1000);}}});}
function new_chat(id,login,mode){if(chat_list.indexOf(parseInt(id))!=-1){return false;}
if(chat_list.length>=max_chat){if(mode=='receive'){sendmsg_service(id,"Le destinataire a atteint le nombre maximal de conversations, votre message n'a pas pu être remis.");}else{alert("Vous avez atteint le nombre maximal de conversations.");}
return false;}
chat_list.push(parseInt(id));cookie.set('contactlist',chat_list);login_list.set(id,login);if((mode=='create')&&(abo==0)){Element.insert('contact_bar',chatAboTemplate.evaluate({'id':id,'login':login}));Element.insert('chat_bar',chatButtonTemplate.evaluate({'id':id,'login':login}));}else if(login!='...'){Element.insert('contact_bar',chatWindowTemplate.evaluate({'id':id,'login':login}));Element.insert('chat_bar',chatButtonTemplate.evaluate({'id':id,'login':login}));}else{Element.insert('contact_bar',chatWindowTemplate.evaluate({'id':id,'login':'<span id="window_chat'+id+'_login" class="loading">chargement...</span>'}));Element.insert('chat_bar',chatButtonTemplate.evaluate({'id':id,'login':'<span id="button_chat'+id+'_login" class="loading">chargement...</span>'}));var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'getlogin','id':id},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']=='OK'){$('window_chat'+id+'_login').update(json['login']);$('window_chat'+id+'_login').removeClassName('loading');$('button_chat'+id+'_login').update(json['login']);$('button_chat'+id+'_login').removeClassName('loading');$('window_chat_notice'+id+'_login').update(json['login']);$('window_chat_notice'+id+'_login').removeClassName('loading');login_list.set(id,json['login']);window_redraw();}}});}
get_photo(id);if(mode=='receive'){var mylogin=login;if(login=='...'){mylogin='<span id="window_chat_notice'+id+'_login" class="loading">...</span>';}
Element.insert('chat_bar',chatNoticeTemplate.evaluate({'id':id,'login':mylogin}));chat_notice_list.push(parseInt(id));var anim=new Animator({duration:1500})
.addSubject(new NumericalStyleSubject($('window_chat_notice'+id),'bottom',-130,21))
.addSubject(new NumericalStyleSubject($('window_chat_notice'+id),'opacity',0,1));anim.toggle();Event.observe('close_notice'+id,'click',function(event){close_notice(id,event);});Event.observe('window_chat_notice'+id,'click',function(event){close_notice(id,event);blink_stop('button_chat'+id);window_switch('window_chat'+id);});}
Event.observe('button_chat'+id,'mouseover',button_hover);Event.observe('button_chat'+id,'mouseout',button_out);Event.observe('button_chat'+id,'click',function(event){blink_stop('button_chat'+id);window_switch('window_chat'+id);});Event.observe('close_chat'+id,'click',function(event){blink_stop('button_chat'+id);close_chat(id,event);});window_redraw();}
function get_photo(id){if(photo_list.indexOf(parseInt(id))!=-1){img_preload(id);return;}
var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'getphoto','id':id},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']=='PHOTO'){photo_list.push(parseInt(id));photo_url.set(parseInt(id),json['data']);img_preload(id);}}});}
function img_preload(id){var img=new Image();img.onload=function(){if($('photo'+id)){$('photo'+id).src=img.src;clip_img_id('photo'+id,50);}
if($('photo_chat'+id)){$('photo_chat'+id).src=img.src;clip_img_id('photo_chat'+id,50);}};img.src=photo_url.get(parseInt(id));}
function clip_img_id(id,dim){var img=$(id);if(img.naturalHeight){h=img.naturalHeight;w=img.naturalWidth;}else{lgi=new Image();lgi.src=img.src;h=lgi.height;w=lgi.width}
if(h<w){new_h=dim;new_w=Math.round(dim*w/h);l=-Math.round((new_w-dim)/2);t=0;}else{new_w=dim;new_h=Math.round(dim*h/w);t=-Math.round((new_h-dim)/2);l=0;}
img.style.width=new_w+"px";img.style.height=new_h+"px";img.style.top=t+"px";img.style.left=l+"px";}
function close_notice(id,ev){Event.stop(ev);$('close_notice'+id).stopObserving();$('window_chat_notice'+id).stopObserving();chat_notice_list=chat_notice_list.without(parseInt(id));var anim=new Animator({duration:800,onComplete:function(){$('window_chat_notice'+id).remove();}})
.addSubject(new NumericalStyleSubject($('window_chat_notice'+id),'bottom',21,-130))
.addSubject(new NumericalStyleSubject($('window_chat_notice'+id),'opacity',1,0));anim.toggle();}
function close_chat(id,ev){if(chat_list.indexOf(parseInt(id))==-1){return false;}
Event.stop(ev);if(current_window=='window_chat'+id){current_window=null;}
chat_list=chat_list.without(parseInt(id));cookie.set('contactlist',chat_list);$('button_chat'+id).stopObserving();$('window_chat'+id).remove();$('button_chat'+id).remove();}
function chat_persist(){var create_list=cookie.get('contactlist');if(create_list){create_list.each(function(id){new_chat(id,"...","persist");});}}
var blink_state=0;var blink_list=new Array();var blink_save=new Hash();function blink_start(id){if(blink_list.indexOf(id)!=-1){return 1;}
blink_save.set(id,$(id).style.backgroundColor);blink_list.push(id);}
function blink_stop(id){if(blink_list.indexOf(id)!=-1){blink_list=blink_list.without(id);$(id).style.backgroundColor=blink_save.get(id);blink_save.unset(id);}}
function blink(){blink_state=1-blink_state;if(blink_state==1){blink_list.each(function(id){new Animator().addSubject(new ColorStyleSubject($(id),'background-color',"#EEEEEE","#ffa1be")).toggle();});}else{blink_list.each(function(id){new Animator().addSubject(new ColorStyleSubject($(id),'background-color',"#ffa1be","#EEEEEE")).toggle();});}}
function keepalive(){var req=new Ajax.Request('/contact/services.php',{method:'get',parameters:{'service':'keepalive'},requestHeaders:{Accept:'application/json'},onSuccess:function(transport){var json=transport.responseText.evalJSON(true);if(json['message']!='OK'){}}});}
function tooltip_show(id){$(id).style.display='block';}
function tooltip_hide(id){$(id).style.display='none';}
function button_hover(id){this.addClassName('button_hover');}
function button_out(id){this.removeClassName('button_hover');}
function get_time(){var d=new Date()
return d.getHours().toPaddedString(2)+':'+d.getMinutes().toPaddedString(2);}
function unix_timestamp(){return new Date().getTime().toString().substring(0,10);}
function getElementY(id){var element=$(id);var targetTop=0;if(element.offsetParent){while(element.offsetParent){targetTop+=element.offsetTop;element=element.offsetParent;}}else if(element.y){targetTop+=element.y;}
return targetTop;}
function getElementX(id){var element=$(id);var targetLeft=0;if(element.offsetParent){while(element){targetLeft+=element.offsetLeft;element=element.offsetParent;}}else if(element.x){targetLeft+=element.x;}
return targetLeft;}
function getWindowWidth(){var myWidth=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){myWidth=document.documentElement.clientWidth;}else if(document.body&&document.body.clientWidth){myWidth=document.body.clientWidth;}
return myWidth;}
function debug(msg){$('debug').insert(msg+"<br>");}
var tab_smileys=new Array({'regexp':':-\\)','url':'/images/smilies/smile.gif'},{'regexp':':-[\\(<]','url':'/images/smilies/frown.gif'},{'regexp':':-[Oo0]','url':'/images/smilies/redface.gif'},{'regexp':':-D','url':'/images/smilies/biggrin.gif'},{'regexp':';-\\)','url':'/images/smilies/wink.gif'},{'regexp':':-[pP]','url':'/images/smilies/tongue.gif'},{'regexp':':\\?\\?:','url':'/images/smilies/confused.gif'},{'regexp':':cool:','url':'/images/smilies/cool.gif'},{'regexp':':sarc:','url':'/images/smilies/rolleyes.gif'},{'regexp':':fou:','url':'/images/smilies/mad.gif'},{'regexp':':eek:','url':'/images/smilies/eek.gif'},{'regexp':':lol:','url':'/images/smilies/laugh.gif'},{'regexp':':wahoo:','url':'/images/smilies/yawn.gif'},{'regexp':':crazy:','url':'/images/smilies/wobble.gif'},{'regexp':':hello:','url':'/images/smilies/wavey.gif'},{'regexp':':cry:','url':'/images/smilies/crying.gif'},{'regexp':':happy:','url':'/images/smilies/happy.gif'},{'regexp':':soleil:','url':'/images/smilies/sun.gif'},{'regexp':':love:','url':'/images/smilies/love.gif'},{'regexp':':sleep:','url':'/images/smilies/sleep.gif'},{'regexp':':sweat:','url':'/images/smilies/sweat.gif'},{'regexp':':bisous:','url':'/images/smilies/ladysman.gif'},{'regexp':':beer:','url':'/images/smilies/beerchug.gif'},{'regexp':':flame:','url':'/images/smilies/flamethrowingsmiley.gif'},{'regexp':':ange:','url':'/images/smilies/biggrinangelA.gif'},{'regexp':':laser:','url':'/images/smilies/laser_shot_jump.gif'},{'regexp':':non:','url':'/images/smilies/nono.gif'},{'regexp':':diable:','url':'/images/smilies/bat_angel.gif'},{'regexp':':rage:','url':'/images/smilies/rage.gif'},{'regexp':':amoureux:','url':'/images/smilies/amoureux.gif'},{'regexp':':amour:','url':'/images/smilies/amour.gif'},{'regexp':':bise:','url':'/images/smilies/bise.gif'},{'regexp':':hendrix:','url':'/images/smilies/hendrix.gif'},{'regexp':':walkman:','url':'/images/smilies/walkman.gif'},{'regexp':':marteau:','url':'/images/smilies/marteau.gif'},{'regexp':':pika:','url':'/images/smilies/pika.gif'},{'regexp':':mickey:','url':'/images/smilies/mickey.gif'},{'regexp':':darkvador:','url':'/images/smilies/darkvador.gif'},{'regexp':':enpleur:','url':'/images/smilies/enpleur.gif'},{'regexp':':concert:','url':'/images/smilies/concert.gif'},{'regexp':':ovni:','url':'/images/smilies/ovni.gif'},{'regexp':':ballon:','url':'/images/smilies/ballon.gif'},{'regexp':':tel:','url':'/images/smilies/tel.gif'},{'regexp':':coktail:','url':'/images/smilies/coktail.gif'},{'regexp':':glace:','url':'/images/smilies/glace.gif'},{'regexp':':popcorn:','url':'/images/smilies/popcorn.gif'},{'regexp':':noel:','url':'/images/smilies/noel.gif'},{'regexp':':anniversaire:','url':'/images/smilies/anniversaire.gif'},{'regexp':':tronconneuse:','url':'/images/smilies/tronconneuse.gif'},{'regexp':':combat:','url':'/images/smilies/combat.gif'},{'regexp':':coeur:','url':'/images/smilies/coeur.gif'},{'regexp':':respect:','url':'/images/smilies/respet.gif'},{'regexp':':gfaim:','url':'/images/smilies/manger.gif'},{'regexp':':bigbisous:','url':'/images/smilies/embrasse.gif'},{'regexp':':danse:','url':'/images/smilies/hug.gif'},{'regexp':':heart:','url':'/images/smilies/luxlove.gif'},{'regexp':':embrasse:','url':'/images/smilies/kotc.gif'},{'regexp':':amourbis:','url':'/images/smilies/smlove2.gif'},{'regexp':':bordage:','url':'/images/smilies/bordage.gif'},{'regexp':':kawa:','url':'/images/smilies/cafe.gif'},{'regexp':':rose:','url':'/images/smilies/fleur1.gif'},{'regexp':':maya:','url':'/images/smilies/abeille.gif'},{'regexp':':appl:','url':'/images/smilies/applause.gif'},{'regexp':':hehe:','url':'/images/smilies/hehe.gif'},{'regexp':':smoking:','url':'/images/smilies/smoking.gif'},{'regexp':':7n1:','url':'/images/smilies/7n1.png'},{'regexp':':7n2:','url':'/images/smilies/7n2.png'},{'regexp':':7n3:','url':'/images/smilies/7n3.png'},{'regexp':':7n4:','url':'/images/smilies/7n4.png'},{'regexp':':7n5:','url':'/images/smilies/7n5.png'},{'regexp':':7n6:','url':'/images/smilies/7n6.png'},{'regexp':':7n7:','url':'/images/smilies/7n7.png'},{'regexp':':bong:','url':'/images/smilies/bong.gif'},{'regexp':':betty:','url':'/images/smilies/betty.gif'},{'regexp':':hirond:','url':'/images/smilies/hirondelle.gif'},{'regexp':':squaw:','url':'/images/smilies/squaw.gif'},{'regexp':':tipi:','url':'/images/smilies/tipi.gif'},{'regexp':':arbez:','url':'/images/smilies/zebra.gif'},{'regexp':':citr:','url':'/images/smilies/citrouille.gif'},{'regexp':':lib:','url':'/images/smilies/libel.gif'},{'regexp':':loco:','url':'/images/smilies/train.gif'},{'regexp':':chatb:','url':'/images/smilies/chat_blanc.gif'},{'regexp':':zezebre:','url':'/images/smilies/zebre02.gif'},{'regexp':':tidino:','url':'/images/smilies/dino.gif'},{'regexp':':titedinote:','url':'/images/smilies/dino5.gif'},{'regexp':':speedy:','url':'/images/smilies/escargot.gif'},{'regexp':':prof:','url':'/images/smilies/ksket.gif'},{'regexp':':flash:','url':'/images/smilies/photo.gif'},{'regexp':':alien:','url':'/images/smilies/aa1.gif'},{'regexp':':divers:','url':'/images/smilies/aa2.gif'},{'regexp':':muzik:','url':'/images/smilies/aa3.gif'},{'regexp':':blbl:','url':'/images/smilies/aa4.gif'},{'regexp':':isotop:','url':'/images/smilies/aa5.gif'},{'regexp':':ocenco:','url':'/images/smilies/aa6.gif'},{'regexp':':wolf:','url':'/images/smilies/aa7.gif'},{'regexp':':chaton21:','url':'/images/smilies/bb1.gif'},{'regexp':':fleur:','url':'/images/smilies/fleur2.gif'},{'regexp':':grrr:','url':'/images/smilies/pdm.gif'},{'regexp':':oyeoye:','url':'/images/smilies/smileyAnnonce.gif'},{'regexp':':colere:','url':'/images/smilies/smileyColere.gif'},{'regexp':':geek:','url':'/images/smilies/smileyPC.gif'},{'regexp':':atable:','url':'/images/smilies/smileyRepas.gif'},{'regexp':':lbbye:','url':'/images/smilies/coucou.gif'},{'regexp':':74123:','url':'/images/smilies/wavy_gif.gif'},{'regexp':':grim:','url':'/images/smilies/grimace.gif'},{'regexp':':garf:','url':'/images/smilies/garf.gif'},{'regexp':':hihi:','url':'/images/smilies/hihi.gif'},{'regexp':':shine:','url':'/images/smilies/shine.gif'},{'regexp':':sssnake:','url':'/images/smilies/python.gif'},{'regexp':':yaah:','url':'/images/smilies/terroris.gif'},{'regexp':':banana:','url':'/images/smilies/bananeangel.gif'},{'regexp':':fifi:','url':'/images/smilies/ours.gif'},{'regexp':':walkingtux:','url':'/images/smilies/pinguin2_gif.gif'},{'regexp':':chief:','url':'/images/smilies/cuisto.gif'},{'regexp':':stop:','url':'/images/smilies/6263.gif'},{'regexp':':pfff:','url':'/images/smilies/626362.gif'},{'regexp':':ouin:','url':'/images/smilies/bebe.gif'},{'regexp':':ouf:','url':'/images/smilies/fou.gif'},{'regexp':':kask:','url':'/images/smilies/casque.gif'},{'regexp':':chagrinvert:','url':'/images/smilies/2007112901.gif'},{'regexp':':dolph:','url':'/images/smilies/2007112902.gif'},{'regexp':':flaplg:','url':'/images/smilies/2007112903.gif'},{'regexp':':ilestfou:','url':'/images/smilies/2007112904.gif'},{'regexp':':pompomg:','url':'/images/smilies/2007112905.gif'},{'regexp':':yestop:','url':'/images/smilies/2007112906.gif'},{'regexp':':silence:','url':'/images/smilies/2007112907.gif'},{'regexp':':blblbl:','url':'/images/smilies/2008011701.gif'},{'regexp':':chuttt:','url':'/images/smilies/2008011702.gif'},{'regexp':':diabolo:','url':'/images/smilies/2008011703.gif'},{'regexp':':habon:','url':'/images/smilies/2008011704.gif'},{'regexp':':mensonge:','url':'/images/smilies/2008011705.gif'},{'regexp':':oups:','url':'/images/smilies/2008011706.gif'},{'regexp':':papycanne:','url':'/images/smilies/2008011707.gif'},{'regexp':':rex:','url':'/images/smilies/2008011708.gif'},{'regexp':':teach:','url':'/images/smilies/2008011709.gif'});function filtre_smilies(txt){tab_smileys.each(function(line){var exp=line['regexp'];var url=line['url'];var re=new RegExp(exp,"i");txt=txt.replace(re,"<img alt='' src='"+url+"'>");});return txt;}
