function checkFrameSet(){
    var ici = window.location.search;
    if (ici)
        {
        ici = unescape(ici.substring(1));
        alert("unescape " + ici);
        if (ici.substring(0,31) == "http://test.regie2c.fr/regie2c/") 
            {frames.bottom.location.href = ici;}
        return false;    
        }
    }

function checkFrame(){
    var ici = window.location.href;
    var bandeau = "http://test.regie2c.fr/bandeau_haut";
    //alert("yoho");
    //si la frame top n'est pas présente   
    
    if (parent.frames.top.location.href != bandeau || !parent.top | !parent.frames.top)
        {   
        //alert("parent.frames.top " + parent.frames.top.location.href);
        //on redirige vers le site
        window.location.href = "http://test.regie2c.fr?" + escape(ici);
        }
    else
        {
        //alert("oki");
        return false;}
    }

function openpopup(page){
   
    window.open(page, "Newsletter", "width=630,status=yes,resizable=yes,toolbar=no,menubar=no,location=no, scrollbars=yes, screenX=10, screenY=10");
   
}

function checkAllLinks()
    {
    Liens = document.getElementsByTagName('a');

    for(i=0; i<Liens.length; i++)
        {
            str = Liens[i].href;        
            a = str.substring(0,7) == 'http://';
            b = str.substring(7,22) != 'test.regie2c.fr';
            c = str.substring(7,21) != 'www.regie2c.fr'
            d = str.substring(7,22) != 'www.regie2c.com'            
            if (a && b && c && d)
                {
                    //alert(str);
                    Liens[i].onclick = function()
                        {
                        this.target = '_blank';
                        }
                }

        }     
    }
