// JavaScript Document
function total() {
//Monday Column Totals
var mon1 = document.hours.mon1.value - 0;
var mon2 = document.hours.mon2.value - 0;
var mon3 = document.hours.mon3.value - 0;
var mon4 = document.hours.mon4.value - 0;
var mon5 = document.hours.mon5.value - 0;
var mon6 = document.hours.mon6.value - 0;
var mon7 = document.hours.mon7.value - 0;
var mon8 = document.hours.mon8.value - 0;
var mon_fh = document.hours.mon_fh.value - 0;
var mon_vac = document.hours.mon_vac.value - 0;
var mon_hol = document.hours.mon_hol.value - 0;
var mon_totals = document.hours.mon_totals.value;
document.hours.mon_totals.value = mon1+mon2+mon3+mon4+mon5+mon6+mon7+mon8+mon_fh+mon_vac+mon_hol;
//Tuesday Column Totals
var tue1 = document.hours.tue1.value - 0;
var tue2 = document.hours.tue2.value - 0;
var tue3 = document.hours.tue3.value - 0;
var tue4 = document.hours.tue4.value - 0;
var tue5 = document.hours.tue5.value - 0;
var tue6 = document.hours.tue6.value - 0;
var tue7 = document.hours.tue7.value - 0;
var tue8 = document.hours.tue8.value - 0;
var tue_fh = document.hours.tue_fh.value - 0;
var tue_vac = document.hours.tue_vac.value - 0;
var tue_hol = document.hours.tue_hol.value - 0;
var tue_totals = document.hours.tue_totals.value;
document.hours.tue_totals.value = tue1+tue2+tue3+tue4+tue5+tue6+tue7+tue8+tue_fh+tue_vac+tue_hol;
//Wednesday Column Totals
var wed1 = document.hours.wed1.value - 0;
var wed2 = document.hours.wed2.value - 0;
var wed3 = document.hours.wed3.value - 0;
var wed4 = document.hours.wed4.value - 0;
var wed5 = document.hours.wed5.value - 0;
var wed6 = document.hours.wed6.value - 0;
var wed7 = document.hours.wed7.value - 0;
var wed8 = document.hours.wed8.value - 0;
var wed_fh = document.hours.wed_fh.value - 0;
var wed_vac = document.hours.wed_vac.value - 0;
var wed_hol = document.hours.wed_hol.value - 0;
var wed_totals = document.hours.wed_totals.value;
document.hours.wed_totals.value = wed1+wed2+wed3+wed4+wed5+wed6+wed7+wed8+wed_fh+wed_vac+wed_hol;
//Thursday Column Totals
var thu1 = document.hours.thu1.value - 0;
var thu2 = document.hours.thu2.value - 0;
var thu3 = document.hours.thu3.value - 0;
var thu4 = document.hours.thu4.value - 0;
var thu5 = document.hours.thu5.value - 0;
var thu6 = document.hours.thu6.value - 0;
var thu7 = document.hours.thu7.value - 0;
var thu8 = document.hours.thu8.value - 0;
var thu_fh = document.hours.thu_fh.value - 0;
var thu_vac = document.hours.thu_vac.value - 0;
var thu_hol = document.hours.thu_hol.value - 0;
var thu_totals = document.hours.thu_totals.value;
document.hours.thu_totals.value = thu1+thu2+thu3+thu4+thu5+thu6+thu7+thu8+thu_fh+thu_vac+thu_hol;
//Friday Column Totals
var fri1 = document.hours.fri1.value - 0;
var fri2 = document.hours.fri2.value - 0;
var fri3 = document.hours.fri3.value - 0;
var fri4 = document.hours.fri4.value - 0;
var fri5 = document.hours.fri5.value - 0;
var fri6 = document.hours.fri6.value - 0;
var fri7 = document.hours.fri7.value - 0;
var fri8 = document.hours.fri8.value - 0;
var fri_fh = document.hours.fri_fh.value - 0;
var fri_vac = document.hours.fri_vac.value - 0;
var fri_hol = document.hours.fri_hol.value - 0;
var fri_totals = document.hours.fri_totals.value;
document.hours.fri_totals.value = fri1+fri2+fri3+fri4+fri5+fri6+fri7+fri8+fri_fh+fri_vac+fri_hol;
//Saturday Column Totals
var sat1 = document.hours.sat1.value - 0;
var sat2 = document.hours.sat2.value - 0;
var sat3 = document.hours.sat3.value - 0;
var sat4 = document.hours.sat4.value - 0;
var sat5 = document.hours.sat5.value - 0;
var sat6 = document.hours.sat6.value - 0;
var sat7 = document.hours.sat7.value - 0;
var sat8 = document.hours.sat8.value - 0;
var sat_fh = document.hours.sat_fh.value - 0;
var sat_vac = document.hours.sat_vac.value - 0;
var sat_hol = document.hours.sat_hol.value - 0;
var sat_totals = document.hours.sat_totals.value;
document.hours.sat_totals.value = sat1+sat2+sat3+sat4+sat5+sat6+sat7+sat8+sat_fh+sat_vac+sat_hol;
//Sunday Column Totals
var sun1 = document.hours.sun1.value - 0;
var sun2 = document.hours.sun2.value - 0;
var sun3 = document.hours.sun3.value - 0;
var sun4 = document.hours.sun4.value - 0;
var sun5 = document.hours.sun5.value - 0;
var sun6 = document.hours.sun6.value - 0;
var sun7 = document.hours.sun7.value - 0;
var sun8 = document.hours.sun8.value - 0;
var sun_fh = document.hours.sun_fh.value - 0;
var sun_vac = document.hours.sun_vac.value - 0;
var sun_hol = document.hours.sun_hol.value - 0;
var sun_totals = document.hours.sun_totals.value;
document.hours.sun_totals.value = sun1+sun2+sun3+sun4+sun5+sun6+sun7+sun8+sun_fh+sun_vac+sun_hol;
//Straight Time Column Totals
var st1 = document.hours.st1.value - 0;
var st2 = document.hours.st2.value - 0;
var st3 = document.hours.st3.value - 0;
var st4 = document.hours.st4.value - 0;
var st5 = document.hours.st5.value - 0;
var st6 = document.hours.st6.value - 0;
var st7 = document.hours.st7.value - 0;
var st8 = document.hours.st8.value - 0;
var st_fh = document.hours.st_fh.value - 0;
var st_vac = document.hours.st_vac.value - 0;
var st_hol = document.hours.st_hol.value - 0;
var st_totals = document.hours.st_totals.value;
document.hours.st_totals.value = st1+st2+st3+st4+st5+st6+st7+st8+st_fh+st_vac+st_hol;
//Overtime Column Totals
var ot1 = document.hours.ot1.value - 0;
var ot2 = document.hours.ot2.value - 0;
var ot3 = document.hours.ot3.value - 0;
var ot4 = document.hours.ot4.value - 0;
var ot5 = document.hours.ot5.value - 0;
var ot6 = document.hours.ot6.value - 0;
var ot7 = document.hours.ot7.value - 0;
var ot8 = document.hours.ot8.value - 0;
var ot_fh = document.hours.ot_fh.value - 0;
var ot_vac = document.hours.ot_vac.value - 0;
var ot_hol = document.hours.ot_hol.value - 0;
var ot_totals = document.hours.ot_totals.value;
document.hours.ot_totals.value = ot1+ot2+ot3+ot4+ot5+ot6+ot7+ot8+ot_fh+ot_vac+ot_hol;



}
function monday() {

week();
total();
var mon_totals = document.hours.mon_totals.value - 0;
var tue_totals = document.hours.tue_totals.value - 0;
var wed_totals = document.hours.wed_totals.value - 0;
var thu_totals = document.hours.thu_totals.value - 0;
var fri_totals = document.hours.fri_totals.value - 0;
var sat_totals = document.hours.sat_totals.value - 0;
var sun_totals = document.hours.sun_totals.value - 0;
var st_totals = document.hours.st_totals.value - 0;
var ot_totals = document.hours.ot_totals.value - 0;
var ptot_totals = document.hours.ptot_totals.value;

document.hours.ptot_totals.value = mon_totals+tue_totals+wed_totals+thu_totals+fri_totals+sat_totals+sun_totals;//+st_totals+ot_totals;

}

