vos commentaire// JavaScript Document
var bGlobalDontShowAgain = false;

 

function GetRealBodyWidth()

{

    // screen size

    var screenWidth = screen.width;

    var screenHeight = screen.height;

 

    // body size

    var scrollWidth = document.body.scrollWidth;

    var scrollHeight = document.body.scrollHeight;

 

    if(screenWidth < scrollWidth)

    {

        scrollWidth = screenWidth;

    }

 

    if(screenHeight < scrollHeight)

    {

        scrollHeight = screenHeight;

    }

    return scrollWidth;

}

 

 

function CommitTopSlide() {

                if(EBStop)

                {

                                var d = document.getElementById('EBTopBanner');                       

                  //  d.style.width= parseInt(GetRealBodyWidth());

                                d.style.left = 0+"px";

                                if(d.style.display=="none")d.style.display="block";

                    if (d) {

                        if (__top < 0) {

                            __top += 3;

                            d.style.top = __top+"px";

                                                                d.style.hieght=__top+"px";

                            setTimeout(CommitTopSlide, 25);

                        }

                    }

                } 

}

 

 

function EBPreVanishTopSlide(bDontShowAgain)

{

    if (bGlobalDontShowAgain == true){bDontShowAgain=true}

    var iDays = bDontShowAgain ? DAYS_FOR_NEXT_APPEARANCE_DONT_SHOW_NOTIFICATION : DAYS_FOR_NEXT_APPEARANCE_CLOSE_BUTTON;   

    EBStop=true;

    BannersControlHelper.SetCookie("TopSliderExposed","1",iDays);  

    EBVanishTopSlide();

}

 

 

function EBDownloadToolbar()

{

    setTimeout(EBPreVanishTopSlide, 5000);

}

 

function DelayVanish()

{

     var objCheckTopScrollDontShowAgain = document.getElementById("checkTopScrollDontShowAgain");

    

     if(objCheckTopScrollDontShowAgain != null)

     {

        bGlobalDontShowAgain = objCheckTopScrollDontShowAgain.checked;

        if(bGlobalDontShowAgain)       

            setTimeout(EBPreVanishTopSlide, 5000)

     }

}

 

function EBVanishTopSlide() {

                if(EBStop)

                {

                                var d = document.getElementById('EBTopBanner');

                                 d.style.left = 0+"px";

                                if(d.style.display=="none")d.style.display="block";

                    if (d) {

                        if (__top > -77) {

                            __top -= 10;

                            d.style.top = __top+"px";

                                                                d.style.hieght=__top+"px";

                            setTimeout(EBVanishTopSlide, 10);

                        }

                    }

                }   

}

 

 

function GetAlphaFilter()

{

    var ie = (document.all) ? 1 : 0;

   

    if(ie)

     return "filter:alpha(opacity=" + __opacity+")";

    else

     return "-moz-opacity: " + __opacity/ 100 ;

}

 

 

 

//definitions - internals

var __top                 = -66;

var EBStop                = true;

var DAYS_FOR_NEXT_APPEARANCE_CLOSE_BUTTON =7;

var DAYS_FOR_NEXT_APPEARANCE_DONT_SHOW_NOTIFICATION =365;

 

 

 

//Images

var __bgImage;

var __arrowImage;

var __textImage;      

var __downloadBtn;       

var __downloadBtnOver;

var __downloadBtnDown;

var __closeBtn;

var __closeBtnOver;

var __closeBtnDown;

var __dontShowCaption;

var __imagesPath;

 

 

function InitImagesDefinitions()

{

    __imagesPath        = __baseURL +  'Banners/TopSlider/';

    __bgImage           = __imagesPath + "strip_" + __selectedColor + ".gif";

    __arrowImage        = __imagesPath + "arrow_" + __selectedColor + ".gif";

    __textImage         = __imagesPath + "text_" + __selectedColor + ".gif"; //"[put the path to the image here e.g. /images/myTextImage.gif]";

    __downloadBtn       = __imagesPath + "dnld_" + __selectedColor + ".gif";

    __downloadBtnOver   = __imagesPath + "dnld_" + __selectedColor + "_over.gif";

    __downloadBtnDown   = __imagesPath + "dnld_" + __selectedColor + "_dn.gif";

    __closeBtn          = __imagesPath + "close_" + __selectedColor + ".gif";

    __closeBtnOver      = __imagesPath + "close_" + __selectedColor + "_over.gif";

    __closeBtnDown      = __imagesPath + "close_" + __selectedColor + "_dn.gif";

    __dontShowCaption   = __imagesPath + "dont_show.gif";  

}

 

 

 

