function hide(id)
{
	document.getElementById(id).style.visibility= 'hidden';
}

function show(id)
{
	document.getElementById(id).style.visibility= 'visible';
}

function getval(id)
{
	return document.getElementById(id).value;
}

function setval(id, value)
{
	document.getElementById(id).value = value;
}

function getindex(id)
{
	return document.getElementById(id).selectedIndex;
}

function setindex(id, index)
{
	document.getElementById(id).selectedIndex = index;
}

function getoption(id, index)
{
	if (index >-1)
	{
	return document.getElementById(id).options[index].text
	}
	else
	{return "no object selected"};
}

function editoption(id, index, value)
{
	document.getElementById(id).options[index].text = value;
}

function addoption(id, index, value)
{
	var y=document.createElement('option');
	y.text=value;
	var x=document.getElementById(id);
	try
	{
		x.add(y,null); // standards compliant
	}
	catch(ex)
	{
		x.add(y); // IE only
	}

}

function deloption(id, index)
{
	document.getElementById(id).remove(index);
}

function emptyselect(id)
{
	start = 0;
	stop = loselect(id);
	for (count = start; count < stop; count++)
	{
		deloption(id, 0);
	}
}

function loselect(id)
{
	return document.getElementById(id).length;
}

function selectarray(id)
{
	temp_array = new Array();
	start = 0;
	stop = loselect(id);
	for (count = start; count < stop; count++)
	{
		temp_array[count] = getoption(id, count);
	}
	return temp_array;
}

function setFGcolor(id, color)
{
	document.getElementById(id).style.color = color;
}

function setBGcolor(id, color)
{
	document.getElementById(id).style.background = color;
}

function setwidth(id, width)
{
	document.getElementById(id).style.width = width;
}

function setheight(id, height)
{
	document.getElementById(id).style.height = height;
}
//xml functions
function openxml()
{
  try //Internet Explorer
  {
  return new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    return document.implementation.createDocument("","",null);
    }
  catch(e)
    {
    alert(e.message);
    return;
    }
  }
}

function loadXMLDoc(dname) 
{
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    xmlDoc=document.implementation.createDocument("","",null);
    }
  catch(e) {alert(e.message)}
  }
try 
  {
  xmlDoc.async=false;
  xmlDoc.load(dname);
  return(xmlDoc);
  }
catch(e) {alert(e.message)}
return(null);
}

function disable(id)
{
	document.getElementById(id).disabled =true;
}

function enable(id)
{
	document.getElementById(id).disabled =false;
}

function getXMLtxt(xml, tag, index)
{
	return xml.getElementsByTagName(tag)[index].childNodes[0].nodeValue;

}

function check(id)
{
	document.getElementById(id).checked=true;
}

function uncheck(id)
{
	document.getElementById(id).checked=false;
}

function no_elements(xml, tag)
{
	return xml.getElementsByTagName(tag).length;
}