/****************************************** New Document.Write */
function w(theText)
{
    document.write(theText);
}

function wl(theText)
{
    document.writeln(theText);
}

/****************************************** 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) { (document.all)?divStyle(thisDiv).pixelLeft = L:divStyle(thisDiv).left = L; }
   if(T) { (document.all)?divStyle(thisDiv).pixelTop = T:divStyle(thisDiv).top = T; }
   if(Z) { divStyle(thisDiv).zIndex = Z; }
}
function divVal(thisDiv,whichVal)
{
    if(whichVal == "L")
    {
        if (document.getElementById) return document.getElementById(thisDiv).offsetLeft;
        else return ((document.all)?eval('document.all.'+thisDiv+'.offsetLeft'):divStyle(thisDiv).left);
    }
    if(whichVal == "T")
    {
        if (document.getElementById) return document.getElementById(thisDiv).offsetTop;
        else return ((document.all)?eval('document.all.'+thisDiv+'.offsetTop'):divStyle(thisDiv).top);
    }
    if(whichVal == "Z")
    {
        if (document.getElementById) return document.getElementById(thisDiv).zIndex;
        else return ((document.all)?eval('document.all.'+thisDiv+'.zIndex'):divStyle(thisDiv).zIndex);
    }
}
function clipDiv(thisDiv,cT,cR,cB,cL)
{
   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 i=0;i<showDiv.arguments.length;i++)
    {
        if (document.getElementById) { node = document.getElementById(showDiv.arguments[i]).style.visibility='visible'; }
        else divStyle(showDiv.arguments[i]).visibility = "visible";
    }
}

function hideDiv()
{
    for(var i=0;i<hideDiv.arguments.length;i++)
    {
        if (document.getElementById) { node = document.getElementById(hideDiv.arguments[i]).style.visibility='hidden'; }
        else divStyle(hideDiv.arguments[i]).visibility=(document.all)?"hidden":"hide";
    }
}

function transDiv(thisDiv,dur,trans)
{
    if(navigator.userAgent.indexOf('MSIE 5.5')>0 || navigator.userAgent.indexOf('MSIE 6')>0)
    {
        var theDiv = document.getElementById(thisDiv);
        hideDiv(thisDiv);
        if(trans == 24)
        {
            theDiv.filters.blendTrans.Duration=dur;
            theDiv.filters.blendTrans.stop();
            theDiv.filters.blendTrans.apply();
            showDiv(thisDiv);
            theDiv.filters.blendTrans.play();        
        }
        else if (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);
    }
}

/****************************************** Image Manipulation */
function newImage(theImgLoc)
{
    if (document.images)
    {
        var theNewImg = new Image();
        theNewImg.src = theImgLoc;
        return theNewImg;
    }
} 

function swapImg(theImg, theSrc, theDiv)
{
    if(theDiv)
    {
        (document.all || document.getElementById)?eval("document.images."+theImg+".src = "+theSrc+".src"):eval("document."+theDiv+".document.images."+theImg+".src = "+theSrc+".src");
    }
    else
    {
        eval("document.images."+theImg+".src = "+theSrc+".src");
    }
}

/****************************************** Disable Right Click on Images */
var clickmessage="All images are copyrighted and may not be used without\nexpress written permission from Spine Center Atlanta"

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();
}