// =================================================
// flash start
// =================================================
function flashMovie_intro(p,w,h,t,c){
	flashMovie_2(p, w, h,t,c, '')
}

function flashMovie_intro(p,w,h,t,c, code){
	var s_index="";
	var m_flash_movie="";
 	s_index="/flash/"+p;
 	flash_vars = "page_code="+code;

// alert(flash_vars);
 		m_flash_movie+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' bgcolor='"+c+"' id='submenu_flash' name='submenu_flash'>";
		m_flash_movie+="<param name='movie' value='"+s_index+"'>";
		m_flash_movie+="<param name='menu' value='false'>";
		m_flash_movie+="<param name='FlashVars' value='"+flash_vars+"'>";
		m_flash_movie+="<param name='allowScriptAccess' value='always'>";
		m_flash_movie+="<param name='quality' value='high'>";
		m_flash_movie+="<param name='wmode' value='"+t+"'/>";	
		m_flash_movie+="<embed src='"+s_index+"' wmode='"+t+"'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' bgcolor='"+c+"' allowScriptAccess='always' swLiveConnect=true id='submenu_flash' name='submenu_flash'></embed></object>";	
	
		document.write(m_flash_movie);
}
//skin
function flashMovie_skin(p,w,h,t,c){
	flashMovie__skin2(p, w, h,t,c, '')
}

// =================================================
// right scroll start 
// =================================================

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false); 
var isNS4 = (document.layers ? true : false); 
function getRef(id) { 
        if (isDOM) return document.getElementById(id); 
        if (isIE4) return document.all[id]; 
        if (isNS4) return document.layers[id]; 
} 
var isNS = navigator.appName == "Netscape"; 
function moveRightEdge() { 
        var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck; 
        if (isNS4) { 
                yMenuFrom   = divMenu.top; 
                yMenuTo     = windows.pageYOffset + 60;   // À§ÂÊ À§Ä¡ 
        } else if (isDOM) { 
                yMenuFrom   = parseInt (divMenu.style.top, 10); 
                yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 250; // À§ÂÊ À§Ä¡ 
        } 
        timeoutNextCheck = 500; 
        if (yMenuFrom != yMenuTo) { 
                yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20); 
                if (yMenuTo < yMenuFrom) 
                        yOffset = -yOffset; 
                if (isNS4) 
                        divMenu.top += yOffset; 
                else if (isDOM) 
                        divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset; 
                        timeoutNextCheck = 10; 
        } 
        setTimeout ("moveRightEdge()", timeoutNextCheck); 
} 

// =================================================
// È­¸é È®´ë,Ãà¼Ò
// »ó¼¼¼³¸í: javascript:zoomInOut('zoom','in') È®´ë javascript:zoomInOut('zoom','out') Ãà¼Ò
//	+, - Å°¸¦ ÀÔ·ÂÇÏ¸é È­¸é È®´ë, Ãà¼Ò¸¦ ÇÑ´Ù.
// =================================================
var zoomRate = 20;			// È®´ë/Ãà¼Ò½Ã Áõ°¨·ü
var maxRate = 300;			//ÃÖ´ëÈ®´ë·ü
var minRate = 100;			//ÃÖ¼ÒÃà¼Ò·ü

function GetCookie(name){
	if (document.cookie != "") {
		zoomc = document.cookie.split("; ");
		for (var i=0; i < zoomc.length; i++) {
            zoomv = zoomc[i].split("="); 
            if (zoomv[0] == name) {
			    return  unescape(zoomv[1]);
            }
		}        
	}else{
		return "";
	}
}

function SetCookie(name,value){
	document.cookie = name + "=" + escape (value)+";";
}

function GoZoom(contentid){
	if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
		document.all[contentid].style.zoom = GetCookie("zoomVal");
		currZoom=GetCookie("zoomVal");
	}
	else{
		document.all[contentid].style.zoom = '100%'; 
		currZoom = '100%';
	}
}

