﻿function popUp(url,width,height,scroll,resize)
{
	var left = screen.width/2 - width/2;
	var top = screen.height/2 - height/2;
	var popWin = window.open(url, "pop", "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",scrollbars=" + scroll + ",resizable=" + resize);
}

function GoogleSearch()
{
    this.document.forms["googleSearchFRM"].q.value = this.document.forms["aspnetForm"].q.value;
    for (l_i = 0; l_i < document.forms["aspnetForm"].sitesearch.length; l_i++ )
    {
        if (document.forms["aspnetForm"].sitesearch[l_i].checked == true )
        {
            this.document.forms["googleSearchFRM"].sitesearch.value = document.forms["aspnetForm"].sitesearch[l_i].value;
        }
    }
    this.document.forms["googleSearchFRM"].submit();
}

function Show(a_show)
{
    if (document.layers)
    {
        if (document.layers(a_show).style.display.toLowerCase() != "block")
        {//show it
            document.layers(a_show).style.display = "block";
        }
        else
        {//hide it
            document.layers(a_show).style.display = "none";
        }
    }
    else
    {
        if (document.getElementById(a_show).style.display.toLowerCase() != "block")
        {//show it
            document.getElementById(a_show).style.display = "block";
        }
        else
        {//hide it
            document.getElementById(a_show).style.display = "none";
        }
    }
}

function ShowHide(a_show, a_hide)
{
    if (document.layers)
    {
        document.layers(a_show).style.display = "block";
        document.layers(a_hide).style.display = "none";
    }
    else
    {
        document.getElementById(a_show).style.display = "block";
        document.getElementById(a_hide).style.display = "none";
    }
}

//these can be set on a page by page basis if needed
var processingIMG = "";
var processingSRC = "";

function ShowWorking(a_show, a_hide)
{
    ShowHide(a_show,a_hide);
    setTimeout("ProgressBar()", 100);
    window.status = "Working ...";
} 

function ProgressBar()
{
    document[processingIMG].src = processingSRC;
}

function ShowPageLink()
{
    document.write("<input type='text' value='<a href=\"" + document.location + "\">" + document.title + "</a>' onclick='this.select()' />");
}

function PageTitle()
{
    document.write(document.title);
}