// JavaScript Document
// ================= IMAGE ROLLOVER FUNCTION =========================
function imgRollMenu (id, name, action) {
	if (document.images) {
		if (action == "out") {
			action = "";
		} else {
			action = "_" + action;
		}
		var source = "images/layout/btn_" + name + action + ".gif";
		document.getElementById(id).src = source;
	}
}
// ================= IMAGE POP-UP FUNCTION =========================
function imgPopUp (image, disp, width, height) {
	//get users screen width
	var scrWidth = document.body.clientWidth;
	//math to figure out where to put new image
	//add 8 to make up for the padding width
	var imgLeft = ((scrWidth/2) - ((width+8)/2));
	//set fade div name
	var fadeName = (image + "_fade");
	//set display to faded black to on
	document.getElementById(fadeName).style.display=disp;
	//set display to light to on
	document.getElementById(image).style.display=disp;
	//change width/height of popUp
	//add 8 to make up for the padding width
	document.getElementById(image).style.width=(width+8) + "px";
	//add 32 to make up for the "close window" text cell
	document.getElementById(image).style.height=(height+32) + "px";
	//change left position of popUp
	document.getElementById(image).style.left=imgLeft + "px";
	if (image == "loginForm") {
		document.form.userLog.focus();
	}
}
// ================= EVENT DATE DAY CHANGE FUNCTION =========================
function eventDay (month, day, year, input_num, input_type) {
	//debug
	//alert ("Month = " + month + "\nDay = " + day + "\nYear = " + year + "\nInput Number = " + input_num);
	//set date for input value
	var newDate = month + "/" + day + "/" + year;
	//set input var
	if (input_type == "from") {
		var elementId = "from_date_" + input_num;
		var imgPop = "from_date_" + input_num;
		var imgPopFade = "from_date_" + input_num + "_fade";
	} else {
		var elementId = "to_date_" + input_num;
		var imgPop = "to_date_" + input_num;
		var imgPopFade = "to_date_" + input_num + "_fade";
	}
	//debug
	alert (newDate);
	alert (elementId);
	// set input value to match newDate
	var inputObj = document.getElementById( elementId );
	alert (inputObj.value);
	inputObj.value = newDate;
	// hide popUp // -- this works
	imgPopUp (imgPop, 'none', 0, 0);
}
