//------------------------------------------------------------------------------
function setupCalendar(input_fld, trigger_id)
{
 Calendar.setup(
    {
      inputField  : input_fld,
      ifFormat    : "%Y-%m-%d",
      button      : trigger_id
    }
  );
}
//------------------------------------------------------------------------------
function navigatePaging(url, page, totalPages)
{
	if(!isNumeric(page))
	{
		alert('Please enter only numbers'); page.focus(); return false;
	}
	pageId	=	trimAll(page.value);
	if(pageId > totalPages || pageId < 1)
	{
		alert('Invalid Page'); page.focus(); return false;
	}
	//window.location	=	url+pageId+"/";
	window.location	=	url+pageId;
	return false;
}
//------------------------------------------------------------------------------
function goBack(url)
{
	if(url == "")
		history.go(-1);
	else
		window.location	=	url;
}
//------------------------------------------------------------------------------
function goToPage(url)
{
	window.location	=	url;
}
//------------------------------------------------------------------------------
function delAlert(url)
{
	if(confirm("Are you sure?"))
	{
		window.location	=	url;
	}
	else
	{
		return false;
	}
}
//------------------------------------------------------------------------------
function swapImage(imgObj, id)
{
	imgPath	=	imgObj.src;
	if(id != undefined)
	{
		if(imgPath.indexOf(id.toLowerCase()) > 0)
		{
			return true;
		}
	}
	arrPath	=	imgPath.split("_");

	if(arrPath[1]	==	"on.gif")
		imgObj.src	=	eval("'" + arrPath[0] + "_off.gif'");
	else
		imgObj.src	=	eval("'" + arrPath[0] + "_on.gif'");
}
//------------------------------------------------------------------------------
