// // MAIN JAVASCRIPT INCLUDE // var SESSION="PHPSESSID="; if(typeof getCookie == 'function' && getCookie('PHPSESSID')){ SESSION+=getCookie('PHPSESSID'); }else if(document.location.search.indexOf('PHPSESSID=')!=-1){ var start=document.location.search.indexOf('PHPSESSID=')+10; var end=document.location.search.indexOf('&',start); if(end==-1){ end=document.location.search.length; } else{ end-=start;} SESSION+=document.location.search.substr(start,end); } function initLinks(source){ var lnks=source.getElementsByTagName('a'); for(var i=0; i0) setTimeout('smoothScroll(0,'+y+')',200); } if(lnks[i].href.indexOf('#')>=1 && document.location.host==lnks[i].host && document.location.pathname!=lnks[i].pathname){ lnks[i].href=lnks[i].href.replace(/#/,'#ss'); } } } function clickMultimedia(e){ if(!this || !this.href){ return; } var p, ps, section, picid, xxx, autoplay; p=getParamFromQuerystring('p',this.href); if(!p){ p=getParamFromQuerystring('p',location.href); } if(!p){ ps=getParamFromQuerystring('ps',this.href); } if(!p && !ps){ ps=getParamFromQuerystring('ps',location.href); } if(!p && !ps && location.href.match(/\/rencontre-[a-zA-Z\-]*-[a-zA-Z0-9]*\.php/i)){ var start=location.href.lastIndexOf('-')+1; var end=location.href.lastIndexOf('.php'); var tmp=location.href.substring(start,end).toLowerCase().replace(/[^0-9a-z]/,''); if(tmp){ ps=tmp; } } if(!p && !ps && document.getElementById('results')){ var el=this; while(el.parentNode){ el=el.parentNode; if(el.className.match(/p[^a-zA-Z]/) && el.getAttribute('id').match(/p[0-9]+$/)){ break; } } if(el.getAttribute('id').match(/p[0-9]+$/)){ p=el.getAttribute('id').replace(/p/,''); } } if(this.className.indexOf('lnkpic')!=-1){ section='pics'; }else if(this.className.indexOf('lnkalb')!=-1){ section='pics'; if(this.firstChild && this.firstChild.getAttribute && this.firstChild.getAttribute('id')!=''){ picid=this.firstChild.getAttribute('id'); if(this.firstChild.className.indexOf('explicit')!=-1){ xxx=true; } } }else if(this.className.indexOf('lnkvox')!=-1){ section='vox'; if(this.className.indexOf('autoplay')!=-1){ autoplay=1; } }else if(this.className.indexOf('lnkvid')!=-1){ section='vid'; if(this.className.indexOf('autoplay')!=-1){ autoplay=1; } } if(p || ps){ cancelDefaultBehavior(e); var params='ie='+ie+'&ie9='+ie9+'&ieversion='+ieversion; if(SESSION){ params+='&'+SESSION; } if(p){ params+='&p='+p;} if(ps){ params+='&ps='+ps;} if(section){ params+='§ion='+section;} if(picid){ params+='&picid='+picid;} if(xxx){ params+='&xxx=1'; } if(autoplay){ params+='&autoplay=1'; } if(!self.callbackMultimedia){ include ('/inc/js/popmm.js'); } setTimeout('getMultimedia("'+params+'")',100); } } function getMultimedia(params){ // callbackMultimedia défini dans multimedia.js if(params.indexOf('xxx')!=-1){ if(!usrAllowsXXX(true)){ return; } } //XHRQuery('/inc/xml/multimedia.php','post',params,'xml',callbackMultimedia); XHRQuery('/inc/xml/popmm.php','post',params,'xml',callbackMultimedia); } function addFav(e){ if(!this){ location.href="/liste/favoris.php?"+SESSION; } var pseudo; if(this.getAttribute('title')){ pseudo=this.getAttribute('title') pseudo=pseudo.replace(/[^0-9a-z]/gi,''); } if(pseudo){ xml=XHRQuery('/inc/xml/addfav.php','post','&ps='+pseudo+'&'+SESSION,'xml','RETURN',true); var msg=xml.getElementsByTagName('msg'); if(msg[0]){ cancelDefaultBehavior(e); box=document.createElement('div'); createNodeTree(msg[0],box); var code=xml.getElementsByTagName('code'); popDHTML('popmsgcfm',box,450,'auto',true); if(typeof build_widget_fav!='undefined'){ build_widget_fav(); } return true; } } location.href="/liste/favoris.php?"+SESSION; } function addBkl(e){ if(!this){ location.href="/options/bkl.php?"+SESSION; } var pseudo; if(this.getAttribute('title')){ pseudo=this.getAttribute('title') pseudo=pseudo.replace(/[^0-9a-z]/gi,''); } if(pseudo){ xml=XHRQuery('/inc/xml/addbkl.php','post','&ps='+pseudo+'&'+SESSION,'xml','RETURN',true); var msg=xml.getElementsByTagName('msg'); if(msg[0]){ cancelDefaultBehavior(e); box=document.createElement('div'); createNodeTree(msg[0],box); popDHTML('popmsgcfm',box,450,'auto',true); if(typeof build_widget_fav!='undefined'){ build_widget_fav(); } return true; } } location.href="/options/bkl.php?"+SESSION; } function addAlb(e){ if(!this){ location.href="/profil/album.php?"+SESSION; } var pseudo; if(this.getAttribute('title')){ pseudo=this.getAttribute('title') pseudo=pseudo.replace(/[^0-9a-z]/gi,''); } if(pseudo){ xml=XHRQuery('/inc/xml/addalb.php','post','&ps='+pseudo+'&'+SESSION,'xml','RETURN',true); var msg=xml.getElementsByTagName('msg'); if(msg[0]){ cancelDefaultBehavior(e); box=document.createElement('div'); createNodeTree(msg[0],box); var code=xml.getElementsByTagName('code'); popDHTML('popmsgcfm',box,450,'auto',true); return true; } } location.href="/profil/album.php?"+SESSION; } function get_abo_avantages(e){ var url='/inc/xml/avantages.php'; if(SESSION){ url+='?'+SESSION; } xml=XHRQuery(url,'get','','xml','RETURN',true); if(xml){ cancelDefaultBehavior(e); var content=document.createElement('div'); createNodeTree(xml,content); popDHTML('pop_abo_avantages',content,767,382,true); } } function clickVideoFull(e){ if(!this || !this.href || this.href==''){ return; } cancelDefaultBehavior(e); popVideoFull(this.href); } function popVideoFull(lnk){ xml=XHRQuery(lnk+'&'+SESSION+'&xml=1&ie6='+ie6,'get','','xml','RETURN',true); if(xml){ var content=document.createElement('div'); try{ var xml_to_string = (new XMLSerializer()).serializeToString(xml); var explicit=0; if(xml_to_string.indexOf('xxx')!=-1){ explicit=1; } content.innerHTML=''+xml_to_string; }catch (e){ try{ var xml_to_string=String(xml.xml); content.innerHTML=xml_to_string; }catch (e){ createNodeTree(xml,content); } if(!document.getElementById('framepopb')){ var iframe=document.createElement('iframe'); iframe.setAttribute('id','framepopb'); iframe.setAttribute('frameborder','0'); iframe.setAttribute('src','/profil/pop_album_top.php?'+SESSION+'&explicit='+explicit); iframe.setAttribute('scrolling','no'); iframe.className='b728x90'; content.insertBefore(iframe, content.firstChild); } } if(typeof str_msg_videxplicit!='undefined'){ var divs=content.getElementsByTagName('div'); for(var i=0; i'); }else{ var content=document.createElement('iframe'); content.setAttribute('name','adn_trucs'); content.setAttribute('src','/adn/trucs.php?ps='+pseudo+'&pop&'+SESSION); content.setAttribute('width',"100%"); content.setAttribute('height',"100%"); content.setAttribute('frameBorder',0); content.setAttribute('scrolling','auto'); } popDHTML('pop_adn_truc',content,750,450,true); } } function getPhotoReplacement(pic){ replace=''; alt=''; if(pic.className.indexOf('picf')!=-1){ replace='300x250'; }else if(pic.className.indexOf('pict')!=-1){ replace='100x75'; }else if(pic.className.indexOf('picm')!=-1){ replace='42x31'; } if(replace!=''){ alt=pic.getAttribute('alt'); tmp=alt.indexOf(' - '); alt=alt.substr(tmp+3,alt.length).toLowerCase(); if(alt=='woman' || alt=='femme' || alt=='frau'){ replace='femme_'+replace; }else if(alt=='man' || alt=='homme' || alt=='mann'){ replace='homme_'+replace; }else if(alt=='couple woman/woman' || alt=='couple femme/femme' || alt=='paar frau/frau'){ replace='couple11_'+replace; }else if(alt=='couple man/man' || alt=='couple homme/homme' || alt=='paar mann/mann'){ replace='couple22_'+replace; }else if(alt.indexOf('couple')!=-1 || alt.indexOf('paar')!=-1){ replace='couple_'+replace; }else{ replace='default_'+replace; } replace='/img/nophoto/'+replace+'.jpg'; } return replace; } // CALLBACK POUR POPDHTML function initPopDHTMLContent(source){ initLinks(source); initDynamicTabs(source); fixAudio(source); initOverLabel(source); initHints(source); } function reposPhotoTrim(){ var $img = $(this); $img.parent().css({backgroundImage:'url("'+$img.attr('src')+'")'}); if($img.width()>$img.height()){ $img.parent().css({backgroundSize:'auto 100%'}); }else{ $img.parent().css({backgroundSize:'100% auto'}); } // console.log($img.attr('src')+'='+$img.width()+'>'+$img.height()); $img.hide(); } // Ajustements d'interface GENERAL function progEnhance(){ initLinks(document); initDynamicTabs(document); fixAudio(document); initOverLabel(document); initHints(document); initVideos(document); correctFooterPos(); // transformation des photos var imgs=document.getElementsByTagName('img'); for(var i=0; i