
 function show_idx()
 {
    location.hash=g_cur_photo;
 }
var g_cur_photo;
              
 function alb_show_enl(n)
{
	g_cur_photo = n;
	
  // document.getElementById('indexz').innerHTML=' '

    document.getElementById('imagez').innerHTML='<IMG SRC="' +  g_alb_photos_enl[ g_cur_photo]   + '" class="enl-img"> <br>'
    document.getElementById('captionz').innerHTML=' '+  g_alb_captions[ g_cur_photo] +''
    document.getElementById('filez').innerHTML=' ' +g_alb_photos_enl[ g_cur_photo].substring(2)    + ''
   
           //document.getElementById('thumbnails').innerHTML='test'
      
//       parent.parent.alb_thumbs.location.replace("thumbs.htm?id=" + n);
//parent.parent.alb_contents.location.replace("toc.htm#" + n);
  

}

function alb_first()
{
  //  alb_slideshow_stop();
	alb_show_enl(0);
}

function alb_last()
{
//	alb_slideshow_stop();
	alb_show_enl(g_alb_photos_idx.length - 1);
}

function alb_prev()
{
//	alb_slideshow_stop();
	if (g_cur_photo > 0)
		alb_show_enl(g_cur_photo - 1);
}

function alb_next()
{
  //  alb_slideshow_stop();
	if (g_cur_photo < g_alb_photos_idx.length - 1)
		alb_show_enl((g_cur_photo - 0) + 1);
}

 //write index to a string
function generate_index2(nRowSize)
{
	labels_and_filenames_above_image = true;
   // init_page();
  // document.writeln('<div id="indexz">');

   myIndex = '<TR>';
	for (i = 0; i < g_alb_photos_idx.length; i++) {
   myIndex = myIndex + '<TD VALIGN=MIDDLE ALIGN=CENTER class="idx-td" >';
	    
             
 myIndex = myIndex + '<IMG class="idx-img" SRC="' + g_alb_photos_idx[i] + '"  onClick="alb_show_enl(\'' + i +'\')" BORDER=0 VALIGN=MIDDLE ALIGN=CENTER>';
     	
      
	  myIndex = myIndex + '<\/TD>';
		if ((i + 1) % nRowSize == 0)
		  myIndex = myIndex +'<\/TR><TR>';
	}
   myIndex = myIndex + '<\/TR>';

   
    document.getElementById('imagez').innerHTML=''
document.getElementById('captionz').innerHTML=''
document.getElementById('filez').innerHTML=' '
     



}
    
/* this method gets an element by its name.
its called by: onmouseover="highlight_img(\'' + i +'\')"
it can be performed by: onmouseover="this.style.borderColor=\'#00ff00\';"  

either saving the id to a var and then applying the style to the var
   // var aInput=document.getElementById(n);
   // aInput.style.borderColor='#00ff00'

or applying to the element works
 // document.getElementById(n).style.borderColor='#00fff0'
  
 the element must first be retrieved (the page must know the object), then the style can be applied   
   
    */
function highlight_img(n,x)
{
if (document.getElementById) {
  if (x==1)
  document.getElementById(n).style.borderColor='#ffff00'
else 
     document.getElementById(n).style.borderColor='#ff0000'
     
}
}




 /*
#403610 
 #8c0000 red in background
ereebf - light yellow for picture background
#a85028; = date header
#d0aa3c; = background under the title
#dbbf4e;
#ee3c0c;
#c63008;
#f45d3f;
#e7d564; = the yellow in the main of the page

    */


//writes index as a ul\li
function generate_index3()
{

   document.writeln('<ul>');
	for (i = 0; i < g_alb_photos_idx.length; i++) {
     
      //these 2 lines do the same thing, i did it to test passing a name and doing something with it...

  // 	document.write('<li><IMG name=' + i + ' SRC="' + g_alb_photos_idx[i] + '" onmouseover="this.style.borderColor=\'#00ff00\';"  onmouseout="this.style.borderColor=\'#ff0000\';"  onClick="alb_show_enl(\'' + i +'\')"> ');
   	document.write('<li><IMG id="' + i + '" SRC="' + g_alb_photos_idx[i] + '" onmouseover="highlight_img(\'' + i +'\',1)"  onmouseout="highlight_img(\'' + i +'\',2)"  onClick="alb_show_enl(\'' + i +'\')"> ');

      
	   		document.writeln('<\/li>');
	}
  
    document.writeln('<\/ul>');

   }




