
$(document).ready(function() {

	$.ifixpng('/gfx/x.gif');
 	$('img[@src$=.png],h1#logo,h2#slogan,h1#title').ifixpng();

	$('a').focus( function() { this.hideFocus=true; } );

	$("div#slide a.photo").fancybox({
		'overlayOpacity' : 0.70,
		'overlayShow': true 
	}); 
	
});

function emailaddress()
{
	// encoded using mailto encoder by SOLMETRA (www.solmetra.com)
	var spaf_eml = [105,111,104,114,68,103,117,122,107,113,121,125,111,117,119,115,131,63,117,116];
	var spaf_txt = [105,111,104,114,68,103,117,122,107,113,121,125,111,117,119,115,131,63,117,116];
	var spaf_sub = [];
	document.write('<a href=\"mailto:');
	cnt = spaf_eml.length; for (i=0; i<cnt; i++) { document.write(String.fromCharCode(spaf_eml[i]-i)); }
	document.write('\">');
	cnt = spaf_txt.length; for (i=0; i<cnt; i++) { document.write(String.fromCharCode(spaf_txt[i]-i)); }
	document.write('</a>');
}

PEPS = {};

PEPS.rollover =
{
   init: function()
   {
      this.preload();
     
      $(".ro").hover(
         function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); },
         function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
      );
   },

   preload: function()
   {
      $(window).bind('load', function() {
         $('.ro').each( function( key, elm ) { $('<img>').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
      });
   },
   
   newimage: function( src )
   {
      return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_o' + src.match(/(\.[a-z]+)$/)[0];
   },

   oldimage: function( src )
   {
      return src.replace(/_o\./, '.');
   }
};
