var ButtonStyles_onload

if (typeof(window.onload) == "function")
{
	ButtonStyles_onload = window.onload
}

window.onload = initButtonStyles


function initButtonStyles()
{
	var buttons = document.getElementsByTagName("INPUT")
	for (var c=buttons.length-1; c>=0; c--)
	{
		var theButton = buttons[c]
		if (theButton.type=="submit" || theButton.type=="button" )
		{
			if (theButton.className.substring(0,4)=="jsr-")
			{
				var link = document.createElement("A")
				link.href="#;"
				link.jsr_form = theButton.form
				link.jsr_name = theButton.name
				link.onclick = submitForm
				link.className = theButton.className
				link.innerHTML = theButton.value;
				theButton.parentNode.replaceChild( link, theButton );
			}
		}
	}
	
	if (typeof(ButtonStyles_onload) == "function")
	{
		ButtonStyles_onload()
	}
}

function submitForm(e)
{

	if (this.jsr_name!="")
	{
		var elm = document.createElement("input");//(window.event) ? document.createElement("<input name='" + this.jsr_name + "'>") : document.createElement("input")

		
		elm.type = "hidden"
		elm.value = this.innerHTML
		 elm.name = this.jsr_name;

		this.jsr_form.appendChild(elm)
	}

	this.jsr_form.submit()
}