Cufon.replace('.dMed, .footerLinks h3, .availabilityList h3, button span, #topNav li h3, #midBar span, #sideMenu li h2, .tabContent h2, .productDetail h2, .thumbsInfo li', { fontFamily: 'daxmed' });
Cufon.replace('.dLt, h2.title, #midBar h2, #midBar h3, #midBar .colOne p, #sideMenu li h3, #colOne h2.title, #breadCrumb, #innerBanner h3', { fontFamily: 'daxlight' });
Cufon.replace('.dReg', { fontFamily: 'daxreg' });
Cufon.replace('.dBld, .colTwo .date', { fontFamily: 'daxbold' });
Cufon.replace('.topNavLinks a', {
fontFamily: 'daxreg',
hover: {
color: '#ea0000'
}
});
Cufon.replace('#tabs li a, #sideMenu li a', {
fontFamily: 'daxlight',
hover: {
color: '#ea0000'
}
});

Cufon.replace('#pageTop ul li a', {
fontFamily: 'daxmed',
hover: {
color: '#ea0000'
}
});


jQuery(document).ready(function(){
var _win = jQuery(window).width();
bom();
jQuery('#bannerWrapper').css({'width': _win +'px', 'overflow':'hidden'});
jQuery(window).resize(function(){
var _win = jQuery(window).width();
if(_win <= 1000){
jQuery('#bannerWrapper').css({'width': 1000 +'px', 'overflow':'hidden'});
} else {
jQuery('#bannerWrapper').css({'width': _win +'px', 'overflow':'hidden'});
}
bom();
});
jQuery('.start-stop.playing').animate({opacity: 0.1}, 100);
jQuery('.start-stop').hover(function(){
	jQuery(this).animate({opacity: 0.9}, 100);
	}, function(){
		jQuery(this).animate({opacity: 0.1}, 100);
		});
jQuery('#innerBanner').hover(function(){
jQuery(this).parent().find('.bannerInfo').slideDown("200");
}, function(){		
jQuery(this).parent().find('.bannerInfo').slideUp("200");
});

var sinfo = {    
sensitivity: 3, 
interval: 10,     
over: doOpen,   
timeout: 200,    
out: doClose    
};

function doOpen() {
var _h =jQuery(this).height();
var _ah = 364 - _h;
$(this).addClass("hover");
jQuery(this).stop(true, true).animate({ top: _ah }, 800);
}

function doClose() {
var _h =jQuery(this).height();
var _ah = 364 - _h;
$(this).removeClass("hover");

jQuery(this).stop(true, true).animate({ top: 329}, 800);
}

$("#bannerItems .slideInfo").hoverIntent(sinfo);

jQuery(".bannerOverlay li.middle").animate({opacity: 0}, 200);
jQuery(".bannerOverlay li:nth-child(2), .bannerOverlay li:nth-child(4)").hover(function(){
jQuery(this).css({'z-index': '-9'});
}, function(){
jQuery(this).css({'z-index': '9'});
});
jQuery('ul li:first-child').addClass("firstItem");
jQuery('ul li:last-child').addClass("lastItem");
jQuery('div.compBox:last-child').addClass("lastBox");	
jQuery('.tabContent').find("table").find("tr:even").addClass("evenRow");

jQuery('#bannerItems li').click(function(){
});
jQuery('#mainCats ul li').each(function(){
if ($(this).find('ul').size()!=0) 
{ 
jQuery(this).addClass('parent');			
} 
else 
{ 	
} 
});
function megaHoverOver(){
$(this).find(".sub").stop().fadeTo('fast', 1).show();

$(this).children("a:first").addClass("active");

//Calculate width of all ul's
(function($) { 
jQuery.fn.calcSubWidth = function() {
rowWidth = 0;
//Calculate row
$(this).find("ul").each(function() {
var _uw = $(this).width(); 
$(this).css({'width': _uw +'px'});					
rowWidth += _uw; 
});	
};
})(jQuery); 

if ( $(this).find(".row").length > 0 ) { //If row exists...
var biggestRow = 0;	
//Calculate each row
$(this).find(".row").each(function() {							   
$(this).calcSubWidth();
//Find biggest row
if(rowWidth > biggestRow) {
biggestRow = rowWidth;
}
});
//Set width
$(this).find(".sub").css({'width' :biggestRow});
$(this).find(".row:last").css({'margin':'0'});

} else { //If row does not exist...

$(this).calcSubWidth();
//Set Width
$(this).find(".sub").css({'width' : rowWidth});

}
}

function megaHoverOut(){ 
$(this).children("a:first").removeClass("active");
$(this).find(".sub").stop().fadeTo('fast', 0, function() {
$(this).hide(); 
});
}


var config = {    
sensitivity: 2,  
interval: 100, 
over: megaHoverOver,
timeout: 500, 
out: megaHoverOut  
};

$("#mainCats ul li .sub").css({'opacity':'0'});
$("#mainCats ul li").hoverIntent(config);

jQuery("#tabs li").click(function()
{ 
var _thislink = jQuery(this).find('a');
jQuery(this).addClass('current').siblings('li').removeClass('current');
var _index =  jQuery(this).index(); 
jQuery('div.tabContent').hide().eq(_index).show(); 
}).eq(0).click();

jQuery("#sideMenu li h2,#sideMenu li h3").click(function(e){
e.preventDefault(); 

if (this.nodeName == 'H2' || this.nodeName == 'h2') { 
if (this.className != 'active')
{
jQuery('#sideMenu li h2').removeClass("active");
jQuery(this).addClass("active");
jQuery("#sideMenu li h2").siblings('ul').slideUp('slow'); 
jQuery(this).siblings('ul').slideDown("slow");

} else if(this.className = 'active'){
jQuery(this).removeClass("active");
jQuery(this).siblings('ul').slideUp('slow');

}
else {

}
} else if (this.nodeName == 'H3' || this.nodeName == 'h3'){
if (this.className != 'active'){
jQuery('#sideMenu li h3').removeClass("active");
jQuery(this).addClass("active");
jQuery("#sideMenu li h3").siblings('ul').slideUp('slow'); 
jQuery(this).siblings('ul').slideDown("slow");
} else if(this.className = 'active'){
jQuery(this).removeClass("active");
jQuery(this).siblings('ul').slideUp('slow');
}
else {
jQuery(this).siblings('ul').slideUp("slow");
}

} else {


}

}).eq(0).click();
jQuery('#tabs li').click(function(){
var _class = jQuery(this).attr("class");
var _this = jQuery(this).find("a");
var _newthis = jQuery(this).siblings().children("a");
Cufon.replace(_this, {fontFamily: 'daxlight',	color: '#ea0000'});
Cufon.replace(_newthis, {fontFamily: 'daxlight',	color: '#003e7e'});
});	

$('input[type="text"], textarea').each(function() {
var default_value = this.value;
$(this).css('color', '#666'); // this could be in the style sheet instead
$(this).focus(function() {
if(this.value == default_value) {
this.value = '';
$(this).css('color', '#333');
}
});
$(this).blur(function() {
if(this.value == '') {
$(this).css('color', '#666');
this.value = default_value;
}
});
});


function bom(){
var _win = jQuery(window).width();
var _mw = (_win - 952)/2;
jQuery("ul.bannerOverlay").css({'width':_win+'px'});
jQuery("ul.bannerOverlay li:first-child, ul.bannerOverlay li:first-child div, ul.bannerOverlay li:last-child, ul.bannerOverlay li:last-child div").css({'width':_mw+'px'});
};
});

