function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function validateLog(){
        frm = document.loginF
        if(!frm.user.value || !frm.pass.value){
                alert("Please enter your login information")
                return false
        }
}

function validateSign(email){
        frm = document.signF
        if(!frm.mname.value){
                alert("Please enter your signup information")
                return false
        }else{
                return echeck(email)
        }
}

function calcAge(){
        dob = Number(document.getElementById("dob").value);
        mob = Number(document.getElementById("mob").value);
        yob = Number(document.getElementById("yob").value);
        mil = (new Date())-(new Date(yob,mob-1,dob))
        Age = Math.floor(((((mil/1000)/60)/60)/24)/365)
        switch(mob){
                case 1:if(dob>=20){strS="Aquarius";}else{strS="Capricorn";};break;
                case 2:if(dob>=19){strS="Pisces";}else{strS="Aquarius";};break;
                case 3:if(dob>=21){strS="Aries";}else{strS="Pisces";};break;
                case 4:if(dob>=20){strS="Taurus";}else{strS="Aries";};break;
                case 5:if(dob>=21){strS="Gemini";}else{strS="Taurus";};break;
                case 6:if(dob>=21){strS="Cancer";}else{strS="Gemini";};break;
                case 7:if(dob>=23){strS="Leo";}else{strS="Cancer";};break;
                case 8:if(dob>=23){strS="Virgo";}else{strS="Leo";};break;
                case 9:if(dob>=23){strS="Libra";}else{strS="Virgo";};break;
                case 10:if(dob>=23){strS="Scorpio";}else{strS="Libra";};break;
                case 11:if(dob>=22){strS="Sagittarius";}else{strS="Scorpio";};break;
                case 12:if(dob>=22){strS="Capricorn";}else{strS="Sagittarius";};break;
        }
        document.getElementById('AgeF').innerHTML="You are <strong>"+Age+"</strong> years old<br> And your star sign is <strong>"+strS+"</strong>";
        document.getElementById('enterage').value = "true"
}

function alertM(){
        alert('This section still under construction!\n We will inform you when it will be available');
}

function initScrollLayer() {
        var wndo = new dw_scrollObj('wn1', 'lyr1');
        var wndo = new dw_scrollObj('wn2', 'lyr2');
        var wndo = new dw_scrollObj('wn3', 'lyr3');
        dw_scrollObj.GeckoTableBugFix('wn1');
        dw_scrollObj.GeckoTableBugFix('wn2');
        dw_scrollObj.GeckoTableBugFix('wn3');
}

function chkB(id,chckn){
        if(document.getElementById(chckn).value!='on'){
                document.getElementById('chkbx' + id).src = "images/chkBT.gif";
                document.getElementById(chckn).value = "on"
        }else{
                document.getElementById('chkbx' + id).src = "images/chkBF.gif";
                document.getElementById(chckn).value = "off"
        }
}

function openPage(aya,w,h){
        sWidth = screen.width
        sHeight = screen.height
        pWidth = w
        pHeight = h
        posx = (sWidth/2) - (pWidth/2)
        posy = (sHeight/2) - (pHeight/2)
        dest=aya
        window.open (dest,"just4LEB","toolbar=no,scrollbars=no,directories=no,menubar=no,width="+pWidth+",height="+pHeight+",left="+posx+",top="+posy+"");
}

function getP(){
        arr = new Array("-1")
        prm = new Array()
        hrf = location.href
        t = hrf.slice(hrf.lastIndexOf("?")+1,hrf.length)
        for(i=0;i<t.length;i++){
                if(t.slice(i,i+1)=="&"){
                        arr.push(i)
                }
        }
        for(j=0;j<arr.length;j++){
                strt = parseInt(arr[j])+1
                if(!strt){
                                strt=0
                }
                par = t.slice(strt,arr[j+1])
                tmpp = par.slice(0,par.lastIndexOf("="))
                tmpv = par.slice(par.lastIndexOf("=")+1,par.length)
                tmp = new Array(tmpp,tmpv)
                prm.push(tmp)
        }
        return tmpv
}

