﻿function openPopUp(srcFile,widthPopup,heightPopup)
{
    if(screen.width)
    {
        var winl = (screen.width-widthPopup)/2;
        var wint = (screen.height-heightPopup)/2;
    }
    else
    {
        winl = 0;wint =0;
    }

    var strFeatures;
    strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width="+widthPopup+",height="+heightPopup+",top="+wint+",left="+winl+"";
    oWindow = window.open(srcFile, '_blank', strFeatures);
    oWindow.focus();
}

function openImagePopUp(srcFile,widthPopup,heightPopup)
{
    if(screen.width)
    {
        var winl = (screen.width-widthPopup)/2;
        var wint = (screen.height-heightPopup)/2;
    }
    else
    {
        winl = 0;wint =0;
    }

    var strFeatures;
    strFeatures = "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width="+(widthPopup + 20)+",height="+(heightPopup + 25)+",top="+wint+",left="+winl+"";
    oWindow = window.open(srcFile,'_blank', strFeatures);
    
    oWindow.document.open();
    oWindow.document.writeln("<style>body{margin: 0px;} a{font-family: Arial, Helvetica, sans-serif; font-size:11px; color:#5E5E5E;}</style>");
    oWindow.document.writeln("<img src='" + srcFile + "' onClick='window.close();'>");
    oWindow.document.writeln("<center><a href='JavaScript:window.close();'>[x] inchide</a></center>");
    oWindow.document.close();
    
    oWindow.focus();
}

function expandColapse(elementID)
{
    var element = document.getElementById(elementID);
    var hdnElement = document.getElementById("hdn" + elementID);

    if (hdnElement.value == 1)
    {
        hdnElement.value = 0;
        element.style.display = "none";
        document.getElementById("exp" + elementID).innerHTML = "[+]";
    }
    else
    {
        hdnElement.value = 1;
        element.style.display = "block";
        document.getElementById("exp" + elementID).innerHTML = "[-]";
    }
}
