	function countCharacters(textArea, counterField, maxLength){		
	  if(textArea !=null && textArea.value != null) {
			if (textArea.value.length > maxLength){
					alert("Your message may not exceed " +  maxLength +" characters in length.");
					textArea.value = textArea.value.substring( 0, maxLength);
			} else {
					counterField.value = maxLength - textArea.value.length;
			}
    }
	}	
	

function showInfo(){
	alert("You can use the word \"now\" and messages will be sent immediately.\nYou can also use a date and time, for example:\n    7/26/06 9:00PM    or\n    7/26/06 21:00\n    today 9:00am\n    tomorrow 9:00pm\nIf you just put a date without a time, we assume you mean midnight.");
}

function showGroceryInfo(){
	alert("Checking the box will let you manage a grocery list.  In your message, just type the items you want to remember...it will be added to your grocery list.  Special keywords are:\n   send - This will send your grocery list to you at the date and time you specify.\n   clear - This will clear your grocery list.\n   view - This will open up your grocery list.");
}

function deletePerson(x,y){
		if (confirm('Are you sure you want to delete:\n'+unescape(y))){
			document.location.replace('smsDeletePerson.asp?personSMS='+unescape(x)+'&action=delete');
		}
}

function selectPerson(x, y){
	box = document.forms['composeForm'].smsTo;
	boxlength = document.forms['composeForm'].smsTo.length;
		for (i=0; i<boxlength; i++){
			if (x == box.options[i].value){
				box.options[i].selected = true;
			}
		}
		
		if (y.toUpperCase() == 'TRUE'){
			document.forms['composeForm'].GroceryList.checked = true;
		}
}