/*******************************************/
/*  Copyright 2001,2002,2003 - Jon Dunfee  */
/*  http://www.3b.net/globaljs             */
/*  last updated: August 29, 2003          */
/*  Permission granted for unlimited use   */
/*  so far as the copyright notice above   */
/*  remains intact.                        */
/*******************************************/
/****************************************** DHTML Common Scripts */
function divStyle(theDiv)
{
    if (document.getElementById) { return document.getElementById(theDiv).style; }
    return eval("document."+((document.all)?"all."+theDiv+".style":theDiv));
}
function moveDiv(thisDiv,L,T,Z)
{
    if(L != "relative") {(document.all)?divStyle(thisDiv).pixelLeft = L:divStyle(thisDiv).left = L;}
    if(T != "relative") {(document.all)?divStyle(thisDiv).pixelTop = T:divStyle(thisDiv).top = T;}
    if(Z) { divStyle(thisDiv).zIndex = Z; }
}

function clipDiv(thisDiv,cT,cR,cB,cL)
{
    if (navigator.appName.indexOf("Opera") == -1)
    {
        if (document.all || document.getElementById) { divStyle(thisDiv).clip = "rect("+cT+" "+cR+" "+cB+" "+cL+")"; }
        else
        {
            divStyle(thisDiv).clip.top = cT;
            divStyle(thisDiv).clip.bottom = cB;
            divStyle(thisDiv).clip.left = cL;
            divStyle(thisDiv).clip.right = cR;
        }
    }
}

function showDiv()
{ 
    for(var sDi=0;sDi<showDiv.arguments.length;sDi++)
    {
        if (document.getElementById) { node = document.getElementById(showDiv.arguments[sDi]).style.visibility='visible'; }
        else divStyle(showDiv.arguments[sDi]).visibility = "visible";
    }
}

function hideDiv()
{
    for(var hDi=0;hDi<hideDiv.arguments.length;hDi++)
    {
        if (document.getElementById) { node = document.getElementById(hideDiv.arguments[hDi]).style.visibility='hidden'; }
        else divStyle(hideDiv.arguments[hDi]).visibility=(document.all)?"hidden":"hide";
    }
}
/****************************************** DHTML Additional Scripts */
function transStyle(dur,trans)
{
    var navApp = navigator.appVersion;
    if(navApp.substring(navApp.indexOf("MSIE")+5,navApp.indexOf("MSIE")+8) >= 5.5 && dur)
    {
        if(trans < 24)
        {
            return "filter:revealTrans(duration="+dur+",transition="+trans+");";
        }
        else
        {
            return "filter:blendTrans(duration="+dur+");";
        }
    }
    return "";
}

function transDiv(thisDiv,dur,trans)
{
    var navApp = navigator.appVersion;
    if(navApp.substring(navApp.indexOf("MSIE")+5,navApp.indexOf("MSIE")+8) >= 5.5 && trans)
    {
        var theDiv = document.getElementById(thisDiv);
        hideDiv(thisDiv);
        if(theDiv.filters && trans == 24)
        {
            theDiv.filters.blendTrans.Duration=dur;
            theDiv.filters.blendTrans.stop();
            theDiv.filters.blendTrans.apply();
            showDiv(thisDiv);
            theDiv.filters.blendTrans.play();        
        }
        else if (theDiv.filters && trans < 24 && trans > 0)
        {
            theDiv.filters.revealTrans.Transition=((trans)?trans:23);
            theDiv.filters.revealTrans.Duration=dur;
            theDiv.filters.revealTrans.stop();
            theDiv.filters.revealTrans.apply();
            showDiv(thisDiv);
            theDiv.filters.revealTrans.play();        
        }
        else
        {
            showDiv(thisDiv);
        }
    }
    else
    {
        showDiv(thisDiv);
    }
}

