$(function(){	
	$.easy.navigation();
	$.easy.tooltip();
	$.easy.popup();
//	$.easy.external();
	$.easy.rotate();
	$.easy.cycle();
	$.easy.forms();
	$.easy.showhide();
	$.easy.jump();
	$.easy.tabs();
	$.easy.accordion();	
});

$(function() {
	// Hide all the content except the first
	$('.accordian li:odd:gt(0)').hide();
	
	// Add a padding to the first link
	$('.accordian li:first').animate( {
		paddingLeft:"0px"
	} );
	
	// Add the dimension class to all the content
	$('.accordian li:odd').addClass('dimension');
	
	// Set the even links with an 'even' class
	$('.accordian li:even:even').addClass('even');
	
	// Set the odd links with a 'odd' class
	$('.accordian li:even:odd').addClass('odd');
	
	// Show the correct cursor for the links
	$('.accordian li:even').css('cursor', 'pointer');
	
	// Handle the click event
	$('.accordian li:even').click( function() {
		// Get the content that needs to be shown
		var cur = $(this).next();
		
		// Get the content that needs to be hidden
		var old = $('.accordian li:odd:visible');
		
		// Make sure the content that needs to be shown 
		// isn't already visible
		if ( cur.is(':visible') )
			return false;
		
		// Hide the old content
		old.slideToggle(200);
		
		// Show the new content
		cur.stop().slideToggle(200);
		
		// Animate (add) the padding in the new link
		$(this).stop().animate( {
			paddingLeft:"0px"
		} );
		
		// Animate (remove) the padding in the old link
		old.prev().stop().animate( {
			paddingLeft:"0px"
		} );
	} );
});


// quick slider
        jQuery(document).ready(function() {
            jQuery(window).bind("resize", function() {
                jQuery("#quick_menu_div").css("top", 139).css("left", ( document.body.clientWidth / 2)  + 500).show();
            }).trigger("resize");
            
            b_width = $(document.body).width(); //페이지 전체크기
            t_height = $(document.body).scrollTop(); //상단 높이
       
       
            width = b_width/2 + 500;
            height = t_height + 157; //상단부터 띄워야 하는 높이
       
            $("#quick_menu_div").css({top:height, left:width, display:'block'});
           
           
            var currentPosition = parseInt($("#quick_menu_div").css("top"));
           
            $(window).scroll(function() {
                var position = $(window).scrollTop(); // 현재 스크롤바의 위치값을 반환합니다.
                $("#quick_menu_div").stop().animate({"top":position+currentPosition+"px"},100);
            });
        });


function page_print(table, uid, cat) {
	window.open('/html/print.html?table='+table+'&uid='+uid+'&cat='+cat, 'print', 'top=100, left=100, width=660, height=600, toolbar=0, status=0, menubar=0, scrollbars=1, resizable=0');
}

function map_print() {
	window.open('/html/print_map.html', 'print_map', 'top=100, left=100, width=660, height=600, toolbar=0, status=0, menubar=0, scrollbars=1, resizable=0');
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function changecss(theClass,element,value) {
  
 var cssRules;
 if (document.all) 
 {
  cssRules = 'rules';
 }
 else if (document.getElementById) 
 {
  cssRules = 'cssRules';
 }
 
 var added = false;
 
 for (var S = 0; S < document.styleSheets.length; S++)
 {
  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) 
  {
   if (document.styleSheets[S][cssRules][R].selectorText == theClass) 
   {
    if(document.styleSheets[S][cssRules][R].style[element])
    {
     document.styleSheets[S][cssRules][R].style[element] = value;
     added=true;
     break;
    }
   }
  }
  
  if(!added)
  {
   if(document.styleSheets[S].insertRule)
   {
    document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+';}',document.styleSheets[S][cssRules].length); 
   }
   else if (document.styleSheets[S].addRule) 
   {
    document.styleSheets[S].addRule(theClass,element+': '+value+';'); 
   }
  }
 }
}

function show_msg_fadeout(msg) {
	ck_show_msg();
	$("#div_status_inner").html(msg);

	$("#div_status .close").click(function() {
		$("#div_status").hide();
		return false;
	});

	$("#div_status").fadeIn('fast').delay('3000').fadeOut('fast');
}

function show_msg_fadeout_fun(msg, fun) {
	ck_show_msg();
	$("#div_status_inner").html(msg);

	$("#div_status .close").click(function() {
		$("#div_status").hide();
		return false;
	});

	$("#div_status").fadeIn('fast').delay('3000').fadeOut('fast', fun);

}

function show_msg_fun(msg, fun) {
	ck_show_msg();
	$("#div_status_inner").html(msg);

	$("#div_status .close").click(function() {
		$("#div_status").hide();
		return false;
	});

	$("#div_status").fadeIn('fast').delay('3000', fun);

}

jQuery(function($){
	// List Tab Navigation
	var tab_list = $('div.tab.list');
	var tab_list_i = tab_list.find('>ul>li');
	tab_list.removeClass('jx');
	tab_list_i.find('>ul').hide();
	tab_list.find('>ul>li[class=active]').find('>ul').show();
	tab_list.css('height', tab_list.find('>ul>li.active>ul').height()+40);
	function listTabMenuToggle(event){
		var t = $(this);
		tab_list_i.find('>ul').hide();
		t.next('ul').show();
		tab_list_i.removeClass('active');
		t.parent('li').addClass('active');
		tab_list.css('height', t.next('ul').height()+40);
		return false;
	}
	tab_list_i.find('>a[href=#]').click(listTabMenuToggle).focus(listTabMenuToggle);
});
