$(function(){
	//ADD TOMMYBAHAMA CLASS TO LEFT NAV
	$('#topnav_381').parent().addClass('tommybahama');

	//REMOVE SITE DIRECTORY
	//$('#topnav_381').parent().next().addClass('lastitem'); turned off in CFM

	//INSERT BABY TOMMYBAHAMA LOGO ON PROD PAGE
	if($('#container').hasClass('tommyprodpage')) 
	{
		$('<div id="tommybabylogo"><img src="/sitemedia/content/images/traf/tommybahama/TB_Logo_baby.jpg" alt="Tommy Bahama Logo" title="Tommy Bahama Logo" /></div>').insertBefore('#productdetail');	  
	}
	//JOIN OUR MAILING LIST ADJUSTMENTS
	$('#emailform2 h3').html('Join our mailing list');
	$('#emailform2 h3').css('display','inline');
	$('#emailform2 a').html('Submit');
});



//Menus
$(function() { 
  $('#mainnav li > ul').hide(); //hide subsidiary nav
  
  var isieLT8 = ($.browser.version < 8 && $.browser.msie ) //IE 7 insists on inserting white spaces between top level links. Workaround.
  
  //add event handlers to top level links only
  $('#mainnav>ul>li').hover(  
    //mouseEnter - show subsidary nav
    function() 
      {
        var subnav = $(this).find('ul')
        if(subnav.length > 0)
          {
            if(isieLT8) {this.style.marginBottom = '-3px'; } //tell IE 7 to close up extra space
            subnav.show()  
          }//end, if       
      }, //end, mouseEnter
    //mouseOut - hide subsidary nav
    function() 
      {
        var subnav = $(this).find('ul')
        if(subnav.length > 0)
          {
            if(isieLT8) {this.style.marginBottom = ''; } //tell IE 7 to clear out margin bottom style
            subnav.hide()  
          }//end if        
      }//end function
    );
});	