function __TopSlide()

{

 

    WriteToolbarAPIRequest();

    InitImagesDefinitions();

    WriteBannerHTML();

       

    //ExecuteFlyOver only after page loads and banner

    //code is written to the document!!!

 

    BannersControlHelper.AttachEvent(window,'onload',ExecuteTopSlide);       

}

 

function ExecuteTopSlide()

{

    if(ValidateShow())

    {

                                var d = document.getElementById('EBTopBanner');                       

                    d.style.width= parseInt(GetRealBodyWidth());

        setTimeout(CommitTopSlide, 400);

    }

}

 

 

 

function ValidateShow()

{

    if (typeof __preview == "string")

        return true;

      

    //if the ctid var was defined, use the TPI to check if toolbar

    //is already installed in order to disable the banner in such case. 

    if (typeof __ctid =="string")

    {

   

      var oToolbar = new TPI.Toolbar(__ctid);      

      var oReturn = oToolbar.IsVisible();           

      if (oReturn.returnValue   ==  true)//toolbar is installed and visible

        return false

    }      

       

    //first validate period exposure

    if (BannersControlHelper.ReadCookie("TopSliderExposed") == "1")

        return false;

       

    //Validate cookies are enabled on the user's browser

    BannersControlHelper.SetCookie("TopSliderTester","1",1);   

  

    if(BannersControlHelper.ReadCookie("TopSliderTester") == "1")

    {

        //Cookies Enabled on user's browser

        if (BannersControlHelper.ReadCookie("TopSliderExposed") == "1")

        {

           return false;

        }           

                         

        return true;            

    }

    else //Cookies disabled on user's browser

    {

        return false;

    }

}

 

 

 

function WriteToolbarAPIRequest()

{

    document.write("<script src=\"" + __baseURL + "/Api/ToolbarApi.js\"></script>");

}

 

 

function WriteBannerHTML()

