﻿// JScript File

function ToggleWindow(img,pnl)
{
    var p = document.getElementById(pnl);
    var i = document.getElementById(img);
    if( p.style.display == "none")
    {
        p.style.display="";
        if(i)
            i.src=minus.src;
    }
    else
    {
        if(i)
            i.src=plus.src;
        p.style.display="none";
    }
}
function ToggleDiv(pnl)
{
    var p = document.getElementById(pnl);
    if( p.style.display == "none")
    {
        p.style.display="";
    }
    else
    {
        p.style.display="none";
    }
}

function RedirectLink(id)
{
    if( id==0)
    {
        window.location="default.aspx";
    }
    else if(id==-1)
    {
        window.location="Archive.aspx";
    }
    else if(id==-2)
    {
        window.location="Subscripe1.aspx";
    }
    else
    {
        window.location="StaticContent.aspx?id="+id;
    }
}
function Redirect(index)
{

    if(index==1)
    {
        window.location="default.aspx";
    }
    else if(index==2)
    {
        window.location="StaticContent.aspx?id=1";
    }
    else if(index==3)
    {
        window.location="StaticContent.aspx?id=2";
    }
    
    else if(index==5)
    {
        window.location="SiteFeed.aspx";
    }
    else if(index==4)
    {
        window.location="Archive.aspx";
    }
    else if(index==6)
    {
        window.location="Subscripe1.aspx";
    }
    else if(index==7)
    {
        window.location="Jobs.aspx";
    }
    else if(index==8)
    {
        window.location="ContactUs.aspx";
    }
    else if(index==9)
    {
        window.location="SubscribeNews.aspx?id=1";
    }
    else if(index==10)
    {
        window.location="SubscribeNews.aspx?id=2";
    }
}
function listen(evnt, elem, func) 
{
    if (elem.addEventListener) // W3C DOM
        elem.addEventListener(evnt,func,false);

    else if (elem.attachEvent) 
    { // IE DOM
        var r = elem.attachEvent("on"+evnt, func);
        return r;
    }
    else 
        window.alert('I\'m sorry Dave, I\'m afraid I can\'t do that.');
}
function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;

    return true;
}