// JavaScript Document
function func_search()
{
	document.frm_show_data.submit()
}
function func_panging(no)
{
	document.frm_show_data.page.value = no
	document.frm_show_data.submit()
}
function link_location(url)
{
	document.location = url
}
function submit_to(url)
{
	document.frm_show_data.action = url
	document.frm_show_data.submit()
}
function order_by(field,no)
{
	document.frm_show_data.field_asc_desc.value = field
	document.frm_show_data.asc_desc.value = no
	document.frm_show_data.submit()
}
function click_confirm(msg)
{
	if(confirm(msg))
	{
		return true
	}
	else
	{
		return false
	}
}
function check_checkbox(num)
{
	flag = document.getElementById('ck_all').checked
	for(i = 0; i < num; i++)
	{
		try
		{
			document.getElementById('id_'+i).checked = flag
		}
		catch(e)
		{
			break
		}
	}
}
function del_selected(url,num,msg)
{
	del = false
	for(i = 0; i < num; i++)
	{
		try
		{
			if(document.getElementById('id_'+i).checked == true)
			{
				del = true;
				break;
			}
		}
		catch(e)
		{
			break
		}
	}
	
	if(!del)
	{
		alert("Pilih salah satu record yang ingin dihapus");
	}
	else
	{
		if(!confirm(msg))
		{
			return
		}
	
		submit_to(url)
	}
}

function submit_save()
{
	document.frm_input_data.submit()
}


function sendGet(url,div_id)
{
	//alert($(div_id).innerHTML)
	$(div_id).innerHTML = '<img src="images/loading.gif" />';
	//alert(div_id)
	new Ajax.Request(url, {   
					 method: 'get',   
					 onSuccess: function(transport) 
					 {     
					 	$(div_id).update(transport.responseText);
					 } 
	}); 
}
