
function toggleClientLogin() {
	var thiselement = document.getElementById('clogin');
	if(thiselement.style.display == 'block') {
		thiselement.style.display = 'none'
	} else {
		thiselement.style.display = 'block';
	}
}

function hideById(id){
	var theElement = document.getElementById(id);
	theElement.style.display = 'none';
}

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 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);
				}
			}
		}
	}
}

function showTab(_id,_liid){
	hideByTagAndClass('div','jobcontent');
	var theElement = document.getElementById(_id);
	theElement.style.display = 'block';
	
	var ul = document.getElementById('jobtabs');
	if (! ul) { return; }
	var lis = ul.getElementsByTagName("li");
	for (var h = 0; h < lis.length; h++) {
		if (lis[h].className.indexOf('active') > -1){
			var newValue = lis[h].className;
			newValue = newValue.replace('active','');
			lis[h].className = newValue;
		}
	}
	var activeli = document.getElementById(_liid);
	if(activeli && activeli.className.indexOf('active') == -1){
		activeli.className = activeli.className + " " + "active";
	}
}

