//*** Prepares inputs to change color when in and out of focus
function setupInputs() {
	var inputs = document.getElementsByTagName("input");
	var textarea = document.getElementsByTagName("textarea");
	var lists = document.getElementsByTagName("select");
	for (var i=0; i<inputs.length; i++) {
		if (inputs[i].type == "text" || inputs[i].type == "password" || inputs[i].type == "select") {
			inputs[i].onfocus = function() {
				this.className += '_focus';
			}
			inputs[i].onblur = function() {
				this.className = this.className.replace( '_focus', '' );
			}
		}
	}
	for (i=0; i<textarea.length; i++) {
		textarea[i].onfocus = function() {
			this.className += '_focus';
		}
		textarea[i].onblur = function() {
			this.className = this.className.replace( '_focus', '' );
		}
	}
	for (i=0; i<lists.length; i++) {
		lists[i].onfocus = function() {
			this.className += '_focus';
			//this.style.background = "#FFFF7F";
		}
		lists[i].onblur = function() {
			this.className = this.className.replace( '_focus', '' );
			//this.style.background = "white";
		}
	}
}
function unfocus() {
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++) {
		if (inputs[i].type == "text" || inputs[i].type == "password" || inputs[i].type == "select") {
			inputs[i].className = inputs[i].className.replace( '_focus', '' );
		}
	}
}
function setupListRows(browser) {
	var rows = document.getElementsByTagName("tr");
	var url = "";
	for (var i=0; i<rows.length; i++) {
		if ( 'odd' != rows[i].className && 'even' != rows[i].className ) {
		    continue;
		}
	   if (browser.isIE) {
			// but only for IE, other browsers are handled by :hover in css
			rows[i].onmouseover = function() {
				this.className += ' hover';
			}
			rows[i].onmouseout = function() {
				this.className = this.className.replace( ' hover', '' );
			}
	   }
		//*** Send id to the locally-defined "rowClicked" function
		rows[i].onmousedown = function() {
			url = this.getAttribute("url");
			rowClicked(this.id,url);
		}
	}
}
function setupLinks(browser) {
	var anchors = document.getElementsByTagName("a");
	var url = "";
	for (var i=0; i<anchors.length; i++) {
	   if (browser.isIE) {
			// but only for IE, other browsers are handled by :hover in css
			anchors[i].onmouseover = function() {
				this.className += ' hover';
			}
			anchors[i].onmouseout = function() {
				this.className = this.className.replace( ' hover', '' );
			}
	   }
	}
}
function popCalendar(thisObj) {
	var thisLeft = getX(thisObj);
	var thisTop = getY(thisObj) + thisObj.offsetHeight;
	//*** Call calendar object from Xin classes
	showCalendar('', thisObj, thisObj, '', 'holder', thisLeft, thisTop, 1);
}


