// Menu

(function($){
	$(document).ready(function () {

		// gnb show & hide
		$('#gnb ul li').hover(function () {
				$(this).children('ul:not(":animated")').slideDown('fast');
			}, function () {
				$('ul', this).slideUp('fast');
		}).children('a').focus(function(){
			$(this).parent('li').parent('ul').children('li').children('.sub').addClass('closed');
			$(this).removeClass('closed').addClass('opened');
			$(this).parent('li').children('ul').slideDown('fast');
			if($(this).attr('class').match('opened')) $(this).parent('li').parent('ul').children('li').children('.closed').parent('li').children('ul').fadeOut('fast');
		});
		$('*:not("#gnb a")').focus(function(){
			$('#gnb ul li ul').fadeOut('fast');
		});

		jQuery('.select_language_button button').click(function () {
				jQuery(this).css({'border-bottom':'1px'});
				jQuery('.language_line ul').slideToggle('fast');
		});
	});
})(jQuery);


// Show And Hide Toggle
var cc=0
function showHide(id) {
    if (cc==0) {
        cc=1
        document.getElementById(id).style.display="block";
    } else {
        cc=0
        document.getElementById(id).style.display="none";
    }
}

// Local Navigation Toggle
function lnbToggle(id) {
	for(num=1; num<=3; num++) document.getElementById('D3MG'+num).style.display='none'; //D4MG1~D4MG3 까지 숨긴 다음
	document.getElementById(id).style.display='block'; //해당 ID만 보임
}

// IS
function chkIsKind(key, value) {
    showHide('selectOrder');
    xGetElementById('search_target'+key).checked = true;
    xInnerHtml('search_target_label', value);
}


// Pop

  function OpenWin(page, opt){
        Open = window.open(page, '', opt);
  }



// Onfocus
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


// Bookmark
function favor(){
window.external.AddFavorite('http://www.yeum.org', '예음교회 - 복있는 선산, 꿈이 있는 교회');
}

