jQuery(document).ready(function($){
	
	//colorbox
  $("a[rel='colorboxpopup']").colorbox({
  	transition:"fade",
  	maxWidth: "60%"
  	});
  
	//menu categories animate
	$('#sidebar ul li a').mouseenter(function(){
		if(jQuery.browser.msie && parseInt(jQuery.browser.version.substr(0, 1)) <= 9)
 		{
	    $(this).animate({ 
	      color:		'#000000'
	    }, 180 );
	  } else {
	    $(this).animate({ 
	      fontSize: '1.5em',
	      color:		'#000000'
	    }, 180 );
	  }  	  	  
  });
  
  $('#sidebar ul li a').mouseleave(function(){
  	if(jQuery.browser.msie && parseInt(jQuery.browser.version.substr(0, 1)) <= 9)
 		{
	  	$(this).animate({ 
	      color:		'#666666'
	    }, 180 );
	  } else { 
	    $(this).animate({ 
	      fontSize: '1em',
	      color:		'#666666'
	    }, 120 );
	  }
  });
  
  //Mega Drop Down Menus V2
  jQuery('.description').hide();
	jQuery('#bt_description').css({width:'85px'}).hover(
		function () {
			//show its submenu
			jQuery('.description', this).css({width:'318px'}).slideDown(200);
		}, 
		function () {
			//hide its submenu
			jQuery('.description', this).slideUp(200);			
		}
	);	
	
	//hover animate list project	
  $('#project ul li a').hover(function(){
			$(this).animate({paddingLeft:'20px'},{queue:false,duration:180});
		}, function() {
			$(this).animate({paddingLeft:'15px'},{queue:false,duration:180});
	});
	
	//image scrolling
	$('div#makeMeScrollable').smoothDivScroll({
		scrollingSpeed: 5, 
		mouseDownSpeedBooster: 8, 
		autoScroll: "onstart", 
		autoScrollDirection: "backandforth", 
		autoScrollSpeed: 1, 
		visibleHotSpots: "onstart", 
		hotSpotsVisibleTime: 5
	});

	//fading page 	
	$('body').hide().fadeIn(1000);
	$('#content').hide().fadeIn(3000);
	
	//scroll div
	$('.scroll-pane').jScrollPane({
		scrollbarWidth: 7,
		scrollbarMargin : 10
	});
	
	//focus menu category
	$('#categories ul li a').each(function()
  {
  	pathname_array = location.pathname.split('/');
  	link_array = $(this).attr('href').split('/');
  	if (pathname_array.length > 2 && link_array.length > 2) link_array.length = pathname_array.length = 2;
  	if(pathname_array.join('/') == link_array.join('/'))
  	{
  	  $(this).addClass('active_cat');
  	 }
  });
  
  //focus menu navigation
	$('#navigation ul li a').each(function()
  {
  	if(location.pathname == $(this).attr('href'))
  	{
  	  $(this).addClass('active');
  	  return false;
  	}
  });
  
  //focus menu news
	$('#actus ul li a').each(function()
  {
  	if(location.pathname == $(this).attr('href'))
  	{
  	  $(this).addClass('active_proj');
  	  return false;
  	}
  });

	
});
