function gotoLink (htmlElement) {
	
	var destinationURL = "";
	var target = "";
	
	if(htmlElement.href) {
		destinationURL = htmlElement.href;
		target = htmlElement.getAttribute("target");
	}
	else {
		if(htmlElement.childNodes) {
			if(htmlElement.getElementsByTagName("a")) {
				destinationURL = htmlElement.getElementsByTagName("a")[0].href;
				target = htmlElement.getElementsByTagName("a")[0].getAttribute("target");
			}
		}
	}
	
	if(target == "_blank") {
		window.open(destinationURL);
	}
	else {
		location.href = destinationURL;
	}
}

function autoSubmitForm( formId, submitButtonId ) {
    Event.observe(
        window, "dom:loaded",
        function() {
            var formToSubmit = $( formId );
            if( formToSubmit ) {

                var submitButton = $( submitButtonId );
                if( submitButton ) {
                    submitButton.disable();
                }
                formToSubmit.submit();
            }
        },
        false
    );
}
