function getRequestBody(oForm)
{
	var aParams = new Array();
	for (var i=0; i < document.all[oForm].length; i++)
	{
		if (document.all[oForm].elements[i].name!=""&&document.all[oForm].elements[i].value!="")
		{
			var sParam = document.all[oForm].elements[i].name;
			sParam += "=";
			if (document.all[oForm].elements[i].type=="checkbox")
			{
				if (document.all[oForm].elements[i].checked==true) sParam += 'Y';
				else sParam += 'N';
			}
			else sParam += document.all[oForm].elements[i].value;
			aParams.push(sParam);
		}
	}
	return aParams.join("&");
}

function getRequestBodyURI(oForm)
{
	var aParams = new Array();
	
	for (var i=0; i < document.all[oForm].length; i++)
	{
		if (document.all[oForm].elements[i].name!="")
		{
			//&&document.all[oForm].elements[i].value!=""
			//alert(document.all[oForm].elements[i].source);
			var sParam = encodeURIComponent(document.all[oForm].elements[i].name);
			sParam += "=";
			if (document.all[oForm].elements[i].type=="checkbox"||document.all[oForm].elements[i].type=="radio")
			{
				if (document.all[oForm].elements[i].checked==true&&document.all[oForm].elements[i].value!=="on")
				{
					sParam += encodeURIComponent(document.all[oForm].elements[i].value);
					aParams.push(sParam);
				}
				else if (document.all[oForm].elements[i].checked==true)
				{
					sParam += 'Y';
					aParams.push(sParam);
				}
				else if (document.all[oForm].elements[i].value=="Y")
				{
					sParam += 'N';
					aParams.push(sParam);
				}
				
			}
			else
			{
				sParam += encodeURIComponent(document.all[oForm].elements[i].value);
				aParams.push(sParam);
			}
		}
	}
	return aParams.join("&");
}

function get_form_checkboxes(oForm)
{
	var aParams = new Array();
	
	for (var i=0; i < document.all[oForm].length; i++)
	{
		if (document.all[oForm].elements[i].name!=""&&document.all[oForm].elements[i].type=="checkbox"
		&&document.all[oForm].elements[i].checked==false&&document.all[oForm].elements[i].value=="Y")
		{
			var sParam = encodeURIComponent(document.all[oForm].elements[i].name);
			sParam += "=";
			sParam += 'N';
			aParams.push(sParam);
		}
	}
	return aParams.join("&");
}

function reset_picture(pic_tag,picture)
{
	if (picture !== "")
	{
		document.all[pic_tag].src = picture;
	}
	else
	{
		document.all[pic_tag].src = '../images/blank.gif';
	}
}

function set_innerHTML(data,to_tag)
{
	document.all[to_tag].innerHTML = data;
}

function set_display(tag,disp)
{
	if (document.all[tag]!=null&&document.all[tag]!=="undefined")
	{
		if (disp == true) document.all[tag].style.display = '';
		else document.all[tag].style.display = 'none';
	}
}

function invert_display(tag)
{
	if (document.all[tag]!=null&&document.all[tag]!=="undefined")
	{
		if (document.all[tag].style.display == 'none') document.all[tag].style.display = '';
		else document.all[tag].style.display = 'none';
	}
}


function display_group_element(elem, group_name)
{
	var count = selected_groups[group_name].count;
	var bgactive = selected_groups[group_name].bgactive;
	var bgpassive = selected_groups[group_name].bgpassive;
	
	for (i=1;i<=count;i++)
	{
		if (document.all[group_name+'_'+i]!=null)
		{
			if (i==elem)
			{
				document.all[group_name+'_'+i].style.display = '';
				document.all[group_name+'_key_'+i].style.background = bgactive;
			}
			else
			{
				document.all[group_name+'_'+i].style.display = 'none';
				document.all[group_name+'_key_'+i].style.background = bgpassive;
			}
		}
	}
}