<!--

function openWindow(theURL,winName,features, myWidth, myHeight, isCenter){
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function doValidateMailing(objF){
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(objF.email.value)){
			alert("Please enter a valid email address.");
		objF.email.focus();
		return false;
	}
}

function doValidateLogin(objF){
	if((!objF.username.value)||(objF.username.value=='User Name:')){
		alert("Please enter your username.");
		objF.username.focus();
		return false;
	}
	if((!objF.password.value)||(objF.password.value=='Password:')){
		alert("Please enter your password.");
		objF.password.focus();
		return false;
	}
}

function doSwapContent(objT,strDefault,intAction){
	if(intAction == 1){
		if(objT.value == strDefault){
			objT.value = '';
		}
	}
	else if(intAction == 2){
		if(objT.value == ''){
			objT.value = strDefault;
		}
	}
}

function doValidateRegister(objF){
	if(!objF.forename.value){
		alert("Please enter your first name.");
		objF.forename.focus();
		return false;
	}
	
	if(!objF.surname.value){
		alert("Please enter your surname.");
		objF.surname.focus();
		return false;
	}
	
	if(!objF.company.value){
		alert("Please enter your company name.");
		objF.company.focus();
		return false;
	}
	
	if(!objF.position.value){
		alert("Please enter your position within the company.");
		objF.position.focus();
		return false;
	}
	
	if(!objF.address_1.value){
		alert("Please enter your address.");
		objF.address_1.focus();
		return false;
	}
	
	if(!objF.address_4.value){
		alert("Please enter your city.");
		objF.address_4.focus();
		return false;
	}
	
	if(!objF.address_5.value){
		alert("Please enter your county.");
		objF.address_5.focus();
		return false;
	}
	
	if(!objF.postcode.value){
		alert("Please enter your postcode.");
		objF.postcode.focus();
		return false;
	}
	
	if(!objF.telephone.value){
		alert("Please enter your telephone number.");
		objF.telephone.focus();
		return false;
	}
	
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(objF.email.value)){
			alert("Please enter a valid email address.");
		objF.email.focus();
		return false;
	}
	
	if(!objF.utype.value){
		alert("Please enter your business type.");
		objF.utype.focus();
		return false;
	}
	
	if(!objF.bus_type.value){
		alert("Please select your business type.");
		objF.bus_type.focus();
		return false;
	}
	
	if((objF.bus_type.value == 1)&&(!objF.bus_type_reg_no.value)){
		alert("Please enter your company registration number.");
		objF.bus_type_reg_no.focus();
		return false;
	}
	
	if((objF.bus_type.value == 2)&&(!objF.bus_type_reg_no.value)){
		alert("Please enter your company registration number.");
		objF.bus_type_reg_no.focus();
		return false;
	}
	
	if((objF.bus_type.value == 3)&&(!objF.bus_type_owner.value)){
		alert("Please enter the partners' full names.");
		objF.bus_type_owner.focus();
		return false;
	}
	
	if((objF.bus_type.value == 4)&&(!objF.bus_type_owner.value)){
		alert("Please enter the business owner's full name.");
		objF.bus_type_owner.focus();
		return false;
	}
	
	if(!objF.bus_activity.value){
		alert("Please select your business activity.");
		objF.bus_activity.focus();
		return false;
	}
	
	if((objF.bus_activity.value == 4)&&(!objF.bus_activity_other.value)){
		alert("Please specify \"other\". business activity.");
		objF.bus_activity_other.focus();
		return false;
	}
	
	if(objF.acc_no.value.length < 6){
		alert("Please enter a username of at least 6 characters.");
		objF.acc_no.focus();
		return false;
	}
	
	if(objF.password.value.length < 6){
		alert("Please enter a password of at least 6 characters.");
		objF.password.focus();
		return false;
	}
	
	if(objF.password.value != objF.confirm.value){
		alert("Password and confirmation do not match.");
		objF.confirm.focus();
		return false;
	}
	
	if(!objF.terms.checked){
		alert("You must agree to our terms and conditions.");
		objF.terms.focus();
		return false;
	}
	
}


-->

