//Á¡¼±»èÁ¦ ½ºÅ©¸³Æ®
/*
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 
*/

//png ½ºÅ©¸³Æ®
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 +"',sizingMethod='image');"
	obj.src=''; 
	return '';
}

// ¸ÞÀÎ¸Þ´º ³»ºñ°ÔÀÌ¼Ç
var persistmenu="yes" 
var persisttype="sitewide" 

if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
	if (offset != -1) { 
		offset += search.length
		end = document.cookie.indexOf(";", offset);
	if (end == -1) end = document.cookie.length;
		returnvalue=unescape(document.cookie.substring(offset, end))
	}
}
return returnvalue;
}

function onloadfunction(){
	if (persistmenu=="yes"){
	var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
	var cookievalue=get_cookie(cookiename)
	if (cookievalue!="")
		document.getElementById(cookievalue).style.display="block"
	}
}

function savemenustate(){
	var inc=1, blockid=""
	while (document.getElementById("sub"+inc)){
	if (document.getElementById("sub"+inc).style.display=="block"){
		blockid="sub"+inc
	break
	}
	inc++
}
	var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
	var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
	document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
	window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
	window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
	window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate


//ÇÃ·¡½Ã ½ºÅ©¸³Æ®
function Flash(Url,Width,Height){
 document.writeln("<object type='application/x-shockwave-flash' data='"+Url+"' width='"+Width+"' height='"+Height+"'>"); 
 document.writeln("<param name='movie' value='"+Url+"'/>"); 
 document.writeln("<param name='quality' value='high'/>");     
 document.writeln("<param name='wmode' value='transparent'>"); 
 document.writeln("</object>"); 
}


// ÄÞº¸¹Ú½º
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// absolute¿¡¼­ ´Ã¾î³ª´Â div
function fix_height(fname,lname) {
 if(document.getElementById(fname) && document.getElementById(lname)) {
  var Fname = document.getElementById(fname);
  var Lname = document.getElementById(lname);
  
  if(Fname.offsetHeight < Lname.offsetHeight)
   Fname.style.height = Lname.offsetHeight;
 }
}

//ÅÇ ³»ºñ°ÔÀÌ¼Ç
function tab(n) {
 document.getElementById('tab'+n).style.display = "block";
    for(var i = 1; i < 4; i++) {
        obj = document.getElementById('tab'+i);
        //img = document.getElementById('tab_0'+i);     
        if ( n != i ) {
            obj.style.display = "none";   
            //img.src = "tab_0"+i+".gif";          //     
        }
    }
}

//ÅÇ ³»ºñ°ÔÀÌ¼Ç2
function tabT(n) {
 document.getElementById('tabT'+n).style.display = "block";
    for(var i = 1; i < 3; i++) {
        obj = document.getElementById('tabT'+i);
        //img = document.getElementById('tab_0'+i);     
        if ( n != i ) {
            obj.style.display = "none";   
            //img.src = "tab_0"+i+".gif";          //     
        }
    }
}

//ÅÇ Áöµµ ³»ºñ°ÔÀÌ¼Ç2
function surrTab(n) {
 document.getElementById('surrTab'+n).style.display = "block";
    for(var i = 1; i < 4; i++) {
        obj = document.getElementById('surrTab'+i);
        //img = document.getElementById('tab_0'+i);     
        if ( n != i ) {
            obj.style.display = "none";   
            //img.src = "tab_0"+i+".gif";          //     
        }
    }
}

//¸ÞÀÎ ÆË¾÷_ÄíÅ°
function getCookie() {
	//alert(document.cookie);  

	var allcookies = document.cookie;

	var cookies = allcookies.split("; ");

	for (var i = 0; i < cookies.length; i++) {
		var keyValues = cookies[i].split("=");
		if (keyValues[0] == '7luckEvent')
			return unescape(keyValues[1]);
	}
	return "";
}
