
$(document).ready(function() {

	$('.activeMenu').each(function (){
		$(this).attr('src',this.src.replace( /01.gif$/, '03.gif' ));
	});

  $('#menu img').mouseover(function(){
      $(this).attr('src',this.src.replace( /01.gif$/, '02.gif' ));
    }).mouseout(function(){
      if(!$(this).hasClass('activeMenu')){
        $(this).attr('src',this.src.replace( /02.gif$/, '01.gif' ));
      }
    });

	$('.twitter img').mouseover(function(){
      $(this).attr('src',this.src.replace( /.png$/, '-over.png' ));
    }).mouseout(function(){
        $(this).attr('src',this.src.replace( /-over.png$/, '.png' ));
    });


  $('.lightbox').lightBox();
  $('.slidebarImg').lightBox();

  // Load video
  $('#youtube_video').click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'none',
				'easingIn'      : 'easeOutBack',
				'title'			: this.title,
				'width'			: 854,
				'height'		: 510,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
									'wmode'				: 'transparent',
									'allowfullscreen'	: 'true'
								  }
			});
	
		return false;
	});
});

var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}
var Lightbox = Class.create();

Lightbox.prototype = { start : function(elementLink) {
  var image = String(elementLink);
  var imageID = image.substring(image.lastIndexOf('/')+1).replace('.jpg','');    
  $('#sbImg' + imageID).click();
} } 
