﻿function imageOver(img_name, img_src) {
    img_name.src = img_name.src.replace(img_src + '.gif', 'over_' + img_src + '.gif');
}

function imageNormal(img_name, img_src) {
    img_name.src = img_name.src.replace('over_' + img_src + '.gif', img_src + '.gif');
}

function changeCssClass(obj, cssClass) {
    var element = document.getElementById(obj);
    element.setAttribute("class", cssClass);
}

function HightLight(obj, color, background) {
    document.getElementById(obj).style.cssText = 'color:' + color + ';' + 'background:' + background + ';';
}

function UndoHightLight(obj, color, background) {
    document.getElementById(obj).style.cssText = 'color:' + color + ';' + 'background:' + background + ';';
}

function mouseOver(obj) {
    if (obj == 'tdSoporte') {
        document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 1px; border-color: #CCCCCC;; width: 92px; background-color:#EAEAEA; color:#FFFFFF; cursor:pointer;';
    } else {
        if (obj == 'tdOpinion') {
            document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 0px; border-color: #CCCCCC;; width: 242px; background-color:#EAEAEA; color:#000000; cursor:pointer;';
        } else {
            document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 0px; border-color: #CCCCCC;; width: 92px; background-color:#EAEAEA; color:#FFFFFF; cursor:pointer;';
        }
    }
}

function mouseOut(obj) {
    if (obj == 'tdSoporte') {
        document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 1px; border-color: #CCCCCC;; width: 92px; background-color:#FFFFFF; color:#000000; cursor:pointer;';
    } else {
        if (obj == 'tdOpinion') {
            document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 0px; border-color: #CCCCCC;; width: 242px; background-color:#CCCCCC; color:#000000; cursor:pointer;';
        } else {
            document.getElementById(obj).style.cssText = 'border-style: solid; border-width: 1px 1px 1px 0px; border-color: #CCCCCC;; width: 92px; background-color:#FFFFFF; color:#000000; cursor:pointer;';
        }
    }
}

function submouseOver(obj) {
    document.getElementById('ctl00_' + obj).style.cssText = 'width: auto; cursor: pointer; background-color: #999999;';
}

function submouseOut(obj) {
    document.getElementById('ctl00_' + obj).style.cssText = 'width: auto; cursor: pointer; background-color: #CCCCCC;';

}

// Variables
var msg;

function okScript() {
    msg = 'ok';
}

function cancelScript() {
    msg = 'cancel';
}
function showInfo() {
    var panel = document.getElementById("ctl00_Panel1");
    panel.style.height = "500px";

    var table = document.getElementById("tblMasInfo");
    table.visible = "true";

    var ctl00_lblDescripcion = document.getElementById("ctl00_lblDescripcion");
    ctl00_lblDescripcion.style.visibility = "visible";

    var ctl00_ibtnMail = document.getElementById("ctl00_ibtnMail");
    ctl00_ibtnMail.style.visibility = "visible";

    var ctl00_ibtnPrint = document.getElementById("ctl00_ibtnPrint");
    ctl00_ibtnPrint.style.visibility = "visible";

    //    var ctl00_lblMailContacto = document.getElementById("ctl00_lblMailContacto");
    //    ctl00_lblMailContacto.style.visibility = "visible";
}

function showInfo2() {
    var table = document.getElementById("tblMasInfo");
    table.visible = "true";

    var ctl00_lblDescripcion = document.getElementById("ctl00_ContentPlaceHolder2_lblDescripcion");
    ctl00_lblDescripcion.style.visibility = "visible";

    var ctl00_ibtnMail = document.getElementById("ctl00_ContentPlaceHolder2_ibtnMail");
    ctl00_ibtnMail.style.visibility = "visible";

    var ctl00_ibtnPrint = document.getElementById("ctl00_ContentPlaceHolder2_ibtnPrint");
    ctl00_ibtnPrint.style.visibility = "visible";
}

function postback(link) {
    window.location = link;
}

function imagesP(img, imgPath, index) {
    if (index > 0) {
        img.src = imgPath + '.jpg';
    }
    else {
        img.src = imgPath + '_dis.jpg';
    }
}
function imagesN(img, imgPath, index, total, factor) {
    if (index < (total - factor)) {
        img.src = imgPath + '.jpg';
    }
    else {
        img.src = imgPath + '_dis.jpg';
    }
}

function moveFix(behavior, delta) {
    var images = $get('images');
    images.visibleIndex = delta;
    var animation = behavior._onClick._animation._animations[1]._animations[0];
    animation.set_startValue(parseInt(images.style.left));
    animation.set_endValue(images.visibleIndex * -781);
}

function initialize() {
    var images = $get('images');

    images.imageCount = 0;
    for (var i = 0; i < images.childNodes.length; i++) {
        var child = images.childNodes[i];
        if (child.tagName && child.tagName.toLowerCase() == 'img') {
            images.imageCount++;
        }
    }
    //781 org
    images.style.width = (images.imageCount * 781) + 'px';
    images.style.left = '0px';

    images.visibleIndex = 0;
}
