function changeField(myargs)
{
	myargs.style.border = "1px solid #61A9DB"
	myargs.style.background = "#CBDAF0"
}
function revertField(myargs)
{
	myargs.style.border = "1px solid #01369E"
	myargs.style.background = "#ffffff"
}

function textFieldChange(myField,myValue,myAction)
{
	if(myAction == 'focus')
	{
		if(myField.value == myValue)
		{
			myField.value = '';
		}
	}
	else
	{
		if(myField.value == '')
		{
			myField.value = myValue;
		}
	}
}
function textPasswordChange()
{
	document.getElementById('Password').style.backgroundImage="url('/images/general/spacer.gif')";
}
function textPasswordRevert(formField)
{
	if(formField.value == '')
	{
		document.getElementById('Password').style.backgroundImage="url('/images/general/bg-password.gif')";
	}
}


/***************************************************************
The following three function are used to copy the delivery detail
into billing detail. if user check the 'same as above'
check box at the beginning of the postal detail section, then 
fill in each form field with the same value of the business detail 
form field value.
****************************************************************/
function billingDetailCheck(form)
{
	if (form.billingCopy.checked)
	{
		fillBillingDetail(form)
	}
	else
	{
		clearBillingDetail(form)
	}
}

function fillBillingDetail(form)
{
	form.f_BillingStreet.value = form.f_DelStreet.value;
	form.f_BillingSuburb.value = form.f_DelSuburb.value;
	var billingCountryIndex = form.f_DelCountry.selectedIndex;
	form.f_BillingCountry.options[billingCountryIndex].selected = true;
	form.f_BillingState.value = form.f_DelState.value;
	form.f_BillingPostcode.value = form.f_DelPostcode.value;
	//form.f_BillingCountry.value = form.f_DelCountry.value;
}

function clearBillingDetail(form)
{
	form.f_BillingStreet.value = '';
	form.f_BillingSuburb.value = '';
	form.f_BillingCountry.options[0].selected = true;
	form.f_BillingState.value = '';
	form.f_BillingPostcode.value = '';
	//form.f_BillingCountry.value = '';
}
