var tWid = 780;
var m=0;
var n=tWid;
mwid = -1 * tWid;
nwid = -1 * tWid;
var speed=5000;
var ImgArry = new Array();
var MaxImgCnt = 0;
var CurImgIdx = 0;
//alert("Load");

function handleImgClick(InvIdx) {
	var tNewLoc = "/inventory/wrightway-detl.php?invitemidx=" + InvIdx + "&hassearch=0";

	window.document.location = tNewLoc;
}
function scrollPics() {
    document.getElementById('div1').style.left=m+'px';
    document.getElementById('div2').style.left=n+'px';
    m--;
    n--;
    if(m==mwid) {
        m=tWid;
    }
    if(n==nwid) {
        n=tWid;
    }
    setTimeout('scrollPics()',speed);
}
function changePics() {
	var PicElement = document.getElementById('chgpic1');

	PicElement.src = ImgArry[CurImgIdx];
	CurImgIdx++;
	if ( CurImgIdx >= MaxImgCnt ) CurImgIdx = 0;
    setTimeout('changePics()',speed);
}
window.onload=function() {
    changePics();
}