function fadeDiv(theDiv,speed,show,alpha)
{
    var alpha = (alpha)?alpha+10:10;
    hideDiv(theDiv);
    if(document.all)
    {
        document.getElementById(theDiv).style.filter = "alpha(opacity="+((show)?alpha:100-alpha)+")";
    }
    showDiv(theDiv);
    if(alpha < 100)
    {
        setTimeout("fadeDiv('"+theDiv+"',"+speed+","+show+","+alpha+")",speed);
    }
    else if(!show)
    {
        hideDiv(theDiv);
    }
}
/****************************************** Simplified Document.Write */
function w(theText)
{
    document.write(theText);
}

function wl(theText)
{
    document.writeln(theText);
}

/****************************************** Image Manipulation */
function newImage(theImgLoc)
{
    if (document.images)
    {
        var theNewImg = new Image();
        theNewImg.src = theImgLoc;
        return theNewImg;
    }
}

function swapImg(theImg, theSrc, theDiv)
{
    if(theDiv)
    {
        if(document.getElementById)
        {
            eval("document.getElementById(theImg).src = "+theSrc+".src");
        }
        else
        {
            (document.all)?eval("document.images."+theImg+".src = "+theSrc+".src"):eval("document."+theDiv+".document.images."+theImg+".src = "+theSrc+".src");
        }
    }
    else
    {
        if(document.getElementById)
        {
            eval("document.getElementById(theImg).src = "+theSrc+".src");
        }
        else
        {
            eval("document.images."+theImg+".src = theSrc.src");
        }
    }
}
/****************************************** Additional Image Manipulation */
function transImg(thisImg,img,dur,trans,div)
{
    var div = (div)?div:false;
    var navApp = navigator.appVersion;
    if(navApp.substring(navApp.indexOf("MSIE")+5,navApp.indexOf("MSIE")+8) >= 5.5 && trans)
    {
        var theImg = document.getElementById(thisImg);
        if(theImg.filters && trans < 24 && trans > 0)
        {
            theImg.filters.revealTrans.Transition=((trans)?trans:23);
            theImg.filters.revealTrans.Duration=dur;
            theImg.filters.revealTrans.stop();
            theImg.filters.revealTrans.apply();
            swapImg(thisImg,img,div);
            theImg.filters.revealTrans.play();
        }
        else if(theImg.filters && trans == 24)
        {
            theImg.filters.blendTrans.Duration=dur;
            theImg.filters.blendTrans.stop();
            theImg.filters.blendTrans.apply();
            swapImg(thisImg,img,div);
            theImg.filters.blendTrans.play();
        }
        else
        {
            swapImg(thisImg,img,div);
        }
    }
    else
    {
        swapImg(thisImg,img,div);
    }
}

/****************************************** Input Focus Color Change */
function inputFocus(f,t)
{
    f.style.backgroundColor = (t)?"#FEF8E2":"#ffffff";
}

/****************************************** Disable Right Click on Images */
var clickmessage="All images are copyrighted and may not be used\nwithout express written permission from SESI."

document.writeln('<meta http-equiv="imagetoolbar" content="no">'); // Removes IE popup toolbar

function disableclick(e)
{
    if (document.all)
    {
        if (event.button==2||event.button==3)
        {
            if (event.srcElement.tagName=="IMG")
            {
                alert(clickmessage);
                return false;
            }
        }
    }
    else if (document.layers)
    {
        if (e.which == 3)
        {
            alert(clickmessage);
            return false;
        }
    }
    else if (document.getElementById)
    {
        if (e.which==3 && e.target.tagName=="IMG")
        {
            alert(clickmessage);
            return false;
        }
    }
}

function associateimages()
{
    for(i=0;i<document.images.length;i++)
    {
        document.images[i].onmousedown=disableclick;
    }
}

if (document.all)
{
    document.onmousedown=disableclick;
}
else if (document.getElementById)
{
    document.onmouseup=disableclick;
}
else if (document.layers)
{
    associateimages();
}
