function doSubmit(button, formName, actionPath, target) {
	var formObj;
	if(!formName){
		formObj = window.document.forms;
	}else{
		formObj = document.getElementsByName(formName);

	}
	if(formObj==null){
        return;
	}
    if(button){
		if(button.onclick != null){
			button.onclick = "";
		}    
		button.disabled = true;
	}
	
	//save the position
	if (window.document.forms[0].scrollTop && window.document.forms[0].gamenId)	{
		window.document.forms[0].scrollTop.value = window.document.forms[0].gamenId.value 
								+ ":" + (navigator.userAgent.indexOf("Safari") == -1 ? document.documentElement.scrollTop : document.body.scrollTop);
	}
	if (window.document.forms[0].scrollLeft && window.document.forms[0].gamenId) {
		window.document.forms[0].scrollLeft.value = window.document.forms[0].gamenId.value 
								+ ":" + (navigator.userAgent.indexOf("Safari") == -1 ? document.documentElement.scrollLeft :document.body.scrollLeft);
	}	

	if(target){
		formObj[0].target = target;
	}
	
	if(actionPath){
		formObj[0].action = actionPath;
	}

	formObj[0].submit();
	if(target){
		formObj[0].target = "";
	}
}

function jump() {
	var messageAnchor = window.document.getElementById("messageAnchor");
	if (messageAnchor != null) {
		window.location.hash = "messageAnchor";
	}
	else if (window.document.forms[0].scrollTop) {
		window.scrollTo(window.document.forms[0].scrollLeft.value,window.document.forms[0].scrollTop.value);
	}

}
function doHref(actionPath){
	location.href=actionPath;
}

function gobackSubmit(submitUrl,target) {

	if(target){
		window.document.forms[0].target = target;
	}
	
	window.document.forms[0].action = submitUrl;
	window.document.forms[0].submit();
}

function gobackSubmitOnce(button, submitUrl) {
    if(button){
		button.disabled = true;
		if(button.onclick != null){
			button.onclick = "";
		}
	}
	window.document.forms[0].action = submitUrl;
	window.document.forms[0].submit();
}

