 $(function(){
 	// sliding menu item
	$(".navItem").hover(
		function() {
			$(this).animate({paddingLeft: '90px'}, 400);
			$(this).css({background: '#f5bdbd'});
		},
		function() {
			$(this).animate({paddingLeft: '43px'}, 400);
			$(this).css({background: '#1d1d1d'});
		}
	
	),

	 
	// swap menu buttons
	$(".swapButton").hover(				
		function() {
			$replaceBy = $(this).attr("src").replace(/([^/]+)_off((\.gif)|(\.jpg))$/g, "$1_on$2");
			$(this).attr("src", $replaceBy);
		},
		function() {
			$replaceBy = $(this).attr("src").replace(/([^/]+)_on((\.gif)|(\.jpg))$/g, "$1_off$2");
			$(this).attr("src", $replaceBy);
		}
	),
	
	$("#overlay").css({"opacity": "0.5"}),
	$("#overlay").show(),
	
	// shop online menu toggle	
	$("#showShopMenu").click(
		function(e) {
			e.preventDefault();
			$("#mainMenu").fadeOut();
			$("#shopMenu").fadeIn();
		}
	),
	$("#showMainMenu").click(
			function(e) {
				e.preventDefault();
				$("#mainMenu").fadeIn();
				$("#shopMenu").fadeOut();
			}
	)	
	
});












function getNewCaptcha(id, url) {
	var imgObj = getObj(id);
	imgObj.src = url+'&'+Math.random();
}

function validateProductForm() { 
	var x = document.orderForm;
	var quantity = x.quantity;
	
	if (parseInt(quantity.value) > 0)
		 x.submit();
	else
		alert('Please enter quantity');
}

