/* Constructor * PARAMS:	thumb_list - array of thumbIDs *			first_thumb - the index of the first_thumb to be shown */function ThumbSlider(thumb_list, active_pid, num_thumbs){	this.num_thumbs = num_thumbs; // the number of thumbs that are displayed	this.thumbList = thumb_list; // the list of thumb IDs		window_padding = Math.floor(this.num_thumbs/2); // find the number of padding images in the viewing window	currIndex = 0;	this.first_index = 0; // the first thumb index 	found = false; // flag to see if a match has occured	//alert('before loop window_padding = '+window_padding);	for(i = 0; i< window_padding; i++)	{				//alert('array value = '+this.thumbList[currIndex]+'\nactive_pid = '+active_pid);		// check if the pid is in the first few, so there is no need to move the first_index		if(this.thumbList[currIndex] == active_pid)		{			found = true; // change the flag			//alert('found');		}		else			currIndex++; // not found so move to the next	}		while(!found && currIndex < this.thumbList.length -window_padding-1)	{		if(this.thumbList[currIndex] == active_pid)		{			found = true; // change the flag			//alert('found');		}		else		{	currIndex++; // not found so move to the next			this.first_index++;		}	}		currIndex = this.first_index;	for(i = 0; i< this.num_thumbs; i++)	{//		alert('thumb_'+this.thumbList[currIndex]);		currThumb = document.getElementById('thumb_'+this.thumbList[currIndex]);		currThumb.style.display = "inline";		currIndex++;	}}/* Function to hide the leftmost thumb and show the next one */ThumbSlider.prototype.moveRight = function(){	// check to see if it can still move previous ie thumb left at the end	right_thumb = this.first_index + this.num_thumbs;	if(right_thumb < this.thumbList.length)	{		// get the first of the thumbs that is displayed		leftThumb = document.getElementById('thumb_'+this.thumbList[this.first_index]);		leftThumb.style.display = "none";				nextThumb = document.getElementById('thumb_'+this.thumbList[right_thumb]);		nextThumb.style.display = "inline";			this.first_index++; // move the first index up one	}}/* Function to hide the rightmost thumb and show the previous one */ThumbSlider.prototype.moveLeft = function(){	// check to see if it can still move previous ie thumb left at the end	left_thumb = this.first_index -1;	//alert('next_thumb = '+next_thumb+'\nthumbList length = '+this.thumbList.length);	right_thumb = this.first_index + this.num_thumbs;	if(this.first_index > 0)	{		// get the first of the thumbs that is displayed		leftThumb = document.getElementById('thumb_'+this.thumbList[this.first_index - 1]);		leftThumb.style.display = "inline";				rightThumb = document.getElementById('thumb_'+this.thumbList[right_thumb - 1]);		rightThumb.style.display = "none";			this.first_index--; // move the first index down one	}}ThumbSlider.prototype.changePhoto = function(){	}ThumbSlider.prototype.addThumb = function(thumbID){	this.thumbList.push(thumbID);}
