// MINICART REMOVE FUNCTION
function mcRemoveLinks() {
	$(".delprod").unbind("click").click(function() {
		theLink = $(this);
		
		$.get(theLink.attr("href"),function(responseText) {
			theLink.parents(".minicart_prod").slice(0).animate({
				height:  "hide",
				opacity: "hide"
			},function() {
				$("#minicartinner").load("inc_minicart_content.asp?reload=2",function() {
					
					// REATTACH
					mcRemoveLinks();	
				});
			});
		});
		
		return false;
	});
}
$(document).ready(function () {
	// MINICART REMOVE FUNCTIONALITY
	mcRemoveLinks();

	$('.header_minicart_link').live('click', function () {
		$('.header_minicart_link').toggleClass('mini_link_active');
		$('#minicart_detail').slideToggle();
		return false;
	});

	$(".openable ul a").click(function (event) {
		event.stopPropagation();
		return true;
	});

	$('.openable').click(function (event) {
		$(".openable").not(this).find("ul").slideUp();
		$('ul', this).slideToggle();
		return false;
	});

	$('#prodpage_tabs > li > a').click(function () {
		targetDiv = $(this).attr('rel');
		$('#prodpage_tabs > li').removeClass("tab_on");
		$(this).parent().addClass("tab_on");
		$('.tabcontent_on').slideUp(function () {
			$(this).removeClass('tabcontent_on');
			$('#' + targetDiv).slideDown();
			$('#' + targetDiv).addClass('tabcontent_on');
		});
		return false;
	});

	$('.homefeat').hover(
		function () {
			$(this).children('.homefeat_inner').show();
		},
		function () {
			$(this).children('.homefeat_inner').hide();
		}
	);
	
	$('.homefeat').click( function(){
		thelink = $(this).find('a').attr("href");
		location.href=thelink;
		
	});
	
	$('.feature').hover(
		function () {
			$(this).children('.feature_inner').show();
		},
		function () {
			$(this).children('.feature_inner').hide();
		}
	);
	
	$('.feature').click( function(){
		thelink = $(this).find('a').attr("href");
		location.href=thelink;
		
	});

	$('.altimg').click(function () {
		newURL = $(this).attr("href");
		
		/*
		$(this).effect("transfer",{
			to: ".enlargeMe > img",
			className: "ui-effects-transfer"
		},750,function() {
			$('.enlargeMe > img').attr("src", newURL);
			$('.enlargeMe').attr("href", newURL.replace('products', 'prodhuge'));
		});
		*/
		
		//$('.enlargeMe > img').attr("src", newURL);
		//$('.enlargeMe').attr("href", newURL.replace('products', 'prodhuge'));
			
		return false;
	});

	$('.enlargeMe').click(function () {		
		largeURL = $(this).attr('href');
		$('#enlarged').html("<img id='imgdown' src='images/minus.png' alt='minus' /><img src='" + largeURL + "' width='100%' height='100%' />");
		$('#enlarged').fadeIn(function () {
			$('#enlarged').animate({
				width: '790',
				height: '948'
			}, 500
			);
		});
		
		return false;
	});

	$('#enlarged').click(function () {
		if (!$(this).is(":animated")) {
			$('#enlarged').animate({
				width: '500',
				height: '600'
			}, 500, function () {
				$('#enlarged').fadeOut();
			});
		}
		return false;
	});



});

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('li.lh_head > span', { hover: true });
Cufon.replace('#footer-lft > p');
