<!-- Hide From Old Browsers

function openWindow(pURL,pQString,pWindowID,pWindowProperties) { 
	//URL EXAMPLE: "thisPage.asp"
	//QSTRING EXAMPLE:		"?name=john&age=32&job=salesman"
	//WINDOW ID EXAMPLE:	"GenericWin"	--name identifying window
	//PROPERTIES EXAMPLE:	"width=250,height=150,scrollbars=yes,resizable=yes"
	
	var TheWindow;
	TheWindow = window.open(pURL + pQString, pWindowID, pWindowProperties);
	TheWindow.focus()
	return false;
}

function chkCategoryDropDown() 
{
	if (frmListing.cboCategories.value == "none") 
	{
		alert("Please choose a category before proceeding.")
	}
	else 
	{
		frmListing.submit()
	}
}

function chkSubCategoryDropDown() 
{
	if (frmListing.cboSubCategories.value == "none") 
	{
		alert("Please choose a category before proceeding.")
	}
	else 
	{
		frmListing.submit()
	}
}

function chkCheckBoxes() 
{	//Loop through all check boxes and alert if none are checked.  Else submit.
	var checkedBoxCounter = 0;
	var controlindex;
	var element;
	var NumOfControls = document.frmListing.length;
	
	for (controlindex = 0; controlindex < NumOfControls; controlindex++)
	{
		element = document.frmListing[controlindex];
		if (element.type == "checkbox") 
		{
			if (element.checked == true) 
			{
				checkedBoxCounter++;
			}
		}
	}
	
	if (checkedBoxCounter < 1) 
	{
		alert("Please check at least one of the sub category boxes.");
	}
	else 
	{
		document.frmListing.submit();
	}
}

function chkListingTextFields() 
{
	var errorMsg = "";
	var endErrorMsg = " is necessary to process your request.\n";
	var blnError = false;
	
	//CHECK THE FIRST NAME FIELD
	if (document.frmListing.Fname.value == "") 
	{
		blnError = true; 
		errorMsg = errorMsg + "A first name" + endErrorMsg;
	}
	
	//CHECK THE LAST NAME FIELD
	if (document.frmListing.Lname.value == "")
	{
		blnError = true; 
		errorMsg = errorMsg + "A last name" + endErrorMsg;
	}
	
	//CHECK THE ORGANIZATION FIELD
	if (document.frmListing.Organization.value == "") 
	{
		blnError = true;
		errorMsg = errorMsg + "The Name of your organization" + endErrorMsg; 
	}
	
	//CHECK PHONE 1 FIELD 
	if (document.frmListing.Phone1.value == "") 
	{
		blnError = true;
		errorMsg = errorMsg + "At least 1 phone number" + endErrorMsg; 
	}
	
	//CHECK EMAIL FIELD
	if (document.frmListing.Email.value == "") 
	{
		blnError = true;
		errorMsg = errorMsg + "An email address" + endErrorMsg; 
	}
	
	//AFTER CHECKING EVERYTHING, DECIDE WHETHER TO SUBMIT FORM OR ALERT NEGLECTED FIELDS.
	if (blnError) 
	{
		alert(errorMsg)
	}
	else 
	{
		document.frmListing.submit();
	}
}

function LoginValidate() 
{//Used by admin login
	var blnError = false;
	var strError = "";
	
	strError = strError + "Xiao Go Shong!  This might work better if you:\n";
	
	if (document.frmAdminLogin.User.value == "none") 
	{
		blnError = true; 
		strError = strError +  "\nSelect a user!\n";
	}
	
	if (document.frmAdminLogin.UserPassword.value == "") 
	{
		blnError = true;
		strError = strError +  "\nType in a password!\n";
	}
	
	if (blnError) 
	{
		alert(strError);
	}
	
	else 
	{
		document.frmAdminLogin.submit();
	}
}

function ListSearchValidate() 
{
	if (document.frmCheckListing.ListingID.value == "") 
	{
		alert("Xiao He!  You can't search with out a listing I.D.");
	}
	else 
	{
		document.frmCheckListing.submit();
	}
}


// Stop Hiding From Old Browsers.-->