var loader = { 
  imgs: [],
  load: function(src) {img=this.imgs; var ct=img.length; img[ct]=new Image();img[ct].src=src;}
};
$(function() {

  $(document).pngFix();

  /* roll over */
  $("a.ro").each(function() { loader.load($(this).children('img').attr('src').replace(/(\.[a-z]{3})$/i,"_on$1"));});
  $("a.ro").mouseover(function() {
    var src=$(this).children('img').attr('src');
    $(this).children('img').attr('src', src.replace(/(\.[a-z]{3})$/i,"_on$1"));
  });
  $("a.ro").mouseout(function() {
    var src=$(this).children('img').attr('src');
    $(this).children('img').attr('src', src.replace(/_on/,""));
  });
  
  /* lightbox */
  root='/';
  $('a[@rel*=lightbox]').lightBox({
		imageLoading:  root+'images/lightbox-ico-loading.gif',
		imageBtnClose: root+'images/lightbox-btn-close.gif',
		imageBtnPrev:  root+'images/lightbox-btn-prev.gif',
		imageBtnNext:  root+'images/lightbox-btn-next.gif'
  });

});

function navSelect(num) {
  if (!num) { return;}
	t = "#global-nav #nav"+num+" a";
  $(t).removeClass("ro");
	src = $(t).children('img').attr('src');
	$(t).children('img').attr('src', src.replace(/(\.[a-z]{3})$/i,"_sel$1"));
	//$(t).addClass('selected');
}


