function moveLayer(strMovID) {
    this.iInitialpoint = 0;   
    this.iWidth = 11; 	        
    this.iNumberOfImages = 0;  
    this.iCount = 0;          
    var iLeader = 1;   
    var iLeft = 0; 	  
    var oVisDiv = new Array(this.iNumberOfImages);				    
    var MediaData = new Array();				    
    var TimeOutID;
    var msobj = this;
    msobj.Start = function() { msobj.doIt('left', 1) }
    msobj.Startleft = function() { msobj.doIt('right', 4) }
    msobj.Startright = function() { msobj.doIt('left', 4) }
    
    var isFirefox = (navigator.userAgent.search("Firefox") != -1) ? true : false; 


    this.startScroll = function() {
        this.stopScroll();
        if (isFirefox)
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Start, 40) : "";
		else
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Start, 30) : "";
    }    

    this.stopScroll = function() {
	    clearInterval(TimeOutID);
    }

    this.scrollmLeft = function() {
        this.stopScroll();
        if (isFirefox)
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Startleft, 20) : "";
		else
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Startleft, 15) : "";	
    }

    this.scrollmRight = function() {
        this.stopScroll();
        if (isFirefox)
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Startright, 20) : "";
		else
			TimeOutID = (this.iNumberOfImages > this.iCount) ? window.setInterval(msobj.Startright, 15) : "";	
    }

    makeData = function(imageclickId, Width, Height) {
	    this.imageclickId = imageclickId;
	    this.Width = Width;
	    this.Height = Height;
	    return true;
    }

    this.loadVisibleDiv = function() {
        if (document.layers) {
            for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {
                oVisDiv[iCnt] = document.layers[strMovID + iCnt];
            }
        } else if (document.all) {
            for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {
                oVisDiv[iCnt] = document.all[strMovID + iCnt].style;
            }
        } else if (document.getElementById) {
            for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {
                oVisDiv[iCnt] = document.getElementById(strMovID + iCnt).style;
            }
        }
        for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {
            document.getElementById(strMovID + iCnt).onmouseover = function() { msobj.stopScroll(); }
            document.getElementById(strMovID + iCnt).onmouseout = function() { msobj.startScroll(); }
            MediaData[iCnt] = new makeData(iCnt, parseInt(oVisDiv[iCnt].width) + this.iWidth, 0);
        }
    }
    this.doDefault = function() {
	    var iLocal;
	    var iAddIncr; 
	    iLocal = iLeader;
	    iAddIncr = this.iInitialpoint;

	    for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {

		    oVisDiv[iLocal].left = (iLeft + iAddIncr) + "px";

		    iAddIncr += MediaData[iLocal].Width;
		    iLocal += 1;
	    }
    }

    this.doIt = function(move, speed) {
	    var iLocal; 
	    var iAddIncr;
	    iLocal = iLeader;
	    iAddIncr = this.iInitialpoint;

	    for (var iCnt = 1; iCnt <= this.iNumberOfImages; iCnt++) {

		    oVisDiv[iLocal].left = (iLeft + iAddIncr) + "px";

		    iAddIncr += MediaData[iLocal].Width;
		    iLocal += 1;
		    if (iLocal > this.iNumberOfImages) {
			    iLocal = 1
		    }
	    }

	    if (move == "left") {
 
		    if (iLeft <= -(MediaData[iLeader].Width + 1)) {
			    iLeft = 0;

			    iLeader += 1;

			    if (iLeader > this.iNumberOfImages) {
				    iLeader = 1;
			    }
		    }
		    iLeft -= speed;

	    } else {			    
	        if (iLeft >= 1) {
	            iLeader -= 1;


	            if (iLeader < 1) {
	                iLeader = this.iNumberOfImages;
	            }
	            iLeft = 0 - (parseInt(MediaData[iLeader].Width));
		    }
		    iLeft += speed;
	    }
    }
}


