﻿function showTip(obj, imgsrc) {

var tipElement = document.getElementById(obj);
var tipImage = document.getElementById(imgsrc);

if ( tipElement.style.display != 'none' ) {
    tipElement.style.display = 'none';
    if (tipImage) tipImage.src ="templates/"+ siteTemplate +"/images/tip_plus.gif";
    }
else {
    tipElement.style.display = '';
    if (tipImage) tipImage.src ="templates/"+ siteTemplate +"/images/tip_minus.gif";
    }
}

var _showEmailUsTipLastRow = null;
var _showEmailUsTipLastCell = null;
var _showEmailUsTipLastImage = null;
function showEmailUsTip(objRow, objCell, imgsrc) {
    var cellElement = document.getElementById(objCell);
    var rowElement = document.getElementById(objRow);
    var tipImage = document.getElementById(imgsrc);

    if (cellElement == _showEmailUsTipLastCell) {
        if (cellElement.style.visibility == 'collapse') {
            rowElement.style.display = 'table-row';
            cellElement.style.visibility = 'visible';
            if (tipImage) tipImage.src = "templates/"+siteTemplate + "/images/tip_minus.gif";
        } else {
            rowElement.style.display = 'none';
            cellElement.style.visibility = 'collapse';
            if (tipImage) tipImage.src = "templates/"+siteTemplate + "/images/tip_plus.gif";

            _showEmailUsTipLastRow = null;
            _showEmailUsTipLastCell = null;
            _showEmailUsTipLastImage = null;
        }
    } else {
        if (_showEmailUsTipLastCell != null) { _showEmailUsTipLastCell.style.visibility = 'collapse'; }
        cellElement.style.visibility = 'visible';

        if (_showEmailUsTipLastRow != null) { _showEmailUsTipLastRow.style.display = 'none'; }
        rowElement.style.display = 'table-row';

        if (_showEmailUsTipLastImage != null) { _showEmailUsTipLastImage.src = "templates/"+siteTemplate+"/images/tip_plus.gif"; }
        if (tipImage) tipImage.src="templates/"+siteTemplate +"/images/tip_minus.gif";
    }

    _showEmailUsTipLastRow = rowElement;
    _showEmailUsTipLastCell = cellElement;
    _showEmailUsTipLastImage = tipImage;
}
