//alert(window.location.hostname);

// Document Ready Function
jQuery(document).ready(function($) {
	
	// Slide down for sub menus.  I still need to find how to do this in the actual Magento code.
	$(".header-nav > #nav > li ").hover(function(){
		$('ul', this).hide().slideDown('fast'); 
	},
	function(){
		//$('ul', this).slideUp('fast'); 
	});
	
	
	//Make the current page active so the nav image will stay selected
	$('#nav > .active').children('a').addClass('active');
	
	
	// Make the hover states work when hovering over sub navs
	$(".header-nav > #nav ul.level0").hover(function(){
		$(this).siblings('a').addClass('active');
	},
	function(){
		$(this).siblings('a').removeClass('active');
		$('#nav > .active').children('a').addClass('active');
	});
	
	// Quick hack to change telephone to cell phone in checkout and account dashboard
	$('label[for|=billing:telephone]').html('Cell Phone <span class="required">*</span>');
	$('label[for|=telephone]').html('Cell Phone <span class="required">*</span>');

	// Quick hack to change fax to secondary phone in checkout and account dashboard
	$('label[for|=billing:fax]').html('Secondary Phone');
	$('label[for|=fax]').html('Secondary Phone');
	

	// Put dummy email in newsletter signup until clicked and replace it if the user doesn't enter anything
	$('#newsletterInput').val('email@domain.com').one('click', function(){
		$(this).val('');
		$(this).focus();
	}).blur(function(){
		if ($(this).val() == ''){
			$(this).val('email@domain.com').one('click', function(){
				$(this).val('');
				$(this).focus();
			})
		}
	});

	
	// Add the AskJeff button
	$('<li id="spacer"><img src="/skin/frontend/default/CFUSA/images/nav/line.gif" /></li><li id="AskJeffLink"><a href="/askjeff">&nbsp;</a></li>').insertBefore($('#search_mini_form'));
	
});


