// JavaScript Document

//NOTES
//If using different frames, the frame names need to be... 
//          thumbs (this is for the thumbnails) 
//          bigpics (this is for the large pictures)
//They both need to be controlled from a parent frame
//

////// important.... do not create any variables pXXX where XXX is any number (such as p1, p4, p53, etc.)  --- variables pXXX are loaded from the html header (photoTitles.txt).


var path="images/";  //path to images
var startimgsrc = path + "p1.jpg";
var picwritein ='<br><br><img align="center" height=400px id=pic src="' +  startimgsrc + '">';
var titlewritein = '<div id=titdiv><textarea readonly="readonly" aling="center" cols="60" id="txt" value="'+p1+'"/>'+p1+'</textarea></div><br><a id="linktxt" href="images/p1.jpg">Click Here for Full Size</a> ';

function initThumbView() {
	var maxnum=number_of_images+1;  // number_of_images is found in the html header (photoTitles.txt).
	
	document.write('<span><td width="300"><center><br><br>');
	document.write('<div id=navdiv>')
	for (var x=1; x<maxnum;x++)
	{ 
		//insert our images into page
		var passedsrc=  "'" + "p" + x + ".jpg" + "'";  
		var smallsrc= path + "p" + x + "_thumb.jpg";
		var tmpsrc= '<a class=navs href="#" onclick="showpic(' + passedsrc +  '); return false;" ><img id=navpics src="' + smallsrc + '" height="75" width="75"></a>';
		document.write(tmpsrc); //prints out small images
	}
	
	//uncomment below if thumbnails and picture are in same frame...else call each function seperately from each frame.
	//initImgView();

};

function initImgView() {
	titlewritein = '<div id=titdiv><textarea readonly="readonly" aling="center" cols="60" id="txt" value="'+p1+'">'+p1+'</textarea></div>';
	linkwritein = '<br><a id="linktxt" href="images/full/p1.jpg" target="_blank">Click Here for Full Size</a><br>Warning...this opens a new window';
	document.write('<center>');
	document.write(picwritein);  //prints out big image
	document.write(titlewritein);//prints out label
	document.write(linkwritein);//prints out fill size link
	document.write('</center>');
};
   
function loadthisimg(imgref) { 
	document.getElementById(imgref).style.visibility='hidden';
};

function showpic(imgno) {
	var tmp1=imgno.split('.');
	var tmp2=path + imgno; //full path with file name
	parent.bigpics.document.getElementById('pic').src=tmp2;
	parent.bigpics.document.getElementById('txt').value=eval(tmp1[0]);
	parent.bigpics.document.getElementById('linktxt').href="images/full/"+imgno;
};