/**
 * @author Enykey
 */

$(document).ready(function()
{
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) {
		$('.menu>.item').hover(function(){
			$(this).css({
				width: '86px',
				borderRight: '5px solid #CFCFCF'
			});
			$(('.cell'), this).css({
				width: '86px'
			});
			
			$(('a'), this).css({
				paddingRight: '4px'
			});
			$(('span'), this).animate({
				color: '#C50E20'
			}, {
				queue: false,
				duration: 150
			});
		}, function(){
			$(this).css({
				width: '90px',
				borderRight: '1px solid #CACACA'
			});
			$(('.cell'), this).css({
				width: '90px'
			});
			$(('a'), this).css({
				paddingRight: '8px'
			});
			$(('span'), this).animate({
				color: '#3F3F3D'
			}, {
				queue: false,
				duration: 150
			});
		});
	}
	else
	if (/MSIE (7).+Win/.test(navigator.userAgent)) {
		$('.menu>.item').hover(function(){
			$(this).css({
				width: '86px',
				borderRight: '5px solid #CFCFCF'
			});
			$(('.cell'), this).css({
				width: '86px'
			});
			$(('span'), this).css({
				marginRight: '4px'
			});
			$(('span'), this).animate({
				color: '#C50E20'
			}, {
				queue: false,
				duration: 150
			});
		}, function(){
			$(this).css({
				width: '90px',
				borderRight: '1px solid #CACACA'
			});
			$(('.cell'), this).css({
				width: '90px'
			});
			$(('span'), this).css({
				marginRight: '8px'
			});
			$(('span'), this).animate({
				color: '#3F3F3D'
			}, {
				queue: false,
				duration: 150
			});
		});
	}
	else {
		$('.menu>.item').hover(function(){
			$(this).css({
				width: '86px',
				borderRight: '5px solid #CFCFCF'
			});
			$(('.cell'), this).css({
				width: '86px'
			});
			$(('a'), this).css({
				paddingRight: '4px'
			});
			$(('span'), this).animate({
				color: '#C50E20'
			}, {
				queue: false,
				duration: 150
			});
		}, function(){
			$(this).css({
				width: '90px',
				borderRight: '1px solid #CACACA'
			});
			$(('.cell'), this).css({
				width: '90px'
			});
			$(('a'), this).css({
				paddingRight: '8px'
			});
			$(('span'), this).animate({
				color: '#3F3F3D'
			}, {
				queue: false,
				duration: 150
			});
		});
	}
	
	var NavTimer; 
	
	$('.item').bind('mouseenter', function()
	{
		clearTimeout(NavTimer);
		
		$('.item').not(this).find('.sub-level').slideUp(100);
		$(this).find('.sub-level').slideDown(100);
	});
	
	$('.item').bind('mouseleave', function()
	{
		NavTimer = setTimeout('$(".sub-level:visible").slideUp(100);', 500);
	});
	
	/*if (!$.browser.msie){*/
		$(document).ready(function()
		{
			$('.thickbox').fancybox({ 
				'zoomSpeedIn': 200, 
				'zoomSpeedOut': 200,
				'frameWidth': 100,
				'frameHeight': 100,
				'overlayShow': true 
			});
		});
	/*}*/

});