function navField(currentField,nextField){
var max = parseInt(currentField.maxLength);
if(currentField.value.length == max){
		var element = document.getElementById(nextField)
		if(element != null){
			element.focus();
		}
	}	
}

function focusElement(elementID,jumpToEnd){
	var element = document.getElementById(elementID);
	if(element != null){
		element.focus();
	}
}
function openHelp(field){
	var loc = "Help.aspx?fieldName=" + field;
	window.open(loc,null,"height=300,width=500,status=yes,toolbar=no,menubar=no,location=no");
}

function SetScrollerPosition() {    
    if (document.getElementById("XPos").value != "") {
        var x = document.getElementById("XPos").value;
        var y = document.getElementById("YPos").value;
        window.scrollTo(x, y);
    }
    document.getElementById("XPos").value = "0";
    document.getElementById("YPos").value = "0";
}


function GetScollerPosition() {
    var scrollX, scrollY;
    if (document.all) {
        if (!document.documentElement.scrollLeft)
            scrollX = document.body.scrollLeft;
        else
            scrollX = document.documentElement.scrollLeft;
        if (!document.documentElement.scrollTop)
            scrollY = document.body.scrollTop;
        else
            scrollY = document.documentElement.scrollTop;
    }
    else {
        scrollX = window.pageXOffset;
        scrollY = window.pageYOffset;
    }
    document.getElementById("XPos").value = scrollX;
    document.getElementById("YPos").value = scrollY;
}

