var imgGallery = [
				"Gallery_zzz_PlaceHolder.jpg",
				
"DSH_bigdevil.jpg",
"CampusCreek_BottleOpener.jpg",
"Shape_Magnets.jpg",
"coasters.jpg",
"Carabiners.jpg",
"APS_WaistApron02-10.jpg",
"DukeHonor_CoffeeSleeve04-10.jpg",
"EnoValley_Tennis05-09.jpg",
"GlobalHealth_1ozSanitizer.jpg",
"Julians_ArgyleTs02-10.jpg",
"MaureenJoy_Circle12-09.jpg",
"PFADP_FryOkra01-10.jpg",
"PhoenixPhys_GolfBall06-09.jpg",
"PhoenixPhys_PigBank06-09.jpg",
"SAF_SoccerBall02-10.jpg",
"VIF_USBdrive11-08.jpg",
"WFM_Bonnaroo05-09.jpg",
"ADL_Bottle03-10.jpg",
"Gallery_zzz_PlaceHolder.jpg",
"Gallery_zzz_PlaceHolder.jpg",
"Gallery_zzz_PlaceHolder.jpg",
"Gallery_zzz_PlaceHolder.jpg",			
                                "Gallery_zzz_PlaceHolder.jpg"
				];
var imgTot = 12;
var pgNum = 1;
var pgTot = imgGallery.length/imgTot;
function galPg(dir) {
	if (dir) {
		pgNum += dir;
	}
	if (pgNum<1) {
		pgNum = pgTot;
	} else if (pgNum>pgTot) {
		pgNum = 1;
	}
	writeDiv('thumbCt', pgNum+" of "+pgTot);
	var thumbStart = ((pgNum-1)*imgTot)+1;
	var thumbs = '';
	for (var i=thumbStart; i<thumbStart+imgTot; i++) {
		if (imgGallery[i]) {
			thumbs += '<div class="thumb"><a href="#" onclick="openWin(\'popup.html?img='+imgGallery[i]+'\');"><img src="images/graphic/thumbs/'+imgGallery[i]+'" width="127" height="113" /></a></div>';
		}
	}
	writeDiv('thumbArray', thumbs);
}
// function : open popup window
var popWin;
function openWin(file) {
	if (!popWin || popWin.closed) {
		popWin = window.open(file, 'popup', 'width=360,height=360,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,directories=0');
	}
	if (window.focus) {
		popWin.focus();
	}
}
// write html to div
function writeDiv(id, text) {
	var div;
	if (document.getElementById) {
		div = document.getElementById(id);
		div.innerHTML = '';
		div.innerHTML = text;
	} else if (document.all) {
		div = document.all[id];
		div.innerHTML = text;
	} else if (document.layers) {
		div = document.layers[id];
		div.document.open();
		div.document.write(text);
		div.document.close();
	}
}
