
// png 이미지
function setPng24(obj) { 
    obj.width=obj.height=1; 
	obj.style.width = obj.width + "px"; 
    obj.style.height = obj.height + "px"; 
    obj.className=obj.className.replace(/\bpng24\b/i,''); 
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
    obj.src='';  
    return ''; 
} 

// 기본 플래시				
function flashObj(URL,SizeX,SizeY,LnkId,Frm,Flag) // quick
{
	document.write('            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
	document.write('                    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
	document.write('                    width="'+SizeX+'" height="'+SizeY+'"  id="'+LnkId+'" align="middle">');
	document.write('            <param name="movie"     value="'+URL+'" />');
	document.write('            <param name="quality"   value="high" />');
	if ( Flag == null || Flag != 'N' )
		{
			document.write('        <param name="wmode"     value="transparent"/>');
		}
	document.write('   <param name="allowScriptAccess" value="always"/> ');
	document.write('   <param name="base" value="." />');
	document.write('            <embed base="." src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'"  align="middle" ');
	if ( Flag == null || Flag != 'N' )
		{
			document.write('         wmode="transparent" ');
		}
	document.write('             type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always" swLiveConnect=true name="'+LnkId+'"  />');
	document.write('            </embed></object>'); 
	if ( Frm == 'Y' ) { // form 태그 들어가는 페이지에 적용
	eval("window." + LnkId + " = document.forms[0]."+ LnkId +"; ");
 }
}


//quick_top
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.style.zIndex= "10";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 1000;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}

//팝업띄우기 스크롤 있는 거
function popsn(url,trgt,w,h) { 
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=no,resizable=no,copyhistory=no,toolbar=no,status=no'); 
}
//팝업띄우기 스크롤 없는 거
function popsy(url,trgt,w,h) { 
    window.open(url,trgt,'width='+w+',height='+h+',scrollbars=yes,resizable=no,copyhistory=no,toolbar=no,status=no,left=0,top=0'); 
}


//탭
function Over(imgName) {
	imgName.src = imgName.src.replace(/(_on.gif|.gif)$/i, "_on.gif");
	imgName.src = imgName.src.replace(/(_on.jpg|.jpg)$/i, "_on.jpg");
}
function Out(imgName) {
	imgName.src = imgName.src.replace(/(_on.gif|.gif)$/i, ".gif");
	imgName.src = imgName.src.replace(/(_on.jpg|.jpg)$/i, ".jpg");
}

function clOver(clName){	
	clName = clName.className = "on";
}
function clOut(clName){
	clName = clName.className = "";
}

function layer_events()
{
  if (document.layers) {
    document.layers['gnb_area'].captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEUP);
    document.layers['gnb_area'].onmouseout = new Function("this.style.height='115'");
    document.layers['gnb_area'].onmouseover = new Function("this.style.height='260'");
  }
}

function display_open(n) {
	div_name = document.getElementById(n);

	if(div_name.style.display == "block"){
		div_name.style.display ="none";
	}else{
		div_name.style.display ="block";
	}
}

function layer_close(n) {
	div_name = document.getElementById(n);
	div_name.style.display ="none";
}



//chgHeight
function chgHeight(n) {
	swf_name = document.getElementById("nanta_gnb");
	if(n == "open"){
		swf_name.style.height ="250px";
	}else{
		swf_name.style.height ="80px";
	}
}




//faq_list
function faq(n) {
	for(i = 1; i <= 10; i++){
		faq_con = document.getElementById("faq_con"+i);
		faq_title = document.getElementById("faq_title"+i);
		if(i == n){			
			faq_con.style.display = "block";
			faq_title.className = "on";
		}else{
			faq_con.style.display = "none";	
			faq_title.className = "";
		}
	}
}


//공연
function performance(n) {
	for(i = 1; i <= 3; i++){
		tab_img = document.getElementById("tab"+i);
		con_div = document.getElementById("con"+i);

	if(i == n){    
		tab_img.src="../images/performance/tab_performance0"+i+"_on.gif";
		con_div.style.display ="block";   

	}else{
		tab_img.src="../images/performance/tab_performance0"+i+".gif";
		con_div.style.display ="none";   
		}
	}
}


//chgHeight
function topNaviOver() {
	swf_name = document.getElementById("pmc_gnb");
	div_name = document.getElementById("top_area");
	main_name = document.getElementById("main_navi");
		
	if (!swf_name) return false;
	if (!div_name) return false;
	if (!main_name) return false;

	//div_name.style.height = "340px";
	swf_name.style.height = "340px";	//sub navi
	main_name.style.height = "340px";	//main navi

//	document.getElementById('pmc_gnb').style.overflow='auto';
}

function topNaviOut() {
	swf_name = document.getElementById("pmc_gnb");
	div_name = document.getElementById("top_area");
	main_name = document.getElementById("main_navi");

	if (!swf_name) return false;
	if (!div_name) return false;
	if (!main_name) return false;

	//div_name.style.height = "220px";
	swf_name.style.height = "220px";
	main_name.style.height = "100px";
}



//history
function viewhistory(obj) {
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;

	for (i=1; i<5; i++){
		if(!document.getElementById("p_history_"+i)) return false;
		document.getElementById("p_history_"+i).style.display="none";
	}
	document.getElementById(obj).style.display="block";
}

function resizeIt(f_height){ 
  document.getElementById("frame").style.height=f_height; 
}

