﻿//framebreaker
if (top != self) top.location.href = location.href;

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 Search()
{
    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 != "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 != "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";
    }
}

function ShowWorking(a_show, a_hide)
{
    ShowHide(a_show,a_hide);
}

function ShowHeadlines(a_show)
{
    var l_headlines = new Array("eHeadlines", "lHeadlines", "gHeadlines", "sHeadlines", "hHeadlines");

    //hide all of the headlines
    for (l_i = 0; l_i < l_headlines.length; l_i++)
    {
        if (document.layers)
        {
            document.layers(l_headlines[l_i]).style.display = "none";
            document.layers(l_headlines[l_i] + "Link").className = "inactive";
        }
        else
        {
            document.getElementById(l_headlines[l_i]).style.display = "none";
            document.getElementById(l_headlines[l_i] + "Link").className = "inactive";
        }
    }
    
    //show the correct one
    if (document.layers)
    {
        document.layers(a_show).style.display = "block";
        document.layers(a_show + "Link").className = "active";
    }
    else
    {
        document.getElementById(a_show).style.display = "block";
        document.getElementById(a_show + "Link").className = "active";
    }
}

function ShowVideos(a_show) {
    var l_videos = new Array("eVideos", "lVideos", "gVideos", "sVideos", "hVideos");

    //hide all of the Videos
    for (l_i = 0; l_i < l_videos.length; l_i++) {
        if (document.layers) {
            document.layers(l_videos[l_i]).style.display = "none";
            document.layers(l_videos[l_i] + "Link").className = "inactive";
        }
        else {
            document.getElementById(l_videos[l_i]).style.display = "none";
            document.getElementById(l_videos[l_i] + "Link").className = "inactive";
        }
    }

    //show the correct one
    if (document.layers) {
        document.layers(a_show).style.display = "block";
        document.layers(a_show + "Link").className = "active";
    }
    else {
        document.getElementById(a_show).style.display = "block";
        document.getElementById(a_show + "Link").className = "active";
    }
}
