jQuery(function($) {
	// Your code using failsafe $ alias here...

	$(".enterZip").live("click", function(){
		$(this).parent().siblings(".shipData").toggle();
		return false;
	});

	$("ul.sf-menu").superfish({
		animation: {height:'show'},
		speed: 300,
		autoArrows: false,
		dropShadows: false
	}).find("ul").bgIframe();

	$(".itemRow").equalHeights(true);
	$(".modCarousel .items").equalHeights(true);

	$(".itemWrapper ul.swatchList li a").live("mouseover", function(){
		$(this).parents(".swatchList").find("a").removeClass("active");
		$(this).addClass("active");
		var newImg = $(this).find(".swatchAlt").html();
		$(this).parents(".itemWrapper").find(".itemImage").attr({src: newImg});
	});
	
	//Banner slide show
	$("#homeSSW").cycle({
		fx: 'fade',
		speed: 300,
		timeout: 5000,
		pager: '.nav'
	});	
	$(".sswControls").css({'opacity' : '0.9'});
	
	$(".truncate").truncate({
		max_length: 400,
		more: "read more",
		less: "read less"
	});

// dialog windows 
	$(".uiModal").dialog({
		autoOpen: false,
		width: "720px",
		bgiframe: true,
		modal: true,
		resizable: false,
		buttons: {
			Close: function() {
				$(this).dialog('close');
			}
		}
	});
	
	$(".uiDialog").dialog({
		autoOpen: false,
		width: "720px",
		bgiframe: true,
		modal: false,
		resizable: false,
		buttons: {
			Close: function() {
				$(this).dialog('close');
			}
		}
	});
	
	$(".pageTools .recent").live("click", function(){	
		$(".recentDialog").dialog( "open" );		
		return false;
	});
	
	$(".productImage .btnEnlarge").live("click", function(){	
		$(".enlargeView").dialog( "open" );
		return false;
	});
// END dialog windows 
	
	$(".tabModule .tabsRow > ul").tabs();
	$(".cartSupport .supportTabs > ul").tabs();
	
// carousels 
	$(".modCarousel4 .scrollable").scrollable({
		size: 4,
		items: ".items",
		clickable: false
	});
	

	$(".modCarousel5 .scrollable").scrollable({
		size: 5,
		items: ".items",
		clickable: false
	});

	$(".scrollable").each(function() {
		var mcHeight = $(".itemWrapper:first", this).height();
		$(this).css({'height' : mcHeight});
	});
// END carousels 
		
	$(".swatchList a").cluetip({
	cluetipClass: 'swatch',
		width: '178px',
		positionBy: 'fixed',
		topOffset: '-122px',
		leftOffset: '-115px',
		local:true,
		dropShadow: false,
		showTitle: false
	});
});
