/* JavaScripts for ageless-athletes.com */
/* Chad Blake @ pcr-inc.com */

var INIT_SZ, MAX, MIN;

var init = function()
{
	INIT_SZ = 14;
	MAX = 24;
	MIN = 10;
	var elem = document.getElementsByTagName('div');
	var size = parseInt(elem[0].style.fontSize.replace("px", ""));		
	elem[0].style.fontSize = 14;	
	
	normal_image = new Image();
	normal_image.src = "img/logo.jpg";

	mouseover_image = new Image();
	mouseover_image.src = "img/logo2.jpg";	
}

// if the user wants to update their email address on coach_assessment8.php, it displays the update email input box
function updateEmail() {
	
	var update_email = document.getElementById("update_email");
	var email_address = document.getElementById("email_address");	
	var email_error = document.getElementById("email_error");
		
	if (update_email.style.display == "none") {
		email_address.style.display = "none";
		email_error.style.display = "none";
		update_email.style.display = "";
	} 
}

// increases the size of the text
function enlarge(eid)	
{			
	var x = document.getElementsByName(eid);	    
    var i=0;  
    var size=0; 
    
	for (i=0;i<x.length;i++) {	
		
		if (x[i].currentStyle) {
			var y = getStyle(eid,'fontSize',i);			
		}
		else if (window.getComputedStyle) {
			var y = getStyle(eid,'font-size',i);			
		}	
		size = parseInt(y);
		if (size < MAX) {
			x.item(i).style.fontSize = (size + 1) + "px";
		}
	}
}

// decreases the size of the text
function shrink(eid)
{	
	var x = document.getElementsByName(eid);	    
    var i=0;  
    var size=0;   
    
	for (i=0;i<x.length;i++) {	
		
		if (x[i].currentStyle) {
			var y = getStyle(eid,'fontSize',i);			
		}
		else if (window.getComputedStyle) {
			var y = getStyle(eid,'font-size',i);			
		}			

		size = parseInt(y);
		if (size > MIN) {
			x.item(i).style.fontSize = (size - 1) + "px";
		}		
	}	
}


// returns the value of the text-style that is searched for
// the first if tests for internet explorer, the else if tests for mozilla and other browsers
function getStyle(el,styleProp,i)
{	
	var x = document.getElementsByName(el);
	if (x[i].currentStyle)
		var y = x[i].currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x[i],null).getPropertyValue(styleProp);
	return y;
}

// function for the mouseover image swap of the ageless-athletes logo
function swap() {
	if (document.images){
		for (var x=0;x<swap.arguments.length;x+=2) {
			document[swap.arguments[x]].src = eval(swap.arguments[x+1] + ".src");
		}
	}
}

// error checking and validation for coach_assessment1.php
function coachAssessment1() {
	
	var fname = document.training_form.fname;
	if (fname.value == "") {
		alert ("Error: Your 'First Name' was left blank.");
		fname.focus();
		return false;
	}
	
	var lname = document.training_form.lname;
	if (lname.value == "") {
		alert ("Error: Your 'Last Name' was left blank.");
		lname.focus();
		return false;
	}
	
	var country = document.training_form.country;
	var other_country = document.training_form.other_country;
	if (country[1].checked == true && other_country.value == "") {
		alert ("Error: Your 'Country' was left blank.");
		other_country.focus();
		return false;
	}	
	
	var phone1 = document.training_form.primary_country_code;
	var phone2 = document.training_form.primary_phone1;
	var phone3 = document.training_form.primary_phone2;	
	if (phone1.value == "" || phone2.value == "" || phone3.value =="") {
		alert ("Error: All or part of your 'Primary Phone Number' was left blank.");
		phone1.focus();
		return false;
	}
	
	var email = document.training_form.email;
	if (email.value == "") {
		alert ("Error: Your 'Email Address' was left blank.");
		email.focus();
		return false;
	}
	
	var verify_email = document.training_form.verify_email;
	if (verify_email.value == "") {
		alert ("Error: Please verify your 'Email Address'.");
		verify_email.focus();
		return false;
	}
	
	if (email.value != verify_email.value) {
		alert ("Error: Your 'Email Address' does NOT match, Please Verify.");
		verify_email.focus();
		return false;
	}
	
	
}

