function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
   {
      anchor.target = "_blank"; 
   }
 } 
}

function gallery( ps_url, ps_id, ps_attributes )
{
   if( ps_attributes == null ) 
   {
      ps_attributes = 'height=380,width=530,location=no,menubar=no,resizable=no,top=50,left=50,scrollbars=no,status=no,titlebar=yes,toolbar=no';
   }
   else
   {
      ps_attributes = 'height=380,width=530,location=no,menubar=no,resizable=no,top=50,left=50,scrollbars=no,status=no,titlebar=yes,toolbar=no';
   }
   var ps_id = window.open(ps_url, ps_id, ps_attributes);
   if( ps_id!=null ) ps_id.focus();
}

function galleryPopup( ps_path, ps_id )
{
   ps_attributes = "height=275,width=300,location=no,menubar=no,directories=no,top=50,left=50,scrollbars=no,status=no,titlebar=yes,toolbar=no";
   var ls_altText = ps_id.replace(/.jpg/,"");
   ls_altText=ls_altText.replace(/\s/g,'_');
   ls_galleryWindow = window.open( '', ls_altText, ps_attributes );
   var ls_content = ls_galleryWindow.document;
   ls_content.write( '<html>\r\n' );
   ls_content.write( '   <head>\r\n\r\n' );
   ls_content.write( '      <title>' + ls_altText + '</title>\r\n' );
   ls_content.write( '      <link rel="stylesheet" type="text/css" href="/style/gallery.css">\r\n\r\n' );
   ls_content.write(    '</head>\r\n' );
   ls_content.write(    '<body>\r\n\r\n' );
   ls_content.write(    '      <!-- Page content starts here -->\r\n\r\n' );
   ls_content.write(    '      <img src="' + ps_path + '" width="300" height="275" border="0"  alt="' + ls_altText + '" />\r\n' );
   ls_content.write(    '      <p class="button" id="galleryButtons"><a href="javascript:close();" title="Close this window">Close</a> <a href="javascript:print();" title="Print this image">Print</a></p>\r\n\r\n' );
   ls_content.write( '   </body>\r\n' );
   ls_content.write( '</html>\r\n' );
   ls_content.close();
   if( ps_id!=null ) ps_id.focus();
}