var carouselpos = 0;
var carouselwidth = 0;
var carousel2pos = 2115;
var carousel2width = 0;

function carouselmoveleft() {
	carouselwidth = document.getElementById("collectionCarouselList").offsetWidth
	carousel2width = document.getElementById("collectionCarouselList2").offsetWidth
	
	if (carouselpos <= 0 && carouselpos >= -940) {
		carousel2pos = carouselpos + parseInt(document.getElementById("collectionCarouselList").offsetWidth);
		document.getElementById("collectionCarouselList2").style.left = carousel2pos + 'px';
	}
	if (carousel2pos <= 0 && carousel2pos >= -940) {
		carouselpos = carousel2pos + parseInt(document.getElementById("collectionCarouselList2").offsetWidth);
		document.getElementById("collectionCarouselList").style.left = carouselpos + 'px';
	}
	
	carouselpos -= 470;
	carousel2pos -= 470;
	var myAnim = new YAHOO.util.Anim('collectionCarouselList', { 
	left: { to: carouselpos }
	}, 1, YAHOO.util.Easing.easeBothStrong);
	myAnim.animate();
	var myAnim2 = new YAHOO.util.Anim('collectionCarouselList2', { 
	left: { to: carousel2pos }
	}, 1, YAHOO.util.Easing.easeBothStrong);
	myAnim2.animate();
}

function carouselmoveright() {
	carouselwidth = parseInt(document.getElementById("collectionCarouselList").offsetWidth);
	carousel2width = parseInt(document.getElementById("collectionCarouselList2").offsetWidth);
	
	if (carouselpos <= 0 && carouselpos >= -940) {
		carousel2pos = carouselpos - parseInt(document.getElementById("collectionCarouselList").offsetWidth);
		document.getElementById("collectionCarouselList2").style.left = carousel2pos + 'px';
	}
	if (carousel2pos <= 0 && carousel2pos >= -940) {
		carouselpos = carousel2pos - parseInt(document.getElementById("collectionCarouselList2").offsetWidth);
		document.getElementById("collectionCarouselList").style.left = carouselpos + 'px';
	}
	
	carouselpos += 470;
	carousel2pos += 470;
	var myAnim = new YAHOO.util.Anim('collectionCarouselList', { 
	left: { to: carouselpos }
	}, 1, YAHOO.util.Easing.easeBothStrong);
	myAnim.animate();
	var myAnim2 = new YAHOO.util.Anim('collectionCarouselList2', { 
	left: { to: carousel2pos }
	}, 1, YAHOO.util.Easing.easeBothStrong);
	myAnim2.animate();
}

function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
}
