// JavaScript Document
/*
 * Copyright (c) 2011 Giang Nguyen.
 *
 */
 
Cufon.replace('h1'); 
Cufon.replace('h2'); 
Cufon.replace('#mew h3');

jQuery(function(){
		jQuery('#loader').css("visibility", "hidden");
});

jQuery(document).ready(function(){
  jQuery(".button a")
    .css({  'backgroundPosition': '0 0' })
    .hover(
      function(){
        jQuery(this)
          .stop()
          .animate({
            'opacity': 0.75
          }, 500);
      },
      function(){
        jQuery(this)
          .stop()
          .animate({
            'opacity': 1
          }, 500);
      }
    );
});

jQuery(document).ready(function(){
  jQuery("#mew a")
    .css({  'backgroundPosition': '0 0' })
    .hover(
      function(){
        jQuery(this)
          .stop()
          .animate({
            'opacity': 0.6
          }, 500);
      },
      function(){
        jQuery(this)
          .stop()
          .animate({
            'opacity': 1
          }, 500);
      }
    );
});

var nav  = [ '#works a', '#about a', '#contact a' ];

jQuery(document).ready(function(){  
	for ( i = 0; i < nav.length; i++ ) {  
		jQuery(nav[i]).bind( 'mouseover', {id: i}, function(event) {
			_x = event.data.id*(-160);
			jQuery(this).stop().animate( { backgroundPosition: _x + 'px 54px' }, 100) 
		}); 
		
		 
		jQuery(nav[i]).bind( 'mouseout', {id: i}, function(event) {
			_x = event.data.id*(-160);
			jQuery(this).stop().animate( { backgroundPosition: _x-15 + 'px 54px' }, 100) 
		}); 
	}
});

