function toright()
{
  if ( document.frm )
	{
	  var index=document.frm.region_list.selectedIndex;
	  if ( index>=0 )
		if ( document.frm.region_list.options[index].value!='' )
		  {

			document.frm.quarters.options[document.frm.quarters.length]=new Option ( document.frm.region_list.options[index].text,document.frm.region_list.options[index].value );
			document.frm.region_list.options[index].selected=false;


		  }
	}
}

function delright()
{
  if ( document.frm )
	{
	  var index=document.frm.quarters.selectedIndex;
	  var length=document.frm.quarters.length;
	  if ( index>=0 )
		{
		  for ( i=index;i<(length-1);i++ ) { document.frm.quarters.options[i]=new Option (document.frm.quarters.options[i+1].text,document.frm.quarters.options[i+1].value); }
		  document.frm.quarters.length--;

		}
	}
}





function selectOption(str_id)
   {
	  var oSelect = document.getElementById(str_id);
	  for (var i = 0, len = oSelect.options.length; i < len; i++)
	  {
		 oSelect.options[i].selected = true;
	  }
}

  function listbox_move(listID, direction) {

			var listbox = document.getElementById(listID);
			var selIndex = listbox.selectedIndex;

			if(-1 == selIndex) {
				alert("Please select an option to move.");
				return;
			}

			var increment = -1;
			if(direction == 'up')
				increment = -1;
			else
				increment = 1;

			if((selIndex + increment) < 0 ||
				(selIndex + increment) > (listbox.options.length-1)) {
				return;
			}

			var selValue = listbox.options[selIndex].value;
			var selText = listbox.options[selIndex].text;
			listbox.options[selIndex].value = listbox.options[selIndex + increment].value
			listbox.options[selIndex].text = listbox.options[selIndex + increment].text

			listbox.options[selIndex + increment].value = selValue;
			listbox.options[selIndex + increment].text = selText;

			listbox.selectedIndex = selIndex + increment;
		}

		function listbox_moveacross(sourceID, destID) {
			var src = document.getElementById(sourceID);
			var dest = document.getElementById(destID);

			for(var count=0; count < src.options.length; count++) {

				if(src.options[count].selected == true) {
						var option = src.options[count];

						var newOption = document.createElement("option");
						newOption.value = option.value;
						newOption.text = option.text;
						newOption.selected = false;
						try {
								 dest.add(newOption, null); //Standard
								 src.remove(count, null);
						 }catch(error) {
								 dest.add(newOption); // IE only
								 src.remove(count);
						 }
						count--;

				}

			}

		}
		function listbox_selectall(listID, isSelect) {

			var listbox = document.getElementById(listID);
			for(var count=0; count < listbox.options.length; count++) {

				listbox.options[count].selected = isSelect;

			}
		}

/* show hide div */
var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
/* show hide div */

/* ---------- */

var isIE=document.all?true:false;
var isDOM=document.getElementById?true:false;
var isNS4=document.layers?true:false;

/* _w : which ID (1) or (2) */
/* _h : (h)ide or (s)how */
function toggleT(_w,_h) {
  if (isDOM)
  {
	if (_h=='s') document.getElementById(_w).style.display='block';
	if (_h=='h') document.getElementById(_w).style.display='none';
  }
  else if (isIE) {
	if (_h=='s') eval("document.all."+_w+".style.display='block';");
	if (_h=='h') eval("document.all."+_w+".style.display='none';");
  }
  else if(isNS4)
  {
	if (_h=='s') eval("document.layers['"+_w+"'].display='block';");
	if (_h=='h') eval("document.layers['"+_w+"'].display='none';");
  }
}

/* ---------- */

