sale.js 1.53 KB
QSale = {
	oldDayId:1,
	oldWeekId:1,
	init:function()
	{
		this.dayPage('','');
		this.weekPage('','');
	},
	dayPage:function(page, obj)
	{
		QGlobal.Page.QSend_Url = '/winner/datelist';
		QGlobal.Page.QItem = 'dayItem';
		QGlobal.Page.getList('winner_type=1&' + page, obj);
	},
	weekPage:function(page,obj)
	{
		QGlobal.Page.QSend_Url = '/winner/datelist';
		QGlobal.Page.QItem = 'weekItem';
		QGlobal.Page.getList('winner_type=2&' + page, obj);
	},
	showWinnerList:function(id,winner_date, winner_type)
	{
		if(typeof winner_date == 'undefined' || winner_date == '')
		{
			return false;
		}
		$.get('/winner/winnerlist', {'winner_date':winner_date, 'winner_type':winner_type}, function(html){
			if(html != ''){
				if(winner_type == 1)
				{
					$('#dayList').html(html);
					$('#day_' + QSale.oldDayId).attr('class', '');
					$('#day_' + id).attr('class', 'act');
					QSale.oldDayId = id;
				}else{
					$('#weekList').html(html);
					$('#week_' + QSale.oldWeekId).attr('class','');
					$('#week_' + id).attr('class', 'act');
					QSale.oldWeekId = id;
				}
			}
		});
	},
	showsub_b:function (id)
	{
		for (i = 0;i<=10;i++)
		{
			document.getElementById("tab_b"+i).className = "";
			document.getElementById("sub_b"+i).style.display = "none";
		}
		document.getElementById("tab_b"+id).className = "act";
		document.getElementById("sub_b"+id).style.display = "";
	},
	showsub : function (id)
	{
		for (i = 0;i<4;i++)
		{
			document.getElementById("sub_b"+i).style.display = "none";
		}
		document.getElementById("sub_b"+id).style.display = "";
	}
};