
function EncodeCart()
{
	var length = document.shopping_cart.elements.length;
	var elements = document.shopping_cart.elements;

	var message = ""

	for ( i = 0; i < length; i++ )
	{
		if ( elements[i].type == "text" )
		{ 
        	message += elements[i].name + "=" + parseInt(elements[i].value) + "&";
		}
	}
	return message;
}
function EncodeAndUpdateCart(send)
{
	var post = EncodeCart();
	update_cart(post,send);
}







function ScrollHandler()
{
	
	scroller = 0;
	if ( document.body )
	{
		scroller = document.body.scrollTop;
	}
	else if ( document.documentElement )
	{
		scroller = document.documentElement.scrollTop;
	}
	var value = scroller - 112;
	if ( value < 0 )
		value = 0;
	
	
	scroll_position = value;
	

}

function ScrollInterval()
{
	
	move_cart = document.getElementById('floating_cart');
	pos = parseInt(move_cart.style.top);

	
	diff = scroll_position - pos;
	
	
	if ( diff >= 0 )
		jump = Math.ceil(diff / 3);
	else
		jump = Math.floor(diff / 3);
	
	move_cart.style.top = jump + pos;

	
	setTimeout("ScrollInterval()",100);
}


function ScrollHandlerSnap()
{
	
	
	scroller = 0;
	if ( document.body )
	{
		scroller = document.body.scrollTop;
	}
	else if ( document.documentElement )
	{
		scroller = document.documentElement.scrollTop;
	}
	var value = scroller - 112;
	if ( value < 0 )
		value = 0;
	move_cart.style.top = value;
}

