/*******************************************/
/*  Copyright 2001 - Jon Dunfee            */
/*  http://www.3b.net/globaljs             */
/*  last updated: July 17, 2001            */
/*  Permission granted for unlimited use   */
/*  so far as the copyright notice above   */
/*  remains intact.                        */
/*******************************************/
/****************************************** NS Resize Script */
if (document.layers)
{
   origWidth = innerWidth;
   origHeight = innerHeight;
}
function resizeDetected()
{
   if (document.layers)
   {
      if (innerWidth != origWidth || innerHeight != origHeight)
      {
         // location.reload();
   		location.href = location.href;
      }
   }
}

/****************************************** 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 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(thisDiv)
{ 
    if (document.getElementById) { node = document.getElementById(thisDiv).style.visibility='visible'; }
    else divStyle(thisDiv).visibility = "visible"
}

function hideDiv(thisDiv)
{
    if (document.getElementById) { node = document.getElementById(thisDiv).style.visibility='hidden'; }
    else divStyle(thisDiv).visibility=(document.all)?"hidden":"hide";
}

/****************************************** 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\nwithout express written permission from Dataproducts Plus, Inc"

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();
}