// Picture Show

document.write("\r\n<style type=\"text/css\">#noscript{display: none;}</style>");

MM_preloadImages('images/misc/loading.gif');

function displayImages() {
		var allpics = document.getElementById('noscript').getElementsByTagName('img');
		var tnails = [];
		var mp = "<img src=\"images/misc/blank.gif\" name=\"largeImage\" height=\"" + mphigh + "\" id=\"largeImage\" onMouseOver=\"pageAdjust()\">";
		var m = 0;
		swapImage('largeImage','images/misc/blank.gif',''); //insert('div','mainpic','',mp);
		for(i=0; i<allpics.length; i++) {
			m++;
			imgSrc = allpics[i].src;
			imgClass = allpics[i].className;
			if(imgClass != "") {iClass = " class=\"" + imgClass + "\"";} else {iClass = "";}
			tnails += "\r\n<li><a href=\"javascript:;\" onMouseOver=\"swapImage('largeImage','" + imgSrc + "','" + imgClass + "'); pageAdjust()\"><img src=\"" + imgSrc + "\" " + tdim + iClass + "></a></li>\r\n";
			if(m == t) {insert("ul",'',"thumbnails",tnails); m=0; tnails="";}
			if(m < t && i == allpics.length-1) {insert("ul",'',"thumbnails",tnails); m=0; tnails="";}
		}
}

function insert(e,id,cn,c) {
	var newInsert = "";
	if(e) {newInsert = document.createElement(e);}
	if(id) {newInsert.id = id;}
	if(cn) {newInsert.className = cn;}
	if(c) {newInsert.innerHTML = c;}
	if(newInsert) {document.getElementById('maincontent').appendChild(newInsert);}
	return;
}

function pageAdjust() {
	window.scrollTo(0,scrollDown);
}

function thumbCss() {
	document.write("\r\n<style type=\"text/css\">.thumbnails li {width: "+twide+"px; height: "+thigh+"px; overflow: hidden;}</style>\r\n");
}

function mainCss() {
	document.write("\r\n<style type=\"text/css\">#mainpic {width: 500px;}\r\n#mainpic img {position: absolute; bottom: 0; margin: 0 auto;}</style>\r\n");
}

