
	function fnCreateAccount(frmObject)
	{
		if(frmObject.Name.value=='')
		{
			alert('You must enter your Name');
			return;
		}

		if(frmObject.Email.value=='')
		{
			alert('You must enter your Email address');
			return;
		}

		if(frmObject.bmoLoginPassword.value=='')
		{
			alert('You must enter a password');
			return;
		}

		
		if(frmObject.bmoLoginPassword.value!=frmObject.bmoLoginPasswordConfirm.value)
		{
			alert('You\'re Passwords do not match');
			return;
		}

		if(frmObject.ScreenName.value=='')
		{
			alert('You must enter a Screen Name');
			return;
		}

		
		if(frmObject.ZipCode.value=='')
		{
			alert('You must enter a Zip Code');
			return;
		}

		
		if(frmObject.PhoneNumber.value=='')
		{
			alert('You must enter a Phone Number');
			return;
		}

		frmObject.submit();
	
	}

	function IsNumeric(sText)

	{
	   var ValidChars = "0123456789. ";
	   var IsNumber=true;
	   var Char;

	 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
			 IsNumber = false;
			 }
		  }
	   return IsNumber;
	   
	   }

	
	function fnSubmitListing(frmObject)
	{
		if(frmObject.sCat.value=='')
		{
			alert('You must select a category');
			return;
		}		
		if(frmObject.Title.value=='')
		{
			alert('You must type a Title for your ad');
			return;
		}

		if(frmObject.Description.value=='')
		{
			alert('You must type a description for your ad');
			return;
		}

		if(frmObject.numDays.value=='')
		{
			alert('You must choose a number of days for your ad to run');
			return;
		}

		if(!IsNumeric(frmObject.Price.value))
		{
			alert('Price must be a NUMBER and cannot contain any non numeric-characters');
			return;
		}

		frmObject.method='post';
		frmObject.action='bleCore.php';
		frmObject.SubmitForm.style.display='none';

		frmObject.submit();
	}


	
	function fnModifyAdSubmit(frmObject)
	{
		if(frmObject.sCat.value=='')
		{
			alert('You must select a category');
			return;
		}		
		if(frmObject.Title.value=='')
		{
			alert('You must type a Title for your ad');
			return;
		}

		if(frmObject.Description.value=='')
		{
			alert('You must type a description for your ad');
			return;
		}

		if(!IsNumeric(frmObject.Price.value))
		{
			alert('Price must be a NUMBER and cannot contain any non numeric-characters');
			return;
		}


		frmObject.method='post';
		frmObject.action='bleCore.php';		
		frmObject.submit();
	}

	

	function fnChangeDeclineText(strAdId)
	{		
		var aSel=document.getElementById('decline_'+strAdId);
		var aSelValue=aSel.value;		
		var dText=document.getElementById('declineMessage_'+strAdId);		
		if(aSelValue>0)
		{			
			var getText=document.getElementById('cannedText_'+aSelValue);				
			dText.value=getText.value;
		}
		else
		{
			dText.value='Type Custom Message';
		}

	}

	function fnChangeAdApproval(strAdId)
	{
		var aSel=document.getElementById('adId_'+strAdId);
		var aSelValue=aSel.value;

		if(aSelValue<0)
		{
			var dDiv=document.getElementById('adDecline_'+strAdId);
			dDiv.style.display='block';
		}
		else
		{
			var dDiv=document.getElementById('adDecline_'+strAdId);
			dDiv.style.display='none';

		}
	}

	function fnDeleteOptionFromCat(strCat,strOption)
	{
		var r=window.confirm("Are you SURE you want to delete this option from this category? - Doing so will REMOVE all user entered values for this option/category combination");

		if(r)
			window.navigate('bleCore.php?FunctionName=DeleteOptionFromCat&CatId='+strCat+'&OptionId='+strOption);



	}

	
	function fnDeleteOption(strOption)
	{
		var r=window.confirm("Are you SURE you want to delete this option ? - Doing so will REMOVE all user entered values for this option");

		if(r)
			window.navigate('bleCore.php?FunctionName=DeleteOption&OptionId='+strOption);

	}

	
	function fnDeleteMessage(strMessageId)
	{
		var r=window.confirm("Are you SURE you want to delete this message ?");

		if(r)
			window.navigate('bleCore.php?FunctionName=DeleteMessage&MessageId='+strMessageId);

	}

	function fnAdvancedSearchCategorySwitch(strTopLevelCatId)
	{
		document.getElementById('divAutoSearch').style.display='none';
		document.getElementById('divEmploymentSearch').style.display='none';
		document.getElementById('divRealEstateSearch').style.display='none';

		switch(strTopLevelCatId)
		{
			case '2':
				document.getElementById('divAutoSearch').style.display='block';
				break;
			case '3':
				document.getElementById('divEmploymentSearch').style.display='block';
				break;
			case '9':
				document.getElementById('divRealEstateSearch').style.display='block';
				break;
			default:
				//alert('Non Custom');
		}			

	}

	function homePageSearchSubmit(frmObject)
	{
		if(frmObject.searchType.value==1)
		{
			frmGoogleSearch.q.value=frmObject.q.value;
			frmGoogleSearch.submit();
		}
		else
		{
			if(frmObject.searchType.value==2)
			{
				frmObject.action='ebaySearch.php';
				frmObject.submit();
			}
			else
			{
				frmObject.submit();
			}
		}
	}



	var searchClicked=false;

	function fnTopSearchEnter()
	{
		if(!searchClicked)
		{			
			searchClicked=true;
			frmTopSearch.q.value="";
		}
	}

