jQuery(document).ready(function($) {
  // $() will work as an alias for jQuery() inside of this function
/* $('#slider').cycle({
		 fx:      'custom', 
    sync: 0, 
    cssBefore: {  
        top:  260, 
        bottom: 250, 
        display: 'block',
		cleartype: true, cleartypeNoBg: false
    }, 
    animIn:  { 
        top: 0 ,
		cleartype: true, cleartypeNoBg: false
    }, 
    animOut: {  
        top: 250 ,
		cleartype: true, cleartypeNoBg: false
    },	
    delay: -500,
	cleartype: true, cleartypeNoBg: false
	});
 */
  $('.show_detail').cycle({
		 fx:      'fade', 
pause:  2,
cleartype: true, cleartypeNoBg: false
	});


});

jQuery(document).ready(function($) {
  // $() will work as an alias for jQuery() inside of this function

		//transitions
		//for more transition, goto http://gsgd.co.uk/sandbox/jquery/easing/
		var style = 'easeOutElastic';
		
		//Retrieve the selected item position and width
		var default_left = Math.round($('#main_menu_container li.selected').offset().left - $('#main_menu_container').offset().left);
		var default_width = $('#main_menu_container li.selected').width();

		//Set the floating bar position and width
		$('#box').css({left: default_left});
		$('#box .head').css({width: default_width});

		//if mouseover the menu item
		$('#main_menu_container li').hover(function () {
			
			//Get the position and width of the menu item
			left = Math.round($(this).offset().left - $('#main_menu_container').offset().left);
			width = $(this).width(); 

			//Set the floating bar position, width and transition
			$('#box').stop(false, true).animate({left: left},{duration:3000, easing: style});	
			$('#box .head').stop(false, true).animate({width:width},{duration:3000, easing: style});	
		
		//if user click on the menu
		}).click(function () {
			
			//reset the selected item
			$('#main_menu_container li').removeClass('selected');	
			
			//select the current item
			$(this).addClass('selected');
	
		});
		
		//If the mouse leave the menu, reset the floating bar to the selected item
		$('#main_menu_container').mouseleave(function () {

			//Retrieve the selected item position and width
			default_left = Math.round($('#main_menu_container li.selected').offset().left - $('#main_menu_container').offset().left);
			default_width = $('#main_menu_container li.selected').width();
			
			//Set the floating bar position, width and transition
			$('#box').stop(false, true).animate({left: default_left},{duration:3000, easing: style});	
			$('#box .head').stop(false, true).animate({width:default_width},{duration:3000, easing: style});		
			
		});
		
	});

jQuery(document).ready(function($) {
  // $() will work as an alias for jQuery() inside of this function

	$('ul#filter a').click(function() {
		$(this).css('outline','none');
		$('ul#filter .current').removeClass('current');
		$(this).parent().addClass('current');
		
		var filterVal = $(this).text().toLowerCase().replace(' ','-');
				
		if(filterVal == 'all') {
			$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
		} else {
			
			$('ul#portfolio li').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
		}
		
		return false;
	});
});

