// JavaScript Document

var albumId;
var picArr = new Array();
var picSize = 400;
var timerArr = new Array();

function movePhotoPrev(uniqueId){
	var box = document.getElementById(uniqueId);
	var top = parseInt(box.style.top);
	if(top < 0){
		 setBigBoxY(parseInt(top) + picSize, box);
	}else{
		var count = box.getElementsByTagName("div").length;
		var maxY = (count-1) * picSize;
		 setBigBoxY((-1 * (maxY)), box);
	
	}
	
}
function movePhotoNext(uniqueId){
	var box = document.getElementById(uniqueId);
	var top = parseInt(box.style.top);
	if(isNaN(parseInt(top))){
		top = 0;	
	}
	var count = box.getElementsByTagName("div").length;
	var maxY = (count-1) * picSize;
	if(top > (-1 * maxY)){
		
		 setBigBoxY(parseInt(top) - picSize, box);
	}else{
		 setBigBoxY(0, box);
	}
	
}

function stopCount(uniqueId){
	clearInterval(timerArr[uniqueId]);
}

function setBigBoxY(nY, box){

   var effect = new Fx.Style(box.id, 'top', {
      duration: 200,
      transition: Fx.Transitions.Sine.easeInOut
   });

   var top = document.getElementById(box.id).style.top;
       if (top == "")
         top = 0;

   effect.start(parseInt(nY));	
}






// Photo object

function picture(nPictureId, nFileId, nAlbumId, nShortDesc){
	this.pictureId = nPictureId;
	this.fileId = nFileId;
	this.albumId = nAlbumId;
	this.shortDesc = nShortDesc;
	//initLoad of photo
	
}
