/***** COMMON JQUERY *****/
function backgroundPos() {
	var x = parseInt(-(1360 - $(window).width()) / 2);
	var pos = x + "px 0px";
	$("body").css({backgroundPosition : pos});
}
// MAIN JQUERY BEGIN //
	$(document).ready(function() {
		$(window).load(function() {
			backgroundPos();
		}).resize(function() {
			backgroundPos();
		});
		$("#partners").jcarousel({
			scroll : 4
		});
		$("#sacs").jcarousel({
			scroll : 5
		});
		$("#nav li a.sub").click(function() {
			$("div.product-dd").hide();
			$("#"+this.title).show();
			$(".product-dd-list").jcarousel({scroll : 6});
			$("#nav li a").removeClass("active");
			$(this).addClass("active");
			return false;
		});
		$("div.product-dd a.close").click(function() {
			$("#nav li a").removeClass("active");
			$(this).parent().hide();
			return false;
		});
		$('.tabs a').click(function(e){
			e.preventDefault();
			$('.tabs a').removeClass('active');
			$(this).addClass('active');
			$('.tab-panel').removeClass('active');
			$($(this).attr('href')).addClass('active');
		});
		$('ul.bag input[type=checkbox]').change(function() {
			if($(this).attr('checked')) visible='visible'; 
			else visible='hidden';
			$(this).parent().parent().find('span.visible').css('visibility', visible);
		});
		$('.sac-box .jcarousel-clip').hide();
		$('.sac-box input[type=checkbox]').change(function() {
			if( $(this).attr('checked') ) {
				$('.sac-box .jcarousel-clip').show();
			} else {
				$('.sac-box .jcarousel-clip').hide();
			}
		});
		$("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;
				}
			});
		});
		$("ul.cat1 li a").mouseover(function() {
			$(this).parent().find('span.tooltip').show();
		});
		$("ul.cat1 li a").mouseout(function() {
			$(this).parent().find('span.tooltip').hide();
		});
		$('div.pager ul').css('margin', (660 - $('div.pager ul').width)/2);
	});
// MAIN JQUERY END //