//Zoom In & Zoom Out
function zoomInOut(contentid, how) {

	if(GetCookie("zoomVal") != null && GetCookie("zoomVal") != ""){
		document.all[contentid].style.zoom = GetCookie("zoomVal");
		divMenu.style.zoom = GetCookie("zoomVal");
		currZoom=GetCookie("zoomVal");
	}else{
		document.all[contentid].style.zoom = '100%'; 
		divMenu.style.zoom = '100%';
		currZoom = '100%';
	}
	
	if (((how == "in") && (parseInt(currZoom) >= maxRate)) || ((how == "out") && (parseInt(currZoom) <= minRate)) ) {
		return; 
	}
	if (how == "in") {
		document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)+zoomRate+'%'
		divMenu.style.left = parseInt(divMenu.style.left)+200;
		divMenu.style.top = parseInt(divMenu.style.top)+60;
		divMenu.style.zoom = parseInt(divMenu.style.zoom)+zoomRate+'%';
	}
	else {
		document.all[contentid].style.zoom = parseInt(document.all[contentid].style.zoom)-zoomRate+'%'
		divMenu.style.left = parseInt(divMenu.style.left)-200;
		divMenu.style.top = parseInt(divMenu.style.top)-60;
		divMenu.style.zoom = parseInt(divMenu.style.zoom)-zoomRate+'%';
	}
	SetCookie("zoomVal",document.all[contentid].style.zoom);
	SetCookie("floatingLeft",divMenu.style.left);
	SetCookie("floatingTop",divMenu.style.top);
}

// =================================================
// ´ÜÃàÅ° ±â´É
// =================================================
document.onkeypress = getKey;

function getKey(keyStroke) {
	isNetscape=(document.layers);
	eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
	which = String.fromCharCode(eventChooser).toLowerCase();
	which2 = eventChooser;

	var el=event.srcElement;

	if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA")){ //input,textarea ¾È¿¡¼­ ½ÇÇà¾ÈµÇµµ·Ï
		if(which == "+" ) zoomInOut('zoom', 'in'); // È­¸éÈ®´ë
		else if(which == "=" ) zoomInOut('zoom', 'in'); // È­¸éÈ®´ë
		else if(which == "-" ) zoomInOut('zoom', 'out'); // È­¸éÃà¼Ò
		else if(which == "h" ) top.location.href="/"; // ¸ÞÀÎÆäÀÌÁö·Î ÀÌµ¿
		//else if(which == "s" ) location.href="/site_info/search/index.asp?CT=1"; // °Ë»öÆäÀÌÁö·Î ÀÌµ¿
		//else if(which == "?" ) location.href="/site_info/guide/index.asp"; // µµ¿ò¸»ÆäÀÌÁö·Î ÀÌµ¿
		//else if(which == "/" ) location.href="/site_info/guide/index.asp"; // µµ¿ò¸»ÆäÀÌÁö·Î ÀÌµ¿
	}
}

//top button start
function back_top() 
{ 
        x = document.body.scrollLeft; 
        y = document.body.scrollTop; 
        step = 2; 

        while ((x != 0) || (y != 0)) { 
                scroll (x, y); 
                step += (step * step / 300); 
                x -= step; 
                y -= step; 
                if (x < 0) x = 0; 
                if (y < 0) y = 0; 
        } 
        scroll (0, 0); 
} 
//top button end

// =================================================
//Æ¯Á¤ ºÎºÐ Ãâ·Â ½ÃÀÛ 
// =================================================

var printAreaId;

/*
* ÁöÁ¤ ¿µ¿ªÀ» ÇÁ¸°Æ®
*/
function printArea( printId )
{
if( document.all && window.print )
{
//## printµÉ ¿µ¿ª div °´Ã¼
printAreaId = document.all[printId]; 
window.onbeforeprint = actionBeforePrint;
window.onafterprint = actionAfterPrint;
window.print();
}
}

/*
* ÇÁ¸°Æ® ÇÏ±âÀü¿¡ ¾×¼Ç
: 1. BODY ¾È¿¡ ¸ðµç HTMLÀ» °¨Ãá´Ù.( DISPLAY ÇÏÁö ¾Ê´Â´Ù. )
2. ÇÁ¸°Æ®ÇÒ ºÎºÐ ¹®ÀÚ¿­À» printview¿¡ »ðÀÔ
*/
function actionBeforePrint()
{
//## div ÅÂ±× ¹è¿­
var aDiv = document.all.tags('DIV'); 

//## BODY ¾È¿¡ ¸ðµç HTML À» °¨Ãá´Ù.
aDiv['print_base'].style.display = 'none';

//## printview id¸¦ °¡Áø ·¹ÀÌ¾î¿¡ ÇÁ¸°Æ®ÇÒ ¹®ÀÚ¿­À» »ðÀÔ
aDiv['print_temp'].style.display = "inline"; 
aDiv['print_temp'].innerHTML = printAreaId.outerHTML;
}

