// GESTIONE DELLA			***	MYPage  ***
function MyPage_modifyThisBox(boxId, options)
{
	options = SISAL.isNullOrEmpty(options) ? {} : SISAL.copy(options);
	
	SISAL.ajax("/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/box"+boxId+"%20modifica", {
		target: 'tableMyPage_' + boxId,
		method: 'GET'
	});
	
	if (SISAL.isNullOrEmpty(options.method))
	{
		SISAL.ajax("/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/button"+boxId+"%20modifica", {
			target: 'tableMyPageButtons_' + boxId,
			method: 'GET'
		});
	} else
	{
		SISAL.ajax("/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/button"+boxId+"%20choose", {
			target: 'tableMyPageButtons_' + boxId,
			method: 'GET'
		});
	}
}
function MyPage_showBox(boxId, options)
{
	options = SISAL.isNullOrEmpty(options) ? {} : SISAL.copy(options);

	if (!SISAL.isNullOrEmpty(document.getElementById('tableMyPage_' + boxId)))
		SISAL.ajax("/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/", {
			target: 'tableMyPage_' + boxId,
			method: 'GET'
		});
	
	
	if (!SISAL.isNullOrEmpty(document.getElementById('tableMyPageButtons_' + boxId)))
		SISAL.ajax("/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/button"+boxId+"/", {
			target: 'tableMyPageButtons_' + boxId,
			method: 'GET'
		});
	
}
function getParamsBox()
{
	var checkId = 'idSelect_';
	
	var risultato = '';
	for (i=0; i<100; i++)
	{
		var checkObj = document.getElementById(checkId+i);
		if (!SISAL.isNullOrEmpty(checkObj))
		{
			if (checkObj.checked == true)
			{
				risultato = risultato + i + '|';
			}
		}
	}
	return risultato;
}
function MyPage_submitThisBox(boxId)
{
	if (getParamsBox() != "")
	{
		var urlDestinazione = "/portal/page/portal/PortaleGiochiNumerici/mypage/box"+boxId+"/box"+boxId+"%20modifica";
		var urlFinale = urlDestinazione + "?paramsbox=" + getParamsBox() + "&boxmodify=" + "modificato";	
		
		SISAL.ajax(urlFinale, {
			method: 'GET',
			success: function () { MyPage_showBox(boxId); }
		});
	}
}
