//jquery.js gets included from theme and it is working in noconflict mode $j=jQuery

var FbFNS = {};

FbFNS.buttonClicked = function buttonClicked(requestType, formId) {
	document.getElementById('requestType').value = requestType;
	document.getElementById(formId).submit();
}

FbFNS.wizTabClicked = function wizTabClicked(requestType, selectedPage, formId) {
	document.getElementById('requestType').value = requestType;
	document.getElementById('pageIndex').value = selectedPage;
	document.getElementById(formId).submit();
}

FbFNS.buttonClickedFormId = function buttonClickedFormId(formId) {
	document.getElementById(formId).submit();
}

//Used to set URL to the one generated by some portlet
FbFNS.changeLocation = function changeLocation(urlContainerId) {
	document.location = $j("#" + urlContainerId).val();
}

/**
 * Before submitting when finished, add finish param to the submit
 */
FbFNS.finishButtonClicked = function finishButtonClicked(formId) {
	$j("#" + formId).append("<input type='hidden' name='_finish' id='_finish' value='true' />");
	document.getElementById(formId).submit();
}


