﻿function RowOverCategoria(id) {
    document.getElementById(id).style.background = "#F77F00";
}

function RowOutCategoria(id) {
    document.getElementById(id).style.background = "#6BA4EB";
    if (id % 2 == 0) {
        document.getElementById(id).style.background = "#0145D4";
    }
}


function RowOver(id) {
    document.getElementById(id).style.background = "#F77F00";
}

function RowOut(id) {
    document.getElementById(id).style.background = "#6BA4EB";
    if (id % 2 == 0) {
        document.getElementById(id).style.background = "#0145D4";
    }
}

function RowOver2(id) {
    document.getElementById(id).style.background = "LightGreen";
}

function RowOut2(id) {
    document.getElementById(id).style.background = "LightBlue";
    if (id % 2 == 0) {
        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 = ":::::: cch Araujo 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 GetImagem(imagem, idcliente) {
    w = 385;
    h = 289;
    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("ContentImagem.aspx?imagem=" + imagem + "&idcliente=" + idcliente, "Imagem", propriedades);
    return false;
}

function GetPortifolio(imagem, idcliente) {
    w = 600;
    h = 450;
    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("ContentPortifolioGrande.aspx?imagem=" + imagem + "&idcliente=" + idcliente, "Imagem", propriedades);
    return false;
}

function mainValues() {
    var lsString;
    lsString = document.getElementById("HiddenFieldDma").value;
    window.opener.parent.document.getElementById("ctl00_ContentPlaceHolderContent_HiddenFieldDma").value = lsString;
    window.close();
}

function SetDivMain() {
    var x = screen.Height;
    var h = screen.availHeight - 150;
    div = document.getElementById("TableMain");
    div.style.height = h + "px";
    div.style.visibility = "visible";
}

function SetImagemOver(img) {
    img.border = 5;
    img.width = 125;
    img.height = 91;
}

function SetImagemOut(img) {
    img.border = 0;
    img.width = 135;
    img.height = 101;
}
