// JavaScript Document
// Gallery display

<!-- // hide from old browsers

var base = 'http://wdc.csulb.edu/depot/img/buttons/gallery/';

function changeImages(imgname,newimgsrc){
	document.images[imgname].src = base+newimgsrc
}

function openGallery(theURL) { //v2.0
	winName = 'alumniGallery'
	features = 'width=520,height=625,resizable=1'
	foo = window.open(theURL,winName,features);
	foo.focus();
}

// Draws a thumbnail selection based on the args provided.  Check out Kaleidoscope for a working
// example.
// assumes count starts at one, no zfill, all images in an img/ subdirectory
function DrawThumbnailTable(cols,rows,imgcount,lnkprefix,lnksuffix,imgprefix,imgsuffix,alttext,height,width){
	  imgdir = 'img/'
	  document.write('<table  border="0" cellspacing="3" cellpadding="5"><tr>')
	  count = 1
	  while (count<=(cols*rows)){
	  	lnk = lnkprefix+String(count)+lnksuffix
		//document.write('lnk='+lnk+'<br>');
		img = imgdir+imgprefix+String(count)+imgsuffix
		// write a cell
		if (count>imgcount){
			// we've run out of images, draw a blank cell
			content = '&nbsp;'
		} else {
			// show an image
			content = '<a href="#" \
			onclick="openGallery(\''+lnk+'\')"><img height="'+height+'" width="'+width+'" \
			src="'+img+'"  vspace="0" hspace="0" border="0"  alt="'+alttext+'" /></a>'
		}
	  	document.write('<td width="'+width+'">'+content+'</td>');
		// insert a column break when necessary
		if(count%cols==0 && count<imgcount){ document.write('</tr><tr>') };
		// increment the counter
		count += 1
	  }
	  document.write('</tr></table>')
}
// -->