function week() {
		var mon1 = document.hours.mon1.value - 0;
		var tue1 = document.hours.tue1.value - 0;
		var wed1 = document.hours.wed1.value - 0;
		var thu1 = document.hours.thu1.value - 0;
		var fri1 = document.hours.fri1.value - 0;
		var sat1 = document.hours.sat1.value - 0;
		var sun1 = document.hours.sun1.value - 0;
		var st1 = document.hours.st1.value - 0;
		var ot1 = document.hours.ot1.value - 0;
		var ptot1 = document.hours.ptot1.value - 0;
		document.hours.ptot1.value = mon1+tue1+wed1+thu1+fri1+sat1+sun1;

		var week1 = document.hours.ptot1.value;
		if (week1 <= 40) { st1 = mon1+tue1+wed1+thu1+fri1+sat1+sun1; over1 = 0; }
		else { st1 = 40; over1 = mon1+tue1+wed1+thu1+fri1+sat1+sun1 - 40; }
		document.hours.st1.value = st1;
		document.hours.ot1.value = over1;

		var mon2 = document.hours.mon2.value - 0;
		var tue2 = document.hours.tue2.value - 0;
		var wed2 = document.hours.wed2.value - 0;
		var thu2 = document.hours.thu2.value - 0;
		var fri2 = document.hours.fri2.value - 0;
		var sat2 = document.hours.sat2.value - 0;
		var sun2 = document.hours.sun2.value - 0;
		var st2 = document.hours.st2.value - 0;
		var ot2 = document.hours.ot2.value - 0;		
		document.hours.ptot2.value = mon2+tue2+wed2+thu2+fri2+sat2+sun2;
		
		var week2 = document.hours.ptot2.value;
		if (week2 <= 40) { st2 = mon2+tue2+wed2+thu2+fri2+sat2+sun2; over2 = 0; }
		else { st2 = 40; over2 = mon2+tue2+wed2+thu2+fri2+sat2+sun2 - 40; }
		document.hours.st2.value = st2;
		document.hours.ot2.value = over2;	
		
		var mon3 = document.hours.mon3.value - 0;
		var tue3 = document.hours.tue3.value - 0;
		var wed3 = document.hours.wed3.value - 0;
		var thu3 = document.hours.thu3.value - 0;
		var fri3 = document.hours.fri3.value - 0;
		var sat3 = document.hours.sat3.value - 0;
		var sun3 = document.hours.sun3.value - 0;
		var st3 = document.hours.st3.value - 0;
		var ot3 = document.hours.ot3.value - 0;
		document.hours.ptot3.value = mon3+tue3+wed3+thu3+fri3+sat3+sun3;
		
		var week3 = document.hours.ptot3.value;
		if (week3 <= 40) { st3 = mon3+tue3+wed3+thu3+fri3+sat3+sun3; over3 = 0; }
		else { st3 = 40; over3 = mon3+tue3+wed3+thu3+fri3+sat3+sun3 - 40; }
		document.hours.st3.value = st3;
		document.hours.ot3.value = over3;	

		var mon4 = document.hours.mon4.value - 0;
		var tue4 = document.hours.tue4.value - 0;
		var wed4 = document.hours.wed4.value - 0;
		var thu4 = document.hours.thu4.value - 0;
		var fri4 = document.hours.fri4.value - 0;
		var sat4 = document.hours.sat4.value - 0;
		var sun4 = document.hours.sun4.value - 0;
		var st4 = document.hours.st4.value - 0;
		var ot4 = document.hours.ot4.value - 0;
		document.hours.ptot4.value = mon4+tue4+wed4+thu4+fri4+sat4+sun4;
		
		var week4 = document.hours.ptot4.value;
		if (week4 <= 40) { st4 = mon4+tue4+wed4+thu4+fri4+sat4+sun4; over4 = 0; }
		else { st4 = 40; over4 = mon4+tue4+wed4+thu4+fri4+sat4+sun4 - 40; }
		document.hours.st4.value = st4;
		document.hours.ot4.value = over4;		

		var mon5 = document.hours.mon5.value - 0;
		var tue5 = document.hours.tue5.value - 0;
		var wed5 = document.hours.wed5.value - 0;
		var thu5 = document.hours.thu5.value - 0;
		var fri5 = document.hours.fri5.value - 0;
		var sat5 = document.hours.sat5.value - 0;
		var sun5 = document.hours.sun5.value - 0;
		var st5 = document.hours.st5.value - 0;
		var ot5 = document.hours.ot5.value - 0;		
		document.hours.ptot5.value = mon5+tue5+wed5+thu5+fri5+sat5+sun5;

		var week5 = document.hours.ptot5.value;
		if (week5 <= 40) { st5 = mon5+tue5+wed5+thu5+fri5+sat5+sun5; over5 = 0; }
		else { st5 = 40; over5 = mon5+tue5+wed5+thu5+fri5+sat5+sun5 - 40; }
		document.hours.st5.value = st5;
		document.hours.ot5.value = over5;		

		var mon6 = document.hours.mon6.value - 0;
		var tue6 = document.hours.tue6.value - 0;
		var wed6 = document.hours.wed6.value - 0;
		var thu6 = document.hours.thu6.value - 0;
		var fri6 = document.hours.fri6.value - 0;
		var sat6 = document.hours.sat6.value - 0;
		var sun6 = document.hours.sun6.value - 0;
		var st6 = document.hours.st6.value - 0;
		var ot6 = document.hours.ot6.value - 0;	
		document.hours.ptot6.value = mon6+tue6+wed6+thu6+fri6+sat6+sun6;
		
		var week6 = document.hours.ptot6.value;
		if (week6 <= 40) { st6 = mon6+tue6+wed6+thu6+fri6+sat6+sun6; over6 = 0; }
		else { st6 = 40; over6 = mon6+tue6+wed6+thu6+fri6+sat6+sun6 - 40; }
		document.hours.st6.value = st6;
		document.hours.ot6.value = over6;				

		var mon7 = document.hours.mon7.value - 0;
		var tue7 = document.hours.tue7.value - 0;
		var wed7 = document.hours.wed7.value - 0;
		var thu7 = document.hours.thu7.value - 0;
		var fri7 = document.hours.fri7.value - 0;
		var sat7 = document.hours.sat7.value - 0;
		var sun7 = document.hours.sun7.value - 0;
		var st7 = document.hours.st7.value - 0;
		var ot7 = document.hours.ot7.value - 0;
		document.hours.ptot7.value = mon7+tue7+wed7+thu7+fri7+sat7+sun7;
		
		var week7 = document.hours.ptot7.value;
		if (week7 <= 40) { st7 = mon7+tue7+wed7+thu7+fri7+sat7+sun7; over7 = 0; }
		else { st7 = 40; over7 = mon7+tue7+wed7+thu7+fri7+sat7+sun7 - 40; }
		document.hours.st7.value = st7;
		document.hours.ot7.value = over7;				
		
		var mon8 = document.hours.mon8.value - 0;
		var tue8 = document.hours.tue8.value - 0;
		var wed8 = document.hours.wed8.value - 0;
		var thu8 = document.hours.thu8.value - 0;
		var fri8 = document.hours.fri8.value - 0;
		var sat8 = document.hours.sat8.value - 0;
		var sun8 = document.hours.sun8.value - 0;
		var st8 = document.hours.st8.value - 0;
		var ot8 = document.hours.ot8.value - 0;
		document.hours.ptot8.value = mon8+tue8+wed8+thu8+fri8+sat8+sun8;		

		var week8 = document.hours.ptot8.value;
		if (week8 <= 40) { st8 = mon8+tue8+wed8+thu8+fri8+sat8+sun8; over8 = 0; }
		else { st8 = 40; over8 = mon8+tue8+wed8+thu8+fri8+sat8+sun8 - 40; }
		document.hours.st8.value = st8;
		document.hours.ot8.value = over8;		

//Holiday Hours			
		var mon_hol = document.hours.mon_hol.value - 0;
		var tue_hol = document.hours.tue_hol.value - 0;
		var wed_hol = document.hours.wed_hol.value - 0;
		var thu_hol = document.hours.thu_hol.value - 0;
		var fri_hol = document.hours.fri_hol.value - 0;
		var sat_hol = document.hours.sat_hol.value - 0;
		var sun_hol = document.hours.sun_hol.value - 0;
		var st_hol = document.hours.st_hol.value - 0;
		var ot_hol = document.hours.ot_hol.value - 0;
		
		document.hours.ptot_hol.value = mon_hol+tue_hol+wed_hol+thu_hol+fri_hol+sat_hol+sun_hol+st_hol+ot_hol;
//Vacation Hours
		var mon_vac = document.hours.mon_vac.value - 0;
		var tue_vac = document.hours.tue_vac.value - 0;
		var wed_vac = document.hours.wed_vac.value - 0;
		var thu_vac = document.hours.thu_vac.value - 0;
		var fri_vac = document.hours.fri_vac.value - 0;
		var sat_vac = document.hours.sat_vac.value - 0;
		var sun_vac = document.hours.sun_vac.value - 0;
		var st_vac = document.hours.st_vac.value - 0;
		var ot_vac = document.hours.ot_vac.value - 0;
		document.hours.ptot_vac.value = mon_vac+tue_vac+wed_vac+thu_vac+fri_vac+sat_vac+sun_vac+st_vac+ot_vac;						
//Floating Holiday Hours
		var mon_fh = document.hours.mon_fh.value - 0;
		var tue_fh = document.hours.tue_fh.value - 0;
		var wed_fh = document.hours.wed_fh.value - 0;
		var thu_fh = document.hours.thu_fh.value - 0;
		var fri_fh = document.hours.fri_fh.value - 0;
		var sat_fh = document.hours.sat_fh.value - 0;
		var sun_fh = document.hours.sun_fh.value - 0;
		var st_fh = document.hours.st_fh.value - 0;
		var ot_fh = document.hours.ot_fh.value - 0;
		document.hours.ptot_fh.value = mon_fh+tue_fh+wed_fh+thu_fh+fri_fh+sat_fh+sun_fh+st_fh+ot_fh;

}