// JavaScript Document

    $(document).ready(function(){                           
        $("a").bind("focus",function(){
            if(this.blur){ 
                this.blur();
             }
        });
    });	
	

	function ok(select){
		if(select.options[select.selectedIndex].value!='$') {
			window.open(select.options[select.selectedIndex].value,'_blank');
		}
	}


	$(function(){ 
//		$("ul.menu_2nd ul:empty").css({"background":"none","border":"none"});
		$("ul.menu_2nd ul:empty").prev().removeClass("arrow");
		$("#column_list li ul:empty, ul.menu_2nd ul:empty").remove();
	});


	$(function(){ 
		$('.nav li').hover(
			function(){
				$(this).children('ul').stop(true,true).fadeIn('fast');
			},function(){
				$(this).children('ul').stop(true,true).fadeOut('slow');
			});
	});
	
//	$(function(){ 
//		$('#column_list li ul').hide();	
// 
//		
//		var $lis = $('#column_list li:has(ul)');
//		var $lisa = $lis.find("a:eq(0)");
//
// 		$lis.css({"height":"100%"});
// 		$lisa.attr("href","#");
//
//
//		$lisa.click(function () {
//			$(this).next('ul').toggle("slow");
//		});    
//	
//
//
//	});

	$(function(){ 
		$('#column_list li ul').hide();	
 
		var $lis = $('#column_list li:has(ul)');
		var $lisa = $lis.find("a:eq(0)");

		$lis.each(function(index){
			$(this)
			    .css({"height":"100%"})
				.hover(function(){},function(){ $(this).find("ul").slideUp("slow")});
		});
		$lisa.each(function(index){
			var $lisaul = $(this).next("ul");
			$(this)
				.removeAttr("href")
				.css({"cursor":"pointer"})
				.click(function(){
							$lisaul.toggle("slow");					   
				})
		});


	});

	window.onload=function()
	{
		load();
	}
 
	function load(){

		thisHREF = document.location.href;
				
		if((thisHREF.indexOf("GSGK")>-1)||(thisHREF.indexOf("Category_22")>-1)){
			$("#mainNav li #mainNav2").css({ "background":"url(/_images/topNav.png) -67px -26px no-repeat"	})
		}
		else if((thisHREF.indexOf("CPYJJFA")>-1)||(thisHREF.indexOf("Category_23")>-1)){
			$("#mainNav li #mainNav3").css({ "background":"url(/_images/topNav.png) -166px -26px no-repeat"})
		}
		else if((thisHREF.indexOf("CGAL")>-1)||(thisHREF.indexOf("Category_24")>-1)){
			$("#mainNav li #mainNav4").css({ "background":"url(/_images/topNav.png) -313px -26px no-repeat"})
		}
		else if((thisHREF.indexOf("KFZX")>-1)||(thisHREF.indexOf("GuestWrite")>-1)){
			$("#mainNav li #mainNav5").css({ "background":"url(/_images/topNav.png) -413px -26px no-repeat"})
		}
		else if((thisHREF.indexOf("CPYC")>-1)||(thisHREF.indexOf("Category_26")>-1)){
			$("#mainNav li #mainNav6").css({ "background":"url(/_images/topNav.png) -513px -26px no-repeat"})
		}
		else if((thisHREF.indexOf("YWHZ")>-1)||(thisHREF.indexOf("Category_27")>-1)){
			$("#mainNav li #mainNav7").css({ "background":"url(/_images/topNav.png) -613px -26px no-repeat"})
		}		
		else {
			$("#mainNav li #mainNav1").css({ "background":"url(/_images/topNav.png) 0 -26px no-repeat"})
		}

	}



