if (document.images) {            // Active Images
	img1on = new Image();      
    img1on.src = "Res/Index_ourcompany_on.gif";

    img1off = new Image();      
    img1off.src = "Res/Index_ourcompany.gif"; 
}



// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}

// *****************************************************
// HIDE||SHOW DETAILS [div]
// *****************************************************
function ToggleSubDisplay(id, idLimit, objTarget) 
{
	var elemDiv;
	var elemTarget;
	elemTarget = document.getElementById(objTarget)
	
	// SHOW ELEMENTS	
	for(var i=1; i<= idLimit; i++) {
		elemDiv = id + i;

		var elemA = document.getElementById(elemDiv);

		if (elemA == elemTarget) {
				if(elemA.style.visibility == 'visible') {
					elemA.style.display = 'none';
					elemA.style.visibility = 'hidden';
				} else {
					elemA.style.display = 'block';
					elemA.style.visibility = 'visible';
				}
			}
		}
}

// *****************************************************
// USED FOR PRINTING 
// *****************************************************
function DoPrint(objPrintArea,strPrefix)
{
	var text;
 	text = objPrintArea.innerHTML;	

	// HEADER
	text = text.replace('<!--INQPRINT','');
	text = text.replace('INQPRINT-->','');
	
	// HIDE TEXT
	text = text.replace('<!--HDx-->','<!--');
	text = text.replace('<!--xHD-->','-->');
	
	// TABLE WIDTH
	text = text.replace('width=990','width=700');

	var str;
	str = "";

	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;

		var xc = (aw - 800) / 2;
		var yc = (ah - 600) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}

	var objPrintWindow = window.open('', 'PrintWindow', "width=780,height=660,center,toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0" + str);
		
	objPrintWindow.document.write("");
	objPrintWindow.document.write("<link href=\"/_mcfa/" + strPrefix + "style.css\" rel=\"stylesheet\" type=\"text/css\" />");
	objPrintWindow.document.write(text);
	objPrintWindow.document.close();

	// CALL PRINT COMMAND FROM WINDOW
	// objPrintWindow.print();

	// CLOSE WINDOW :: 
	// objPrintWindow.close();
}

// -->


