function showflash(str, width, height) {

	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>")
	document.write("<param name='movie' value='"+str+"'>")
	document.write("<param name='wmode' value='transparent'>")
	document.write("<param name='quality' value='high'>")
	document.write(" <embed wmode='transparent' src='"+str+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed></object>")

}

function imgSolutionPop(str, width, height) {

	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' id='theMovie' width='"+width+"' height='"+height+"'>")
	document.write("<param name='FlashVars' value='"+str+"'>")
	document.write("<param name='Menu' value='FALSE'>")
	document.write("<param name='SRC' value='/zoom/zoomifyviewer.swf'>")
	document.write("<param name='BGCOLOR' value='#FFFFFF'>")
	document.write("<param name='wmode' value='transparent'>")
	document.write("<param name='quality' value='high'>")
	document.write("<embed FlashVars='"+str+"' src='/zoom/zoomifyviewer.swf' MENU='false' BGCOLOR='#FFFFFF' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' NAME='theMovie' width='"+width+"' height='"+height+"'></embed></object>")

}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function popupWindow(url, w, h) {
        var posX = (screen.width - w) / 2;
        var posY = (screen.height - h) / 2;
        var option = ",resizable=no,scrollbars=no,status=no";
        window.open(url, "new_win","width="+w+",height="+h+",left="+posX +",top="+posY+option);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function showhide(num){ 
	for (i=1; eval("document.all.review_c"+i) ; i++) { 

		objReview = eval("document.all.review_c"+i+".style");
		objReviewTitle = eval("document.all.review_"+i+".style");

		if (num==i ) {
			if (objReview.display==""){
				objReview.display="none"; 
			}else{
				objReview.display=""; 
			}

		}else{ 
			objReview.display="none"; 
		}
	}
}


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 '';
}

// 메인메뉴 스크립트
function initNavigation(seq) {
	nav = document.getElementById("TopMenu_M");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;


	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace("_over.gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 100);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);

		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace("_over.gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", "_over.gif");
				if (this.submenu){
					this.submenu.style.display = "block";
				}
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}


function img_over(obj)
{
	temp = obj.src.indexOf("_over.gif");
	if(temp < 0) obj.src = obj.src.replace(".gif","_over.gif");
}

function img_origin(obj)
{
	obj.src = obj.src.replace("_over.gif",".gif");
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
function JSFX_FloatDiv(id, sx, sy)
{
	var el=document.getElementById?document.getElementById(id):document.all?document.all[id]:document.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(document.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}

// 플로터 - 범위제한
//ex) initMoving("idname",884,500);
function initMoving(id,xleft,ytop) {
	target = document.getElementById(id);
	if (!target) return false;
	var obj = target;
	obj.initLeft = xleft;//절대좌표x
	obj.initTop = ytop;//절대좌표y
	obj.bottomLimit = document.documentElement.scrollHeight - 220;
	obj.topLimit = 550;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";
	obj.style.left = obj.left + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		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";
	}, 40)
}

var arrFntTag = new Array( 'div','td','tr', 'a','p','span','dt','dd','li');
var arrFntSize = new Array( '8','9','10','11','12','13','14','15','16','17','18' );
var stFntSize = 4;

function AutoTextSize(tget,cnt) {
	var cText = null, sSize = stFntSize, cTag;

	sSize += cnt;
	
	if ( sSize < 0 ) sSize = 0;
	if ( sSize > 10 ) sSize = 10;

	stFntSize = sSize;

	if (!( cText = document.getElementById(tget))) 
		cText = document.getElementsByTagName(tget)[0];

	cText.style.fontSize = arrFntSize[sSize]+'px';
	
	for ( i = 0 ; i < arrFntTag.length ; i++ ) {
		cTag = cText.getElementsByTagName(arrFntTag[i]);
		for ( j = 0 ; j < cTag.length ; j++ ) {
			cTag[j].style.fontSize = arrFntSize[sSize]+'px';
		}
	}

}


function PagePrint(Obj, width, type) { 
	var style = "";
	Obj = document.getElementById(Obj);
    var W = Obj.offsetWidth;       
    var H = Obj.offsetHeight;
	var divW = "660";
	style = "\n<link href='/eng/css/global2.css' rel=stylesheet type=text/css>\n<script type='text/javascript' src='/eng/js/common.js'></script>\n<script type='text/javascript' src='/js/ajax.js'></script>\n<script type='text/javascript' src='/eng/js/menu_url.js'></script>\n	"; 
	var option = "width=750,height=600,scrollbars=1";
    var PrintPage = window.open("about:blank",Obj.id,option); 
    PrintPage.document.open(); 
    PrintPage.document.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ko\" lang=\"ko\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><title>page print</title>"+style + "</head><body style='background:none;padding-top:30px;padding-left:10px;'><img src=\"/eng/img/common/print_title.gif\" alt='print'><div style='width:"+divW+"px;padding-top:20px;'>" + Obj.innerHTML + "<br><br><br><br></div></body></html>"); 
	PrintPage.document.close(); 
    PrintPage.document.title = document.domain; 
    PrintPage.print(PrintPage.location.reload()); 
} 
