function hideById(_id) {
	var x = document.getElementById(_id);
	x.style.display = 'none';	
}

function showById(_id) {
	var x = document.getElementById(_id);
	x.style.display = 'block';	
}

function hideByTagAndClass(_tag,_class){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if (x[i].className.indexOf(_class) > -1){	
			x[i].style.display = 'none';
		}
	}
}

function showByTagAndClass(_tag,_class){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if (x[i].className.indexOf(_class) > -1){		
			x[i].style.display = 'block';
		}
	}
}

function notVisibleById(_id) {
	var x = document.getElementById(_id);
	x.style.visibility = 'hidden';	
}

function visibleById(_id) {
	var x = document.getElementById(_id);
	x.style.visibility = 'visible';	
}

function notVisibleByTagAndClass(_tag,_class){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if (x[i].className.indexOf(_class) > -1){		
			x[i].style.visibility = 'hidden';
		}
	}
}

function visibleByTagAndClass(_tag,_class){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if (x[i].className.indexOf(_class) > -1){		
			x[i].style.visibility = 'visible';
		}
	}
}

function changeAttributeValue(_id,_attribute,_value){
	if (document.getElementById && document.createElement){
		node = document.getElementById(_id).parentNode;
		node.setAttribute(_attribute,_value);
	}
}
function changeNodeValue(_id,_attribute,_value){
	if (document.getElementById && document.createElement){
		node = document.getElementById(_id).parentNode;
		node.style.setProperty(_attribute,_value,null);
	}
}

function toggleClass(_tag,_originalclass,_newclass){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if(x[i].className.indexOf(_originalclass) > -1){
			//alert(x[i].className + " / " + _originalclass + " / " + _newclass);
			x[i].className = x[i].className.replace(_originalclass,_newclass);
		}
	}
}

function findReplaceNodeValue(_tag,_class,_attribute,_find,_replace){
	var x = document.getElementsByTagName(_tag);
	for (var i=0;i<x.length;i++){
		if(x[i].className.indexOf(_class) > -1){
			var newValue = x[i].getAttribute(_attribute);
			if(newValue){
				newValue = newValue.replace(_find,_replace);
				x[i].setAttribute(_attribute,newValue);
			}
		}
		if(_attribute == 'class') {
			if(x[i].className.indexOf(_class) > -1){
				var newValue = x[i].getAttribute('className');
				if(newValue){
					newValue = newValue.replace(_find,_replace);
					x[i].setAttribute('className',newValue);
				}
			}
		}
	}
}