/*
* ÇÁ¸°Æ® ÈÄ ¾×¼Ç
: 1. printview id¸¦ °¡Áø ·¹ÀÌ¾îÀÇ ³»¿ëÀ» Áö¿î´Ù.
2. ¼û°å´ø BODY ¾È ¸ðµç HTMLÀ» º¸¿©ÁØ´Ù.
*/
function actionAfterPrint()
{
var aDiv = document.all.tags('DIV');
aDiv['print_temp'].innerHTML = "";
aDiv['print_temp'].style.display = "none"; 
aDiv['print_base'].style.display = 'block';
}
//Æ¯Á¤ ºÎºÐ Ãâ·Â ³¡

//copyright change date Start
today=new Date();
y0=today.getFullYear();
////copyright change date End

//images View Start
function preView(form) {
ImgX = form.width.value;
ImgY = form.height.value;
ImgFile = form.upfile.value;
NS = (document.layers) ? 1 : 0;
localurl = ImgFile.indexOf('http://') == -1;
if (NS && localurl) ImgFile = "file:///" + ImgFile;
var win;
var sWidth;
var sHeight;
win = window.open("","","width="+ImgX+",height="+ImgY+",menubar=no,toolbar=no,top=100,left=100");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
win.document.open();
win.document.write("<html><head><title>ÀÌ¹ÌÁö ¹Ì¸®º¸±â</title></head><body onBlur=this.close();>");
win.document.write('<div style="position:absolute;width:'+ImgX+'px;height:'+ImgY+'px;left:0px;top:0px">');
win.document.write("<img src="+ImgFile+" width=" + ImgX + " height=" + ImgY + "></div></body></html>");
win.document.close();
}
//images View End

// =================================================
//119 window Start
// =================================================

function new_window(url, w, h) {
  win = window.open(url, 'winname1', 'fullscreen=no, resizable=no, scrollbars=no, x=100,y=200,width=' + w + ',height=' + h);
}
//center
function center(){ 
    var x,y; 
    if (self.innerHeight) { // IE ¿Ü ¸ðµç ºê¶ó¿ìÀú 
        x = (screen.availWidth - self.innerWidth) / 2; 
        y = (screen.availHeight - self.innerHeight) / 2; 
    }else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict ¸ðµå 
        x = (screen.availWidth - document.documentElement.clientWidth) / 2; 
        y = (screen.availHeight - document.documentElement.clientHeight) / 2; 
    }else if (document.body) { // ´Ù¸¥ IE ºê¶ó¿ìÀú( IE < 6) 
        x = (screen.availWidth - document.body.clientWidth) / 2; 
        y = (screen.availHeight - document.body.clientHeight) / 2; 
    } 
    window.moveTo(x,y); 
} 
// =================================================
//copyright auto date
// =================================================
today=new Date();
y0=today.getFullYear();

// =================================================
//New Window
// =================================================
String.prototype.popupView = function () { 

var img_view = this; 
var x = x + 20 ; 
var y = y + 30 ; 
htmlz = "<html><head><title>Big size</title><style>body{margin:0;cursor:hand;}</style></head><body scroll=auto onload='width1=document.all.Timage.width;if(width1>1024)width1=1024;height1=document.all.Timage.height;if(height1>768)height1=768;top.window.resizeTo(width1+30,height1+54);' onclick='top.window.close();'><img src='"+img_view+"'  title='Å¬¸¯ÇÏ½Ã¸é ´ÝÈü´Ï´Ù.' name='Timage' id='Timage' galleryimg='no'></body></html>" 
imagez = window.open('', "image", "width="+ 100 +", height="+ 100 +", top=0,left=0,scrollbars=auto,resizable=1,toolbar=0,menubar=0,location=0,directories=0,status=1"); 
imagez.document.open(); 
imagez.document.write(htmlz) 
imagez.document.close(); 
} 