/****************************************
|
| Translational Research Centre, CHRI
| Created by: Kevin Biskaborn
| Copyright 2009 ScriptReaction
| http://www.scriptreaction.com
|
****************************************/

var formHandler = {
	launch: function (){
		var formHolder = document.getElementById("dataForm");
		var formTypes = new Array("input", "select", "textarea");
		
		for(var typeCount=0; typeCount<formTypes.length; typeCount++){
			var whichType = formTypes[typeCount];
			var typeArray = formHolder.getElementsByTagName(whichType);
			
			for(var itemCount=0; itemCount<typeArray.length; itemCount++){
				var whichItem = typeArray[itemCount];
				
				whichItem.onfocus = function (){
					with(this.style){
						backgroundColor	= "#ececec";
						borderColor		= "#000066";
					}
				}
					
				whichItem.onblur = function (){
					with(this.style){
						backgroundColor	= "";
						borderColor		= "";
					}
				}
			}
			
		}
	},
	clear: function (){
		top.location.href = top.location;
	}
}
