﻿// JScript File

var targetWindow = "";
var resetPageActionFlag = false;
var visibleIdPanel;
        
function setPanelVisibility(panelId, panelVisibility)
{
    //alert(panelId);
    try
    {
        visibleIdPanel.style.visibility = "hidden";
    }
    catch (e)
    {
        //ignore
    }
    visibleIdPanel = document.getElementById(panelId);
    visibleIdPanel.style.visibility = panelVisibility;
}      


function openAPopup(winName, Width, Height, resizable)
{
//    if (winName == "HRSAHPOLHelpPage")
//    {
//        thePopupWin = window.open('Help.aspx', winName,'location=no,menubar=yes,status=no,toolbar=no,resizable=' + resizable + ',scrollbars=yes,titlebar=yes,top=25,left=25,height=' + Height + ',width=' + Width ,true); 
//    }
//    else
//    {
        thePopupWin = window.open('Wait.aspx', winName,'location=no,menubar=no,status=no,toolbar=no,resizable=' + resizable + ',scrollbars=yes,titlebar=yes,top=25,left=25,height=' + Height + ',width=' + Width ,true); 
//    }
    targetWindow = winName;
    thePopupWin.focus();
    return true;
}

function setTarget(theForm)
{
    if (targetWindow != "")
    {
        theForm.target = targetWindow;
        targetWindow = "";
        resetPageAction(true);
    }
    else
    {
        theForm.target = "";
        if (resetPageActionFlag) 
        {
            theForm.action = pageName;
        }
    }
    return true;
}

function resetPageAction(flag)
{
    resetPageActionFlag = flag;
}

function closeMe()
{
    window.close();
    return false;
}

function printMe()
{
    window.print();
    return false;
}



//mange the search tab buttons toggle
var tabImages = new Array();
var tabImg;
function preLoadSearchImages()
{
    tabImg = new Image;
    tabImg.src = "images/SearchByAddressWhite.gif"
    tabImages[0] = tabImg
    
    tabImg = new Image;
    tabImg.src = "images/SearchByAddressCyan.gif"
    tabImages[1] = tabImg
    
    tabImg = new Image;
    tabImg.src = "images/SearchByAreaWhite.gif"
    tabImages[2] = tabImg
    
    tabImg = new Image;
    tabImg.src = "images/SearchByAreaCyan.gif"
    tabImages[3] = tabImg
}

function swapImage(theImg, imgIndex)
{
    theImg.src = tabImages[imgIndex].src;
}

preLoadSearchImages();
