(function(){

	$.fn.extend({
	
		menuDrop : function(){
		
			$(this).each(function(){
				$(this).click(function(){
					$(this).find('ul').slideDown('fast').show();
				}).hover(function(){}, function(){
					$(this).find('ul').slideUp('slow');
				});
			});
		
		}
	
	});
	
	$(document).ready(function(){
		$('#lang > li').menuDrop();	
		$(document).bind("contextmenu",function(e){
        	return false;
        });
	});
	
	$(window).load(function(){
		
		$('#cycle').cycle({
			fx : 'fade'
		});
		
		if($('#last_project').size() > 0){
			var last = $('#last_project');
			var rh = last.height()+10;
			last.css('top', '-'+rh+'px');
		}
		
		
		var f_h = -1;
		$('.footer_menu_insideul').each(function(){
			
			if($(this).height() > f_h){
				f_h = $(this).height();
			}
		});
		f_h += 23;
		
		$('.footer, .push, #footer_menu').each(function(){
			$(this).height(f_h)
		});
		f_h += 19;
		$('.wrapper').css('margin', '0 auto -'+f_h+'px');
		
		if($('#last_project').size() > 0){
			$('.push').each(function(){
				$(this).height(rh)
			});
		}
		
		$('.plus').each(function(){
			$(this).hover(function(){
				$(this).find('.plus_info').show();
			}, function(){
				$(this).find('.plus_info').hide();
			});
		});
		
		$('#accordion').accordion({
			autoHeight : false
		});
		
		$('.gallery_link').fancybox({
			centerOnScroll : true,
			overlayColor : '#4d8727'
		});
		
		$('.last_info').jScrollPane();
		
		$('#with_submenu').hover(function(){
			$(this).css('text-indent', '2px');
			$(this).find('.submenu_span').css('background-color', '#e4e4e7');
			$(this).find('ul').hide().show();
		}, function(){
			$(this).css('text-indent', '0px');
			$(this).find('.submenu_span').css('background-color', 'transparent');
			$(this).find('ul').hide();
		});
		
	});
  
})()
