function getElementByID(id)
{
	var obj;
	if(document.getElementById)
	{
        obj = document.getElementById(id);
	}
	else if(document.all)
	{
        obj = document.all(id);
	}
	return obj;
}

function getElementByName(name)
{
	var obj;
	if(document.getElementsByName)
	{
        var lst = document.getElementsByName(name);
		if(lst)
		{
			obj = lst[0];
		}
	}
	else if(document.all)
	{
        obj = document.all(name);
	}
	return obj;
}

function switchDisp(element)
{
    if (typeof element == 'string')
      element = getElementByID(element);

	if(element && element.style)
	{
		if(element.style.display=="none")
				element.style.display=""
		else
				element.style.display="none"
	}
}

function disp(id)
{
	var obj = getElementByID(id);
	if(obj && obj.style)
	{
		obj.style.display = '';
	}
}

function hide(id)
{
	var obj = getElementByID(id);
	if(obj && obj.style)
	{
		obj.style.display = 'none';
	}
}

function changeBgColor(id,color)
{
	var obj = getElementByID(id);
	if(obj && obj.style)
	{
		obj.style.backgroundColor = color;
	}
}


function removeOptions(objSELECT)
{
	if(objSELECT && objSELECT.tagName=="SELECT")
	{
		var len = objSELECT.length;
		for(i = len - 1 ;i >= 0 ; i--)
		{
			objSELECT.options[i] = null;
		}
		return true;
	}
	else
	{
		return false;
	}
}

function appendOptions(objSELECT,text,value)
{
	if(objSELECT && objSELECT.tagName=="SELECT")
	{
		objSELECT[objSELECT.length] = new Option(text,value);
	}
}

function appendOptionsForSelected(objSELECT, text, value, set_selected)
{
	if(objSELECT && objSELECT.tagName=="SELECT")
	{
		objSELECT[objSELECT.length] = new Option(text,value,'',set_selected);
	}
}

