// This contains Java Script functions other than those used for data validation in the generated common.js file 



/*
* This function can be called on a button to redirect to the same file with changed arguments 
* or to a different file but in the same directory with some arguments .
*
*
*/

function go_to_url(args,url){

if(!url){
	window.document.location.search=""
	window.document.location.search = args
	//alert(window.document.location.search)
}else{
	window.location.href= url+'?'+args
}


}

function show_id(id){
	var obj = document.getElementById(id)
	if(obj.style.display)
		obj.style.display='';
	else
		obj.style.display='none';
}



function setradiobutton(frm_name, fld,value){
	var control_str = "document.forms["+frm_name+"]['"+fld+"'] ";
		//alert (control_str)
	var control = eval(control_str)
		//alert(control)
	for(var i = 0 ; i < control.length ; i++){
		//alert(control[i].value)
		if(control[i].value == value) {
			control[i].checked = true
			break;
		}
}
}



function getradiobuttonvalue(frm_name,fld){
	var control_str = "document.forms['"+frm_name+"']['"+fld+"'] ";
		//alert (control_str)
	var control = eval(control_str)
		//alert(control)
	for(var i = 0 ; i < control.length ; i++){
		//alert(control[i].value)
		if(control[i].checked == true) {
			return control[i].value
			break;
		}
}
}