function setElementVisible(id, isVisible) {
	document.getElementById(id).style.display = ((isVisible == true) ? "" : "none");
}

function isElementVisible(id) {
	if (document.getElementById(id).style.display == "none") {
		return false;
	}
	return true;
}

function switchElementVisibility(id) {
	var visible = !isElementVisible(id);
	setElementVisible(id, visible);
	return visible;
}

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

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

function getOptionsSelectedValue(id) {
	return document.getElementById(id).options[document.getElementById(id).selectedIndex].value;
}


function setDDLabelText(id, text) {
	lblTable = document.getElementById(id);
	if (lblTable && lblTable.firstChild && lblTable.firstChild.firstChild 
			&& lblTable.firstChild.firstChild.firstChild 
			&& lblTable.firstChild.firstChild.firstChild.firstChild) {
		lblTable.firstChild.firstChild.firstChild.firstChild.textContent=text;
	}
}

function setDDTextLabelText(id, text) {
	lblTable = document.getElementById(id);
	if (lblTable && lblTable.rows[0] && lblTable.rows[0].cells[0] 
			&& lblTable.rows[0].cells[0].childNodes[0]) {
		lblTable.rows[0].cells[0].childNodes[0].innerHTML=text;
	}
}


function setClass(obj, cl){
    if (obj.className != cl) {
    	obj.className = cl;
    }
}