<!--
    function checkEmpty(objForm)
    {
        var objQuery = document.getElementById("query");
    
        if(objQuery != null)
        {
            if (trim(objQuery.value).length < 1) 
            {
                alert("Veuillez spécifier un critère de recherche.")
                return false;
            }
        }
        return true;
    }

    function checkBeforeSubmit() 
    {
        var objForm = document.getElementById("frmSearch");
        
        if(objForm != null)
        {
            if (checkEmpty(objForm)) 
            {
                objForm.submit();
            }
        }
    }

    function changeDivStyle(obj, isOver) 
    {
        if (isOver) {
            obj.style.backgroundColor = '#C43c46';
            obj.style.borderColor = '#848484'
        }
        else {
            obj.style.backgroundColor = '';
            obj.style.borderColor = '';
         }

     }
     
     function changeStyle(obj, isOver) 
     {
         if (isOver && obj.value == rechercherDefaut) {
             obj.style.fontStyle = "normal";
             obj.style.color = "black";
             obj.value = "";
         }
         else if (obj.value == "")
         {
            obj.style.fontStyle = "italic";
            obj.style.color = "gray";
            obj.value = rechercherDefaut;
          }
      }
     
     function ActionPreviousNext(obj, isOver, imgSrc) {

         if (isOver) {
             obj.style.borderColor = "#C43c46";
             obj.style.color = "#C43c46";
         }
         else {
             obj.style.color = "#848484";
             obj.style.borderColor = "#848484";
         }

        if(imgSrc != null)
        {
            var objImg = document.getElementById(obj.id + "Image");         
            objImg.src = imgSrc;
        }
     }

     //Pour afficher le save ou delete du cart
     function showBouton(obj, show, btnId)
    {
        var objBouton = document.getElementById("add" + btnId); 
    
        if(!show && obj.value == "")
        {
            objBouton.style.visibility = "hidden";
        }
        else
        {
             objBouton.style.visibility = "visible";
        }
    }
     function switchLangage() 
     {
         document.frmLang.submit();
     }
     
     
    //The following is the javascript code, when the user tries to close the browser using (X), this function is called in body tag
    /*
    function HandleOnClose(e) 
    {
        if (event.clientY < 0)
        {
         //  sendXMLHTTRequest(101);
        }
    }
*/
    //The following is the javascript code, the function catches the ID(i.e whether the user is logged in or not) here I am using XMLHTTPREQUEST so that I can make the session abandon, without postback(manual AJAX), so here no need to use any popup window to close the sessions.
    function sendXMLHTTRequest(ID)
    {
        /*100-window close without user logged In
        101- browser close after the user is logged In 
        */
        if(ID >100)
        {
           var xhr_object = false;

             try {
                 // Firefox, Opera 8.0+, Safari
                 xhr_object = new XMLHttpRequest();
             }
             catch (e) {
                 // Internet Explorer
                 try {
                     xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
                 }
                 catch (e) {
                     try {
                         xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                     catch (e) {
                         alert("Your browser does not support AJAX!");
                         return false;
                     }
                 }
             }
             
             //xhr_object.open("POST", "SessionTracker.aspx?ParamID=" + ID, true);
             xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
             
             //xhr_object.send("SessionTracker.aspx?ParamID=" + ID);
        }
    }

    //The following is the javascript code, when the user tries to close the browser using alt-f4
    /*
    document.onkeydown = function()
    {
        if(window.event.keyCode == 115 && event.altKey == true)
        {
           sendXMLHTTRequest(101);
        }
    }
*/
    function showLostPwd() 
    {
        var obj = document.getElementById("divLoginPerdu");

        if (obj == null) return;
        
        if (obj.style.visibility == "visible") obj.style.visibility = "hidden";
        else obj.style.visibility = "visible";
    }
    

    var lastAction = "";
    //blur, focus, over, out
    function changeClass( objControl, classname, newAction )
    {
        if(objControl == null) return;

        if(newAction == "out" && (lastAction == "focus" || lastAction == "over")) return;
        
        if(newAction == "out" && objControl.value == "") return;
        
        if(newAction == "blur" && objControl.value == "") return;
        
        objControl.className = classname;
        lastAction = newAction;
    }
    
    /***********
    *
    ****/
    function GetCartCount( cartCount, grandTotal )
    {
        var objCartCount = document.getElementById("spanCartCount");
        var objGrandTotal = document.getElementById("spanGranTotal");
        
        if(objCartCount != null)
        {
            objCartCount.innerHTML = "(" + cartCount + ")";
        }
        
        if(objGrandTotal != null)
        {
            objGrandTotal.innerHTML = grandTotal;
        }
        
        var dummyField = document.getElementById("dummyField");
        if(dummyField != null)
        {
            dummyField.focus();
        }
    }
//-->    
    
    


