function finishAction( value )
{  
	//alert("call finishAction");
	document.getElementById("action").value = value;

	var samplItem = [];
	var method = "post";
	var path="/ibase/webitm/jsp/ICRWizardSaveSample.jsp";

	var valueXmlString = " <?xml version = \"1.0\"?> <Root> <header> <editFlag> ";
	valueXmlString += " </editFlag> </header> ";
	valueXmlString += " <Detail1> ";
	valueXmlString += " <from_tran_date><![CDATA["+ document.getElementById("from_tran_date").value +"]]></from_tran_date> ";
	valueXmlString += " <to_tran_date><![CDATA["+ document.getElementById("to_tran_date").value +"]]></to_tran_date> ";
	valueXmlString += " <site_code_fr><![CDATA["+ document.getElementById("site_code_fr").value +"]]></site_code_fr> ";
	valueXmlString += " <site_code_to><![CDATA["+ document.getElementById("site_code_to").value +"]]></site_code_to> ";
	valueXmlString += " <chg_user><![CDATA["+ document.getElementById("chg_user").value +"]]></chg_user> ";
	valueXmlString += " <chg_term><![CDATA["+ document.getElementById("chg_term").value +"]]></chg_term> ";
	valueXmlString += " </Detail1> ";
	valueXmlString += " </Root> "; 
	
	samplItem["SAVE_SAMPLE_DATA"] = valueXmlString;
	post_to_url(path, samplItem, method);
}


function isNumberKey(e)
{
	//alert("isNumberKey called...");
	var unicode = e.charCode ? e.charCode : e.keyCode;
	if ((unicode == 8) || (unicode == 9) || (unicode > 47 && unicode < 58)
		|| (unicode == 37) || (unicode == 46) || (unicode == 39)
		|| (unicode == 115) || (unicode == 121) || (unicode == 117)) {
	return true;
	} 
	else 
	{
		window.alert("This field accepts only Numbers");
		return false;
	}
}
	
function numbersonly(myfield, e, dec)
{
	var key;
	var keychar;

	if ( window.event )
	{
		key = window.event.keyCode;
	}
	else
	{
		return true;
	}

	if( key >= 48 && key <= 57 )
	{
		return true;
	}
	else
	{
		return false;
	}
}

function post_to_url(path, params, method) {
	method = method || "post"; // Set method to post by default if not specified.

	// The rest of this code assumes you are not using a library.
	// It can be made less wordy if you use one.
	var form = document.createElement("form");
	form.setAttribute("method", method);
	form.setAttribute("action", path);
	form.target = 'Items';

	for(var key in params) {
		if(params.hasOwnProperty(key)) {
			var hiddenField = document.createElement("input");
			hiddenField.setAttribute("type", "hidden");
			hiddenField.setAttribute("name", key);
			hiddenField.setAttribute("value", params[key]);

			form.appendChild(hiddenField);
		}
	}

	document.body.appendChild(form);
	form.submit();
}
