$("#lnkGames").hover(
		function(){
			$("#topbarDD").show();
			$(this).addClass("on");
			
			if(document.all){
				
				$('html').css('overflow-x', 'hidden');
				
			}
		}, 
		function(event){

				$("#topbarDD").hide();
				$(this).removeClass("on");
	
		}
	);
	$("#topbarDD").hover(
		function(){
			$("#lnkGames").addClass("on");
			
			if(document.all){
				
				$('html').css('overflow-x', 'hidden');
				
			}
			
		}, 
		function(e){
			
			if (document.all) {
				if(e.toElement.nodeName != 'LI' || e.toElement.parentNode.parentNode.id != 'topLink'){
					
					$(this).hide();
					$("#lnkGames").removeClass("on");
					
				}
			} else {
				if(e.relatedTarget.nodeName != 'LI' || e.relatedTarget.parentNode.parentNode.id != 'topLink'){
					
					$(this).hide();
					$("#lnkGames").removeClass("on");
					
				}
			}
		}
	);
	
$('#topbarDT').bind('mouseout', function(e){

	if (document.all) {
		if(e.toElement.id != 'lnkGames' && e.relatedTarget.childNodes[0] != null){
		
			$('#topbarDD').hide();
			$("#lnkGames").removeClass('on');
			
		}
	} else {
		if(e.relatedTarget.id != 'lnkGames' && e.relatedTarget.childNodes[0].nodeValue != 'Perfect World'){
		
			$('#topbarDD').hide();
			$("#lnkGames").removeClass('on');
			
		}
	}
});

//region

$("#lnkRegion").hover(
		function(){
			$("#topbarRG").show();
			
			if(document.all){
				
				$('html').css('overflow-x', 'hidden');
				
			}
		}, 
		function(event){

				$("#topbarRG").hide();
				$(this).removeClass("on");
	
		}
	);
	$("#topbarRG").hover(
		function(){
			
			if(document.all){
				
				$('html').css('overflow-x', 'hidden');
				
			}
			
		}, 
		function(e){
			
			if(e.relatedTarget.nodeName != 'LI' || e.relatedTarget.parentNode.parentNode.id != 'topLink'){
				
				$(this).hide();

				
			}
		}
	);
	
$('#topbarDT').bind('mouseout', function(e){

	if (document.all) {
		if(e.toElement.id != 'lnkGames' && e.relatedTarget.childNodes[0] != null){
		
			$('#topbarDD').hide();
			$("#lnkGames").removeClass('on');
			
		}
	} else {
		if(e.relatedTarget.id != 'lnkGames' && e.relatedTarget.childNodes[0].nodeValue != 'Perfect World'){
		
			$('#topbarDD').hide();
			$("#lnkGames").removeClass('on');
			
		}
	}
});

$(document).ready(function(){
			if($.browser.msie && $.browser.version == '7.0'){		
				 var width = 137;
				 var tempwidth = 0;	
				$('#gnb').find('ul').each(function(){
						var len = $(this).find('li').length;
						for(var i = 0; i<len; i++){
							tempwidth = $(this).find('li').eq(i).width();
							if(tempwidth > width)  width = tempwidth;
						}
						$(this).find('li').width(width);
				});
			}
 });
