function positionView (id1,id2){
	$(id1).className="hidden0";
	$(id2).className="visible0";
}

function initAdd() {
	useLoading('loadingImageZone');
}

function useLoadingImage() {
	useLoading('disabledImageZone');
}

function useLoadingBigImage() {
	useLoading('disabledBigImageZone');
}

function useLoading(id) {
	DWREngine.setPreHook(function() {
		var disabledImageZone = $(id);
		if(!disabledImageZone) {
			disabledImageZone = document.createElement('div');
			disabledImageZone.setAttribute('id', id);
			document.body.appendChild(disabledImageZone);
		} else {
			disabledImageZone.style.display = 'block';
		}
		if (id == 'disabledBigImageZone') {
			disabledImageZone.style.height = YAHOO.util.Dom.getViewportHeight() + 'px';
			disabledImageZone.style.width = YAHOO.util.Dom.getViewportWidth() + 'px';
		}
	});
	DWREngine.setPostHook(function() {
		$(id).style.display = 'none';
	});
}

idAnterior='unoExp1'
function mostrarCapa(idCapa){
	quitarCapa();
	document.getElementById(idCapa).style.display='block';
	idAnterior=idCapa;
}
function quitarCapa(){
	var x = document.getElementById(idAnterior);
	if (x) {
		x.style.display='none';
	}
}

function mostrarDatosContacto(idMostrar,idOcultar,idMostrar2){
	if (idMostrar2) document.getElementById(idMostrar2).style.display='block';
	document.getElementById(idMostrar).style.display='block';document.getElementById(idOcultar).style.display='none';
}

idBloqueAnterior='title2Bloque';
function mostrarBloque(idBloque){
	document.getElementById(idBloqueAnterior).style.display='none';
	document.getElementById(idBloque).style.display='block';
	document.getElementById('li_'+idBloqueAnterior).className='';
	document.getElementById('li_'+idBloque).className='liPulsado';
	idBloqueAnterior=idBloque;
	if(SearchSystem.overlay['positionTitleSearch']) { SearchSystem.overlay['positionTitleSearch'].hide(); }
	if(SearchSystem.overlay['knowledgesSearch']) { SearchSystem.overlay['knowledgesSearch'].hide(); }
}
function getElementBlock(idCapa){
	document.getElementById(idCapa).style.display='block';
}
function getElementNone(idCapa){
	document.getElementById(idCapa).style.display='none';
}


/*function PositionForm_viewCandidates(p) {
	PositionForm.viewCandidates(p);
}*/


/*function PositionForm_viewCandidatesV2(p) {
	positionView('position_edit','position_candidates');
	DWRUtil.setValue('position_candidates', 
			"<div id='loadingMessage'>" +
				"<div id='animacionLoading'>" +
					"<img src='imagenes/ajax-loader2.gif'/>" +
				"</div>" +
			"</div>"
		, { escapeHtml:false });
	PositionForm.viewCandidatesV2(p);
	//window.setTimeout(function () {	}, 1);
}*/

function initPosition() {
	useLoadingBigImage();
}

function tooltipOver(obj, event, title, text, style){
	obj.style.color = '#ffffff'; 
	domTT_activate(obj, event, 'content', title + '<p>' + text +'</p>', 'trail', true, 'fade', 'both', 'fadeMax', 87, 'styleClass', style, 'lifetime' , 15000);
}
function tooltipOut(obj, event) {
	domTT_mouseout(obj, event);
}


function PositionList() {}

PositionList.search = function (url, radioObj) {
	PositionList._commonAction(url, radioObj, 'positionid', '&o2=d&o=p');
}

PositionList.remove = function (url, radioObj) {
	PositionList._commonAction(url, radioObj, 'id', '');
}

PositionList.copy = function (url, radioObj) {
	PositionList._commonAction(url, radioObj, 'id', '&op=c');
}

PositionList.edit = function (url, radioObj) {
	PositionList._commonAction(url, radioObj, 'id', '&op=e');
}

PositionList._commonAction = function (url, radioObj, positionIdName, extra) {
	var positionid = PositionList._getRadioValue(radioObj);
	window.location.href=url + '?' + positionIdName + '=' + positionid + extra;
}


PositionList._getRadioValue = function (radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
