<!--

  function createWindow(cUrl,cName,cFeatures)
  {
  var xWin = window.open(cUrl,cName,cFeatures)
  }

	function openprinwin()
	{
	createWindow('prinwin.html','window1','width=800,height=600,scrollbars,status')
	}

  function view()
  {
  createWindow('picviewer.html','window1','width=800,height=780,scrollbars,status');
  }

function setpic(cIndex)
  {
	  picindex=cIndex;
  }
  
  thispic=new Array;
  thisname=new Array;
  picspec=new Array;
  fullwidth=new Array;

  var picindex = '0';

  var tn1 = '<IMG SRC="';
  var tn2 = '';
  var tn3 = '';
  var tn4 = '';
  var tn5 = '">';
  var tnail  = '';
  
  function set_ptnail(cIndex)
  {
  tn2 = folder+thispic[cIndex];
  tn3 = '" WIDTH="'+tnwid+'" BORDER="2" TITLE="';  
  tn4 = thisname[cIndex];
  tnail  = tn1+tn2+tn3+tn4+tn5;
  document.write(tnail);  
  }

    var picnum;
	 var firstpic;
	 var lastpic;
    var folder='images';
	 
	 function loadpics()
	 {
	 viewer.src = folder+opener.thispic[picnum];
    viewer.width=opener.fullwidth[picnum];
	 ptitle.innerHTML='<FONT COLOR="#660000"><B>'+opener.thisname[picnum]+'</B></FONT><BR><BR>';
	 if(picnum==firstpic)
	 	{
		ptnail.src="images/viewer.jpg";
		ntnail.src=folder+opener.thispic[picnum+1];
		return;
		}
	 if(picnum==lastpic)
	 	{
		ntnail.src="images/viewer.jpg";
		ptnail.src=folder+opener.thispic[picnum-1];
		return;
		}
	ptnail.src=folder+opener.thispic[picnum-1];
	ntnail.src=folder+opener.thispic[picnum+1];
	 }
 
	 function ini()
	 {
	 picnum=window.opener.picindex;
	 firstpic=1;
	 lastpic=opener.lastpic;
	 folder=opener.folder;
	 loadpics();
	 }
 
 	function prevpic()
	{
	picnum = picnum-1;
	if(picnum<1)
		{
		picnum=1;
		}
	loadpics();
	}
	
 	function nextpic()
	{
	picnum = picnum+1;
	if(picnum>lastpic)
		{
		picnum=lastpic;
		}
	loadpics();
	}

	var i=0
	function newrow(startpic,numcols)
		{
		document.write('<TABLE ALIGN="center" WIDTH="785" BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR>');
		for (i=startpic;i<startpic+numcols;i++)
			{
			document.write('<TD ALIGN="CENTER" ONMOUSEOVER="hlOn(this);" ONMOUSEOUT="hlOff(this)" ONCLICK="javascript:setpic('+i+');view();">');
			set_ptnail(i);
			}
		document.write('</TR></TABLE><HR WIDTH="785" HEIGHT="1" ALIGN="CENTER">');
		}

	var j;
	var lastrow;
	var tnwid;
	var colspace = 20;
	function showpics(grp,cols,numpics)
	{
		tnwid=Math.round((785/cols)-colspace);
		folder=folder + '/g' + grp + '/';
		lastrow=numpics%cols;
		for(j=1;j<numpics-lastrow;j+=cols)
			{
			newrow(j,cols);
			}
		if(lastrow>0)
			{
			newrow(j,lastrow);
			}
	}

	function hlOn(td){
	if(document.getElementById||(document.all && !(document.getElementById)))
		{
		td.style.backgroundColor="#C0C0E0";
//		td.style.cursor='hand'; don't work in Firefox		
		td.style.cursor='pointer';//Works in Firefox & IE		
		}
	}

	function hlOff(td){
	if(document.getElementById||(document.all && !(document.getElementById)))
		{
		td.style.backgroundColor="#FFFFE8";
		td.style.cursor='default';		
		}
	}


//-->
