﻿/*************************************
Funcion para mostrar ocultar capas
*************************************/
function mostrar(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');
    capa.visibility = (document.layers) ? "show" : "visible";
    capa.position = (document.layers) ? "relative" : "static" ;
}
function ocultar(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');

    capa.visibility = (document.layers) ? "hide" : "hidden";
    capa.position = (document.layers) ? "relative" : "absolute";
}

function mostrarSinRelative(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');
    capa.visibility = (document.layers) ? "show" : "visible";
    //capa.position = (document.layers) ? "relative" : "static";
}
function ocultarSinRelative(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');

    capa.visibility = (document.layers) ? "hide" : "hidden";
    //capa.position = (document.layers) ? "relative" : "absolute";
}

/*************************************
Funcion Ventana Metrologic
*************************************/


function fnOpenPosiflex() {
    return window.open('http://www.posiflex.es/productes/links.htm', 'Pagina', 'center=1,menubar=1,toolbar=0,width=650,height=600,resizable=1,titlebar=1,left=100,top=50,scrollbars=1');
}

function fnOpen(StrPagina, StrCenter, StrDialogHide, StrResizable, StrStatus, StrDialogWidth, StrDialogHeight, StrDialogHide, StrHelp, StrScroll) {
    return window.showModalDialog(StrPagina, 'Pagina', 'center:' + StrCenter + '; dialogHide:' + StrDialogHide + '; resizable:' + StrResizable + '; status:' + StrStatus + ';  dialogWidth:' + StrDialogWidth + 'px;dialogHeight:' + StrDialogHeight + 'px;dialogHide:' + StrDialogHide + ';help:' + StrHelp + ';scroll:' + StrScroll + '');
}

function fnOpen2(StrPagina, StrCenter, StrDialogHide, StrResizable, StrStatus, StrDialogWidth, StrDialogHeight, StrDialogHide, StrHelp, StrScroll) {
    var left = parseInt((screen.availWidth / 2) - (StrDialogWidth / 2));
    var top = parseInt((screen.availHeight / 2) - (StrDialogHeight / 2));
    return window.open(StrPagina, 'Ventana', 'menubar=0,toolbar=0,screenX=' + left + ',screenY=' + top + ',resizable=' + StrResizable + ', status=' + StrStatus + ',Width=' + StrDialogWidth + 'px, Height=' + StrDialogHeight + 'px,dialogHide=' + StrDialogHide + ',help=' + StrHelp + ',scrollbars=' + StrScroll + '');
}
function fnOpen3(StrPagina, StrDialogWidth, StrDialogHeight) {
    return window.open(StrPagina, 'window', 'scrollbars=1; Width=' + StrDialogWidth + 'px; Height=' + StrDialogHeight + 'px');
}


function setfocus(cual) {
    try {
        document.forms[0].elements[cual].focus();
    }
    catch (e) { }
    return;
}
function fnOpenTec() {
    return window.open('http://www.tec-it.com/online-demos/tbarcode/barcode-generator.aspx?LANG=es', 'Pagina', 'menubar=0,toolbar=0,width=800,height=750,resizable=1,titlebar=0,left=100,top=50,scrollbars=1');
}
function fnOpenTecForm() {
    return window.open('http://www.tec-it.com/online-demos/tformer/FileUpload.aspx', 'Pagina', 'menubar=0,toolbar=0,width=800,height=750,resizable=1,titlebar=0,left=100,top=50,scrollbars=1');
}

/*************************************
Funcion para Atenuar capas
*************************************/
function Atenuar(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');
    //capa.visibility = (document.layers) ? "show" : "visible";
    //capa.position = (document.layers) ? "relative" : "static";
    capa.filter = (document.layers) ? "alpha(opacity=30)" : "alpha(opacity=30)";
    capa.opacity = (document.layers) ? ".3" : ".3";
    capa.fontWeight = (document.layers) ? "normal" : "normal";
}

function DesAtenuar(idCapa) {
    if (document.layers) capa = eval("document." + idCapa);
    if (document.all) capa = eval(idCapa + ".style");
    if (document.getElementById) capa = eval('document.getElementById("' + idCapa + '").style');
    //capa.visibility = (document.layers) ? "show" : "visible";
    //capa.position = (document.layers) ? "relative" : "static";
    capa.filter = (document.layers) ? "alpha(opacity=100)" : "alpha(opacity=100)";
    capa.opacity = (document.layers) ? "1.0" : "1.0";
    capa.fontWeight = (document.layers) ? "bold" : "bold";
}

/*************************************
Enviar emails sin spam

<script>escribe_enlace_correo('prueba')</script>
*************************************/
var efin = "sicae.es";
var emedio = "@";


function dame_correo(einicio) {
    return einicio + emedio + efin
}
function escribe_Sicae_correo(einicio) {
    document.write("<a href='mailto:" + dame_correo(einicio) + "'><img src='http://www.sicae.es/Imagenes/Contacto.gif' border='0' width='120' height='30' ></a>")
}
