
//Added by Yashma Gupta - March,2009

/// Total Projects
var totalProjects = 30;

/// Project Data Arrays
//src1 = ["../SignatureServicesNET/images/Concepts/Projects_In_Production/productionthumb1.jpg","../SignatureServicesNET/images/Concepts/Projects_In_Production/productionthumb2.jpg","../SignatureServicesNET/images/Concepts/Projects_In_Production/productionthumb3.jpg"];
//cap1 = ["amherst elevation", "amherst_h_142","amherst_v_142"];
//url1 = ["javascript:PopupPhotoByID(952,'large','')", "http://www.marvin.com","http://www.marvin.com"]; 


/// Onload Init to set captions

function init()
	{
//debugger;
	for(i=1;i<=totalProjects;i++){
		this['ct'+i] = 1;
		document.getElementById('cap'+i).innerHTML = eval('cap'+i)[0];
	}
}

/// Go to next thumbnail

function nextSlide(imageName) 
{
//debugger;
	tempCt = eval('ct'+imageName);
	tempSrc = eval('src'+imageName);
	tempCt++;
	updateSlideShow(imageName);
}

/// Go to previous thumbnail

function prevSlide(imageName) 
{
//debugger;
	tempCt = eval('ct'+imageName);
	tempSrc = eval('src'+imageName);
	tempCt--;
	updateSlideShow(imageName);
}

/// Update Slideshow

function updateSlideShow(imageName)
{
	//debugger;
	tempSrc = eval('src'+imageName);
	this['ct'+imageName] = tempCt;
	if(tempCt==1){
		document.getElementById('prev'+imageName).style.display = 'none';
		document.getElementById('next'+imageName).style.display = 'block';
	} else if(tempCt>0 && tempCt<tempSrc.length){
		document.getElementById('prev'+imageName).style.display = 'block';
		document.getElementById('next'+imageName).style.display = 'block';
	} else if(tempCt==tempSrc.length){
		document.getElementById('next'+imageName).style.display = 'none';
		document.getElementById('prev'+imageName).style.display = 'block';
	}
	if(tempSrc.length ==1){
		document.getElementById('prev'+imageName).style.display = 'none';
		document.getElementById('next'+imageName).style.display = 'none';
	}
	if(tempCt<=tempSrc.length){
		document.getElementById('thumb'+imageName).src = tempSrc[tempCt-1];	
	}
	document.getElementById('cap'+imageName).innerHTML = eval('cap'+imageName)[tempCt-1];	
}

/// Link out to URL from array

function doLink(imageName)
{
//debugger;
	tempCt = eval('ct'+imageName);
	tempUrl = eval('url'+imageName);
	location.href = tempUrl[tempCt-1];
}

/// Show/Hide a Project

function toggleVis(imageName) 
{
//debugger;
// Find the id's of the show/hide divs
	showID = document.getElementById('show'+imageName)
	hideID = document.getElementById('hide'+imageName)
       if(showID.style.display == 'block'){
          showID.style.display = 'none';
		  hideID.style.display = 'block';
		  /// Switch to down arrow
		  document.getElementById('arrow'+imageName).src = "images/Concepts/Projects_In_Production/arrow-down.gif";
		} else{
          showID.style.display = 'block';
		  hideID.style.display = 'none';
		  /// Switch to right arrow
		  document.getElementById('arrow'+imageName).src = "images/Concepts/Projects_In_Production/arrow-right.gif";
	   }
	/// Set the count to 1 and updated nav
	tempCt = 1
	updateSlideShow(imageName); 
	
	
	
}