﻿function RowOver(id) {
    document.getElementById(id).style.background = "#BAFCCF";
}

function RowOut(id) {
    document.getElementById(id).style.background = "#FFFFFF";
    if (id % 2 == 0) {
        document.getElementById(id).style.background = "#DCDBF9";
    }
}
function RowOverBiblia(id) {
    document.getElementById(id).style.background = "#BAFCCF";
}

function RowOutBiblia(id) {
    document.getElementById(id).style.background = "#FFFFFF";
}

function RowOverProdutos(id) {
    document.getElementById(id).style.border = "1px double #BEBEDE";
}

function RowOutProdutos(id) {
    document.getElementById(id).style.border = "1px double #FFFFFF";
}

function StatusBar() {
    window.status = ":::::: 7 Chaves Loja Virtual ::::::";
}

function CloseDiv(div) {
    document.getElementById(div).innerHTML = "";
}

function OpenWindow(url, win, w, h, scroll) {

    esquerda = (screen.width) ? (screen.width - w) / 2 : 0;
    direita = (screen.height) ? (screen.height - h) / 2 : 0;
    propriedades = 'height=' + h + ',width=' + w + ',top=' + direita + ',left=' + esquerda + ',scrollbars=' + scroll + ',resizable'

    window.open(url, win, propriedades);
}

function GetWindow() {
    var altura = window.screen.height;
    document.getElementById("TableInterface").style.width = "100%";
    document.getElementById("TableInterface").style.height = altura + "px";
}

function GetGetDescricao(evt, v, d) {
    var x = evt.clientX + 50;
    var y = evt.clientY;
    div = document.getElementById("DivGetDescricao");

    if (v == 0) {
        div.style.visibility = "hidden";
    }
    else {
        div.style.border = "5px dotted #3A71BD";
        div.style.backgroundColor = "#FFFFFF";
        div.style.width = "200px";
        div.style.padding = "5px";
        div.style.left = x + "px";
        div.style.top = y + "px";
        div.style.visibility = "visible";
        div.innerHTML = d;
        div.style.visibility = "visible";
    }
}

function GetInfo(evt, v) {
    var x = evt.clientX + 50;
    var y = evt.clientY - 100;
    div = document.getElementById("DivInfo");

    if (v == 0) {
        div.style.visibility = "hidden";
    }
    else {
        div.style.border = "3px double #3A71BD";
        div.style.backgroundColor = "#FFFFFF";
        div.style.width = "300px";
        div.style.padding = "5px";
        div.style.left = x + "px";
        div.style.top = y + "px";
        div.style.visibility = "visible";
        div.innerHTML = d;
        div.style.visibility = "visible";
    }
}

function iframeAutoHeight(quem, heu) {
    if (navigator.appName.indexOf("Internet Explorer") > -1) { //ie sucks
        var func_temp = function() {
            var val_temp = quem.contentWindow.document.body.scrollHeight + 5
            quem.style.height = val_temp + "px";
            alert(val_temp)
        }
        setTimeout(function() { func_temp() }, 100) //ie sucks        
    } else {
        var val = quem.contentWindow.document.body.parentNode.offsetHeight + 5
        quem.style.height = val + "px";
    }
}

function GetCalendario() {
    x = (screen.width) ? (screen.width - 200) / 2 : 0;
    y = (screen.height) ? (screen.height - 200) / 2 : 0;

    div = document.getElementById("DivCalendario");
    div.style.border = "3px double #3A71BD";
    div.style.backgroundColor = "#FFFFFF";
    div.style.width = "300px";
    div.style.height = "300px";
    div.style.padding = "5px";
    div.style.left = x + "px";
    div.style.top = "100px"; //y + "px";
    div.style.visibility = "visible";
    div.innerHTML = "";
}

function GetDma(llInp) {
    w = 250;
    h = 250;
    esquerda = (screen.width) ? (screen.width - w) / 2 : 0;
    direita = (screen.height) ? (screen.height - h) / 2 : 0;
    propriedades = 'height=' + h + ',width=' + w + ',top=' + direita + ',left=' + esquerda + ',scrollbars=' + scroll + ',resizable'
    window.open("PageCalendario.aspx", "aa", propriedades);
    return false;
}

function mainValues() {
    var lsString;
    lsString = document.getElementById("HiddenFieldDma").value;
    window.opener.parent.document.getElementById("ctl00_ContentPlaceHolder1_HiddenFieldDma").value = lsString;
    window.close();
}