function submitForm(f, action) {
	if (isNotNull(f)) {
		if (isNotNull(action)) {
			f.action = action;
		}
		f.submit();
	}
}

function isNotNull(obj) {
	if (obj != null) {
		return true;
	} else {
		return false;
	}
}

// Function added for empty field validation.

function isWhitespace (s){  
	var whitespace = " \t\n\r";
	var i;
	for (i = 0; i < s.length; i++){   
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}
function isEmpty(temp){
	if(temp==""|| temp==null){
		return true;
	}
	else
		if (isWhitespace(temp)) return true;
		return false;
}

/* Functions added to display loading message div*/
function enableLoadingFrame() {
	/*$('#window,#overlay,#HideSelect').remove();
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		if (document.getElementById("HideSelect") === null) {//iframe to hide select elements in ie6
			$("body").append("<iframe id='HideSelect'></iframe><div id='overlay'></div><div id='window'><div id='loadingMsg'></div></div>");
		}
	}else{//all others
		if(document.getElementById("TB_overlay") === null){
			$("body").append("<div id='overlay'></div><div id='window'><div id='loadingMsg'></div></div>");
		}
	}
	$("#overlay").addClass("overlayBG");*///use background and opacity
	//showLoadMsg("Please Wait while page loads...");
}
function showLoadMsg (loadText) {
	var $loadMsg = $("#loadingMsg");
	if ($loadMsg.size() == 0) {
		$loadMsg = $('<div id="loadingMsg"></div>').appendTo('body');
	}
	$loadMsg.text(loadText);
	$("#window").css({display:"block"}); 
	$loadMsg.css({display:"block",visibility:"visible"});
}
function disableLoadingFrame() {
	//$('#window,#overlay,#HideSelect').remove();
}