function file(fichier){if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else
return(false);xhr_object.open("GET",fichier,false);xhr_object.send(null);if(xhr_object.readyState==4)
return(xhr_object.responseText);else return(false);}
function file_quick(fichier){if(window.XMLHttpRequest)
xhr_object=new XMLHttpRequest();else if(window.ActiveXObject)
xhr_object=new ActiveXObject("Microsoft.XMLHTTP");else
return(false);xhr_object.open("GET",fichier,false);xhr_object.send(null);if(xhr_object.readyState==2)
return(xhr_object.responseText);else return(false);}
function checkEmail(email){if(email.search(/^[_a-z0-9-]+(\.[_a-z0-9-]*)*[^._-]@[a-z0-9-]+(\.[a-z0-9]{2,4})$/i)==-1){return false;}
else{return true;}}
function stats_fhg_click(lg,template,type_m,idm){error_in=file("http://media.acces-charme.com/galeries/click.php?lg="+escape(lg)+"&template="+escape(template)+"&type_m="+escape(type_m)+"&idm="+escape(idm)+"");}
function stats_pdv_click(idpdv){error_in=file("http://media.acces-charme.com/pdv/click.php?idpdv="+escape(idpdv)+"");}
function stats_pdv_click2(idpdv,url_pop){error_in=file("http://media.acces-charme.com/pdv/click.php?idpdv="+escape(idpdv)+"");popup2(url_pop);}
function stats_banniere_click(ide,ido){error_in=file_quick("http://media.acces-charme.com/bannieres/click.php?ide="+escape(ide)+"&ido="+escape(ido)+"");}
function verifFormAndSaveEmailDHTML(ide,ido,params){var error=0;var email_input=document.getElementById("email_dhtml").value;if((typeof(wnc_lang)=="undefined")||(wnc_lang=="")){wnc_lang="fr";}
if(!checkEmail(email_input)){error=1;msg="Champ EMAIL non valide !\n";if(wnc_lang=="fr"){msg="Veuillez entrer un EMAIL valide (ex : nom@fournisseur.com) !\n";}
else if(wnc_lang=="en"){msg="Please enter a valid EMAIL (ex : name@company.com) !\n";}
else if(wnc_lang=="es"){msg="Por favor entren un EMAIL valido (por ejemplo: apellido@proveedor.com) !\n";}}
if(error==0){error_in=file_quick("http://media.acces-charme.com/dhtml/click.php?ide="+escape(ide)+"&ido="+escape(ido)+"&email="+escape(email_input)+"&"+params);return true;}else{alert(msg);return false;}}
function verifFormAndSaveEmailPDV(params){var error=0;var email_input=document.getElementById("email").value;if((typeof(wnc_lang)=="undefined")||(wnc_lang=="")){wnc_lang="fr";}
if(!checkEmail(email_input)){error=1;msg="Champ EMAIL non valide !\n";if(wnc_lang=="fr"){msg="Veuillez entrer un EMAIL valide (ex : nom@fournisseur.com) !\n";}
else if(wnc_lang=="en"){msg="Please enter a valid EMAIL (ex : name@company.com) !\n";}
else if(wnc_lang=="es"){msg="Por favor entren un EMAIL valido (por ejemplo: apellido@proveedor.com) !\n";}}
if(error==0){error_in=file_quick("http://media.acces-charme.com/pdv/click.php?email="+escape(email_input)+"&"+params);return true;}else{alert(msg);return false;}}
function addbookmark(bookmarkurl,bookmarktitle){if(document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)}
function dhtml(p_url,p_id_pdv,p_width,p_height,p_classname,p_oklabel,p_buttonclass){Dialog.alert({url:"http://media.acces-charme.com/dhtml/track.php?"+p_url,options:{method:'get'}},{className:p_classname,width:p_width,height:p_height,okLabel:p_oklabel,buttonClass:p_buttonclass});if(p_id_pdv!=""){stats_pdv_click(p_id_pdv);}}
function dhtml_fhg(p_url,p_width,p_height,p_classname,p_oklabel,p_buttonclass,p_lang,p_template,p_type_m,p_idm){Dialog.alert({url:"http://media.acces-charme.com/dhtml/track.php?"+p_url,options:{method:'get'}},{className:p_classname,width:p_width,height:p_height,okLabel:p_oklabel,buttonClass:p_buttonclass});if(p_lang!=""&&p_template!=""&&p_type_m!=""&&p_idm!=""){stats_fhg_click(p_lang,p_template,p_type_m,p_idm);}}
function createPlayer(pid,pfile,pimg,id_pdv,width,height){var the_player="player"+pid;var the_payer_play="play"+pid;if(checkFlashVersion()==1){var msg='<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">';msg+='<img src="http://img.acces-charme.com/media/pdv/1/fr/images/flash.jpg" border="0" alt="Telecharger la derniere version de Flash Player" /></a>';document.getElementById(the_player).innerHTML=msg;}else{var s=new SWFObject("http://www.acces-charme.com/mods/mediaplayer/player.swf","mpl"+pid,width,height,"9","#FFFFFF");s.addParam("allowfullscreen","true");s.addParam("allowscriptaccess","always");s.addParam("wmode","transparent");s.addParam("flashvars","&streamer=lighttpd&bufferlength=5&autostart=true&controlbar=none&file="+pfile+"&image="+pimg);s.write(the_player);}
document.getElementById(the_payer_play).style.visibility='hidden';document.getElementById(the_payer_play).style.display='none';}
function checkFlashVersion(){var version=deconcept.SWFObjectUtil.getPlayerVersion();if(document.getElementById&&version["major"]<9){return"1";}else{return"0";}}
function popup(url,idpdv){var wnc_cook=wnc_get_cookie("wnc_pdv_"+idpdv);if((wnc_cook==null)||(wnc_cook=="")){var vnc_new_win=window.open(url,"","width="+screen.availWidth+",height="+screen.availHeight+",scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0");if(vnc_new_win){vnc_new_win.blur();window.self.focus();wnc_set_cookie("wnc_pdv_"+idpdv,"oui",0);}}}
function popup2(url){if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("MSIE 8")!=-1){var vnc_new_win=window.open(url,'_blank','width=1024, height=950 , toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');if(vnc_new_win!=null){vnc_new_win.blur();}}else{window.open(url,'_blank','width=1024, height=950 , toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');self.focus();}}
function popunder(url,idpdv){var wnc_cook=wnc_get_cookie("wnc_pdv_"+idpdv);if((wnc_cook==null)||(wnc_cook=="")){if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("MSIE 8")!=-1){var vnc_new_win=window.open(url,'_blank','width=1024, height=950 , toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');self.focus();if(vnc_new_win!=null){vnc_new_win.blur();wnc_set_cookie("wnc_pdv_"+idpdv,"oui",0);}}else{window.open(url,'_blank','width=1024, height=950 , toolbar=1, location=1, directories=1, status=1, scrollbars=1, resizable=1, copyhistory=1, menuBar=1');self.focus();wnc_set_cookie("wnc_pdv_"+idpdv,"oui",0);}}}
function plein_ecran(){if(navigator.userAgent.indexOf("Windows")!=-1&&navigator.userAgent.indexOf("Firefox")!=-1){return;}
window.moveTo(0,0);window.resizeTo(screen.availWidth,screen.availHeight);}
function wnc_set_cookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+";"+((expiredays=='')?"":"expires="+exdate.toGMTString()+";")+"path=/;";}
function wnc_get_cookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length;}
return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function wnc_addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}};if(!document.myGetElementsByClassName){document.myGetElementsByClassName=function(className){var children=document.getElementsByTagName('*')||document.all;var elements=new Array();for(var i=0;i<children.length;i++){var child=children[i];var classNames=child.className.split(' ');for(var j=0;j<classNames.length;j++){if(classNames[j]==className){elements.push(child);break;}}}
return elements;}}
var Reflection={defaultHeight:0.5,defaultOpacity:0.5,add:function(image,options){Reflection.remove(image);doptions={"height":Reflection.defaultHeight,"opacity":Reflection.defaultOpacity}
if(options){for(var i in doptions){if(!options[i]){options[i]=doptions[i];}}}else{options=doptions;}
try{var d=document.createElement('div');var p=image;var classes=p.className.split(' ');var newClasses='';for(j=0;j<classes.length;j++){if(classes[j]!="reflect"){if(newClasses){newClasses+=' '}
newClasses+=classes[j];}}
var reflectionHeight=Math.floor(p.height*options['height']);var divHeight=Math.floor(p.height*(1+options['height']));var reflectionWidth=p.width;if(document.all&&!window.opera){if(p.parentElement.tagName=='A'){var d=document.createElement('a');d.href=p.parentElement.href;}
d.className=newClasses;p.className='reflected';d.style.cssText=p.style.cssText;p.style.cssText='vertical-align: bottom';var reflection=document.createElement('img');reflection.src=p.src;reflection.style.width=reflectionWidth+'px';reflection.style.display='block';reflection.style.height=p.height+"px";reflection.style.marginBottom="-"+(p.height-reflectionHeight)+'px';reflection.style.filter='flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(options['opacity']*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(options['height']*100)+')';d.style.width=reflectionWidth+'px';d.style.height=divHeight+'px';p.parentNode.replaceChild(d,p);d.appendChild(p);d.appendChild(reflection);}else{var canvas=document.createElement('canvas');if(canvas.getContext){d.className=newClasses;p.className='reflected';d.style.cssText=p.style.cssText;p.style.cssText='vertical-align: bottom';var context=canvas.getContext("2d");canvas.style.height=reflectionHeight+'px';canvas.style.width=reflectionWidth+'px';canvas.height=reflectionHeight;canvas.width=reflectionWidth;d.style.width=reflectionWidth+'px';d.style.height=divHeight+'px';p.parentNode.replaceChild(d,p);d.appendChild(p);d.appendChild(canvas);context.save();context.translate(0,image.height-1);context.scale(1,-1);context.drawImage(image,0,0,reflectionWidth,image.height);context.restore();context.globalCompositeOperation="destination-out";var gradient=context.createLinearGradient(0,0,0,reflectionHeight);gradient.addColorStop(1,"rgba(255, 255, 255, 1.0)");gradient.addColorStop(0,"rgba(255, 255, 255, "+(1-options['opacity'])+")");context.fillStyle=gradient;context.rect(0,0,reflectionWidth,reflectionHeight*2);context.fill();}}}catch(e){}},remove:function(image){if(image.className=="reflected"){image.className=image.parentNode.className;image.parentNode.parentNode.replaceChild(image,image.parentNode);}}}
function addReflections(){var rimages=document.myGetElementsByClassName('reflect');for(i=0;i<rimages.length;i++){var rheight=null;var ropacity=null;var classes=rimages[i].className.split(' ');for(j=0;j<classes.length;j++){if(classes[j].indexOf("rheight")==0){var rheight=classes[j].substring(7)/100;}else if(classes[j].indexOf("ropacity")==0){var ropacity=classes[j].substring(8)/100;}}
Reflection.add(rimages[i],{height:rheight,opacity:ropacity});}}
var previousOnload=window.onload;window.onload=function(){if(previousOnload)previousOnload();addReflections();};function thumbs_count_clics(id_niche,id_thumb,id_test){file_quick("/thumbs/stats.php?id_thumb="+escape(id_thumb)+"&id_niche="+escape(id_niche)+"&id_test="+escape(id_test));}
function extraits_count_clics(id_niche,id_extrait){file_quick("/extraits/stats.php?id_extrait="+escape(id_extrait)+"&id_niche="+escape(id_niche));}
function thumbs_rencontre_count_clics(id_niche,id_thumb,id_test){file_quick("/thumbs/stats.php?id_thumb="+escape(id_thumb)+"&id_niche="+escape(id_niche)+"&id_test="+escape(id_test)+"&produit=rencontre");}
function extraits_rencontre_count_clics(id_niche,id_extrait){file_quick("/extraits/stats.php?id_extrait="+escape(id_extrait)+"&id_niche="+escape(id_niche)+"&produit=rencontre");}
function thumbs_liveshow_count_clics(id_niche,id_thumb,id_test){file_quick("/thumbs/stats.php?id_thumb="+escape(id_thumb)+"&id_niche="+escape(id_niche)+"&id_test="+escape(id_test)+"&produit=liveshow");}
function extraits_liveshow_count_clics(id_niche,id_extrait){file_quick("/extraits/stats.php?id_extrait="+escape(id_extrait)+"&id_niche="+escape(id_niche)+"&produit=liveshow");}
