////////////////////////////////////////////////////////////////////////////////
//	setScrollPos
//		Sets the browser scroll position to the appropriate position
//
//	Used With:	Page Positioning
//  Compatability:	IE 6.0, Navigator 7.1, Opera 7.53
////////////////////////////////////////////////////////////////////////////////
	function setScrollPos(leftPos,topPos){		
		document.body.scrollLeft = leftPos;
		document.body.scrollTop = topPos;				
		//alert("Testcode: setscrollpos. oben: " + document.body.scrollTop + "links: " + document.body.scrollLeft);
	}


////////////////////////////////////////////////////////////////////////////////
//	getScrollPos
//		Acquires the scroll position from the page and places the values into
//		hidden variables on the form. 
//
//	Used With:		Tab Position Tracking
//  Compatability:	IE 6.0, Navigator 7.1, Opera 7.53
////////////////////////////////////////////////////////////////////////////////
	function getScrollPos(formName){
		if(document.forms[formName]){
			if(document.forms[formName].__leftPos){
				document.forms[formName].__leftPos.value = document.body.scrollLeft;
				document.forms[formName].__topPos.value = document.body.scrollTop;
			}
		}
		//alert("Testcode: getscrollpos. oben: " + document.body.scrollTop + "links: " + document.body.scrollLeft);
	}//end function


////////////////////////////////////////////////////////////////////////////////
//	DoPostBack Hijacking Variables and Methods
////////////////////////////////////////////////////////////////////////////////

var __oldDoPostBack;
var __formName;

////////////////////////////////////////////////////////////////////////////////
function hijackDoPostBack(){
	//This function assumes the variable __oldDoPostBack exists	
	__oldDoPostBack = __doPostBack;
	__doPostBack = runOnSubmit;	
//alert("Testcode: highjack. oben: " + document.body.scrollTop + "links: " + document.body.scrollLeft);
}

////////////////////////////////////////////////////////////////////////////////
function getCode(functionCode){		
	var index = functionCode.indexOf("{");
	functionCode = functionCode.substring(index+1,functionCode.length);
	index = functionCode.lastIndexOf("}");
	functionCode = functionCode.substring(0,index-1);
	index = functionCode.indexOf("ValidatorOnSubmit();");
	if (index != -1){						
		return functionCode.substring(0,index);
	} else {	
		return functionCode;
	}					
	return functionCode;
}

////////////////////////////////////////////////////////////////////////////////
function runOnSubmit(eventTarget, eventArgument){			
	var onSubmitWithoutValidation = 
		new Function(
				getCode(
				document.forms[__formName].onsubmit.toString()
				)
			);
	onSubmitWithoutValidation();
	__oldDoPostBack(eventTarget, eventArgument);		
}

