$(document).ready(function() {
	$("img").pngFix();
	$("img[@src$=png], #hero, #hero-bg, #logo").pngFix();
	$('#product-wrap div:not(#features-area)').hide();
	$('#country').hide();
	$('#product-tabs li a').click(function(){
		$('#product-tabs li').removeClass('tab-on').addClass('tab-off');
		$(this).parent().removeClass('tab-off').addClass('tab-on');
		$('#product-wrap div').hide();
		var clicked = "#" + $(this).parent().attr('id') + "-area";
		$(clicked).show();
	});
	
	$('#product-tabs li').hover(function(){
		$(this).children('a').addClass('tab-hover');
	},
		function(){
			$(this).children('a').removeClass('tab-hover');
	});
	
	var clicked = 0;
	$('#country-selection, #close-box').click(function() {
		if (clicked == 0){
			$('#country').slideDown('fast');
			clicked = 1;
		} else {
			$('#country').fadeOut('fast');
			clicked = 0;
		}
	});
	$("#products-cart input").change(function() {
		if(this.value == '' || this.value == null){
			this.value = 0;
		}
	});
	$("div.item-feat .boxed .checkbox").click(function(){
		if($("input:checked").length > 6){
			$(".boxed").css("background","#E0E0E0 none repeat scroll 0 0");
			$(".boxed a").css({color: "#494949", textDecoration: "none"});
			alert("Please select 6 or fewer products to compare.");
		} else if ($("input:checked").length > 1){
			$(".boxed").css("background","#FFFFAA none repeat scroll 0 0");
			$(".boxed a").css({color: "#000000", textDecoration: "underline"});
		} else {
			$(".boxed").css("background","#E0E0E0 none repeat scroll 0 0");
			$(".boxed a").css({color: "#494949", textDecoration: "none"});
		}
	});
});
