function findimglinksforlightbox()
{
 var links,i;
// loop through all links of the document
 links=document.getElementsByTagName('a');
 for(i=0;i<links.length;i++)
 { 
   // perhaps check if parent node is <li> so all menu links etc will be skipped ?
   // test if the src links to an image (.jpg, .jpeg, .gif, .png)
  
  if(links[i].href.substring(links[i].href.length-4,links[i].href.length)==".jpg" | links[i].href.substring(links[i].href.length-5,links[i].href.length)==".jpeg" | links[i].href.substring(links[i].href.length-4,links[i].href.length)==".gif" | links[i].href.substring(links[i].href.length-4,links[i].href.length)==".png")
  {   // a href links to an image file so we can use with lightbox
	  // set the rel value to 'pgpswimg' if not already
	  if(links[i].rel == '') {links[i].rel = 'pgpswimg';}
	  if(links[i].rel != 'pgpswimg') {links[i].rel = 'pgpswimg ' + links[i].rel;}
  }
  
 }
}