// JavaScript Document
function viewBusiness()
{
	with (window.document.frmListBusiness) {
		if (cboCategory.selectedIndex == 0) {
			window.location.href = 'index.php';
		} else {
			window.location.href = 'index.php?itemId=';
		}
	}
}

function checkContactForm()
{
	with (window.document.frmContactForm) {
			submit();
	}
}

function checkAddOrganizationForm()
{
	with (window.document.frmAddBusiness) {
		if (isEmpty(memberOrganization, 'Enter Organization Name')) {
			return;
		} else if (isEmpty(organizationFirstname, 'Enter Last Name')){
			return;
		} else if (isEmpty(organizationLastname, 'Enter Last Name')){
			return;
		} else if (isEmpty(organizationAddress, 'Enter Address')){
			return;
		} else if (isEmpty(organizationCity, 'Enter City')){
			return;
		} else if (isEmpty(organizationPostalcode, 'Enter Postal Code')){
			return;
		} else if (isEmpty(organizationPhone, 'Enter Phone')){
			return;
		} else {
			submit();
		}
	}
}

function checkAddAffiliateForm()
{
	with (window.document.frmAddBusiness) {
		if (isEmpty(memberFirstname, 'Enter First Name')) {
			return;
		} else if (isEmpty(memberLastname, 'Enter Last Name')){
			return;
		} else if (isEmpty(memberAddress, 'Enter Address')){
			return;
		} else if (isEmpty(memberCity, 'Enter City')){
			return;
		} else if (isEmpty(memberPostalcode, 'Enter Postal Code')){
			return;
		} else if (isEmpty(memberPhone, 'Enter Phone')){
			return;
		} else if (isEmpty(memberOrganization, 'Enter Organization')){
			return;
		} else {
			submit();
		}
	}
}


function addBusiness(itemId)
{
	window.location.href = 'index.php?view=add&itemId=' + itemId;
}

function modifyBusiness(itemId)
{
	window.location.href = 'index.php?view=modify&itemId=' + itemId;
}

function deleteBusiness(itemId)
{
	if (confirm('Delete this member?')) {
		window.location.href = 'processMember.php?action=deleteBusiness&itemId=' + itemId;
	}
}
