function fnConfirmPosting()
{
  var error = "";
  var b_Renewal;
  var h1 = "....................................................\n";
  var msg = "**************** IAHPERD Jobs Posting  ****************\n\n";
  //msg+="\tYou are about to submit your hours for approval.\n";
  //msg+="This will include any non-billable hours.\n";
  msg+="\t\tYou are about to post a job \n\n";
  msg+="\t\tDO YOU WANT TO CONTINUE  ?\n\n";
  msg+="************************************************************";

  // Personal Data -----------------------------------------------------------
  var _UserFirstName = document.getElementById('UserFirstName').value;
  var _UserLastName = document.getElementById('UserLastName').value;

  var _A_Phone = document.getElementById('A_Phone').value;
  var _P_Phone = document.getElementById('P_Phone').value;
  var _E_Phone = document.getElementById('E_Phone').value;

  var _UserEmail = document.getElementById('UserEmail').value;
  var _UserZip = document.getElementById('UserZip').value;

  var _UserJobTitle = document.getElementById('UserJobTitle').value;
  var _UserOrgName = document.getElementById('UserOrgName').value;

  var _PostJobCategory = document.getElementById('PostJobCategory').value;
  var _PostJobTitle =  document.getElementById('PostJobTitle').value;
  var _PostJobAddress =  document.getElementById('PostJobAddress').value;
  var _PostJobCity =  document.getElementById('PostJobCity').value;
  var _PostJobState =  document.getElementById('PostJobState').value;
  var _PostJobDescription =  document.getElementById('PostJobDescription').value;
  var _PostJobDateExp =  document.getElementById('PostJobDateExp').value;
  var _PostJobHowToApply =  document.getElementById('PostJobHowToApply').value;

  var _Code = document.getElementById('code').value;
  var _Sec_Code = document.getElementById('sec_code').value;
// ....................................................................................
  if(_UserFirstName.length == 0 || _UserLastName.length == 0)
    {
      error = "Missing First And/Or Last Name.";
    }

  if(_A_Phone.length == 0 || _P_Phone.length == 0 || _E_Phone.length == 0)
    {
      error += "\nMissing Phone Number.";
    }

  if(_UserEmail.length == 0)
    {
      error += "\nMissing Email.";
    }

  if(_UserZip.length == 0)
    {
      error += "\nMissing Zip Code.";
    }

  if(_UserJobTitle.length == 0)
    {
      error += "\nMissing Job Title.";
    }

  if(_UserOrgName.length == 0)
    {
      error += "\nMissing Organization Name.";
    }
// ....................................................................................
  if(_PostJobCategory.length == 0)
    {
      error += "\nMissing Posted Job Category.";
    }

  if(_PostJobTitle.length == 0)
    {
      error += "\nMissing Posted Job Title.";
    }

  if(_PostJobAddress.length == 0)
    {
      error += "\nMissing Posted Job Address.";
    }

  if(_PostJobCity.length == 0)
    {
      error += "\nMissing Posted Job City.";
    }

  if(_PostJobState.length == 0)
    {
      error += "\nMissing Posted Job State.";
    }

  if(_PostJobDescription.length ==0)
    {
      error += "\nMissing Posted Job Description.";
    }

  if(_PostJobDateExp.length == 0 || _PostJobDateExp.length != 10)
    {
      error += "\nMissing or Invalid Post Expiration Date.";
    }

  if(_PostJobHowToApply.length == 0)
    {
      error += "\nMissing Posted Job Method of Application.";
    }

  if(_Code != _Sec_Code)
    {
		error += "\nInvalid Security Code..";
		document.getElementById('code').value = "";
	}

    if(error.length > 0 )
      {
        alert('We are sorry, but your application has some errors. Please fix the following error before submitting your application: \n' + h1 + error);
        return false
      }

  if(confirm(msg))
  {
    return true;
  }
  else
  {
    return false;
  }

}
// *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
function fnIsNumber(_num,_id,_lbl)
   		{
   			var strValidChars = "0123456789";
   			var strChar;
   			var blnResult = true;

   			if (_num.length == 0) return false;

   			//  test strString consists of valid characters listed above
   			for (i = 0; i < _num.length && blnResult == true; i++)
      				{
      					strChar = _num.charAt(i);
      					if (strValidChars.indexOf(strChar) == -1)
         					{
							alert(_lbl + ' can only contain 0-9');
							 blnResult = false;
         						document.getElementById(_id).value='';
         						document.getElementById(_id).style.backgroundColor='red';
         					}
					else
					        {
					                blnResult = true;
                                                        document.getElementById(_id).style.backgroundColor='white';
					        }
      				}
   			return blnResult;
   		}
// *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
function fnCheckEmail(_id)
{
var str=document.getElementById(_id).value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
	{
		testresults=true
		document.getElementById(_id).style.backgroundColor='lightgreen';
	}
	else
	{
		alert("Please input a valid email address!")
		document.getElementById(_id).value = "";
		document.getElementById(_id).style.backgroundColor='red';
		testresults=false
	}
	return (testresults)
}
// *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
function fnConfirmUpdate()
{
	var _action = document.getElementById('StatusAction').value;
	var _notes = document.getElementById('Notes').value;

	if(_action.length == 0)
	 {
	        alert('No Selected Action');
	        return false;
	 }


	if(_action  == "REJECTED" || _action  == "REVIEW")
	 {
	        if(_notes.length == 0)
		 {
		        alert('Notes are required when the action is REJECTED or REQUIRES REVIEW');
		        return false;
		 }
	 }
	if(_action == "DELETE")
     {
       if(confirm('Are you sure you want to delete this posting?'))
        {
          return true;
        }
       else
        {
          return false;
        }

     }
	return true;
}
// *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
function fnOpenWindow(_url)
{
        settings="toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=750,height=450,left=100,top=150";
        window.open(_url ,"New",settings);
}
// *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
function fnDisplayLegend(_value)
 {
        var _legend;
        var _class;
        switch(_value)
	 {
	   case "APPROVED":
            _legend = "Will post the job to the site and send an email to the submitter that the job has been approved and posted";
            _class = "APP";
            break;

	   case "REJECTED":
            _legend = "Will not allow the job to be posted and will send an email to the submitter that it has been rejected.  A comment is required for rejected actions.";
            _class = "REJ";
            break;

	   case "REVIEW":
            _legend = "Will not post the job and will send an email to the submitter.  This action requires comments and will send them to the submitter along with a link so that the submitter can easily make the suggested changes.  Upon reapplying, you will receive another email stating the job has been updated by the submitter.";
            _class = "REV";
            break;

	   case "DELETE":
	   _class = "DEL";
            _legend = "Will completley delete the job from the database and will not send an email to anyone";
            break;

	   default:
	   _class = "small_lbl";
	   _legend = "No Selected Action";
	 }

        document.getElementById('action_legend').className = _class;
	    document.getElementById('action_legend').innerHTML = _legend;


 }