// JavaScript Document
jQuery(document).ready(function($) {
	$('div#login input#log').focus(function(e) {
		if ($(this).val() == 'Username')
			$(this).val('');
	});
	$('div#login input#pwd').focus(function(e) {
		if ($(this).val() == 'Password')
			$(this).val('');
	});
	$('div#login input#log').blur(function(e) {
		if ($(this).val() == '')
			$(this).val('Username');
	});
	$('div#login input#pwd').blur(function(e) {
		if ($(this).val() == '')
			$(this).val('Password');
	});
	$('#cm-ajax-email').val('Your Email Address');	
	$('#cm-ajax-email').focus(function(e) {
		if ($(this).val() == 'Your Email Address')
			$(this).val('');
	});
	$('#cm-ajax-email').blur(function(e) {
		if ($(this).val() == '')
			$(this).val('Your Email Address');
	});
	$('#right-callout .widget_cm_ajax form p:last-child input').addClass('register-button');
	
	// Disable checkout if less than 6 items in the cart
	if (items_in_cart < 4 && 'cart' == page) {
		$('.checkout-button').text('4 or more items to checkout');
		$('.checkout-button').addClass('checkout-button-disabled');
		$('.checkout-button').click(function(e) {
			e.preventDefault();
		});
	}
});
