﻿// JScript File


var ready
var photos
var current_pos
var slider_location
function initScroll(){
	current_pos = 0;
	slider_location=1;
	photos = document.getElementsByTagName('var');
	//photos = document.all.tags('img')
	ready=true;
	//alert(photos.length);
}

function move(new_pos){
	//alert(new_pos);
	if (ready){
		if (new_pos < 0){
			if (slider_location <= photos.length){
				//alert(current_pos)
				slider_location++
				current_pos = new_pos
				var move=true;
			} else {
				var move=false;
			}
		} else if (new_pos > 0){
			if (slider_location > 1){
				slider_location--
				//alert(new_pos);
				current_pos = new_pos
				
				var move=true;
			} else {
				var move=false;
			}
		}
		if (move == true){
		//alert(new_pos+" "+current_pos);
		var myAnim = new YAHOO.util.Motion('wrap', {points: 
					   { by: [current_pos, 0] }
					   }, 0.8, YAHOO.util.Easing.easeOut); 

		myAnim.animate();
		ready=false;
		setTimeout("ready=true", 1000);
		}
	}
}
