<!-- Begin

function smPopWin(popurl){
	winpops=window.open(popurl,"","width=600,height=650,,resizable,scrollbars,")
}


function returnTrueOnly()
	{
		return true;
	}
	
function pressOnce()
{
	// set the submitcount on page
   if (submitcount == 0)
	     {
		  submitcount++;
		  return true;
	      }
	else 
		  {
		  alert("Processing previous command, please wait.");
		  return false;
	  	  }
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); }
//   onkeypress="return noenter()"   (enter this in text fields)

function refresh()
{
		window.location.reload( true );
}

function popthewin(url,windowname,w,h,x,y){
		window.open(url,windowname,"resizable=yes,toolbar=no,scrollbars=yes,menubar=no,status=no,directories=no,width="+w+",height="+h+",left="+x+",top="+y+"");
}

function entryFieldLimit(formField,fieldLabel)
		{
		  var result = true;
		  if ((formField.value.length < 1) || (formField.value.length > 100))
		  {
			alert('The ' + fieldLabel + ' field is missing OR is longer than 100 characters.');
			formField.focus();
			result = false;
		  }
		
		  return result;
		}

function validRequired(formField,fieldLabel)
{
		  var result = true;
		
		  if (formField.value == "")
		  {
			alert('Please enter a value for the "' + fieldLabel +'" field.');
			formField.focus();
			result = false;
		  }
}

function beforeToday(formField)
//		 ****** if (!beforeToday(calform.formdate1))
//		 ****** 		return false;

		// the values of months and years are hardcoded into SELECTS<br />
		 { 
		  var strDate = formField.value;
		  //var strTime = calform.timehr.value + ':' + calform.timemin.value + ':00 ' + calform.timeap.value;
		   
		   var strTime = "6:00:00 AM"
		   var combineString = strDate + ' ' + strTime;
		  //alert(combineString);
	   		   
		   var dteNow = new Date();
		   var dteExp = new Date(combineString);

		//check to see if date is earlier than today
			if(dteNow > dteExp) {
				alert("Date must be after Today's date.");
				return false;}
	return true;
			}	
			
			
//*******************************************************************************************************


function chkNumeric(strString,fieldLabel)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;

   if (strString.length == 0) return true;

   //  test strString consists of valid characters listed above
	if (isNaN(strString.value))
     {
       alert('Please enter a number for the "' + fieldLabel +'" value.');
      strString.focus();
      return false;
    }
	//	
   return true;
   }

function mustHaveOne(){
		if ((document.calform.zProc.value.length == 0) &&  (document.calform.zPolicy.value.length == 0)) {
			window.alert("Both the Policy and Procedure boxes are empty.");
			calform.zProc.focus();
			return false;}		
}

function newHireName(){
   		if (document.calform.firstname.value.length < 2) {	  
			window.alert("Associate first name required.");
			calform.firstname.focus();
			return false;}

   		if (document.calform.lastname.value.length < 2) {	  
			window.alert("Associate last name required.");
			calform.lastname.focus();
			return false;}

	  	if (document.calform.departmentbx.options[calform.departmentbx.selectedIndex].value == "0"){
			window.alert("Please select a Department.");
			calform.departmentbx.focus();
			return false;}
			
	  	if (document.calform.typeFTE.options[calform.typeFTE.selectedIndex].value == "0"){
			window.alert("Please identify FTE type for this associate.");
			calform.typeFTE.focus();
			return false;}
			
			
}


function submitEstimate() {		
		if (document.calform.EventName.value.length < 3) {	  
			window.alert("Please enter a Name for this Event..");
			calform.EventName.focus();
			return false;}

		if (!chkNumeric(document.calform.NumGuest,"Please enter approximate number of Guest"))	  
			  return false;
		  
		if (calform.EventType.options[calform.EventType.selectedIndex].value == "0"){ 
			window.alert('Please select Event Type.');
			calform.EventType.focus();
			return false;}
			
   		if (document.calform.EventDate.value.length < 8) {	  
			window.alert("Invalid Event Date - MM/DD/YYYY.");
			calform.EventDate.focus();
			return false;}			   		
			
 		 if (!beforeToday(calform.EventDate))
		 		return false;			
			
		if (calform.PersonBudget.options[calform.PersonBudget.selectedIndex].value == "0"){ 
			window.alert('Please select the Cost Per Person.');
			calform.PersonBudget.focus();
			return false;}
			
		if (calform.serviceRequested.options[calform.serviceRequested.selectedIndex].value == "0"){ 
			window.alert('Please select a Type of Service.');
			calform.serviceRequested.focus();
			return false;}

   		if (document.calform.yourName.value.length < 3) {	  
			window.alert("Please enter your Name");
			calform.yourName.focus();
			return false;}			   		

   		if (document.calform.yourPhone.value.length < 10) {	  
			window.alert("Invalid Phone Number, Please enter Area Code (###) ###-####");
			calform.yourPhone.focus();
			return false;}			   		

   		if (document.calform.yourEmail.value.length < 5) {	  
			window.alert("Invalid Email");
			calform.yourEmail.focus();
			return false;}			   		

}

// ********************************************************************************************

function selectRadioButton(){
		// require at least one radio button be selected
		var radioSelected = false;
		for (i = 0;  i < calform.radiobutton.length;  i++)
		{
		if (calform.radiobutton[i].checked)
		radioSelected = true;
		}
		if (!radioSelected)
		{
		alert("Please select one of the \"Smoke or Tobacco Free\" options.");
		return (false);
		}
}


/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jeremy Keith / Anonymous | http://www.alistapart.com/articles/imagegallery/ */
function showPic(whichpic) {
  if (document.getElementById) {
    document.getElementById('placeholder').src = whichpic.href;
    if (whichpic.title) {
      document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
    } else {
      document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
    }
    return false;
  } else {
  return true;
  }
}

var previousToggle=null;
function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block";
    if(previousToggle)previousToggle.style.display="none";
    previousToggle=e;
  }
  return true;
}
