function jHide (formid)
{
	document.getElementById(formid).style.display='none';
}

function jUnhide (formid)
{
	document.getElementById(formid).style.display='block';
}

function swapImage(fileid,imageid,path)
{
	var image = document.getElementById(imageid);
	var dropd = document.getElementById(fileid);
	image.src = path + dropd.value;	
}

function JavaUpdateOptions (listid,optnum)
{
	addoption = new Array ();
	var optionlist = document.getElementById(listid);
	if (optnum > optionlist.length)
	{

		for (i=optionlist.length+1; i<=optnum; i++)
		{
			addoption[i] = document.createElement ('option');
		
			addoption[i].text = "holder "+i;
			addoption[i].value = "holder "+i;

			try {
		    	optionlist.add(addoption[i], null); // standards compliant; doesn't work in IE
			}
		  	catch(ex) 
			{
		    	optionlist.add(addoption[i]); // IE only
		  	}
		}
	}
	if (optnum < optionlist.length)
	{
		for (i=optionlist.length; i>=optnum; i--)
		{
			optionlist.remove(i);
		}
	}
}

function JavaSortName (idname,data)
{
	var lb = document.getElementById(idname);
	arrTexts = new Array();
	for (i=0;i<data.length;i++)
	{
		arrTexts[i] = data[i];
	}
    arrTexts.sort();		
	for(i=0; i<arrTexts.length; i++)  
	{
	  	lb.options[i].text = arrTexts[i];
	  	lb.options[i].value = arrTexts[i];
	}
}