/* *********************************************
FORM VALIDATION ::: JOB APPLICATION 
********************************************* */
function formValidatorFrmJobApplication(){
	// Make quick references to our fields
	var positionappliedfor = document.getElementById('positionappliedfor');
	var lastname = document.getElementById('lastname');
	var firstname = document.getElementById('firstname');
	var address = document.getElementById('address');
	var city = document.getElementById('city');
	var state = document.getElementById('state');
	var zip = document.getElementById('zip');
	var daytime_phone = document.getElementById('daytime_phone');
	var email = document.getElementById('email');
	var OverEighteen = document.getElementById('OverEighteen');
	var PreviousEmployee = document.getElementById('PreviousEmployee');
	var CurrentlyEmployed = document.getElementById('CurrentlyEmployed');
	var LegallyEligible = document.getElementById('LegallyEligible');
	var LicensedDriver = document.getElementById('LicensedDriver');
	var HowDidYouLearn = document.getElementById('HowDidYouLearn');
	var Convicted = document.getElementById('Convicted');
	var EmployerA = document.getElementById('EmployerA');
	var EmployerAAddress = document.getElementById('EmployerAAddress');
	var EducationYearCompleted = document.getElementById('EducationYearCompleted');
	var EducationANameAndLocation = document.getElementById('EducationANameAndLocation');
	var CanPerform = document.getElementById('CanPerform');
	var Signature = document.getElementById('Signature');
	var SignatureDate = document.getElementById('SignatureDate');
	var EmployerAFrom = document.getElementById('EmployerAFrom');
	var EmployerATo = document.getElementById('EmployerATo');
	var EmployerATitle = document.getElementById('EmployerATitle');
	var EmployerABeginningSalary = document.getElementById('EmployerABeginningSalary');
	var EmployerAEndingSalary = document.getElementById('EmployerAEndingSalary');

	// Check each input in the order that it appears in the form!
	if(notEmpty(positionappliedfor, "Please enter a valid Position Applied For.")){
		if(notEmpty(lastname, "Please enter a valid Last Name.")){
			if(notEmpty(firstname, "Please enter a valid First Name.")){
				if(notEmpty(address, "Please enter a valid Address Number ans Street.")){
					if(notEmpty(city, "Please enter a valid City.")){
						if(notEmpty(state, "Please enter a valid State.")){
							if(notEmpty(zip, "Please enter a valid Zipcode.")){
								if(notEmpty(daytime_phone, "Please enter a valid Daytime Phone.")){
									if(emailValidator(email, "Please enter a valid E-mail.")){
										if(notEmpty(OverEighteen, "Please enter answer 'Are you 18 or older?'.")){
											if(notEmpty(PreviousEmployee, "Please enter answer 'Are you a previous employee?'.")){
												if(notEmpty(CurrentlyEmployed, "Please enter answer 'Are you currently employed?'.")){
													if(notEmpty(LegallyEligible, "Please enter answer 'Are you legally eligible for employment in the United States of America?'.")){
														if(notEmpty(LicensedDriver, "Please enter answer 'Are you a licensed driver?'.")){
															if(notEmpty(HowDidYouLearn, "Please enter answer 'How did you learn about the position?'.")){
																if(notEmpty(Convicted, "Please enter answer 'Are you Have you been convicted of a felony or misdemeanor?'.")){
																	if(notEmpty(EmployerA, "Please enter at least 1 Employer")){
																		if(notEmpty(EmployerAFrom, "Please enter at least 1 Employer From Date")){
																			if(notEmpty(EmployerATo, "Please enter at least 1 Employer To Date")){
																				if(notEmpty(EmployerAAddress, "Please enter at least 1 Employer Address.")){
																					if(notEmpty(EmployerATitle, "Please enter at least 1 Employer Title")){
																						if(notEmpty(EmployerABeginningSalary, "Please enter at least 1 Employer Beginning Salary")){
																							if(notEmpty(EmployerAEndingSalary, "Please enter at least 1 Employer Ending Salary")){
																								if(notEmpty(EducationYearCompleted, "Please Check the highest year completed.")){
																									if(notEmpty(EducationANameAndLocation, "Please enter at least 1 Name and Location.")){
																										if(notEmpty(CanPerform, "Please answer 'I feel that I can perform the job functions of the open position.'")){
																											if(notEmpty(Signature, "Please enter a valid Signature.")){
																												if(notEmpty(SignatureDate, "Please enter a valid SignatureDate.")){
																													return true;
																												}
																											}
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	return false;
}

function formValidatorFrmJobApplicationNext(){
	// Make quick references to our fields
	var positionappliedfor = document.getElementById('positionappliedfor');
	var lastname = document.getElementById('lastname');
	var firstname = document.getElementById('firstname');
	var address = document.getElementById('address');
	var city = document.getElementById('city');
	var state = document.getElementById('state');
	var zip = document.getElementById('zip');
	var daytime_phone = document.getElementById('daytime_phone');
	var email = document.getElementById('email');
	var OverEighteen = document.getElementById('OverEighteen');
	var PreviousEmployee = document.getElementById('PreviousEmployee');
	var CurrentlyEmployed = document.getElementById('CurrentlyEmployed');
	var LegallyEligible = document.getElementById('LegallyEligible');
	var LicensedDriver = document.getElementById('LicensedDriver');
	var HowDidYouLearn = document.getElementById('HowDidYouLearn');
	var Convicted = document.getElementById('Convicted');
	var EmployerA = document.getElementById('EmployerA');
	var EmployerAAddress = document.getElementById('EmployerAAddress');
	var EducationYearCompleted = document.getElementById('EducationYearCompleted');
	var EducationANameAndLocation = document.getElementById('EducationANameAndLocation');
	var CanPerform = document.getElementById('CanPerform');
	var Signature = document.getElementById('Signature');
	var SignatureDate = document.getElementById('SignatureDate');
	var EmployerAFrom = document.getElementById('EmployerAFrom');
	var EmployerATo = document.getElementById('EmployerATo');
	var EmployerATitle = document.getElementById('EmployerATitle');
	var EmployerABeginningSalary = document.getElementById('EmployerABeginningSalary');
	var EmployerAEndingSalary = document.getElementById('EmployerAEndingSalary');

	// Check each input in the order that it appears in the form!
	if(notEmpty(positionappliedfor, "Please enter a valid Position Applied For.")){
		if(notEmpty(lastname, "Please enter a valid Last Name.")){
			if(notEmpty(firstname, "Please enter a valid First Name.")){
				if(notEmpty(address, "Please enter a valid Address Number ans Street.")){
					if(notEmpty(city, "Please enter a valid City.")){
						if(notEmpty(state, "Please enter a valid State.")){
							if(notEmpty(zip, "Please enter a valid Zipcode.")){
								if(notEmpty(daytime_phone, "Please enter a valid Daytime Phone.")){
									if(emailValidator(email, "Please enter a valid E-mail.")){
										if(notEmpty(OverEighteen, "Please enter answer 'Are you 18 or older?'.")){
											if(notEmpty(PreviousEmployee, "Please enter answer 'Are you a previous employee?'.")){
												if(notEmpty(CurrentlyEmployed, "Please enter answer 'Are you currently employed?'.")){
													if(notEmpty(LegallyEligible, "Please enter answer 'Are you legally eligible for employment in the United States of America?'.")){
														if(notEmpty(LicensedDriver, "Please enter answer 'Are you a licensed driver?'.")){
															if(notEmpty(HowDidYouLearn, "Please enter answer 'How did you learn about the position?'.")){
																if(notEmpty(Convicted, "Please enter answer 'Are you Have you been convicted of a felony or misdemeanor?'.")){
																	if(notEmpty(EmployerA, "Please enter at least 1 Employer")){
																		if(notEmpty(EmployerAFrom, "Please enter at least 1 Employer From Date")){
																			if(notEmpty(EmployerATo, "Please enter at least 1 Employer To Date")){
																				if(notEmpty(EmployerAAddress, "Please enter at least 1 Employer Address.")){
																					if(notEmpty(EmployerATitle, "Please enter at least 1 Employer Title")){
																						if(notEmpty(EmployerABeginningSalary, "Please enter at least 1 Employer Beginning Salary")){
																							if(notEmpty(EmployerAEndingSalary, "Please enter at least 1 Employer Ending Salary")){
																								if(notEmpty(EducationYearCompleted, "Please Check the highest year completed.")){
																									if(notEmpty(EducationANameAndLocation, "Please enter at least 1 Name and Location.")){
																										if(notEmpty(CanPerform, "Please answer 'I feel that I can perform the job functions of the open position.'")){
																											if(notEmpty(Signature, "Please enter a valid Signature.")){
																												if(notEmpty(SignatureDate, "Please enter a valid SignatureDate.")){
																													ToggleSubDisplay('yy',20, 'yy1');
																													ToggleSubDisplay('xx',20, 'xx1');
																												}
																											}
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	return false;
}



/* *********************************************
CORE VALIDATION FUNCTIONS ::: DO NOT EDIT ::: BEGIN
********************************************* */
function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}

function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

function lengthRestriction(elem, min, max){
	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	}else{
		alert("Please enter between " +min+ " and " +max+ " characters");
		elem.focus();
		return false;
	}
}

function madeSelection(elem, helperMsg){
	if(elem.value == "Please Choose"){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

/* *********************************************
CORE VALIDATION FUNCTIONS ::: DO NOT EDIT ::: END
********************************************* */

/* ************************************* 
09082010
************************************* */
var objWindow = null;

function popVideoWin(site) {
		var str;
		str = "";

		if (window.screen) {
			var ah = screen.availHeight - 30;
			var aw = screen.availWidth - 10;

			var xc = (aw - 800) / 2;
			var yc = (ah - 600) / 2;

			str += ",left=" + xc + ",screenX=" + xc;
			str += ",top=" + yc + ",screenY=" + yc;
		}

		objWindow = window.open(site, 'Video', "width=240,height=200,center,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0" + str);

}
