/* rowHighlighting
*	the function highlights the row that contains the input element with focus
*
*	var jqFormElement: contains a jquery selected form element
*/
function rowHighlighting(jqFormElement){
	element = jqFormElement.find("input, textarea, select");

	element.each(function(){
		var rowElement = ""; //empty var for the row that needs to be highlighted

		$(this).focus(function(){
			rowElement = $(this).closest(".row, .formrow"); //Note_1: .formrow is new rowclas, Description_1: fill the rowElement, this way we don't use the dom three on blur for the second time.			
			rowElement.addClass("highlighted");			
		})
		
		$(this).blur(function(){
			if(rowElement.length != 0){
				rowElement.removeClass("highlighted");
			}
		})
	})
}

$(document).ready(function(){
	$("form.highlightedform").each(function(){
		rowHighlighting($(this));
	})
})