function compartir1(){
	document.getElementById('compartir1').style.display = "block"
}
function compartir2(){
	document.getElementById('compartir2').style.display = "block"
}
function publicar(){
	document.getElementById('publicarsitio').style.display = "block";
	document.getElementById('publicarsitio').style.top = Scroll() + 250 + "px";
}
function cerrarCaja(caja)
{
		document.getElementById(caja).style.display = "none";
}
function link(){
	document.getElementById('linkpermanente').style.display = "block";
	document.getElementById('linkpermanente').style.top = Scroll() + 450 + "px";
}

function opinar(nota_id,nroVotos)
{
	var cook, votaciones,nroVotos;
	if (readCookie("valorar")!=null){
		cook = readCookie("valorar").replace(/%7C/,"|");
	}else{
	    //cook = nota_id;
	}
	nota_id = nota_id + '';
	cook = cook + '';
	
	var votaciones = document.getElementById("votaciones");
	
    if (cook.indexOf(nota_id) == -1)
	{
		nroVotos = parseInt(nroVotos)+1;
		
		document.getElementById("votaciones").innerHTML = 'Ya valoraste (' + nroVotos + ')';
		document.getElementById("votarHabilitado").style.display = 'none';
		document.getElementById("votarDeshabilitado").style.display = 'inline';
		document.getElementById("votacionesDeshabilitadas").innerHTML = 'Ya valoraste (' + nroVotos + ')';
		
		document.getElementById("votaciones2").innerHTML = 'Ya valoraste (' + nroVotos + ')';
		document.getElementById("votarHabilitado2").style.display = 'none';
		document.getElementById("votarDeshabilitado2").style.display = 'inline';
		document.getElementById("votacionesDeshabilitadas2").innerHTML = 'Ya valoraste (' + nroVotos + ')';		
		
		// Exec valorar
		document.getElementById("valorar").src = "/scripts/valorar.aspx?nota_id=" + nota_id;

	}
	else
	{
	    // Valorar notaCabezal
		document.getElementById("votarHabilitado").style.display = "none";
		document.getElementById("votarDeshabilitado").style.display = "inline";
		document.getElementById("votacionesDeshabilitadas").innerHTML = 'Ya valoraste (' + nroVotos + ')';
		
		// Valorar notaPie
		document.getElementById("votarHabilitado2").style.display = "none";
		document.getElementById("votarDeshabilitado2").style.display = "inline";
		document.getElementById("votacionesDeshabilitadas2").innerHTML = 'Ya valoraste (' + nroVotos + ')';		
	}
}


function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
	var c = ca[i];
	while (c.charAt(0)==' ') c = c.substring(1,c.length);
	if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}