PAGE_SIDE_ACTIVE()

function DIV_DARK_BG_ACT(div_id, action) 
{
	document.getElementById(div_id).style.display = action;
}

function DIV_MODAL(div_id, action)
{
	document.getElementById(div_id).style.display = action;
}

function MODAL_TITLE(title_id, content)
{
	alert(content);
	document.getElementById(title_id).innerHTML = content;
}

/*
  ----------------------------------------------------------------------------
	For activating the selected list in side bar
  ----------------------------------------------------------------------------
*/
function PAGE_SIDE_ACTIVE()
{
	var array_links = 
	[
		JSCUS_CACHE.SERVER_URL+"/p/record/ticket_checker.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/barcode.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/history_load.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/history_service.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/history_ticket.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/receipt.html",
		JSCUS_CACHE.SERVER_URL+"/p/record/ticket.html",
		JSCUS_CACHE.SERVER_URL+"/p/account/member.html",
		JSCUS_CACHE.SERVER_URL+"/p/account/level.html",
		JSCUS_CACHE.SERVER_URL+"/p/category/preset_barcode.html",
		JSCUS_CACHE.SERVER_URL+"/p/category/ticket.html",
		JSCUS_CACHE.SERVER_URL+"/p/category/service_group.html",
		JSCUS_CACHE.SERVER_URL+"/p/category/service.html"
	];

	var array_link_ids = 
	[
		"LI_SIDE_REC_TICKET_CHECKER",
		"LI_SIDE_REC_BARCODE",
		"LI_SIDE_REC_HIS_LOAD",
		"LI_SIDE_REC_HIS_SERVICE",
		"LI_SIDE_REC_HIS_TICKET",
		"LI_SIDE_REC_RECEIPT",
		"LI_SIDE_REC_TICKET",
		"LI_SIDE_MEMBER",
		"LI_SIDE_LVL",
		"LI_SIDE_CAT_PRE_LOAD",
		"LI_SIDE_CAT_TICKET",

		"LI_SIDE_CAT_SERVICE",
		"LI_SIDE_CAT_SERVICE"
	];

	for(var i = 0; i < array_links.length; i++)
	{

		if(array_links[i] == window.location.href)
		{
			document.getElementById(array_link_ids[i]).className += 'active';

			if(i >= 1 && i <= 6)
			{
				document.getElementById("LI_SIDE_RECORD").className += ' active';
			}
			else if(i >= 7 && i <= 8)
			{
				document.getElementById("LI_SIDE_ACCOUNT").className += ' active';
			}
			else if(i >= 9 && i <= 12)
			{
				document.getElementById("LI_SIDE_CATEGORY").className += ' active';
			}

		}
	}
}
// ----------------------------------------------------------------------------

// ----------------------------------------------------------------------------
function TXT_TO_CMB(cmb_id, element)
{
	var row_index = element.rowIndex;
	var td = ""; 
	var set_num = "";

	if(row_index == 1)
	{
		row_index -= 1;
	}

	td = JSOC_ELEMENT.VAR_INNER_HTML("ACCESS_RIGHTS_DGV_ROW_SYS_AUTHORITY_ID_"+row_index); 
	set_num = +td - 1;

	JSOC_CMB.VAR_SELECTED_INDEX(cmb_id, td);
}

// ----------------------------------------------------------------------------
function CMB_TO_TXT(cmb_id, txt_id)
{
	JSOC_ELEMENT.VAR_VALUE(txt_id, JSOC_ELEMENT.VAR_VALUE(cmb_id));
}	

