function loadJS() {
     					   
	$("#header").hover(function() {		  
				$(this).find("a").animate({ color: "#eee" }, 600);
        },function() {
				$(this).find("a").animate({ color: "#eee" }, 600);

        });   

	
		 			   
   
	$(".box").hover(function() {		  
               // $(this).animate({ backgroundColor: "#ffffff" }, 400);
				
			 
				//$(this).find("h1 a").animate({ color: "#FC0" }, 600);
				$(this).find(".content a").animate({ color: "#666" }, 600);
				//$(this).find(".category a").animate({ color: "#FC0" }, 600);
                $(this).animate({ borderTopColor: "#666",borderLeftColor: "#666",borderRightColor: "#666",borderBottomColor: "#666"   }, 600);
				$(this).find("a img ").stop().animate({ opacity: 0.1 }, 500);
         

        },function() {
                 //$(this).animate({ backgroundColor: "#0f0f0f" }, 400);     
				// $(this).find("h1 a").animate({ color: "#fff" }, 600);
				 $(this).find(".content a").animate({ color: "#eee" }, 600);
				// $(this).find(".category a").animate({ color: "#666" }, 400);
                 $(this).animate({ borderTopColor: "#0f0f0f",borderLeftColor: "#0f0f0f",borderRightColor: "#0f0f0f",borderBottomColor: "#0f0f0f"   }, 600);
				 $(this).find("a img").stop().animate({ opacity: 1 }, 500);
    });
	
	$('.box h1 a,.box .content a,.box .category a').click(function(){
	  var link = $(this).attr('href');
	  window.location = link;
	});
	
	
  
	/* 
	$("#pagenation").hover(function() {		  
				$(this).find("a").animate({ color: "#FC0" }, 600);
        },function() {
				$(this).find("a").animate({ color: "#eee" }, 600);

    });
   
    $('a.ajaxit').ajaxify({ 
		  loading_target:'#header #loading',
		  loading_txt:'',
		  loading_img:'http://localhost:8888/refruit/wp-content/themes/xmomorobo/images/ajax-loader.gif',		  
		  target:'#grid-content',
		  loadHash:'attr:href',
          tagToload:'.box',
		  animateOut:true,
          animateOutSpeed:500,
		  animateIn:true,
          animateInSpeed:500,	
		  cache:false,
		  title:'attr:title',
		  onComplete: function(op){				      
		  		loadJS() ;					
		  }
	});
	*/


	$('a#thephoto').fancybox(
		{
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'fade',
			'speedIn'		:	900, 
			'speedOut'		:	800, 
			'cyclic'        :   true,
			'centerOnScroll' :   true,
			'titlePosition'  :  'over',
			'changeSpeed'    :  600,
			'changeFade'     :  600,
			'easingIn'      : 'swing',
			'easingOut'     : 'swing',
			'overlayShow'	:	true,
			'overlayColor'  : '#000',
			'overlayOpacity' : 0.7,
			'titleFormat'    : function(title, currentArray, currentIndex, currentOpts) {
			 return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + '  * ' + title + '</span>';}
		}					  
							  
	);
        

}

$(document).ready(function() {
	
       
					   
	function moveFloatMenu() {
		var menuOffset = menuYloc.top + $(this).scrollTop() + "px";
		$('#header').animate({top:menuOffset},{duration:600,queue:false});
	}
 
	menuYloc = $('#header').offset();
 
	$(window).scroll(moveFloatMenu);
 
	moveFloatMenu();				   
						   
	
        /*
	$(window).bind('load', function(){
	       $('.box img').css({visibility:'visible', opacity:0.01}).fadeTo(2000,1);
									
        });  
*/
						   
	
	
		
	
	 
	

	
	$('#contact').hide();
	$('#work').hide();
	$('#profile').hide();
	
	$('a#contact-butt').click(function() {
         $('#contact').slideToggle(400);
		 $('#work').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	$('a#shop-butt').click(function() {
		 $('#work').slideUp(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	$('a#log-butt').click(function() {
		 $('#work').slideUp(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	$('a#profile-butt').click(function() {
		 $('#work').slideUp(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideToggle(400);
         return false;
    });
	$('a#work-butt').click(function() {
         $('#work').slideToggle(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	$('a#buzz-butt').click(function() {
         $('#work').slideUp(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	
	$('#container').click(function() {
		 $('#work').slideUp(400);
		 $('#contact').slideUp(400);
		 $('#profile').slideUp(400);
         return false;
    });
	
	
	
	var hsort_flg = false;

	//setup
	var vg = $('#grid-content').vgrid({
		easeing: "easeOutQuint",
		time: 400,
		delay: 20,
		fadeIn: {
			time: 500,
			delay: 50
		}
	});
	
       
         $('body').load($('#loadingScreen').fadeOut());
        
	
	loadJS();
	 
	
	
});






