// jQuery preload images
jQuery.preloadImages = function() {
	for(var i=0; i<arguments.length; i++) {
		$("<img>").attr("src", arguments[i]);
	}
}

$(document).ready(function(){
	// alert('jQuery Loves You!');
	
	
	/* Remove newsletter's prompt value upon focus and re-add it if blank  */
	var newsletter_prompt = 'Enter Email Address';
	$('div#topnav_newsletter input').focus(function() {
		if ($(this).val() == newsletter_prompt) {
			$(this).val('');
		}
	})
	.blur(function() {
		if ($(this).val() == '') {
			$(this).val(newsletter_prompt)
		}
	});
	
	// product view swap
	$("div#product_images_additional a").click(function(){
		if ($(this).attr("rel")) {
			new_path = "http://assets.k2sports.com/zoot/ftpzoot/products/main/" + $(this).attr("rel") + ".jpg"
			// alert(new_path);
			$("div#product_images_main img").attr("src", new_path);
		}
		return false;
	});
	

	// support answer toggle
	$(".question").click(function(){
		// jQuery(this).siblings(".answer").toggle();
		$(".answer").hide();
		$(this).siblings(".answer").show();
		return false;
	});

});
