//=============================================================================
TMyMovers = {};

//=============================================================================
TMyMovers.OnInit = function() {
	$('input, textarea').placeholder();
	
	$("a[rel^=Lightbox]").lightBox();
	
	if($.browser.msie && $.browser.version < 9) {
		$(".MenuItem").textShadow();
	}
	
	$(".MenuItem").hover(function(){
		$(this).css("backgroundColor", "#232323");
		if($(this).children(".SubMenu").length > 0) {
			$(this).children(".SubMenu").slideDown("fast");
		}
	}, function(){
		$(this).css("backgroundColor", "transparent");
		if($(this).children(".SubMenu").length > 0) {
			$(this).children(".SubMenu").slideUp("fast");
		}
	});
}

//-----------------------------------------------------------------------------
TMyMovers.SearchGo = function() {
	var Keywords = $('#SidebarSearchContentKeywords').attr('value');

	Keywords = Keywords.replace(/\//g, "-");

	document.location.href = '/search/' + Keywords;
}

//=============================================================================
TMyMovers.AddToCart = function(ProductID, NormalID) {
	var Quantity					= parseInt($("#Quantity").attr("value"));
	var ProductsShippingMethodsID	= parseInt($("#ProductsShippingMethodsID").attr("value"));
	var Max							= parseInt($("#Max").attr("value"));

	if(Quantity <= 0) {
		alert("Please enter a valid quantity.");
		$("#Quantity").focus();
		return;
	}else
	if(Quantity > Max && Max > 0) {
		alert("You are not allowed to purchase more than " + Max + " of this product.");
		$("#Quantity").attr("value", Max);
		$("#Quantity").focus();
		return;
	}

	var Parms = {
		"ProductsID"				: ProductID,
		"ProductsShippingMethodsID" : ProductsShippingMethodsID,

		"NormalOptionID"			: NormalID,
		"ImprintOptionID"			: 0,
		"NumColors"					: 0,

		"NormalOptionColors"		: JSON.stringify({}),
		"ImprintOptionColors"		: JSON.stringify({}),

		"Quantity"					: Quantity,

		"Artwork"					: "None"
	};

	MCarts.AddToCart(Parms, function(Code, Content) {
		if(Code == 1) {
			window.location.href = "/cart.php";
		}else{
			alert(Content);
		}
	})
}

//=============================================================================
$(TMyMovers.OnInit);

//=============================================================================

