/* Force first pic to become active.. we have stored the big image url into the thumbs name property (dirtty!!!!) */

/*var first = document.getElementById('productfoto1');
if(first)
{

	img = '/resizer/resize.php?h=300&img='+encodeURIComponent(first.name);
	doSwapImage(img,false);
}
*/

/* Scrolling stuff */
var layer = document.getElementById('images_wrap');
var time;

function doScrollLeft(vertical)
{
	if (vertical != undefined && vertical == true) {
		layer.scrollTop = layer.scrollTop-5;
	} else {
		layer.scrollLeft = layer.scrollLeft-5;
	}
 	time = setTimeout('doScrollLeft(' + vertical + ')',20);
}

function doScrollRight(vertical)
{
	if (vertical != undefined && vertical == true) {
		layer.scrollTop = layer.scrollTop+5;
	} else {
 		layer.scrollLeft = layer.scrollLeft+5;
	}
 	time = setTimeout('doScrollRight(' + vertical + ')',20);
}


function doStopScroll()
{
	if(time) { clearTimeout(time); }
}


/* Swap image */
//function swapImage(src)
//{
//
//	src = '/resizer/resize.php?h=300&img='+encodeURIComponent(src);
//
//	/* Check if we need to do anything */
//	if(src != document.getElementById('productimagebig').src)
//	Effect.Fade('productimagebig',{duration: 0.2, afterFinish: function(){doSwapImage(src,true);}});
//
//}
//
//
//function doSwapImage(src,appear)
//{
////	if(appear) document.getElementById('productimagebig').display = 'none';
////
////	document.getElementById('productimagebig').src = src;
////
////	if(appear) 	Effect.Appear('productimagebig',{duration: 0.2});
//return true;
//}


