﻿// JScript File

    var curMenu = new Array();
    var timerID;
    
    function Rect(top,left,width,height) {
        this.top = top;
        this.left = left;
        this.width = width;
        this.height = height;
    }

	function GetElementRect(obj) {
    
        var left = 0;
        var top = 0;
        for(pObj = obj; pObj != null; pObj = pObj.offsetParent) {
            left += pObj.offsetLeft;                
            top += pObj.offsetTop;
        }
        
        var width = obj.offsetWidth;
        var height = obj.offsetHeight;
        
        return new Rect(top,left,width,height);

    }

    function InitPSIImages() {
        var timeout;
        var i = 1
            
          var img = document.getElementById("img" + i);
          img.imgIndex = 1;

          timeout = 2000;
          self.setTimeout("SwapImage(" + i + ")", timeout);
    }

    function SwapImage(index) {
        
        var img = document.getElementById("img" + index);
        
        img.imgIndex++;
		//This is the number of images you want to cycle - currently set to 4
        if(img.imgIndex > 4)
            img.imgIndex = 1;

        img.swap = false;
		//This is the image folder and name - currently images/csi_banner_<number>.gif (i.e. csi_banner_1.gif, csi_banner_2.gif...)
        TransitionImage(img,"images/csi_banner_" + (img.imgIndex) + ".gif");    
        self.setTimeout("SwapImage(" + index + ")", 6000);
    }

	function TransitionImage(img, src) {
    
			try {
				 FadeImage(img.id,2,src);
			}
			catch(e) {
			    img.src = src;
			}
    
    }
