$(document).ready(function() {
	$('input.watermark').each(function() {
		var watermark = $(this).attr('value');						   
									   
		$(this).focus(function() { 			   
			if($(this).attr('value') == watermark) {
				$(this).attr('value', '');
			}
		});
		
		$(this).blur(function() { 
			if($(this).attr('value') == '') {
				$(this).attr('value', watermark);
			}
		});
	});

    var txtsearch = $("#txt-search");
    var txtsignup = $("#txt-signup");
    txtsearch.focus(function() {
        if ($(this).attr("value") == "Search") $(this).attr("value", "");
    });
    txtsearch.blur(function() {
        if ($(this).attr("value") == "") $(this).attr("value", "Search");
    });
    txtsignup.focus(function() {
        if ($(this).attr("value") == "Email Address") $(this).attr("value", "");
    });
    txtsignup.blur(function() {
        if ($(this).attr("value") == "") $(this).attr("value", "Email Address");
    });
	
    $(".js-show").css("display", "block");

    $(".list li:nth-child(3n)").after("<div class='clear'></div>");

    $(".col1-prod li a").click(function() {
        var imageS = $(this).children('img').attr("src");
        var imageM = $(this).attr("href");
        var imageL = $(this).attr("rel");
        var current = $(".col1-prod p a").attr("rel");
        var current2 = $(".col1-prod p a").attr("href");
        var current3 = $(".col1-prod p a img").attr("src");
        $(".col1-prod p a").attr({ rel: imageS });
        $(".col1-prod p img").attr({ src: imageM });
        $(".col1-prod p a").attr({ href: imageL });
        return false;
    });

    var options = {
        zoomWidth: 273,
        zoomHeight: 273,
        title: false,
        showEffect: 'fadein',
        hideEffect: 'fadeout',
        fadeoutSpeed: 'fast'
    };
    $('.jqzoom').jqzoom(options);

    $(".checkout .checkout-padding").css("display", "none");
    $(".checkout .checkout-padding:first").css("display", "block");

    //    $('.checkout .checkout-padding a.continue').click(function() {
    //        $(this).parent('p').parent('div.checkout-padding').slideUp();
    //        $(this).parent('p').parent('div.checkout-padding').parent('div.checkout-section').next('div.checkout-section').children('div.checkout-padding').slideDown();
    //        return false;
    //    });

    //    $('.checkout .checkout-padding a.back').click(function() {
    //        $(this).parent('p').parent('div.checkout-padding').slideUp();
    //        $(this).parent('p').parent('div.checkout-padding').parent('div.checkout-section').prev('div.checkout-section').children('div.checkout-padding').slideDown();
    //        return false;
    //    });

    $('#dialog').jqm();

    $(".nav a").each(function() {
        var currentURL = location.pathname.toString().split("/");
        var basePath = "/" + currentURL[1] + "/";

        if (location.pathname == $(this).attr("href") || basePath == $(this).attr("href")) {
            $(this).addClass("active");
        }
    });
	
//	$('input.step2').click(function() {
//		$('#entry').hide();
//		$('#friends').fadeIn();
//	});
//	
//	$('input.step3').click(function() {
//		$('#friends').hide();
//		$('#confirm').fadeIn();
//	});

});