{

    document.write('<div class="" id="EBTopBanner" style="'+GetAlphaFilter()+';z-index:1000;padding:0px 0px 0px 0px;display:none;width:100%;position:absolute;top:0px;left:0px;height:66px;background-image:url(' + __bgImage + ');background-repeat: repeat;background-repeat: repeat-x;">');   

    document.write('<table class="" dir="ltr" height="100%" width="100%" cellpadding="0" cellspacing="0">');

    document.write('<tr>');

    document.write('        <td style="width:25%">&nbsp;');

    document.write('        </td>');

    document.write('        <td style="width:50%">');

    document.write('        <table cellpadding="0" cellspacing="0">');

    document.write('        <tr>');

    document.write('        <td ><img src="' + __arrowImage + '" />');

    document.write('        </td>');

    document.write('        <td width="18px">&nbsp;');

    document.write('        </td>');

    document.write('        <td align="top" style="vertical-align:top; padding-top:13px; text-align:right; color:green; font-family:Arial; font-weight:bold; font-size:13px; line-height:13px; width:620px;" > Essayez Notre Barre d'Outils! Le meilleur de Scropines et AccroDeScrap sur votre navigateur gratuitement!
Les news, coupons de réduction avant tout le monde, les dernières démos de produits en vidéo et plus encore.');

    //document.write('    <td align="top" style="vertical-align:top" ><img src="' + __textImage + '" align=top  />');

    document.write('        </td>');

    document.write('        <td style="width:31px">&nbsp;&nbsp;');

    document.write('        </td>');

   

    document.write('        <td  style="padding-top:14px;vertical-align:top"><a href="'+ __downloadUrl +'" ><img border="0" src="' + __downloadBtn  + '"   onmouseover = "this.src=\'' + __downloadBtnOver   +'\'"  onmouseout = "this.src=\'' + __downloadBtn   +'\'" onmousedown = "this.src=\''+ __downloadBtnDown  +'\'"  onmousedown = "this.src=\''+ __downloadBtnDown  +'\'" onclick="EBDownloadToolbar()"  target="_blank" /></a>');

   

    document.write('        </td>');

    document.write('        </tr>');

    document.write('        </table>');

    document.write('        </td>');

    document.write('        <td style="vertical-align:top" width="25%">&nbsp;');

    document.write('        </td>');

    document.write('        <td style="vertical-align:top;text-align:right">');

    document.write('        <table cellpadding="0" cellspacing="0" style="width:100px;">');

    document.write('        <tr>');

    document.write('        <td colspan="2" align="right" style="text-align:right;padding-top:2px;padding-right:4px">&nbsp;');

    document.write('        <img border="0" style="cursor:pointer;cursor:hand" src="' + __closeBtn  + '"   onmouseover = "this.src=\'' + __closeBtnOver  +'\'"  onmouseout = "this.src=\'' + __closeBtn   +'\'" onmousedown = "this.src=\''+ __closeBtnDown  +'\'"  onmousedown = "this.src=\''+ __downloadBtnDown  +'\'" onclick="EBPreVanishTopSlide(false)"    />');

    document.write('        </td>');

    document.write('        </tr>');

    document.write('        <tr>');

    document.write('        <td style="padding-top:1px;padding-right:4px; width:20px;">');

    document.write('        <input type="checkbox" class="" id="checkTopScrollDontShowAgain" onClick="DelayVanish()" />');

    document.write('        </td>');

    document.write('        <td width="40px" style="padding-right:4px; font-size:10px; color:white; font-family:Arial;" >');

    //document.write('    <img border="0" style="margin-top:1px" src="' + __dontShowCaption  + '" >');

   document.write(' Ne pas montrer ');

    document.write('        </td>')

    document.write('        </tr>');

    document.write('        </table>');

    document.write('        </td>');

    document.write('</tr>');

    document.write('</table>');

    document.write('</div>');

}

 

var BannersControlHelper =

{             

                IsIE : function()

                {

                                return (window.navigator.userAgent.indexOf("MSIE") > 0);

                },

                IsIE7 : function()

                {

                                return (window.navigator.userAgent.indexOf("MSIE 7.0") > 0);

                },

                IsIE6 : function()

                {  

                    var regexIE6 = /MSIE ([0-6])/;

                                return (regexIE6.test(window.navigator.userAgent));

                },

                AttachEvent : function(obj, eventName, delegate)

                {

                                if  (typeof( obj.addEventListener ) != 'undefined' )

                                {

                                                obj.addEventListener(BannersControlHelper.GetEventName(eventName),delegate,false);

                                }

                                else {

                                                obj.attachEvent(eventName,delegate);

                                }

                },

                DetachEvent : function(obj,eventName,delegate)

                {

                                if (obj.removeEventListener) {

                                                obj.removeEventListener(eventName,delegate, true);

                                }

                                else if (obj.detachEvent) {

                                                obj.detachEvent(eventName,delegate);

                                }

                },

                GetEventName : function (name)

                {

                                return (name.indexOf('on') == 0) ? name.substring(2,name.length) : name;

                },

                SetCookie:function (cookieName,cookieValue,nDays)

                {

     var today = new Date();

     var expire = new Date();

     if (nDays==null || nDays==0) nDays=1;

     expire.setTime(today.getTime() + 3600000*24*nDays);

     document.cookie = cookieName+"="+escape(cookieValue)

                     + ";expires="+expire.toGMTString();

    },

    ReadCookie:function (cookieName)

    {

     var theCookie=""+document.cookie;

     var ind=theCookie.indexOf(cookieName);

     if (ind==-1 || cookieName=="") return "";

     var ind1=theCookie.indexOf(';',ind);

     if (ind1==-1) ind1=theCookie.length;

     return unescape(theCookie.substring(ind+cookieName.length+1,ind1));

    }

}

