var obj = null;

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');	
	}
}

jQuery.noConflict();

jQuery(document).ready(function($) {
	
	$('.nav-links-container > li').hover(
		function () {
			if (obj) {
				obj.find('ul').fadeOut('fast');
				obj = null;
			}
			$(this).find('ul').fadeIn('fast');
		}, 
		function() {
			obj = $(this);
			setTimeout(
				"checkHover()",
				400);
		}
	);
	
	$('.home #mainNav .home a').mouseover(function() {
		$(this).parent().css('background','url(images/shared/bkgd_tab_mainNav.jpg) repeat-x');
	});

	$('div.banner-contact').click(function() {
		location.href = "contact.php";
	});
	
	$('div.banner-case-study').click(function() {
		location.href = "download_case_study.php";
	});
	
	$('div.banner-contact').mouseover(function() {
		$(this).css('cursor','pointer');
	});
	
	$('div.banner-case-study').mouseover(function() {
		$(this).css('cursor','pointer');
	});
	
	$('dd.hilite-desc-1-sum').toggle(
		function() {
			$(this).css('background','url(images/shared/bullet_expand.gif) 1px 9px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-1-detail').css('display','block');
		},
		function() {
			$(this).css('background','url(images/shared/bullet.gif) 1px 7px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-1-detail').css('display','none');
		}
	);
	
	$('dd.hilite-desc-2-sum').toggle(
		function() {
			$(this).css('background','url(images/shared/bullet_expand.gif) 1px 9px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-2-detail').css('display','block');
		},
		function() {
			$(this).css('background','url(images/shared/bullet.gif) 1px 7px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-2-detail').css('display','none');
		}
	);
	
	$('dd.hilite-desc-3-sum').toggle(
		function() {
			$(this).css('background','url(images/shared/bullet_expand.gif) 1px 9px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-3-detail').css('display','block');
		},
		function() {
			$(this).css('background','url(images/shared/bullet.gif) 1px 7px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-3-detail').css('display','none');
		}
	);
	
	$('dd.hilite-desc-4-sum').toggle(
		function() {
			$(this).css('background','url(images/shared/bullet_expand.gif) 1px 9px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-4-detail').css('display','block');
		},
		function() {
			$(this).css('background','url(images/shared/bullet.gif) 1px 7px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-4-detail').css('display','none');
		}
	);
	
	$('dd.hilite-desc-5-sum').toggle(
		function() {
			$(this).css('background','url(images/shared/bullet_expand.gif) 1px 9px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-5-detail').css('display','block');
		},
		function() {
			$(this).css('background','url(images/shared/bullet.gif) 1px 7px no-repeat').css('cursor','pointer');
			$('div.hilite-desc-5-detail').css('display','none');
		}
	);
	
	$('div.kpo').toggle(
		function() {
			$('div.kpo img').attr('src','images/about-us/icon_info_on.png');
			$('div.kpo-detail').css('display','block');
		},
		function() {
			$('div.kpo img').attr('src','images/about-us/icon_info.jpg');
			$('div.kpo-detail').css('display','none');
		}
	);
	
	/*----- Internet Explorer CSS Rendering Fix -----*/
	if ($.browser.msie) {

		$('.nav-links-container .translation').hover(
			function () {
				$('.nav-links-container .translation .submenu').css('top', '32px');
				$('#mainNav').css('zIndex','9');
			}, 
			function() {
				$('.nav-links-container .translation .submenu').css('top', '-999em');
				$('#mainNav').css('zIndex','auto');
			}
		);
		
		$('.nav-links-container .remote-analyst').hover(
			function () {
				$('.nav-links-container .remote-analyst .submenu').css('top', '32px');
				$('#mainNav').css('zIndex','9');
			}, 
			function() {
				$('.nav-links-container .remote-analyst .submenu').css('top', '-999em');
				$('#mainNav').css('zIndex','auto');
			}
		);
		
		if ($('.home')) {
			$('#content .photo').css('left','-2');
		}
		
		if ($('.ra')) {
			$('#content dl div').css('padding-Left','0');
		}
		
	}
});
