jQuery(document).ready(function(){
	
	// autoclear
	$(".autoclear").each(function(){
		$(this).attr("title", $(this).attr("value"));
	});
	$(".autoclear").focus(function(){
		if ($(this).attr("title") == $(this).attr("value"))
			$(this).attr("value", "");
	});
	$(".autoclear").blur(function(){
		if (!$(this).attr("value") || $(this).attr("value") == "")
			$(this).attr("value", $(this).attr("title"));
		else
			$(this).removeClass("autoclear");
	});
	
	// zebra stripes
	$(
		"table.zebra tbody tr:odd, "
		+ "table#cart tbody tr:odd"
	).addClass('zebra1');
	
	// add input classes since IE can't do attribute selectors
	$("input[@type=text]").addClass("text");
	$("input[@type=password]").addClass("password");
	
	// checkout
	$(
		"#store-checkout-details #checkout-login, "
		+"#store-checkout-details #checkout-register"
	).each(function(i){
		var containr = this;
		$(containr).addClass("checkout-option");
		$("form, p br", containr).hide();
		$(containr).click(function(){
			if ($(this).attr("class").indexOf("checkout-option") == -1)
				return;
			$(".checkout-option").hide("slow");
			$(containr).show("slow");
			$("form, p br", containr).show("slow");
			$(containr).removeClass("checkout-option");
		});
	});
});
