

// SUMMARY: simulate default SUBMIT button press (ASPNET support). forward submit to correct button
// [aBtnSubmitId]: string ID of submit button to forward event 
// [aEvent]: event object
// <retval>: boolean propogate mouseclick to default handlers
function Clck(aBtnSubmitId,aEvent)
{
	var e;
	
	if(window.event)e=window.event; // MSIE
	else e=aEvent;
	
	if( (e.which||e.keyCode)&&(e.which==13||e.keyCode==13) )
	{
		document.getElementById(aBtnSubmitId).click();
		return false;
	} 
	else return true;
}


function Set(aName,aVal)
{
	document.getElementById(aName).value=aVal;
}

function YYYYMMDDHHMMSS()
{
	var dt=new Date();
	
	// build YYYYmmDD sequence
	var tmp=""+(dt.getMonth()+1);
	if(tmp.length<2)tmp="0"+tmp;
	var sVal=dt.getFullYear()+tmp;
	tmp=""+(dt.getDate());
	if(tmp.length<2)tmp="0"+tmp;
	sVal+=tmp;
	tmp=""+(dt.getHours());
	if(tmp.length<2)tmp="0"+tmp;
	sVal+=tmp;
	tmp=""+(dt.getMinutes());
	if(tmp.length<2)tmp="0"+tmp;
	sVal+=tmp;
	tmp=""+(dt.getSeconds());
	if(tmp.length<2)tmp="0"+tmp;
	sVal+=tmp;
	return sVal;
}


function AutoFill1()
{
	var uname="max"+YYYYMMDDHHMMSS();
	var email=uname+"@newmind.co.uk";
	
	Set("customer_txtTitle","Mr");
	Set("customer_txtForename","Max");
	Set("customer_txtSurname","Birkett");
	Set("customer_txtEmail",email);
	Set("customer_ddlMembType","0");
	Set("customer_txtAddr1","Road");
	Set("customer_txtTown","Town");
	Set("customer_txtPCode","Pcode");
	Set("customer_txtUser",uname);
	Set("customer_txtPassword","test1");
	Set("customer_txtConfirmPassword","test1");
	var objCtrl=document.getElementById("customer_chkTerms");
	objCtrl.checked=true;

}
