$(document).ready(function(){
	$('body').addClass('jsOn');
	
	//·Ñ¿À¹ö °øÅë
	$('img.rollover').hover(
		function(){ this.src=this.src.replace('_off','_on'); },	
		function(){ this.src=this.src.replace('_on','_off'); }	
	);
	
	//Å°º¸µå ÅÇ ³×ºñ°ÔÀÌ¼Ç
	$('#navigation li span a img').addClass('navi_img');
	$('#navigation li div.smenu ul li a img').addClass('navi_simg');

	var menulink = $('#navigation li span a');
	var smenulink = $('#navigation li div.smenu a');
	$('h1 a').focusin(
		function() {
			$('#navigation div.smenu').hide();
		}
	);
	$('#body a').focusin(
		function() {
			$('#navigation div.smenu').hide();
		}
	);
	menulink.focusin(
		function() {
			$('#navigation div.smenu').hide();
			$(this).parents('li').find('div.smenu').show();
			var thislink1=$(this).find('img.navi_img');
			var thislinkSrc1 = thislink1.attr('src');
			thislink1.attr('src', thislinkSrc1.replace('_off.gif', '_on.gif'));
		}
	).focusout(
		function() {
			var thislink1=$(this).find('img.navi_img');
			var thislinkSrc1 = thislink1.attr('src');
			thislink1.attr('src', thislinkSrc1.replace('_on.gif', '_off.gif'));
		}
	)
	smenulink.focusin(
		function() {
			$(this).parents('div.smenu').show();
			var thislink2=$(this).find('img.navi_simg');
			var thislinkSrc2 = thislink2.attr('src');
			thislink2.attr('src', thislinkSrc2.replace('_off.gif', '_on.gif'));
		}
	).focusout(
		function() {
			var thislink2=$(this).find('img.navi_simg');
			var thislinkSrc2 = thislink2.attr('src');
			thislink2.attr('src', thislinkSrc2.replace('_on.gif', '_off.gif'));
		}
	);

	//¸¶¿ì½º ¿À¹ö ³×ºñ°ÔÀÌ¼Ç
	$('#navigation li').hover(
		function(){ 
			var thisMenu=$(this).attr('class');
			var thisImg=$(this).find('img.navi_img');
			var thisSrc = thisImg.attr('src');
			thisImg.attr('src', thisSrc.replace('_off.gif', '_on.gif'));
			$('#navigation li.'+thisMenu).find('div').show();
		},	
		function(){ 
			var thisMenu=$(this).attr('class');
			var thisImg=$(this).find('img.navi_img');
			var thisSrc = thisImg.attr('src');
			thisImg.attr('src', thisSrc.replace('_on.gif', '_off.gif'));
			$('#navigation li.'+thisMenu).find('div').hide();
		}
	);
});


function setPng24(obj){
obj.width=obj.height=1;
obj.className=obj.className.replace(/\bpng24\b/i,'');
obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+obj.src+"',sizeMethod='image');"
objsrc='';
return '';
}

/* Tab Content */
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//popup slide
$(document).ready(function(){
	   $(".close").click(function(){
		$("#aside").animate({marginLeft:'-180px'},300);
		return false;
			});
			
	   $(".open").click(function(){
		$("#aside").animate({marginLeft:'0'},300);
		return false; 
			});
		$(".btn a").click(function () {
		$(".btn a").toggle(0);
	});	
});

/*
// pdf ÆÄÀÏ ¼³Ä¡ ¾È³» ½ºÅ©¸³Æ®
var acrobat=new Object(); 
acrobat.installed=false; 
acrobat.version='0.0'; 

if (window.ActiveXObject)
{
    for (x=2; x<10; x++)
    {
        // To Detect older Acrobat Versions 6 -
        try
        {
            oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
            if (oAcro)
            {
                acrobat.installed=true;
                acrobat.version=x+'.0';
            }
        }
        catch(e) {}
    }
 
    // To Detect older Acrobat Versions 6 -
    try
    {
        oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
        if (oAcro4)
        {
            acrobat.installed=true;
            acrobat.version='4.0';
        }
    }
    catch(e) {}
    
    // To Detect Acrobat Version 7 +
    try
    {
        bAcrobatVer7 = new ActiveXObject("AcroPDF.PDF.1");
        if (bAcrobatVer7)
        {
            acrobat.installed=true;
            acrobat.version="7.0";
        }
    }
    catch(e) {}
}
 
if( (acrobat.installed == false || parseInt(acrobat.version,10) < 7 )  &&
		confirm("PDF ºä¾î°¡ ¼³Ä¡µÇÁö ¾Ê¾Ò°Å³ª, ¹öÀüÀÌ ³Ê¹« ³·½À´Ï´Ù.\n\n»õ·Î ¼³Ä¡ÇÏ½Ã°Ú½À´Ï±î?") ) { 
      window.open("http://www.adobe.com/kr/products/acrobat/readstep2.html"); 
}
*/
