///////////////////////////////////////////////////////////////////////////////
// cartanim.js - scrolling cart images javascript
//
// Warren Mann
//
// This javascript sets up and implements a scrolling window effect.
//
// REQUIRES
//
//	jslib.js
//
// HISTORY
//
//	2003.03.14, v. 0.0.1
// 	created - wm.
//
// ----------------------------------------------------------------------------
// Copyright (c) 2001-2002, R&D Associates, Inc., All rights reserved.
// ----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without
// modification, are not permitted under any conditions except with
// the  expressed written consent by R&D Associates, Inc. or one of its
// principals. Furthermore, this source and all technologies contain within
// are the property of R&D Associates, Inc. and may not be disclosed to any
// party without the expressed written consent of R&D Associates, Inc. or one
// of its principals.
//
// In the event that premission is granted to reuse or modify this source,
// the following conditions must be met:
//
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in
//    the documentation and/or other materials provided with the
//    distribution.
//
// 3. All advertising materials mentioning features or use of this
//    software must display the following acknowledgment:
//    "This product includes software developed by R&D Associates, Inc."
//
// 4. Redistributions of any form whatsoever must retain the following
//    acknowledgment:
//    "This product includes software developed by R&D Associates, Inc."
//
// THIS SOFTWARE IS PROVIDED BY R&D ASSOCIATES, INC. ``AS IS'' AND ANY
// EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL R&D ASSOCIATES, INC. OR
// ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
///////////////////////////////////////////////////////////////////////////////

var spam = 0;
var x1 = 0;
var x2 = -1068;



function scroll_carts( speed ) {

	var cart_win = document.getElementById( "cartwin" );
	var win_width = client_width();
	var cart_buf1 = document.getElementById( "cartbuffer1" );
	var cart_buf2 = document.getElementById( "cartbuffer2" );
	
	cart_win.style.width = win_width + "px";
	
	if ( x1 == win_width ) {
		x1 = 0;
		x2 = -1068;
	}
	else {
		x1++;
		x2++;
	}

	cart_buf1.style.left = x1 + "px";
	cart_buf2.style.left = x2 + "px";
	
	spam = setTimeout( 'scroll_carts(' + speed +')', speed );
}
