
jQuery(document).ready(function() {
       
    var userAgent = navigator.userAgent.toLowerCase(), browser = '', version = 0;
	
	jQuery.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
	
	//Is this chrome ?

	if(jQuery.browser.chrome){
	   
	   userAgent = userAgent.substring(userAgent.indexOf('chrome/') + 7);
	   userAgent = userAgent.substring(0, userAgent.indexOf('.'));
	    
	   version = userAgent;
	    
     //Making sure that it is not Safari instead of chrome
	   
	   jQuery.browser.safari = false; 

	   browser = "Chrome";
	}
	//Is this Safari ? 

	if(jQuery.browser.safari){
        userAgent = userAgent.substring(userAgent.indexOf('safari/')+ 7);
	    userAgent = userAgent.substring(0,userAgent.indexOf('.'));
 	    version = userAgent;
  	    browser = "Safari";
	}
	
	/*Increase top navigation height and reposition content site 
     * below top navigation when there are more than 8 navigation links 
   	* */
        

    var maxNaviElem = 8;
	var marginTopValue = "3px";
	
	if(browser == "Chrome" || browser == "Safari"){
		marginTopValue = "40px";
	}
        
        if(jQuery("#top-navi .navi-list .top_navigation_link").length > maxNaviElem){
             
             jQuery("#site").css("marginTop", marginTopValue);
             jQuery("#top-navi").css("height", "65px");
        } 
       
        /*top navigation dropdown*/
        jQuery('.navi-list .top_navigation_link').hover( function() {
            
            jQuery(this).find('.child-menu').show();
            }, function() {
            jQuery(this).find('.child-menu').hide();
        });
});

