// (VFG) Cambio provisional para incluir la función del init.js "STSNavigate"
function STSNavigate(Url)
{
    window.location.href = Url;
}
////////////////////////////////////////////////////
function mostrarOcultar2(capa, capa2){
document.getElementById(capa).style.display ="block"
document.getElementById(capa2).style.display ="none"
}

function mostrarOcultar(capa, capa2, capa3){
document.getElementById(capa).style.display ="block"
document.getElementById(capa2).style.display ="none"
document.getElementById(capa3).style.display ="none"
}

function mostrarOcultar4(capa, capa2, capa3, capa4){
document.getElementById(capa).style.display ="block"
document.getElementById(capa2).style.display ="none"
document.getElementById(capa3).style.display ="none"
document.getElementById(capa4).style.display ="none"
}

function mostrarOcultar6(capa, capa2, capa3, capa4, capa5, capa6) {
document.getElementById(capa).style.display = "block"
document.getElementById(capa2).style.display = "none"
document.getElementById(capa3).style.display = "none"
document.getElementById(capa4).style.display = "none"
document.getElementById(capa5).style.display = "none"
document.getElementById(capa6).style.display = "none"
}

function cambiarEstilo(id) {
var elemento = document.getElementById(id);
if (elemento.className == "desplegado") {
	elemento.className = "plegado";
} else {
	elemento.className = "desplegado";
}
}

function cambiarEstilo2(id) {
var elemento = document.getElementById(id);

if (elemento.style.display == "block") {
	elemento.style.display = "none";
} else {
	elemento.style.display = "block";
}
}
//Cambia clase fecha calendario
function cambioEstiloeIcono(id2) {
var icono = document.getElementById(id2);
if (icono.className == "fechpleg") {
	icono.className = "fechdespleg";
} else {
	icono.className = "fechpleg";
}
}

function cambioEstiloeIcono2(id, id2) {
var elemento = document.getElementById(id);
var icono = document.getElementById(id2);
if (elemento.style.display == "block") {
	elemento.style.display = "none";
	icono.className = "enviar";
} else {
	elemento.style.display = "block";
	icono.className = "enviar_on";
}
}

function cambioEstiloeIcono3(id, id2) {
var elemento = document.getElementById(id);
var icono = document.getElementById(id2);
if (elemento.style.display == "block") {
	elemento.style.display = "none";
	icono.className = "res_plus_lnk";
} else {
	elemento.style.display = "block";
	icono.className = "res_plus_lnk_on";
}
}
function cambioEstiloeIcono4(id, id2) {
	var elemento = document.getElementById(id);
	var icono = document.getElementById(id2);
	
	if (elemento.style.display == "block") {
		elemento.style.display = "none";
		icono.className = "fechpleg";
	}
	else {
		elemento.style.display = "block";
		icono.className = "fechdespleg";
	}
}

//Enviar a un amigo
function iniciaenv() {
document.getElementById('artf_nviar_ok').style.display = "none";
document.getElementById('artf_nviar_carg').style.display = "none";
document.getElementById('artf_nviar_error').style.display = "none";
document.getElementById('form_enviar').style.display = "block";
}
function enviar(id, id2) {
var elemento = document.getElementById(id);
var icono = document.getElementById(id2);

if (elemento.style.display == "block") {
    elemento.style.display = "none";
    icono.className = "enviar";
} else {
    elemento.style.display = "block";
    icono.className = "enviar_on";
}
iniciaenv();
}

function zoomText(Accion,Elemento){
//inicializaciones
obj=document.getElementById(Elemento);
if (obj.style.fontSize==""){
obj.style.fontSize="100%";
}

actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto 
incremento=10;// el valor del incremento o decremento en el tamaño 

//operacion
if(Accion=="aumentar"){
valor=actual+incremento;
obj.style.fontSize=valor+"%"
}
if(Accion=="disminuir"){
valor=actual-incremento;
obj.style.fontSize=valor+"%"
}
}

function LeeLocal(sitio) {
    if (sitio.toUpperCase() == "LOCAL") {
        var provinciaLocal = readCookie("ProvinciaLocal");        
        if (provinciaLocal != null) {
            var local = document.getElementById("Eslocal");           
            local.href = provinciaLocal;            
        }
    }        
    return true;
}

/* Funciones usadas en el control de usuario BarraCompartir.ascx */

function CompartirNoticia(destino, titulo) {
    var title = (titulo != null) ? titulo : window.document.title;
    var href = document.location.href.toString();
    var ancho = 600, alto = 300;
    var abrirVentanaNueva = true;
    switch (destino) {
        case 'meneame': url = 'http://meneame.net/submit.php?url=' + href; ancho = 900; alto = 600; break;
        case 'tuenti': url = 'http://www.tuenti.com/share?url=' + href; break;
        //case 'twitter': url = 'http://twitter.com/share?url=' + href + '&text=' + title + "&via=Noticias_Terra"; abrirVentanaNueva = true; break; 
        //case 'facebook': url = 'http://www.facebook.com/share.php?u=' + href; abrirVentanaNueva = true; ancho = 600; alto = 500; break; 
        default: return false;
    }
    if (abrirVentanaNueva)
        window.open(url, "_blank", 'width=' + ancho + ',height=' + alto);
    else
        location.href = url;

}
function CompartirUrl() {
    return document.location.href;
}

/* Fin funciones usadas en el control de usuario BarraCompartir.ascx */


