//--------------- GNB 
$(function(){
	var gnbVr = $('.navigation');
	gnbVr.find('>ul>li>ul').hide();
	gnbVr.find('>ul>li>a[href]')

	.mouseout(function(){
			$.doTimeout('menuout', 3000, function(){
			gnbVr
				.find('>ul>li>ul:visible')
				.slideUp(100)
				.parent('li')
				.removeClass('active')
				.find('>a')
				.css('fontWeight','');
			return true;
			});
		})
		.mouseover(function(){
			$.doTimeout('menuout');
			gnbVr
				.find('>ul>li>ul:visible')
				.slideUp(100)
				.parent('li')
				.removeClass('active')
				.find('>a')
				.css('fontWeight','');
			$(this)
				.next('ul:hidden')
				.slideDown(100)
				.parent('li')
				.addClass('active')
				.find('>a')
				.css('fontWeight','bold');
			return false;
		})
		.focus(function(){
			$(this).mouseover();
			return false;
		});
	$('#headerTools').find('>ul>li>ul.combo_tabs').hide();	
	$('#headerTools').find('>ul>li>a')
		.click(function(){
			$(this).next('ul:visible').hide(100)
			$(this).next('ul:hidden').show(100);
		});
});

//--------------- ellipsis
(function($) {
        $.fn.ellipsis = function()
        {
                return this.each(function()
                {
                        var el = $(this);

                        if(el.css("overflow") == "hidden")
                        {
                                var text = el.html();
                                var multiline = el.hasClass('multiline');
                                var t = $(this.cloneNode(true))
                                        .hide()
                                        .css('position', 'absolute')
                                        .css('overflow', 'visible')
                                        .width(multiline ? el.width() : 'auto')
                                        .height(multiline ? 'auto' : el.height())
                                        ;

                                el.after(t);

                                function height() { return t.height() > el.height(); };
                                function width() { return t.width() > el.width(); };

                                var func = multiline ? height : width;

                                while (text.length > 0 && func())
                                {
                                        text = text.substr(0, text.length - 1);
                                        t.html(text + "...");
                                }

                                el.html(t.html());
                                t.remove();
                        }
                });
        };
})(jQuery);
//------------------ Header Combobox for new windows
function MM_jumpMenu(targ,selObj,restore){
 if(selObj.options[selObj.selectedIndex].value != ""){
   window.open(selObj.options[selObj.selectedIndex].value,"new","");
 }
}
