var strSect = ""; var numSect = -1;
var strSectCurr = ""; var strAlert = "";
var bolReset = false;

var home_on = new Image();
var home_off = new Image();
var home_roll = new Image();
home_on.src = '/images/mnav_home_on.gif';
home_off.src = '/images/mnav_home_off.gif';
home_roll.src = '/images/mnav_home_roll.gif';

var about_on = new Image();
var about_off = new Image();
var about_roll = new Image();
about_on.src = '/images/mnav_about_on.gif';
about_off.src = '/images/mnav_about_off.gif';
about_roll.src = '/images/mnav_about_roll.gif';

var chemistry_on = new Image();
var chemistry_off = new Image();
var chemistry_roll = new Image();
chemistry_on.src = '/images/mnav_chemistry_on.gif';
chemistry_off.src = '/images/mnav_chemistry_off.gif';
chemistry_roll.src = '/images/mnav_chemistry_roll.gif';

var partner_on = new Image();
var partner_off = new Image();
var partner_roll = new Image();
partner_on.src = '/images/mnav_partner_on.gif';
partner_off.src = '/images/mnav_partner_off.gif';
partner_roll.src = '/images/mnav_partner_roll.gif';

var training_on = new Image();
var training_off = new Image();
var training_roll = new Image();
training_on.src = '/images/mnav_training_on.gif';
training_off.src = '/images/mnav_training_off.gif';
training_roll.src = '/images/_mnav_training_roll.gif';

var careers_on = new Image();
var careers_off = new Image();
var careers_roll = new Image();
careers_on.src = '/images/mnav_careers_on.gif';
careers_off.src = '/images/mnav_careers_off.gif';
careers_roll.src = '/images/mnav_careers_roll.gif';

function rollOverMNav(sect, curr) {
	var strSectNew; var numSectNew;
	var strTemp;
	
	bolReset = false;
	
	strTemp = sect.slice((sect.length - 2), sect.length);
	if(strTemp == parseInt(strTemp, 10)) {
		strSectNew = sect.slice(0, (sect.length - 2));
		numSectNew = parseInt(strTemp, 10);
	} else {strSectNew = sect; numSectNew = 0;}
	strSectCurr = curr;
	
	if(strSectNew != strSect) {
		if(strSect != "") {
			if(numSect != 0) {
				if(numSect < 10) {strTemp = '0' + numSect;} else {strTemp = '' + numSect;}
				document.getElementById(strSect + strTemp).className = 'off';
			}
			document.getElementById(strSect + '00').style.visibility = 'hidden';
			if(strSect != strSectCurr) {document.images[strSect].src = eval(strSect + '_off.src');}
		}
		if(strSectNew != strSectCurr) {document.images[strSectNew].src = eval(strSectNew + '_roll.src');}
		document.getElementById(strSectNew + '00').style.visibility = 'visible';
	} else {
		if(numSect != 0) {
			if(numSect < 10) {strTemp = '0' + numSect;} else {strTemp = '' + numSect;}
			document.getElementById(strSect + strTemp).className = 'off';
		}
		if(numSectNew < 10) {strTemp = '0' + numSectNew;} else {strTemp = '' + numSectNew;}
		document.getElementById(strSect + strTemp).className = 'on';
	}

	strSect = strSectNew; numSect = numSectNew;
}

function rollOutMNav(sect) {
	bolReset = true;
	setTimeout(rsetMNav, 1000);
}

function rsetMNav() {
	var strTemp;

	if(bolReset) {
		if(numSect != 0) {
			if(numSect < 10) {strTemp = '0' + numSect;} else {strTemp = '' + numSect;}
			document.getElementById(strSect + strTemp).className = 'off';
		}
		document.getElementById(strSect + '00').style.visibility = 'hidden';
		if(strSect != strSectCurr) {document.images[strSect].src = eval(strSect + '_off.src');}
	
		strSect = ""; numSect = -1; bolReset = false;
	}
}

function chckAlert() {
	if(strAlert != '') {alert(strAlert);}
}

function chckText(txt) {
	var intLen;
	var i; var bolRet;
	
	intLen = txt.length;
	i = 0; bolRet = false;
	
	while(i < intLen){ 
		if(txt.substr(i,1) != ' ') {bolRet = true; break;}
		i++;
	}
	
	return bolRet;
}

function chckInt(num) {
	var strNum; var intLen;
	var bolRet;
	
	strNum = num; intLen = num.length;
	bolRet = false;
	
	if(intLen != 0) {
		strNum = clipLeadZeros(strNum);
		intLen = strNum.length;

		if (intLen == 0) {bolRet = true;}
		else {if('' + parseInt(strNum) == strNum) {bolRet = true;}}
	}
	
	return bolRet;
}

function chckEmail(eml) {
	var intLen;
	var i; var j; var bolRet;
	
	intLen = eml.length;
	i = 0; j = 0; bolRet = false;
	
	while(i < intLen){ 
		if(j == 0) {if(eml.substr(i,1) == '@') {j = 1;}}
		if(j == 1) {if(eml.substr(i,1) == '.') {bolRet = true; break;}}
		i++;
	}
	
	return bolRet;
}

function chckDate(dte) {
	var arrDate; var dteDate;
	var strMon; var strDay; var strYear;
	var intMon; var intDay; var intYear;
	var bolRet;

	arrDate = dte.split("/");
	bolRet = false;
	
	if(arrDate.length == 3) {
		strMon = arrDate[0]; strDay = arrDate[1]; strYear = arrDate[2];
		if((strMon.length == 2) && (strDay.length == 2) && (strYear.length == 4)) {
			if(chckInt(strMon) && chckInt(strDay) && chckInt(strYear)) {
				
				strMon = clipLeadZeros(strMon); intMon = parseInt(strMon) - 1;
				strDay = clipLeadZeros(strDay); intDay = parseInt(strDay);
				strYear = clipLeadZeros(strYear); intYear = parseInt(strYear);
				
				if((strMon.length > 0) && (strDay.length > 0) && (strYear.length == 4)) {
					dteDate = new Date(intYear, intMon, intDay);
					if((dteDate.getMonth() == intMon) && (dteDate.getDate() == intDay) && (dteDate.getFullYear() == intYear)) {bolRet = true;}
				}
			}
		}
	}
	
	return bolRet;
}

function clipLeadZeros(num) {
	var strNum; var intLen;
	
	strNum = num; intLen = num.length;
	
	while(intLen > 0) {
		if(strNum.substring(0,1) == '0') {
			strNum = strNum.substring(1,intLen);
			intLen = strNum.length;
		} else {break;}
	}
	
	return strNum;
}











