
function readStaticImages(){
	var h = document.getElementById("photo_list");
	h.style.display = "none";
	var l = h.getElementsByTagName( "li" );
	var img, file, descr, extra1;
	reorderArgs( "file","title","description","width","height","extra1","extra2","extra3","extra4","date" );
	for (var i=0; i < l.length; i++){
		img = l[i].getElementsByTagName( "img" );
		if (img.length > 0){
			descr = l[i].getElementsByTagName( "blockquote" );
			extra1 = l[i].getElementsByTagName( "h6" );
			file = new String(img[0].src);
			file = file.substr(file.lastIndexOf("/")+1);
			addImg( 
				file,
				img[0].alt,
				(descr.length > 0)?descr[0].innerHTML:"",
				img[0].getAttribute('xwidth'),
				img[0].getAttribute('xheight'),
				(extra1.length > 0)?extra1[0].innerHTML:"" );
		}
	}
	h.innerHTML = "";
}

// ---------------------------------------------------------------------
// Function: mySlideshow
// Descr:    a local function wraps the photo gallery's slideshow function
//           so visual cue (the anchor) can be displayed
// ---------------------------------------------------------------------
function mySlideshow(){
	var s= document.getElementById("myslides");
	if (toggleSlideshow()) {
		s.innerHTML="Stop Slideshow";
		s.className="stop";
	} else {
		s.innerHTML="Start Slideshow";
		s.className="start";
	}
} // mySlideshow

function doInstantGallery(imgDir){
	// gonna set some defaults settings here, fell free to override them later
	setLoadingImg( "images/photos/image-loading.gif" );
  setSpacer( "images/shim.gif" );
	// setSetDescrWidth( true );

	setThumbWidth( 110 );
	setThumbClass( "thumb" );
	setThumbSpacing( 5 );
	setThumbAll( true );
	
  setElementId( "pages", "pgidx" );
  setElementId( "thumbs", "picture_thumbnails" );
  setElementId( "image", "theimage" );
  setElementId( "description", "picdescr" );
  setElementId( "title", "pictitle" );
	setElementId( "link", "permalink" );
	setElementId( "extra1", "locale" );
  //setElementId( "info", "picinfo" );
	
  setAutoScroll(true);

	setDefDims( 500, 333 );
	setImgDir(imgDir);
	setThumbDir( imgDir+"thumbs/" );
	setCols( 4 );
	setRows( 1 );

	// now let's read picture info from Static HTML
	readStaticImages();
	
	// now blast in the pizza gallery
	writeGallery();	
	enableQuickKeys();

	/*
	document.getElementById("picshim").width= getValue( "maxwidth" );
	*/
} // doInstantGallery