jQuery(function($) { 

	//IE6
	if ($.browser.msie){
		if ($.browser.version <= 6){
			$('#nav li, #meta-nav li').hover(
				function(){ $(this).addClass('hover'); },
				function(){ $(this).removeClass('hover'); }
			);
		}
	}
	
	//Subnav
	$('#subnav li:last-child').addClass('last-child');
	
	//Subnav height
	var $column = $('#column');
	var $content = $('#content');
	var _padding = ($column.is('.small'))?40:98;
	if (($column.height()+_padding) < ($content.height())) {		
		$column.height($content.height()-_padding-15);
	}
	
	//Dialog
	$('.dialog').dialog({
		autoOpen: false,
		width: 652,
		height: 411,
		modal: true
	});
	
	$('#portfolio a').each(function(){
		var _id = this.href.split('#')[1];
		$(this).click(function(){
			$('#'+_id).dialog('open');
			return false;
		});
	});
	
	//Slide
	var slide = function(){
		$slideWrapper = $('#slide-wrapper');
		$slide = $('#slide');
		$slideWrapper.find('.next, .prev').show();
		$slide.css('overflow', 'hidden');
		$slide.find('ul').css('width', '9000px');
		
		$slide.serialScroll({
			items: 'li',
			prev: '#slide-wrapper .prev',
			next: '#slide-wrapper .next',
			duration: 500,
			force: true,
			stop: true,
			lock: false,
			cycle: true
		});
	};
	
	slide();
	
});