// JavaScript Document
/**
 * 首页下拉菜单
 */
jquery=jQuery.noConflict();
function indexmenu()
{
	//下拉菜单
	jquery("#nav li").mouseover(function()
	{
		jquery('dl', this).show();
	}
	).mouseout(function()
	{
		jquery('dl', this).hide();
	})
	
	jquery("#tree_nav li").mouseover(function()
	{
		jquery('dl', this).show();
	}
	).mouseout(function()
	{
		jquery('dl', this).hide();
	})
	
	jquery("#rm_goods li").mouseover(function()
	{
		jquery('dl', this).show();
	}
	).mouseout(function()
	{
		jquery('dl', this).hide();
	})
}

jquery(function()
{
	indexmenu();
	ajax_sort();
});

function ajax_sort()
{	
	var arr=location.href.split("?");
	//alert(arr[1]);
	var first = new Array();
	var last = new Array();
	var sort_s;
	var order_s;
	if(arr[1] != null){
		tmp=arr[1].split("&");
		//alert(tmp.length);
		for(i=0;i<tmp.length;i++){		
			tmp2=tmp[i].split("=");
			first[i]=tmp2[0];
			//alert(first[i]);
			last[i]=tmp2[1];
			//alert(last[i]);
			if(first[i]=="sort"){		
				sort_s=last[i];
			}
			else if(first[i]=="order"){			
				order_s=last[i];
			}		
		}
	}
	if(sort_s==null){
		sort_s="shop_price";
	}
	if(order_s==null){
		order_s="DESC";
	}
	//alert(sort_s);
	//alert(order_s);
	jquery("#" + sort_s).addClass("ui-state-active");
	jquery("#" + order_s).addClass("ui-state-active");
	jquery("#tabs2 li").click(function()
	{
		var s_id = jquery(this).attr("id");
		if(s_id != "ASC" && s_id != "DESC")
			sort_s=s_id;
		else
			order_s=s_id;
		location.href=arr[0] + "?sort="+ sort_s +"&order=" + order_s;
		jquery("#tabs2 li").removeClass("ui-state-active");
	})
}

function c_p()
{
	var number=jquery("#number").val();
	var shop_price=jquery("#ECS_SHOPPRICE").val();
	alert(shop_price);
	var amount=shop_price*number;
	alert(amount);
	jquery("#ECS_SHOPPRICE").val(amount);
}