
if(location.host.indexOf("infojobs")!=-1){
	pdm=0;
}else{
	pdm=location.host.indexOf(".")+1;	
}

function SetCookieSession (name, value) {  
	document.cookie = name + "=" + escape (value) + 
	"; path=/" +  
	"; domain="+location.host.substring(pdm);
}

function SetCookie (name, value) {  
	var expires= new Date(); 
	expires.setYear(2032);
	document.cookie = name + "=" + escape (value) + 
	"; expires=" + expires.toGMTString() +
	"; path=/" +  
	"; domain="+location.host.substring(pdm);
}

function SetCookieDay (name, value) {  
	SetCookieTime (name, value, 2);
}

function SetCookieWeek (name, value) {  
	SetCookieTime (name, value, 7);
}

function SetCookieMonth (name, value) {  
	SetCookieTime (name, value, 30);
}

function SetCookieTime (name, value, tiempo) {  
	var expires= new Date();
	diaaex=expires.getDate()+tiempo;
	expires.setDate(diaaex);
	document.cookie = name + "=" + escape (value) + 
	"; expires=" + expires.toGMTString() +
	"; path=/" +  
	"; domain="+location.host.substring(pdm);
}

function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (!i) break;   
	}  
	return null;
}

function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
	endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}

function deleteCookie(name,value){
	var expires= new Date();
	document.cookie = name + "=" + escape (value) + 
	"; expires=" + expires.toGMTString() +
	"; path=/" +  
	"; domain="+location.host.substring(pdm);
}


function recCooPFvalor(PFdato){
	valorRecu = 0;	
	dpfichas=unescape(unescape(GetCookie('PFICHASG')));
	posdrec=dpfichas.indexOf(PFdato);
	if (posdrec != -1){
		newstringPF=dpfichas.substring(posdrec);
		var posEq = newstringPF.indexOf('=');
		if ( posEq > 0){
			var posComma = newstringPF.indexOf(',',posEq);
			if(posComma > 0){
				valorRecu=newstringPF.substring(posEq +1,posComma);
			}else{
				valorRecu=newstringPF.substring(posEq +1);				
			}
		}
	}else{
			
	}
	return valorRecu;
}


function cS(metrica,ref,idcen,idcur,tipo,palBusq){}



function sC(evt,seg,lPuentes,idCateg,pos,totalResults,urlMetrix,idSite){	  
	var imgName = "spy"+Math.round(Math.random()*1000);
	window[imgName]=new Image(1,1);
	var cPuente = GetCookie("C_ID_PUENTE");
	var p=(cPuente && (lPuentes == '' || lPuentes == '-1'))?cPuente:lPuentes;
	var q =( (typeof(luceneQueryString)!= "undefined") ?luceneQueryString:'');
	if (typeof(totalResults)== "undefined") totalResults = '';
	if (typeof(urlMetrix)== "undefined") urlMetrix = 'http://metrix.emagister.com/';
	if (typeof(idSite)== "undefined") idSite = '1';
	window[imgName].src=urlMetrix+'EmagStatsWebApp/stats?site='+idSite+'&evt='+evt+'&seg='+seg+'&org='+recCooPFvalor('PFICHAORIGEN')+'&id='+p+'&q='+q+'&cat='+idCateg+"&pos="+pos+"&tr="+totalResults+"&sid="+GetCookie("CFID")+"_"+GetCookie("CFTOKEN");
	return true;
}

arrloc=new Array("users","/centros/","quienes","centrodetalles");
arrcs=new Array("MENU_DE_USUARIO","MENU_DE_CENTRO","QUIENES_SOMOS","PCENTRO");
var enco=false;


//Desplegar contenido becas y otros
function mostrarElemento(oculta_puntos, oculta_boton, muestra_texto){
		document.getElementById(oculta_puntos).style.display="none";
		document.getElementById(oculta_boton).style.display="none";
		document.getElementById(muestra_texto).style.display="inline";
	}

