<!--

function addBookmark(sUrl,sTitle){
	if (navigator.appName && navigator.appName.indexOf("Netscape")>=0)
	{
	}
	else
	{
	   if (document.all)
      window.external.AddFavorite(sUrl,sTitle);
	}
}

// Check contact form for errors
function check_contactForm()
{
	var form = document.forms[0];
	var error = "";
	
	if(form.realname.value == "")
		error += "Contact Name\n";
		
	if(form.email.value == "")
		error += "E-mail Address\n";

	if(form.comments.value == "")
		error += "Comments\n";
	
	if(error != "")
	{
		alert("The following fields have not been filled out correctly:\n\n\n\n" + error + "\n\n\n\nPlease fill in these fields and then click submit.\n\n\n\n");
		return false;
	}
	else
		return true;
}

// Check recommend form for errors
function check_recommendForm()
{
	var form = document.forms[0];
	var error = "";
	
	if(form.from_name.value == "")
		error += "Your Name\n";
		
	if(form.from_email.value == "")
		error += "Your E-mail Address\n";

	if(form.to_name.value == "")
		error += "Friend's Name\n";
		
	if(form.to_email.value == "")
		error += "Friend's E-mail Address\n";

	if(error != "")
	{
		alert("The following fields have not been filled out correctly:\n\n\n\n" + error + "\n\n\n\nPlease fill in these fields and then click submit.\n\n\n\n");
		return false;
	}
	else
		return true;
}


// check county select menu
function checkForm()  {

	if (document.forms[0].CountyID.options[document.forms[0].CountyID.selectedIndex].value == 0) {
		alert("Please select a county name from the list");
		return false;
   }
  
  return true;

}


// sleepy test

function Analyze(form){

// Epworth Sleepiness Scale
// by Kevin C. Gaffney, MD 
// Public Domain.

  var Total;
  var Msg;
  Total = 0;
  Total = Total + form.Sitting.options.selectedIndex;
  Total = Total + form.TV.options.selectedIndex;
  Total = Total + form.Public.options.selectedIndex;
  Total = Total + form.Passenger.options.selectedIndex;
  Total = Total + form.Lying.options.selectedIndex;
  Total = Total + form.Talking.options.selectedIndex;
  Total = Total + form.Lunch.options.selectedIndex;
  Total = Total + form.Traffic.options.selectedIndex;
  form.score.value = Total;
  if (Total < 8) form.answer.value = "You have a normal amount of sleepiness. Though your results don't indicate excessive daytime sleepiness you could still be suffering from a sleeping disorder. You should always consult a physician if you suspect an irregularity in your sleeping.";
  if ((Total >= 8) & (Total <=9)) form.answer.value = "You have an average amount of sleepiness. Though your results don't indicate excessive daytime sleepiness you could still be suffering from a sleeping disorder. You should always consult a physician if you suspect an irregularity in your sleeping.";
  if ((Total >= 10) & (Total <=15)) form.answer.value = "You have a moderate to high level of sleepiness.  You should consult a physician for further evaluation and to determine the cause of your sleepiness and whether you have an underlying sleep disorder.";
  if (Total >= 16) form.answer.value = "You are excessively sleepy and should consult a physician immediately. Your currently sleepiness level is extremely dangerous and can lead to other serious health problems. Although your score indicates a high probablilty of the existence of a sleep disorder, your condition can be improved with the proper treatement.";

return false;
}

//-->