// formsjs
function changed(formid)
{
aform=document.getElementById(formid);
aform.changedflag.value=1
}

function formreset(formid)
{
aform=document.getElementById(formid);
aform.reset();
aform.changedflag.value=0;
return true;
}

function exitpage(formid,where)
{
//alert('Debug message code 1');
aform=document.getElementById(formid);
if (aform.changedflag.value==1)
	{
	msg='Are you sure you wish to exit? You will lose the updates you have done'
	if (!window.confirm(msg)) return false	
	}
aform.update.value='1'
aform.action=where;
s=where.indexOf('php',0);
if 	(s>=0)
	{
	aform.submit();
	}
else
	{
	location.href=where;
	}
return true
}


function formsub(formid)
{
aform=document.getElementById(formid);
aform.submit()
}

function formsub_ex(formid,update)
{
aform=document.getElementById(formid);
aform.update.value=update;
aform.submit()
}

function gotopage(formid,where,check)
{
//alert('Debug message code 2');
aform=document.getElementById(formid);
if (check)
	{
	if (aform.changedflag.value==1)
		{
		msg='Are you sure you wish to exit? You will lose the updates you have done'
		if (!window.confirm(msg)) return false	
		}
	}
aform.update.value=0;
aform.page.value=where;
aform.submit()
}