$(function()
{
	ie6_fix_height();
	js_border();
	ie6_fix_menu_hover();
	portfolio_hover();
	js_open();
});

function ie6_fix_height()
{
	if($.browser.msie && $.browser.version=="6.0")
	{
		$('#background').height($(document).height());
	}
	if($('#background').height() > $('#website').height())
	{
		$('#website').height($('#background').height());
	}
}

function ie6_fix_menu_hover()
{
	$('#menu li:not(#menu li li)').hover(function()
	{
		$(this).addClass('hover');
	}
	,function()
	{
		$(this).removeClass('hover');
	});
}

function js_border()
{
	$('.js-border').hover(function()
	{
		$(this).parent().css({'position' : 'relative', 'overflow' : 'hidden', 'width' : $(this).width() - 4, 'height' : $(this).height() - 4, 'border' : '2px solid #054982'});
		$(this).css({'position' : 'relative', 'left' : '-2px', 'top' : '-2px'});
	},
	function()
	{
		$(this).parent().css({'border' : '0px none', 'width' : $(this).width(), 'height' : $(this).height()});
		$(this).css({'position' : 'relative', 'left' : 'auto', 'top' : 'auto'});
	});
}

function portfolio_hover()
{
	$('#portfolio2 ul li .inner').hover(function()
	{
		$(this).css('background', '#e3ebf1');
	}
	,function()
	{
		$(this).css('background', '#f7eee6');
	});
}

function js_open()
{
	$('.js-open').hover(function()
	{
		var id = $(this).attr('id').replace('js-open-key-', '');
		$('#js-open-' + id).parent().find('li').css({'position' : 'absolute', 'left' : '-9999px', 'top' : '-9999px'});
		$('#js-open-' + id).css({'position' : 'relative', 'left' : 'auto', 'top' : 'auto'});
	},function()
	{
	});
}
