function SubmitAction(sAction)
{
	document.frmMain.Action.value = sAction;		
	document.body.style.cursor = "wait";
	
	document.frmMain.submit();
	return false;
}

function SubmitSelection(sAction, sField, sValue)
{
    document.getElementById(sField).value = sValue;
    SubmitAction(sAction);
}

function SubmitActionAndScroll(sAction) {
	if(document.getElementById("ScrollYPos") != null)
		document.getElementById("ScrollYPos").value = document.body.scrollTop;
	SubmitAction(sAction);
}

function ScrollPage(){
	if (document.getElementById("ScrollYPos") != null)
		document.body.scrollTop = document.getElementById("ScrollYPos").value;
	return false;
}

function FieldInt(e)
{
	var myChar;
	e = window.event;
	myChar = String.fromCharCode(e.keyCode);
	if (myChar >= 0 && myChar <= 9) { return true; } else { e.returnValue = false }
}
		
	
function FieldFloat(e)
{
	var myChar;
	e = window.event;
	myChar = String.fromCharCode(e.keyCode);
	if ((myChar >= 0 && myChar <= 9) || (myChar == ".")) { return true; } else { e.returnValue = false }
}

function AppendHiddenInput(sName, sValue)
{	
	sInput = "<input type='hidden' id='" + sName + "' name='" + sName + "' value='" + sValue + "'/>";
	oElement = document.createElement(sInput);
	document.frmMain.appendChild(oElement);
	if(document.getElementById && !document.getElementById(sName)){
		// netscape fix
		oElement = document.createElement('input');
		oElement.value = sValue;
		oElement.setAttribute('type', 'hidden');
		oElement.setAttribute('id', sName);
		oElement.setAttribute('name', sName);
		oElement.setAttribute('value', sValue);
		document.frmMain.appendChild(oElement);
	}
}

// function searchFocus() {
    // alert('Hello World!!!')
    // try {
    //    if (document.getElementById(this.Id).style == "") {
    //        document.getElementById(this.Id).value = "background: #EBE9E9";
    //    } else if (document.getElementById(this.Id).style == "background: #EBE9E9") {
    //        document.getElementById(this.Id).value = "";
    //    }
    // } catch(e) {
        //alert(e);
    // }
// }
