// JavaScript Document
function html_entity_decode(str) {
  var ta=document.createElement("textarea");
  ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  return ta.value;
}

function clasificados(){ 
//--------------- classificats ------------
	var voypor_c = this.document.getElementById('clas_i').value;
	if (voypor_c==""){voypor_c=0;} else {voypor_c=parseInt(voypor_c);}
	if (voypor_c >=3) { voypor_c=0;}

	var valor = new Array(3);
	valor [0] = html_entity_decode(this.document.getElementById('clasf1').value);
	valor [1] = html_entity_decode(this.document.getElementById('clasf2').value);
	valor [2] = html_entity_decode(this.document.getElementById('clasf3').value);
	
	this.document.getElementById("tx_clasificados").value = valor[voypor_c];
	voypor_c++;
	this.document.getElementById('clas_i').value=voypor_c;
	
//--------------- treball ------------
	var voypor_t = this.document.getElementById('treb_i').value;
	if (voypor_t==""){voypor_t=0;} else {voypor_t=parseInt(voypor_t);}
	if (voypor_t>=3) { voypor_t=0;}

	var treball = new Array(3);
	treball [0] = html_entity_decode(this.document.getElementById('treba1').value);
	treball [1] = html_entity_decode(this.document.getElementById('treba2').value);
	treball [2] = html_entity_decode(this.document.getElementById('treba3').value);
	
	this.document.getElementById("tx_trabajo").value = treball[voypor_t];
	voypor_t++;
	this.document.getElementById('treb_i').value=voypor_t;
	
	
    setTimeout("clasificados()",5000) 
} 