/***** COMMON JQUERY *****/
// MAIN JQUERY BEGIN //
	$(document).ready(function() {
		$("input").each(function() {
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = "";
				}
			});
			$(this).blur(function() {
				if(this.value == "") {
					this.value = default_value;
				}
			});
		});
		$(".p-info-box").css("top", 30 - $(".p-info-box").height());
		$("div.p-info-box").show();
		$("a.p-info").click(function() {
			if($(".p-info-box").css("top") == "0px") {
				$('.p-info-box').animate({ top: (30 - $(".p-info-box").height()) }, "fast");
				$("a.p-info").css("background", "url('/img/purchasing-info-button.png')");
			} else {
				$('.p-info-box').animate({ top: 0 }, "fast");
				$("a.p-info").css("background", "url('/img/purchasing-info-button-over.png')");
			}
			return false;
		});
		$("ul.nav li").mouseenter(function() {
			$(this).find("a:not(ul.dd a)").css("background", "url('/img/nav-right.png') top right no-repeat");
			$(this).find("span").css("background", "url('/img/nav-left.png') top left no-repeat");
			
			$(this).find("ul.dd").show();
		});
		$("ul.nav li").mouseleave(function() {
			$(this).find("a:not(ul.dd a)").css("background", "none");
			$(this).find("span").css("background", "none");

			$(this).find("ul.dd").hide();
		});
		$("ul#slider span.caption").show();
		$('#slider').cycle({
			fx:     'fade',
			next:   '#next',
			prev:   '#prev'
		});
		$(".cat-product-list").jcarousel({
			scroll	: 4
		});
		$('table.default tbody tr.bag input[type=checkbox]').change(function() {
			if($(this).attr('checked')) {
				visible = 'visible';
			} else {
				visible = 'hidden';
			}
			$(this).parent().parent().find('span.v').css('visibility', visible);
		});
		$(".bagList").jcarousel({
			scroll	: 5
		});
		$('table.default .jcarousel-clip').hide();
		$('table.default tfoot tr.bag-title input[type=checkbox]').change(function() {
			if($(this).attr('checked')) {
				$('table.default .jcarousel-clip').show();
			} else {
				$('table.default .jcarousel-clip').hide();
			}
		});
	});
// MAIN JQUERY END //