function unsub(){
        sWidth = screen.width
        sHeight = screen.height
        pWidth = 500
        pHeight = 400
        posx = (sWidth/2) - (pWidth/2)
        posy = (sHeight/2) - (pHeight/2)
        dest="unsubscribe.htm"
        window.open (dest,"Ghaddar","toolbar=no,scrollbars=no,directories=no,menubar=no,width="+pWidth+",height="+pHeight+",left="+posx+",top="+posy+"");

}

function clearT(aya){
        var txtB = aya.value
        if(txtB == "Your E-mail here..." || txtB == "Votre E-MAIL ici..."){
                aya.value = ""
        }
}

function chckT(aya){
        var txtB = aya.value
        hrf = location.href
        lang = hrf.slice(hrf.lastIndexOf('.')-3,hrf.lastIndexOf('.'))
        if(txtB == ""){
                if(lang=="_fr"){
                        aya.value = "Votre E-MAIL ici..."
                }else{
                        aya.value = "Your E-mail here..."
                }
        }
}

function echeck(str) {
        var at="@"
        var dot="."
        var lat=str.indexOf(at)
        var lstr=str.length
        var ldot=str.indexOf(dot)
        if(str.length < 8){
                alert("Invalid E-mail Address")
                return false;
        }
        if (str.indexOf(at)==-1){
           alert("Invalid E-mail Address")
           return false
        }
        if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
           alert("Invalid E-mail Address")
           return false
        }
        if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
            alert("Invalid E-mail Address")
            return false
        }
         if (str.indexOf(at,(lat+1))!=-1){
            alert("Invalid E-mail Address")
            return false
         }
         if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
            alert("Invalid E-mail Address")
            return false
         }
         if (str.indexOf(dot,(lat+2))==-1){
            alert("Invalid E-mail Address")
            return false
         }
         if (str.indexOf(" ")!=-1){
            alert("Invalid E-mail Address")
            return false
         }
         if (str.indexOf(",")!=-1){
            alert("Invalid E-mail Address")
            return false
         }
         return true
}

function startR(){
        //checkC()
        ln = 0;
        maxl = Number(news.length)
        curDiv = 1
        document.getElementById("news1").innerHTML = news[ln]
        spd = 25;
        timer = 5;
        roll = true
        tim = setInterval(
                function(){
                        if(roll){
                                ln+=1
                                if(ln==maxl){
                                        ln=0;
                                }
                                cp1 = document.getElementById("news1").style.top
                                p1 = Number(cp1.slice(0,cp1.lastIndexOf('px')))
                                cp2 = document.getElementById("news2").style.top
                                p2 = Number(cp2.slice(0,cp2.lastIndexOf('px')))
                                if(p1 == 0){
                                        document.getElementById("news2").innerHTML = news[ln]
                                        anim = setInterval(
                                                function(){
                                                        cp1 = document.getElementById("news1").style.top
                                                        p1 = Number(cp1.slice(0,cp1.lastIndexOf('px')))
                                                        np1 = p1-2;
                                                        document.getElementById("news1").style.top=np1+"px";
                                                        document.getElementById("news2").style.top=np1+20+"px";
                                                        if(p1 == -20){
                                                                document.getElementById("news2").style.top="0px";
                                                                document.getElementById("news1").style.top="20px";
                                                                clearInterval(anim)
                                                        }
                                                }
                                        ,spd)
                                }else if(p2 == 0){
                                        document.getElementById("news1").innerHTML = news[ln]
                                        anim = setInterval(
                                                function(){
                                                        cp2 = document.getElementById("news2").style.top
                                                        p2 = Number(cp2.slice(0,cp2.lastIndexOf('px')))
                                                        np2 = p2-2;
                                                        document.getElementById("news2").style.top=np2+"px";
                                                        document.getElementById("news1").style.top=np2+20+"px";
                                                        if(p2 == -20){
                                                                document.getElementById("news1").style.top="0px";
                                                                document.getElementById("news2").style.top="20px";
                                                                clearInterval(anim)
                                                        }
                                                }
                                        ,spd)
                                }
                        }
                }
        ,timer*1000)
}

function gotoL(){
        id = ids[ln]
        document.location = "news.asp?nid="+id
}

function checkC(){
        if (navigator.cookieEnabled == 0) {
          alert("You need to enable cookies for this site to run properly!");
        }
}










