function rollBasket(action, product, type) {
	if (action == null) action = 'get';
	url = "/?module=basket&action="+action;
	if (product != null) url = url+"&product="+product;
	if (type != null) url = url+"&type="+type;
	$("#basket").load(url);
	if ($("#basketblock").length == 1) $("#basketblock").load("/?module=order");
}

$(document).ready(function(){
	var $menu = $("#mainmenu");
	var $items = $menu.find("td.item");
	$items.each(function(i){
		var $div = $(this).children("div.submenu")
		var width = $div.width();
		if (width < $(this).width()) width = $(this).width() - 2;
		$div.css({width:width+'px'}).hide();
		$(this).hover (
			function(e) {
				$(this).children("div.submenu").show();
			},
			function(e) {
				$(this).children("div.submenu").hide();
			}
		)
		$div.hover (
			function(e) {
				$(this).show();
			},
			function(e) {
				$(this).hide();
			}
		)
	})
})


