function ProcessPageRedirect(pc_page,pc_form,ln_id)
{
	if (pc_page == 'maintain_bookings.asp')
	{
		document.getElementById(pc_form).action = 'maintain_bookings.asp?id=' + ln_id;
		document.getElementById(pc_form).submit();
	}
	else if (pc_page == 'maintain_assessments.asp')
	{
		document.getElementById(pc_form).action = 'maintain_assessments.asp?id=' + ln_id;
		document.getElementById(pc_form).submit();
	}
	else if (pc_page == 'inspection_reports.asp')
	{
		document.getElementById(pc_form).action = 'inspection_reports.asp';
		document.getElementById(pc_form).submit();
	}
	else if (pc_page == 'au_a')
	{
		document.getElementById(pc_form).action = 'annualupdate_available.asp';
		document.getElementById(pc_form).submit();
	}
	else if (pc_page == 'au_p')
	{
		document.getElementById(pc_form).action = 'annualupdate_progress.asp';
		document.getElementById(pc_form).submit();
	}
	else if (pc_page == 'inspection_details.asp')
	{
		document.getElementById(pc_form).action = 'inspection_details.asp?id=' + ln_id;
		document.getElementById(pc_form).submit();
	}
	else
	{
		alert(pc_page + ' - Page name not known');
	}
}

function DecimalPlaces(pn_Value)
{
	var ln_Pos;
	var ln_Len;
	var ln_Dif;
	var lc_Value;
	lc_Value = pn_Value.toString();
	ln_Pos = lc_Value.indexOf(".");
	if (ln_Pos>0)
	{ 
		ln_Len = lc_Value.length-1;
		ln_Dif = ln_Len - ln_Pos;
		if (ln_Dif == 0)
		{
			lc_Value=lc_Value + ".00"
		}
		else if (ln_Dif == 1)
		{
			lc_Value=lc_Value + "0"
		}
	}
	else
	{
		lc_Value=lc_Value + ".00"
	}
	return lc_Value;
}

// fxn waitToShow is needed so buttons aren't displayed when page is printed in Netscape
function waitToShow (delay) 
{ 		
	if (delay > 1) 
	{			
		setTimeout("waitToShow(1)",10000);
	} 
	else 
	{
		document.getElementById("spnHeader").style.display = '';
	}
}

function hideText ()
{	
	document.getElementById("spnHeader").style.display = 'none';
	window.print();
	eval("waitToShow(60)");	
}

function convert2date (pc_TextDate)
{
	var lc_Convert2Date='';
	var ld_Convert2Date=new Date();
	lc_Convert2Date=pc_TextDate
	ln_Day=lc_Convert2Date.substr(0,2);
	ln_Month=lc_Convert2Date.substr(3,2) - 1;
	ln_Year=lc_Convert2Date.substr(6,4);
	ld_Convert2Date.setFullYear(ln_Year,ln_Month,ln_Day);
	return ld_Convert2Date
}

function gl_KeyPressed (po_Event, pn_Key)
{
	var ll_KeyPressed = false;
	var key = (po_Event.which) ? po_Event.which : po_Event.keyCode;
	if (key==pn_Key)
	{
		ll_KeyPressed=true;
	}
	return ll_KeyPressed;
}