function coachAssessment2() {
	
	// days and times to participate
	var monday = document.training_form.monday;
	var mon_time1 = document.training_form.mon_time1;
	var mon_time2 = document.training_form.mon_time2;
	var mon_time3 = document.training_form.mon_time3;
	var mon_time4 = document.training_form.mon_time4;

	var tuesday = document.training_form.tuesday;
	var tue_time1 = document.training_form.tue_time1;
	var tue_time2 = document.training_form.tue_time2;
	var tue_time3 = document.training_form.tue_time3;
	var tue_time4 = document.training_form.tue_time4;
	
	var wednesday = document.training_form.wednesday;
	var wed_time1 = document.training_form.wed_time1;
	var wed_time2 = document.training_form.wed_time2;
	var wed_time3 = document.training_form.wed_time3;
	var wed_time4 = document.training_form.wed_time4;
	
	var thursday = document.training_form.thursday;
	var thu_time1 = document.training_form.thu_time1;
	var thu_time2 = document.training_form.thu_time2;
	var thu_time3 = document.training_form.thu_time3;
	var thu_time4 = document.training_form.thu_time4;
	
	var friday = document.training_form.friday;
	var fri_time1 = document.training_form.fri_time1;
	var fri_time2 = document.training_form.fri_time2;
	var fri_time3 = document.training_form.fri_time3;
	var fri_time4 = document.training_form.fri_time4;
	
	var saturday = document.training_form.saturday;
	var sat_time1 = document.training_form.sat_time1;
	var sat_time2 = document.training_form.sat_time2;
	var sat_time3 = document.training_form.sat_time3;
	var sat_time4 = document.training_form.sat_time4;
	
	var sunday = document.training_form.sunday;
	var sun_time1 = document.training_form.sun_time1;
	var sun_time2 = document.training_form.sun_time2;
	var sun_time3 = document.training_form.sun_time3;
	var sun_time4 = document.training_form.sun_time4;
	
	
	if (monday.checked == true) {
		if ((mon_time1.checked == false) && (mon_time2.checked == false) && (mon_time3.checked == false) && (mon_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Monday, but have NOT choosen a time.");
			monday.focus();
			return false;
		} 	
	} else if (monday.checked == false) {		
		if ((mon_time1.checked == true) || (mon_time2.checked == true) || (mon_time3.checked == true) || (mon_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Mondays, but HAVE NOT checked the 'Monday' Checkbox. Please check the 'Monday' checkbox if you plan on participating that day.");
			monday.focus();
			return false;
		}		
	}
	
	if (tuesday.checked == true) {
		if ((tue_time1.checked == false) && (tue_time2.checked == false) && (tue_time3.checked == false) && (tue_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Tuesday, but have NOT choosen a time.");
			tuesday.focus();
			return false;
		} 	
	} else if (tuesday.checked == false) {		
		if ((tue_time1.checked == true) || (tue_time2.checked == true) || (tue_time3.checked == true) || (tue_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Tuesdays, but HAVE NOT checked the 'Tuesday' Checkbox. Please check the 'Tuesday' checkbox if you plan on participating that day.");
			tuesday.focus();
			return false;
		}		
	}
	
	if (wednesday.checked == true) {
		if ((wed_time1.checked == false) && (wed_time2.checked == false) && (wed_time3.checked == false) && (wed_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Wednesday, but have NOT choosen a time.");
			wednesday.focus();
			return false;
		} 	
	} else if (wednesday.checked == false) {		
		if ((wed_time1.checked == true) || (wed_time2.checked == true) || (wed_time3.checked == true) || (wed_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Wednesdays, but HAVE NOT checked the 'Wednesday' Checkbox. Please check the 'Wednesday' checkbox if you plan on participating that day.");
			wednesday.focus();
			return false;
		}		
	}
	
	if (thursday.checked == true) {
		if ((thu_time1.checked == false) && (thu_time2.checked == false) && (thu_time3.checked == false) && (thu_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Thursday, but have NOT choosen a time.");
			thursday.focus();
			return false;
		} 	
	} else if (thursday.checked == false) {		
		if ((thu_time1.checked == true) || (thu_time2.checked == true) || (thu_time3.checked == true) || (thu_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Thursdays, but HAVE NOT checked the 'Thursday' Checkbox. Please check the 'Thursday' checkbox if you plan on participating that day.");
			thursday.focus();
			return false;
		}		
	}
	
	if (friday.checked == true) {
		if ((fri_time1.checked == false) && (fri_time2.checked == false) && (fri_time3.checked == false) && (fri_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Friday, but have NOT choosen a time.");
			friday.focus();
			return false;
		} 	
	} else if (friday.checked == false) {		
		if ((fri_time1.checked == true) || (fri_time2.checked == true) || (fri_time3.checked == true) || (fri_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Fridays, but HAVE NOT checked the 'Friday' Checkbox. Please check the 'Friday' checkbox if you plan on participating that day.");
			friday.focus();
			return false;
		}		
	}
	
	if (saturday.checked == true) {
		if ((sat_time1.checked == false) && (sat_time2.checked == false) && (sat_time3.checked == false) && (sat_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Saturday, but have NOT choosen a time.");
			saturday.focus();
			return false;
		} 	
	} else if (saturday.checked == false) {		
		if ((sat_time1.checked == true) || (sat_time2.checked == true) || (sat_time3.checked == true) || (sat_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Saturdays, but HAVE NOT checked the 'Saturday' Checkbox. Please check the 'Saturday' checkbox if you plan on participating that day.");
			saturday.focus();
			return false;
		}		
	}
	
	if (sunday.checked == true) {
		if ((sun_time1.checked == false) && (sun_time2.checked == false) && (sun_time3.checked == false) && (sun_time4.checked == false)) {
			alert ("Error: You have selected that you are able to participate on Sunday, but have NOT choosen a time.");
			sunday.focus();
			return false;
		} 	
	} else if (sunday.checked == false) {		
		if ((sun_time1.checked == true) || (sun_time2.checked == true) || (sun_time3.checked == true) || (sun_time4.checked == true)) {
			alert ("Error: You have selected a time to participate on Sundays, but HAVE NOT checked the 'Sunday' Checkbox. Please check the 'Sunday' checkbox if you plan on participating that day.");
			sunday.focus();
			return false;
		}		
	}	
	
	if ((monday.checked == false) && (tuesday.checked == false) && (wednesday.checked == false) && (thursday.checked == false) && (friday.checked == false) && (saturday.checked == false) && (sunday.checked == false)) {
		alert ("Please select at least '1 day and time' you would like to participate.");
		monday.focus();
		return false;		
	}
	
	var month = document.training_form.month;
	var day = document.training_form.day;
	var year = document.training_form.year;		
	
	if (month.value == 2 && day.value > 29) {
		alert ("Error: February does not have more than 29 days. Please change the 'Day' value.");
		day.focus();
		return false;
	}
	
	if (month.value == 2 && day.value == 29 && (year.value%4!=0)) {
		alert ("Error: The 'Year' you have selected is NOT a leap year. Please review your 'Date of Birth'.");
		day.focus();
		return false;
	}
	
	if ((month.value == 4 || month.value == 6 || month.value == 9 || month.value == 11) && day.value == 31) {
		alert ("Error: The 'Month' you have selected does not have 31 days. Please review your 'Date of Birth'.");
		month.focus();
		return false;
	}
	
	
	var weight = document.training_form.weight;
	if (weight.value == "") {
		alert ("Error: Your 'Weight' was left blank.");
		weight.focus();
		return false;
	}
	
	if (weight.value != parseFloat(weight.value) || weight.value != parseInt(weight.value)) {
		alert ("Error: Your 'Weight' must be a number.");
		weight.focus();
		return false;
	}
	
	var height = document.training_form.height;
	if (height.value == "") {
		alert ("Error: Your 'Height' was left blank.");
		height.focus();
		return false;
	}
	
	if (height.value != parseFloat(height.value) || height.value != parseInt(height.value)) {
		alert ("Error: Your 'Height' must be a number.");
		height.focus();
		return false;
	}
	
	var chest = document.training_form.chest;
	if (chest.value == "") {
		alert ("Error: Your 'Chest Measurement' was left blank.");
		chest.focus();
		return false;
	}
	
	if (chest.value != parseFloat(chest.value) || chest.value != parseInt(chest.value)) {
		alert ("Error: Your 'Chest Measurement' must be a number.");
		chest.focus();
		return false;
	}
	
	var waist = document.training_form.waist;
	if (waist.value == "") {
		alert ("Error: Your 'Waist Measurement' was left blank.");
		waist.focus();
		return false;
	}
	
	if (waist.value != parseFloat(waist.value) || waist.value != parseInt(waist.value)) {
		alert ("Error: Your 'Waist Measurement' must be a number.");
		waist.focus();
		return false;
	}
	
	var hips = document.training_form.hips;
	if (hips.value == "") {
		alert ("Error: Your 'Hips Measurement' was left blank.");
		hips.focus();
		return false;
	}
	
	if (hips.value != parseFloat(hips.value) || hips.value != parseInt(hips.value)) {
		alert ("Error: Your 'Hips Measurement' must be a number.");
		hips.focus();
		return false;
	}
	
	if (arms.value != parseFloat(arms.value) || arms.value != parseInt(arms.value)) {
		alert ("Error: Your 'Arms Measurement' must be a number.");
		arms.focus();
		return false;
	}
	
	if (bodyfat.value != parseFloat(bodyfat.value) || bodyfat.value != parseInt(bodyfat.value)) {
		alert ("Error: Your 'Body Fat Measurement' must be a number.");
		bodyfat.focus();
		return false;
	}
	
	return true;	
}

// error checking and validation for coach_assessment2.php
function coachAssessment3() {	
	
	var wgt_training_mon = document.training_form.wgt_training_mon;
	if (wgt_training_mon.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Monday'. Please limit to under 2000. Current count: "+wgt_training_mon.value.length);
		wgt_training_mon.focus();
		return false;		
	}
	
	var wgt_training_tue = document.training_form.wgt_training_tue;
	if (wgt_training_tue.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Tuesday'. Please limit to under 2000. Current count: "+wgt_training_tue.value.length);
		wgt_training_tue.focus();
		return false;		
	}
	
	var wgt_training_wed = document.training_form.wgt_training_wed;
	if (wgt_training_wed.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Wednesday'. Please limit to under 2000. Current count: "+wgt_training_wed.value.length);
		wgt_training_wed.focus();
		return false;		
	}
	
	var wgt_training_thu = document.training_form.wgt_training_thu;
	if (wgt_training_thu.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Thursday'. Please limit to under 2000. Current count: "+wgt_training_thu.value.length);
		wgt_training_thu.focus();
		return false;		
	}
	
	var wgt_training_fri = document.training_form.wgt_training_fri;
	if (wgt_training_fri.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Friday'. Please limit to under 2000. Current count: "+wgt_training_fri.value.length);
		wgt_training_fri.focus();
		return false;		
	}
	
	var wgt_training_sat = document.training_form.wgt_training_sat;
	if (wgt_training_sat.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Saturday'. Please limit to under 2000. Current count: "+wgt_training_sat.value.length);
		wgt_training_sat.focus();
		return false;		
	}
	
	var wgt_training_sun = document.training_form.wgt_training_sun;
	if (wgt_training_sun.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Sunday'. Please limit to under 2000. Current count: "+wgt_training_sun.value.length);
		wgt_training_sun.focus();
		return false;		
	}
	
	var wgt_training_likemost = document.training_form.wgt_training_likemost;
	if (wgt_training_likemost.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Training you like the MOST'. Please limit to under 2000. Current count: "+wgt_training_likemost.value.length);
		wgt_training_likemost.focus();
		return false;		
	}
	
	var wgt_training_likeleast = document.training_form.wgt_training_likeleast;
	if (wgt_training_likeleast.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Training you like the LEAST'. Please limit to under 2000. Current count: "+wgt_training_likeleast.value.length);
		wgt_training_likeleast.focus();
		return false;		
	}	
	
	var no_program = document.training_form.no_program;	
	if (no_program.checked==0 && wgt_training_mon.value=="" && wgt_training_tue.value=="" && wgt_training_wed.value=="" && wgt_training_thu.value=="" && wgt_training_fri.value=="" && wgt_training_sat.value=="" && wgt_training_sun.value=="") {
		alert ("Please mark the checkbox if you DO NOT have a Weight Training Program.");
	    no_program.focus();
	    return false;		
	} 	
	
	return true;	
}

// error checking and validation for coach_assessment3.php
function coachAssessment4() {	
	
	var aerobic_training_mon = document.training_form.aerobic_training_mon;
	if (aerobic_training_mon.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Monday'. Please limit to under 2000. Current count: "+aerobic_training_mon.value.length);
		aerobic_training_mon.focus();
		return false;		
	}
	
	var aerobic_training_tue = document.training_form.aerobic_training_tue;
	if (aerobic_training_tue.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Tuesday'. Please limit to under 2000. Current count: "+aerobic_training_tue.value.length);
		aerobic_training_tue.focus();
		return false;		
	}
	
	var aerobic_training_wed = document.training_form.aerobic_training_wed;
	if (aerobic_training_wed.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Wednesday'. Please limit to under 2000. Current count: "+aerobic_training_wed.value.length);
		aerobic_training_wed.focus();
		return false;		
	}
	
	var aerobic_training_thu = document.training_form.aerobic_training_thu;
	if (aerobic_training_thu.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Thursday'. Please limit to under 2000. Current count: "+aerobic_training_thu.value.length);
		aerobic_training_thu.focus();
		return false;		
	}
	
	var aerobic_training_fri = document.training_form.aerobic_training_fri;
	if (aerobic_training_fri.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Friday'. Please limit to under 2000. Current count: "+aerobic_training_fri.value.length);
		aerobic_training_fri.focus();
		return false;		
	}
	
	var aerobic_training_sat = document.training_form.aerobic_training_sat;
	if (aerobic_training_sat.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Saturday'. Please limit to under 2000. Current count: "+aerobic_training_sat.value.length);
		aerobic_training_sat.focus();
		return false;		
	}
	
	var aerobic_training_sun = document.training_form.aerobic_training_sun;
	if (aerobic_training_sun.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Sunday'. Please limit to under 2000. Current count: "+aerobic_training_sun.value.length);
		aerobic_training_sun.focus();
		return false;		
	}
	
	var aerobic_training_likemost = document.training_form.aerobic_training_likemost;
	if (aerobic_training_likemost.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Training you like the MOST'. Please limit to under 2000. Current count: "+aerobic_training_likemost.value.length);
		aerobic_training_likemost.focus();
		return false;		
	}
	
	var aerobic_training_likeleast = document.training_form.aerobic_training_likeleast;
	if (aerobic_training_likeleast.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Training you like the LEAST'. Please limit to under 2000. Current count: "+aerobic_training_likeleast.value.length);
		aerobic_training_likeleast.focus();
		return false;		
	}	
	
	var no_program = document.training_form.no_program;	
	if (no_program.checked==0 && aerobic_training_mon.value=="" && aerobic_training_tue.value=="" && aerobic_training_wed.value=="" && aerobic_training_thu.value=="" && aerobic_training_fri.value=="" && aerobic_training_sat.value=="" && aerobic_training_sun.value=="") {
		alert ("Please mark the checkbox if you DO NOT have an Aerobic Training Program.");
	    no_program.focus();
	    return false;		
	} 
	
	return true;	
}

// error checking and validation for coach_assessment4.php
function coachAssessment5() {
	
	var pc_goals = document.training_form.pc_goals;
	if (pc_goals.value == "") {
		alert ("Error: Please enter something that you would like to accomplish with Personal Coaching.");
		pc_goals.focus();
		return false;
	}
	
	if (pc_goals.value.length > 2000) {		
		alert ("Error: There are too many characters in your goals and accomplishments for personal coaching. Please limit to under 2000. Current count: "+pc_goals.value.length);
		pc_goals.focus();
		return false;		
	}
	
	var training_goals = document.training_form.training_goals;
	if (training_goals.value.length > 2000) {		
		alert ("Error: There are too many characters in your training goals. Please limit to under 2000. Current count: "+training_goals.value.length);
		training_goals.focus();
		return false;		
	}
	
	return true;	
}

// error checking and validation for coach_assessment5.php
function coachAssessment6() {
	
	var training_equipment = document.training_form.training_equipment;
	if (training_equipment.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Training Equipment'. Please limit to under 2000. Current count: "+training_equipment.value.length);
		training_equipment.focus();
		return false;		
	}
	
	var physical_problems = document.training_form.physical_problems;
	if (physical_problems.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Physical Problems'. Please limit to under 2000. Current count: "+physical_problems.value.length);
		physical_problems.focus();
		return false;		
	}
	return true;	
}

function coachAssessment7() {
	
	var breakfast = document.training_form.breakfast;
	var lunch = document.training_form.lunch;
	var dinner = document.training_form.dinner;
	var snacks = document.training_form.snacks;
	
	if (breakfast.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Breakfast'. Please limit to under 2000. Current count: "+breakfast.value.length);
		breakfast.focus();
		return false;		
	}
	
	if (lunch.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Lunch'. Please limit to under 2000. Current count: "+lunch.value.length);
		lunch.focus();
		return false;		
	}
	
	if (dinner.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Dinner'. Please limit to under 2000. Current count: "+dinner.value.length);
		dinner.focus();
		return false;		
	}
	
	if (snacks.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Snacks'. Please limit to under 2000. Current count: "+snacks.value.length);
		snacks.focus();
		return false;		
	}
	
	var calories = document.training_form.calories;
	if (calories.value != parseInt(calories.value) && calories.value != "") {
		alert ("Error: Your 'Calorie Intake' must be a number.");
		calories.focus();
		return false;
	}
	
	var supplements = document.training_form.supplements;
	
	if (supplements.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Supplements'. Please limit to under 2000. Current count: "+supplements.value.length);
		supplements.focus();
		return false;		
	}
	
	return true;
}

function coachAssessment8() {
	
	var sleep_patterns = document.training_form.sleep_patterns;
	var stresses = document.training_form.stresses;
	
	if (sleep_patterns.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Sleep Patterns'. Please limit to under 2000. Current count: "+sleep_patterns.value.length);
		sleep_patterns.focus();
		return false;		
	}
	
	if (stresses.value.length > 2000) {		
		alert ("Error: There are too many characters for 'Unusual Stresses'. Please limit to under 2000. Current count: "+stresses.value.length);
		stresses.focus();
		return false;		
	}	
}
