
	var mat = new Object();
	
    function verSector(){
		if (document.getElementById('skill_area').value == '00'){
				document.getElementById('sectorId').disabled=true;
		}else{
				document.getElementById('sectorId').disabled=false;
		}
	}

function validateCampos(){
	ok = false;
	ok = ok || ((document.getElementById('LocationId') != null) && (document.getElementById('LocationId').value!='00'));
	ok = ok || ((document.getElementById('skill_area') != null) && (document.getElementById('skill_area').value!='00'));
	ok = ok || ((document.getElementById('sector') != null) && (document.getElementById('sector').value!='00'));
	ok = ok || ((document.getElementById('jobTypeId') != null) && (document.getElementById('jobTypeId').value!='00'));
	ok = ok || ((document.getElementById('kw') != null) && (document.getElementById('kw').value.replace(/^\s*|\s*$/g,"")!=''));
	return ok;
}
	
function cambioComboFecha(){	
	if (!validateCampos()) {
		var boton=document.getElementById('sd');
		if (boton!=null) {		
			boton.disabled=true;
			boton.selectedIndex=0;
		}			
	} else {
		var boton=document.getElementById('sd');
		if (boton!=null){		
			boton.disabled=false;
		}			
	}
}

	function cambioArea(text){
		document.getElementById('sectorId').length = 0; //clear	
		areaCombo = document.getElementById('skill_area');
		areaTXT = areaCombo.options[areaCombo.selectedIndex].value;
		if (areaTXT != '00'){		
			lista = mat[areaTXT];
			for (var i = 0; i < lista.length; i++) {
				document.getElementById('sectorId').options[i] = new Option(mat[areaTXT][i][1], mat[areaTXT][i][0]);
			}
		}else{
			document.getElementById('sectorId').options[0] = new Option(text, '');			
		}
		verSector();		
		cambioComboFecha();	
	}	
	
	function setMat(newMat){
		mat = newMat;
	}

function validateSearch() {
	if (!validateCampos()) {
		alert('Por favor, indic\341 al menos un criterio de b\372squeda para realizar la misma.');
	}
	return ok; }

function addHighlight(div){
	if(div.id == 'aviso platinum'){
		div.style.backgroundPosition = 'bottom';
		div.style.border="1px solid #FFA46C";
	}
	if(div.id == 'aviso destacado'){
		div.style.backgroundPosition = 'bottom';
		div.style.border="1px solid #9DC1C0";
	}
}
	
function removeHighlight(div){
	
	if(div.id == 'aviso platinum'){
		div.style.backgroundPosition = 'top';
		div.style.border="1px solid #FFEFD7";
	}
	if(div.id == 'aviso destacado'){
		div.style.backgroundPosition = 'top';
		div.style.border="1px solid #E6EFEF";
	}
}

function displayTransparentDiv(transparentDivId, loadingDivId) {
	var transparentDiv = document.getElementById(transparentDivId);
	transparentDiv.style.display = "block";
	modifDiv();
	
	if (loadingDivId) {
		var loadingDiv = document.getElementById(loadingDivId);
		loadingDiv.style.display = "block";
	}
}
function displayActionPopupDiv(actionPopupDivId) {
	var actionPopupDiv = document.getElementById(actionPopupDivId);
	centerElement(actionPopupDiv);
	actionPopupDiv.style.display = "block";	
}
function displayPop(div, div2) {
	displayTransparentDiv(div2);
	displayActionPopupDiv(div);
}
function centerElement(element) {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentElement = element;
			var contentHeight = contentElement.offsetHeight;
			contentElement.style.position = 'absolute';
			if (windowHeight - contentHeight > 0) {
				contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
			}
		}
	}
}
function modifDiv() {
	var obj = document.getElementById('transparentDiv').style;
	if (obj.display == 'none')
		showSelect();
	else
		obj.height = document.getElementById('divMain').offsetHeight + 10 + 'px';
}
function showSelect() {
	var e = document.getElementsByTagName('select');
	for (i = 0; i < e.length; i++) {
		e[i].style.visibility = 'visible';
	}
}
function displayN2(div, div2) {
	document.getElementById(div).style.display = "none";
	document.getElementById(div2).style.display = "none";
}
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof (window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
