function winApply () {
   window.open("apply.asp?JobID=" + document.thisForm.JobID.value, "Apply","resizable=yes, scrollbars=yes, Height=650,Width=750");   
}

function winEmail () {
   window.open("emailTo.asp?JobID=" + document.thisForm.JobID.value, "Email","resizable=yes,Height=575,Width=500");   
}

function winPrint () {
   window.open("printJob.asp?JobID=" + document.thisForm.JobID.value, "Print","resizable=yes,scrollbars=yes, Height=750,Width=600");      
}

function closeWin() {
   window.close();   
}

function printPage() {
   window.print();
}

function verifyDisclaimer(formName)
{
   if (window.confirm("DISCLAIMER: I hereby certify that all of the information given above is true and correct to the best of my knowledge. I understand that the use of this application does not necessarily indicate there are positions open and does not in any way obligate Career Source, LLC (CSLLC) to employ me. I understand that CSLLC may review my background, including contacting my former employer(s) and/or educational institutions I have attended. I hereby authorize all public and private individuals, court and law enforcement agencies, corporations and agencies who possess information about me to release to CSLLC, without liability, any and all information concerning the aforementioned areas of inquiry. I understand any information furnished in this application or obtained as a result of any inquiry will not necessarily preclude my employment, but will be used as part of an overall evaluation of my qualifications. upon completion of any assignment it is my responsibility to notify CSLLC within 48 hours of my availability. It is then my responsibility to maintain weekly contact with CSLLC. If such contact is not made, CSLLC will assume I have voluntarily terminated my employment. I understand that if a claim for unemployment is filed and these steps are not followed my claim for benefits may be affected. I further understand that if employed by CSLLC, if I were to make a personal injury claim against CSLLC, upon request I shall submit to drug screens, breath alcohol testing, and examinations by physicians of CSLLC's selection. CSLLC is an at-will employer giving both employer and employee rights to terminate the working relationship for any reason. No company representative of CSLLC may change the at-will policy through either oral or written promises."))
   { document.forms[formName].submit(); }
} // end of verifyDelete

function verifyDelete(formName)
{
   if (window.confirm("You are about to delete the selected items.\n\nPress Ok to proceed."))
   { document.forms[formName].submit(); }
} // end of verifyDelete

function FormatDate(currentEntry, Fieldname)
{
//  if null, ignore it
  if ((currentEntry == "null") || (currentEntry == "NULL") || (currentEntry == "Null") || (currentEntry == "N/A") || (currentEntry == "n/a")) {
   return "NULL"; 
  }
  if (currentEntry.length == 0) {
    return "";
  }
  else {
    var day,month,year,holder,returnVal;
   var replaceStr = /[^0123456789]+/g;
   currentEntry = currentEntry.replace(replaceStr, "/");
   holder = currentEntry.split("/");
   
   if ((holder.length < 3) || (holder.length > 3)) {
     alert("Insufficient Data For " + Fieldname + "\n\n MM/DD/YYYY or \n MM-DD-YYYY Format Required" )
     return currentEntry;
   }
   else {
     day = holder[1];
     month = holder[0];
     year = holder[2];
     var errormsg = "";
     var errors = 0;
     var yearfinal;
     if ((parseInt(year) >= 90) && (parseInt(year) < 100 )) {yearfinal = "19" + year;}
       else {
        if ((parseInt(year) >= 0) && (parseInt(year) < 30)) {yearfinal = "20" + year;}
        else   {yearfinal = year;}
      }
        
     if ((yearfinal.length < 4) || (yearfinal.length > 4)) { 
       errormsg = errormsg + "4-digit Year Required \n";
      errors = 1;
     }
     if ((parseInt(month) >= 13) || (parseInt(month) < 1)) {
       errormsg = errormsg + "Month Invalid \n";
      errors = 1;
     }
     if (parseInt(day) > 31) {
       errormsg = errormsg + "Day Value is Invalid \n";
      errors = 1;
     }
     
     returnVal = parseInt(month) + "/" + parseInt(day) + "/" + yearfinal;
     if (errors == 0) {
       return returnVal
     }
     else {
       alert("The Following Errors Occurred: \n\n" + errormsg);
      return "";
     }
   }  // end of if..else (3 entries...Day Month Year)
  }  // end of if..else  (initial entry not null)
}  // end of FormatDate()

function onlyNumeric(fieldValue)
// allows for numeric characters .  This is useful for only numeric input fields
// use OnKeyUp="this.value=onlyNumeric(this.value)" to restrict form input
{  var mtchLine = fieldValue.match(/[0123456789]+/g);
   var finalString;
   finalString = "";
   for (item in mtchLine) // go through the array and put the final string back together
   {  finalString += mtchLine[item];   }
   return finalString;
} // end of onlyNumeric

function phoneInput(fieldValue)
// allows for numeric characters, dash and parenthesis  -().  This is useful for 
// phone/fax forms.
// use OnKeyUp="this.value=onlyNumeric(this.value)" to restrict form input
{  var mtchLine = fieldValue.match(/[0123456789\-()]+/g);
   var finalString;
   finalString = "";
   for (item in mtchLine) // go through the array and put the final string back together
   {  finalString += mtchLine[item];   }
   return finalString;
} // end of phoneInput

function textBox(fieldValue)
// allows for numeric characters and the dash "-".  This is useful for standard
// text input fields because a double quote will cause the form object not to submit information
// after the first double-quote. Single quotes are disabled as well in case the input boxes are 
// written with a Response.Write statement. This function is NOT necessary for textarea fields.
// use OnKeyUp="this.value=textBox(this.value)" to restrict form input
{  var mtchLine = fieldValue.match(/[^\"\']+/g);
   var finalString;
   finalString = "";
   for (item in mtchLine) // go through the array and put the final string back together
   {  finalString += mtchLine[item];   }
   return finalString;
} // end of textBox
