var nbmails=0;var mailnum=0;var page=1;var deleting=false;var cptfocus=false;var IE6=false;var gHi;var gHm;var TSel;var sp=true;
var yf='000';var ft=false;
var md=null; sd();
function showhide(n){try{if (Gelt(n).style.display=='') Gelt(n).style.display='none';else Gelt(n).style.display='';}catch(ex){}}
function Gelt(n){return document.getElementById(n);}
function GeltInbox(n){return window.frames['ifinbox'].document.getElementById(n);}
function GeltMail(n){return window.frames['ifmail'].document.getElementById(n);}
function GeltW(w,n){if(w=='') return Gelt(n);else if (w=='ifinbox') return GeltInbox(n);else if (w=='ifmail') return GeltInbox(n);}
function v(w,n,b){try{if(b)GeltW(w,n).style.display='';else GeltW(w,n).style.display='none';}catch(ex){}}
function rmails(){try{GHeights();window.Gelt('nbmail').innerHTML='';v('','winbox',true);SHeights();}catch(ex){}}
function gch(){try{var wch=''; if(window.frames['ifmail'].document.location.href) wch=window.frames['ifmail'].document.location.href;}catch(ex){}return wch;}
function GHeights(){try{if(Goh(Gelt('ifinbox')))gHi=Goh(Gelt('ifinbox'));if(Goh(Gelt('ifmail')))gHm=Goh(Gelt('ifmail'));}catch(ex){}}
function SHeights(){try{if(!Goh(Gelt('ifinbox'))) {sOH(Gelt('ifinbox'), gHi);sOH(Gelt('ifmail'), gHm);}}catch(ex){}}
function sOH(elm, h){try{with(elm.style){height=h+'px';if(elm.offsetHeight == h) return;height=h-(elm.offsetHeight-h)+'px';}}catch(ex){}}
function Goh(o){try{if(o.offsetHeight) return o.offsetHeight;return null;}catch(ex){}}
function finrmail(nbmtot,nbmaff,n,rep,p){try{page=p;nbmails=nbmaff;var ch=gch();var s='';GHeights();v('','winbox',false);if(nbmtot>1)s='s';if(nbmaff==0 || n==0)v('','butmail',false);window.Gelt('nbmail').innerHTML=nbmtot+' mail'+s+' ';deleting=false;SHeights();if(n!=0){cm(n,rep);if(window.frames['ifmail'].document)if(ch.indexOf('m'+gmid(n),0)<0){window.frames['ifmail'].document.location.replace('m.php?b='+compte+'&id=m'+gmid(n));}}else if(window.frames['ifmail'].document && ch.indexOf('?',0)>0) window.frames['ifmail'].document.location.replace('/mail.htm');if(nbmtot==0){var ch=ch+'_';if(window.frames['ifmail'].document && ch.indexOf('m.php',0)<0)window.frames['ifmail'].document.location.replace('m.php');}}catch(ex){}}
function affm(t){try{mcach();window.frames['ifmail'].document.location.href='m.php?b='+compte+'&id='+t+gmid(mailnum);}catch(ex){}}
function affmenc(e){mcach();window.frames['ifmail'].document.location.href='m.php?b='+compte+'&id=m'+gmid(mailnum)+'&c='+e;}
function cm(n,rep){try{if(rep==0){v('','repmail',false);v('','repmail2',false);}else{v('','repmail',true);v('','repmail2',true);}mailnum=n;v('','butmail',true);for(i=1;i<=nbmails;i++){if(n==i){EnvSet(i,2);GeltInbox('m'+i).style.backgroundColor='#e8edf2';}else{EnvSet(i,TSel[i]);if(GeltInbox('m'+i)) GeltInbox('m'+i).style.backgroundColor='';}}}catch(ex){}}
function cEnv(o){try{n=o.id.substring(1,10);EnvSet(n, (TSel[n] + 1) % 2);msgi('');}catch(ex){}}
function EnvSet(n,e){try{o=GeltInbox('e'+n);if(o){if(n>0)u=GeltInbox('m'+n).firstChild;o.style.backgroundPosition=ebp(n,e);if(!IE6){if(e==0 && n>0)u.style.backgroundImage="";if(e==1 && n>0)u.style.backgroundImage="url(/style/pic/inbox.png)";}if(e!=2){TSel[n]=e;if(n>0 && e==0) EnvSet(0,0);if(n>0 && e==1){e0=1;for(var i=1;i<=nbmails;i++) if(TSel[i]!=1 && GeltInbox('e'+i)) {e0=0;break;}EnvSet(0,e0);}}}}catch(ex){}}
function ebp(n,e){try{if(e==2){if(TSel[n]==0)return"-21px -11px"; else return"-21px -25px";}if(e==0) if(n>0){ if(n==mailnum) return"-21px -11px"; else return"-21px 0px"; } else return"-21px 4px";if(e==1) if(n>0) return"-21px -25px"; else return"-21px -21px";}catch(ex){}}
function EnvAll(){try{msgi('');var e=0;for(var i=1;i<=nbmails;i++) if(TSel[i]!=1 && GeltInbox('e'+i)) {e=1;break;}for(var i=1;i<=nbmails;i++) EnvSet(i,e);}catch(ex){}}
function lrep(act){try{mid=gmid(mailnum);if(mid=='') msgi('No mail selected');else window.frames['ifmail'].document.location.href='send-mail.php?act='+act+'&login='+compte+'&mailid='+mid;}catch(ex){}}var timeout;var gmnu;function menuvoir(mnu){try{clearTimeout(timeout);GeltMenu(mnu).style.visibility='visible';GeltMenu(mnu).style.display='';}catch(ex){}}
function menucacher(mnu){try{gmnu=mnu;timeout = setTimeout('mcach()',300);}catch(ex){}}
function mcach(){try{GeltMenu(gmnu).style.visibility='hidden';GeltMenu(gmnu).style.display='none';}catch(ex){}}
function GeltMenu(mnu){if(mnu=='delmenu') return GeltInbox(mnu);else if (mnu=='menu') return Gelt(mnu);else return Gelt(mnu);}function suppr(){try{for(i=1;i<=nbmails;i++)if(TSel[i]==1){ suppr_sel();return;}suppr_mail();}catch(ex){}}
function suppr_all(){try{if(!deleting){deleting=true;try{window.frames['ifmail'].document.body.innerHTML=''}catch(exx){};refr(1,'none','all',gmid(mailnum));}}catch(ex){}}
function suppr_sel(){try{if(!deleting){deleting=true;ch='';for(i=1;i<=nbmails;i++){if(TSel[i]==1){ch=ch+gmid(i)+'|';changeOpac(0,'ifinbox','m'+i);}}if(ch!=''){refr(page,gmid(mailnum),ch.substring(0,ch.length-1),'');}else{msgi(' No mail selected');deleting=false;}}}catch(ex){}}
function suppr_mail(){try{if(!deleting){deleting=true;nextmailid=gmid(Number(mailnum)+1);if(nextmailid=='') nextmailid='last';try{window.frames['ifmail'].document.body.innerHTML=''}catch(exx){};changeOpac(0,'ifinbox','m'+mailnum);refr(page,nextmailid,gmid(mailnum),'',window.frames['ifinbox'].document.documentElement.scrollTop.toString());}}catch(ex){}}
function gmid(n){try{h=GeltInbox('m'+n).firstChild.firstChild.href;return h.substr(h.indexOf('id=',0)+4);}catch(ex){return ''}}
function kp(pEnvent){try{if(pEnvent.keyCode==46 && !cptfocus && nbmails>0) if(pEnvent.ctrlKey) suppr_all(); else suppr();}catch(ex){}}
var tabo;
function opacity(w,id,opacStart,opacEnd,millisec){try{if(tabo){for(i=0;i<=tabo.length;i++){clearTimeout(tabo[i]);}}tabo=new Array(Math.abs(opacEnd-opacStart)+1);if(GeltW(w,id)){var speed = Math.round(millisec / 100);var timer=0;if(opacStart > opacEnd){for(i=opacStart;i>=opacEnd;i--){tabo[i+1]=setTimeout("changeOpac("+i +",'"+w+"','"+id+"')",(timer * speed));timer++;}tabo[i+1]=setTimeout("v('"+w+"','"+id+"',false)",(timer * speed));}else if(opacStart < opacEnd){v(w,id,true);for(i=opacStart;i<=opacEnd;i++){tabo[i]=setTimeout("changeOpac("+i+",'"+w+"','"+id+"')",(timer * speed));timer++;}}}}catch(ex){}}
function changeOpac(opacity,w, id){try{if(GeltW(w,id)){var object = GeltW(w,id).style;object.opacity=(opacity / 100);object.MozOpacity=(opacity / 100);object.KhtmlOpacity=(opacity / 100);object.filter="alpha(opacity=" + opacity + ")";}}catch(ex){}}
function msgi(m){ try{o=GeltInbox('msginbox');o.innerHTML=m;if(m.length>0) o.style.display=''; else o.style.display='none';}catch(ex){}}
function CptonKeyUp(){try{var c=Gelt('login').value;var a=Gelt('autocpt');if(c.indexOf('@')>0)c=c.substring(0,c.indexOf('@'));if(c.length==0){if(a.innerHTML.length!=0)opacity('','autocptobj', 100, 0, 500);a.innerHTML='';return;}if(a.innerHTML.length==0){ opacity('','autocptobj', 0, 100, 500);}var reg_login = /^[-a-zA-Z0-9@_.]{1,}$/; if(!(reg_login.test(c))){a.innerHTML="Use only : a-z 0-9 . _ -";return;}if(c.length > 25){a.innerHTML="25 characters max !";return;}a.innerHTML=''+c+'@yopmail.com';}catch(ex){}}
function WCptonKeyUp(){try{var c=Gelt('login').value;var alt=Gelt('autoaltcpt');if(!alt || !c){alt.innerHTML='';return;}if(c.indexOf('@')>0)c=c.substring(0,c.indexOf('@'));if(c.length==0){alt.innerHTML='';return;}var reg_login = /^[-a-zA-Z0-9@_.]{1,}$/; if (!(reg_login.test(c))) {alt.innerHTML='Error';return;}if(c.length > 25){alt.innerHTML='Error';return;}}catch(ex){}}
function sd(){var d=new Date();document.cookie="localtime="+d.getHours()+":"+d.getMinutes()+";";}
var al = new Array('http',':','/');
function l(o){var r='';for(i = 0; i < o.length; i=i+2){r=r+al[Number(o.charAt(i)+o.charAt(i+1))];}return r;}
function refr_bv(){refr_load();}function refr_load(n){if (typeof this.refrok == 'undefined') {this.refrok=1;if(window.frames['ifinbox'].document.location.href.substring(1,4)!='http'){if(n)yf=n;refr();}}}function refr_(p,i,d,ctrl,scrl,r_c){try{sd();if(!p)var p='1';if((Gelt('login').value!=compte && p == 'r') || p=='f')Gelt('f').submit();else{rmails();if(Gelt('ifinbox')){if(!p)var p='1';if(!i)var i=idaff;if(!d)var d='';if(md!=null)d=md;md=null;if(!ctrl)var ctrl='';if(!scrl)var scrl='';if(!r_c)var r_c='';window.frames['ifinbox'].document.location.replace(l('00010202')+hst+'inbox.php?login='+compte+'&p='+p+'&d='+d+'&ctrl='+ctrl+'&scrl='+scrl+'&spam='+sp+'&yf='+yf+'&yp='+Gelt('yp').value+'&yj=JZwL0ZGH3AGZkZwD1ZQLkZQx&v='+ver+'&r_c='+r_c+'&id='+i);if(yf.length==3){yf=yf.replace('00','11');}}else window.setTimeout("refr()",100);}}catch(ex){}}var rb=0;function r(){if(rb==1){v('','nbmail',false);v('','winbox',true);setTimeout(function(){v('','winbox',false);v('','nbmail',true);},200);return;}rb=1;setTimeout(function(){rb=0;},2000);refr('r');}var nextrf=0;var nIId;var nTId;function refr(p,i,d,ctrl,scrl,r_c){v('','winbox',true);clearTimeout(nIId);clearInterval(nTId);nTId=setTimeout(function(){refr_(p,i,d,ctrl,scrl,r_c);nextrf=1200;},nextrf);nIId=setInterval(function(){if(nextrf<=0){clearInterval(nIId);nextrf=0;return;}nextrf-=100;},100);}function spam(){sp=!sp;refr();}function setp(n,v){try{window.frames['ifcall'].document.location.href='setp.php?n='+n+'&v='+v;}catch(ex){}}
function printmail(){try{window.frames['ifmail'].focus(); window.frames['ifmail'].print(); }catch(ex){}}function inm(){document.write('');window.frames['ifmail'].document.location.href=l('00010202')+hst+'mail.htm';}function inb(){document.write('');refr_to();}function mcf(fib){if(fib){refr_load('006')}}function refr_to(){refr_load('005');}