// JavaScript Document

            
            function updateClock () {
              var currentTime = new Date ( );

              var currentHours = currentTime.getHours ( );
              var currentMinutes = currentTime.getMinutes ( );
              var currentSeconds = currentTime.getSeconds ( );
			  
			  var weekday=new Array("Sun","Mon","Tue","Wed","Thu",
                    "Fri","Sat");
    		  var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",
                    "Sep","Oct","Nov","Dec");
			  
			  var day = currentTime.getDate();
			  var jour = weekday[currentTime.getDay()];
			  var month = monthname[currentTime.getMonth()];
			  var year = currentTime.getFullYear();
			  

              // Pad the minutes and seconds with leading zeros, if required
              currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
              currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

              // Choose either "AM" or "PM" as appropriate
              var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

              // Convert the hours component to 12-hour format if needed
              currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

              // Convert an hours component of "0" to "12"
              currentHours = ( currentHours == 0 ) ? 12 : currentHours;

              // Compose the string for display
              var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
			
              // Update the time display
              document.getElementById("clock").firstChild.nodeValue = currentTimeString;
			  document.getElementById("ctl00_lblTime").firstChild.nodeValue = " " + jour + " " + month + " " + day + ", " + year;
            }            
                        
            var time_id_Home, time_id_Services, time_id_Advertisers, time_id_Publishers, hide_time;            
                      
                function monhorloge()  {       
                
                    updateClock(); 
                    setInterval('updateClock()', 1000);
                  
                    hide_time = "800";
                    $("#navibar").children() // get all child for navibar
                        .each( function(i) { 
                                $(this).hover( 
                                    /***
                                     * Set the hover fucntion
                                     **/
                                    function () {                                        
                                        var id = $(this).find("table:last").attr("id");   
                                        if (! id) return;                                    
                                        var name = $(id.split("_")).get(1);
                                        // correct submenu pos to fix table scatching problems
                                        correct_pos( name );
//                                        eval("clearTimeout(time_id_"+ name +");");  
                                        $(this).find("table:last").stop();
//                                        if ($(this).find("table:last").css("display") == "none")
                                            $(this).find("table:last").css("display", "");                                     
                                        $(this).find("table:last").css("opacity", "0.8");
                                    }, 
                                    /***
                                     * Set the mouse out function
                                     ***/
                                    function () {
                                        var id = $(this).find("table:last").attr("id");   
                                        if (! id) return;                                    
                                        var name = $(id.split("_")).get(1);
                                        var str = "clearTimeout(time_id_"+ name +");";
                                        str += "time_id_"+ name + "=setTimeout('$(\"#" +id+ "\").css(\"display\", \"none\")',"+ hide_time +");"
//                                        eval(str);
                                        $("#"+id)
                                            .animate({opacity: 0}, 800, "", function(){$("#"+id).css("display", "none")});
                                    }
                                );
                        });   
					
                }
                        

