function validate_cat() {
	var obj = document.cat;
	if(obj.category_name.value == '') {
		alert('Please enter category name.');
		obj.category_name.focus();
		return false;
	}
	if(!obj.status[0].checked && !obj.status[1].checked) {
		alert('Please select category status.');
		obj.status.focus();
		return false;
	}
	return true;
} 
function validate_chgpass() {
	var obj = document.chgpass;
	if(obj.OldPass.value == '') {
		alert('Please enter old password.');
		obj.OldPass.focus();
		return false;
	}
	if(obj.NewPass.value == '') {
		alert('Please enter new password.');
		obj.NewPass.focus();
		return false;
	}
	if(obj.NewPass1.value == '') {
		alert('Please enter new password again.');
		obj.NewPass1.focus();
		return false;
	}
	if(obj.NewPass.value != obj.NewPass1.value) {
		alert('Passwords wont match. Please enter again.');
		obj.NewPass.value = '';
		obj.NewPass1.value = '';
		obj.NewPass.focus();
		return false;
	}
	return true;
}
function validate_login() {
	var obj = document.login;
	if(obj.username.value == '') {
		alert('Please enter username.');
		obj.username.focus();
		return false;
	}
	if(obj.password.value == '') {
		alert('Please enter password.');
		obj.password.focus();
		return false;
	}
	return true;
}
function validate_pro() {
	var obj = document.pro;
	if(obj.product_name.value == '') {
		alert('Please enter product name.');
		obj.product_name.focus();
		return false;
	}
	if(obj.category.value == '') {
		alert('Please select category.');
		obj.category.focus();
		return false;
	}
	if(obj.product_description.value == '') {
		alert('Please enter product description.');
		obj.category.focus();
		return false;
	}
	if(!obj.status[0].checked && !obj.status[1].checked) {
		alert('Please select category status.');
		obj.status.focus();
		return false;
	}
	return true;
}
function cat(id) {
	//window.location = '<cfoutput>#http_url#</cfoutput>category.cfm?id='+id;
	alert(id);
}
function pro(id) {
	window.location = 'product.cfm?id='+id;
}

function goto1(obj) {
	var sType = obj.equip_type.value;
	arrType = sType.split("cat_");
	
	if (arrType.length == 2) {
		window.location = 'category.cfm?id='+arrType[1];
	}

	arrType1 = sType.split("pro_");

	if (arrType1.length == 2) {
		window.location = 'product.cfm?id='+arrType1[1];
	}
}
function reset(a) {
	alert(a);
}
function validate_contacts() {
	var obj = document.contacts;
	if(obj.name.value == '') {
		alert('Please enter name.');
		obj.name.focus();
		return false;
	}
	if(obj.email.value == '') {
		alert('Please enter email.');
		obj.email.focus();
		return false;
	}
	if(obj.info.value == '') {
		alert('Please enter requested information.');
		obj.info.focus();
		return false;
	}
	return true;
}
function mem_val() {
	var obj = document.add_mem;
	if(obj.username.value == '') {
		alert('Please enter username.');
		obj.username.focus();
		return false;
	}
	if(obj.password.value == '') {
		alert('Please enter password.');
		obj.password.focus();
		return false;
	}
	if(obj.confirm_password.value == '') {
		alert('Please enter confirm password.');
		obj.confirm_password.focus();
		return false;
	}
	if(obj.password.value != obj.confirm_password.value) {
		alert('Passwords wont match.');
		obj.password.value = '';
		obj.confirm_password.value = '';
		obj.password.focus();
		return false;
	}
	if(obj.firstname.value == '') {
		alert('Please enter first name.');
		obj.firstname.focus();
		return false;
	}
	if(obj.lastname.value == '') {
		alert('Please enter last name.');
		obj.lastname.focus();
		return false;
	}
	if(obj.email.value == '') {
		alert('Please enter email.');
		obj.email.focus();
		return false;
	}
	if(obj.address.value == '') {
		alert('Please enter address.');
		obj.address.focus();
		return false;
	}
	if(obj.city.value == '') {
		alert('Please enter city.');
		obj.city.focus();
		return false;
	}
	if(obj.state.value == '') {
		alert('Please enter state.');
		obj.state.focus();
		return false;
	}
	if(obj.zip.value == '') {
		alert('Please enter zip.');
		obj.zip.focus();
		return false;
	}
	return true;
}
function login_val1() {
	var obj = document.login1;
	if(obj.username.value == '') {
		alert('Please enter username.');
		obj.username.focus();
		return false;
	}
	if(obj.password.value == '') {
		alert('Please enter password.');
		obj.password.focus();
		return false;
	}
	return true;
}
function frgt_validate() {
	var obj = document.frgt;
	if(obj.username.value == '') {
		alert('Please enter username.');
		obj.username.focus();
		return false;
	}
	return true;
}