//------------------------------------------------------------------------------
// ÀÌ¹ÌÁö ¹Ù²ãÁÖ´Â ÇÔ¼ö
//------------------------------------------------------------------------------   
function ImageChange(imgID, imgName) {
   document.images[imgID].src = imgName;
}

//------------------------------------------------------------------------------
// ÇÃ·¡½Ã ÇÔ¼ö
//------------------------------------------------------------------------------  
function flashview (dirNswf,fwidth,fheight,varvalues,id) {
	var flashid="";
	var flashobjec="";

	if (id !=""){
		flashid = " id=\'"+ id +"\'"
	}

	flashobjec+="<object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\' width=\'"+fwidth+"\' height=\'"+fheight+"\'"+flashid+">";
	flashobjec+="<param name=\'allowScriptAccess\' value=\'sameDomain\' />";
	flashobjec+="<param name=\'movie\' value='"+dirNswf+"'>";
	flashobjec+="<param name=\'quality\' value=\'high\'>";
	flashobjec+="<param name=\'wmode\' value=\'"+varvalues+"\'>";
	flashobjec+="<embed src='"+dirNswf+"' quality=\'high\' pluginspage=\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\' type=\'application/x-shockwave-flash\' width=\'"+fwidth+"\' height=\'"+fheight+"\'></embed>";
	flashobjec+="</object>";

	document.write(flashobjec);
}

//------------------------------------------------------------------------------
// ¼­ºêÆäÀÌÁö ¹öÆ° º¯°æ ÇÔ¼ö
//------------------------------------------------------------------------------   
function chgSubImage(sub) {
	var menuID = document.getElementsByName('submenu');
	for (i=0;i<menuID.length;i++){
		num = i+1;
		if (num == sub){
			menuID[i].onmouseout = null;
			menuID[i].onmouseover = null;
			var strNum = String('00'+num);
			strNum = strNum.substring(strNum.length, strNum.length - 2);
			var imgID = document.getElementById('Image'+strNum);
			imgID.src = imgID.src.replace("menu"+strNum,"menu"+strNum+"_on");
		}
	}
}

function chgSubImage2(sub,sub2) {
	var menuID = document.getElementsByName('submenu');
	for (i=0;i<menuID.length;i++){
		num = i+1;
		if (num == sub){
			menuID[i].onmouseout = null;
			menuID[i].onmouseover = null;
			var strNum = String('00'+num);
			strNum = strNum.substring(strNum.length, strNum.length - 2);
			var imgID = document.getElementById('Image'+strNum);
			imgID.src = imgID.src.replace("menu"+strNum,"menu"+strNum+"_on");

			var menuSubID = document.getElementsByName('submenu_'+strNum);
			for (j=0;j<menuSubID.length;j++){
				subnum = j+1;
				if (subnum == sub2){
					menuSubID[j].onmouseout = null;
					menuSubID[j].onmouseover = null;
					var strSubNum = String('00'+subnum);
					strSubNum = strSubNum.substring(strSubNum.length, strSubNum.length - 2);
					var imgSubID = document.getElementById('Image'+strNum+'_s'+strSubNum);
					imgSubID.src = imgSubID.src.replace("menu"+strNum+'_s'+strSubNum,"menu"+strNum+'_s'+strSubNum+"_on");
				}

			}
		}
	}
}

//------------------------------------------------------------------------------
// ÀÌ¹ÌÁöÀÇ Å©±â¿¡ µû¶ó »õÃ¢ÀÇ Å©±â°¡ º¯°æµË´Ï´Ù.
//------------------------------------------------------------------------------  
function image_window(img) {
	var w = img.tmp_width;
	var h = img.tmp_height;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/3;

	if (w >= screen.width) {
		winl = 0;
		h = (parseInt)(w * (h / w));
	}

	if (h >= screen.height) {
		wint = 0;
		w = (parseInt)(h * (w / h));
	}

	var js_url = "<script language='JavaScript1.2'> \n";
		js_url += "<!-- \n";
		js_url += "var ie=document.all; \n";
		js_url += "var nn6=document.getElementById&&!document.all; \n";
		js_url += "var isdrag=false; \n";
		js_url += "var x,y; \n";
		js_url += "var dobj; \n";
		js_url += "function movemouse(e) \n";
		js_url += "{ \n";
		js_url += "  if (isdrag) \n";
		js_url += "  { \n";
		js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n";
		js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n";
		js_url += "    return false; \n";
		js_url += "  } \n";
		js_url += "} \n";
		js_url += "function selectmouse(e) \n";
		js_url += "{ \n";
		js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n";
		js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n";
		js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n";
		js_url += "  { \n";
		js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n";
		js_url += "  } \n";
		js_url += "  if (fobj.className=='dragme') \n";
		js_url += "  { \n";
		js_url += "    isdrag = true; \n";
		js_url += "    dobj = fobj; \n";
		js_url += "    tx = parseInt(dobj.style.left+0); \n";
		js_url += "    ty = parseInt(dobj.style.top+0); \n";
		js_url += "    x = nn6 ? e.clientX : event.clientX; \n";
		js_url += "    y = nn6 ? e.clientY : event.clientY; \n";
		js_url += "    document.onmousemove=movemouse; \n";
		js_url += "    return false; \n";
		js_url += "  } \n";
		js_url += "} \n";
		js_url += "document.onmousedown=selectmouse; \n";
		js_url += "document.onmouseup=new Function('isdrag=false'); \n";
		js_url += "//--> \n";
		js_url += "</"+"script> \n";

	var settings;

	if (g4_is_gecko) {
		settings  ='width='+(w+10)+',';
		settings +='height='+(h+10)+',';
	} else {
		settings  ='width='+w+',';
		settings +='height='+h+',';
	}
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars=no,';
	settings +='resizable=yes,';
	settings +='status=no';


	win=window.open("","image_window",settings);
	win.document.open();
	win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset=euc-kr'>\n");
	var size = "ÀÌ¹ÌÁö »çÀÌÁî : "+w+" x "+h;
	win.document.write ("<title>"+size+"</title> \n");
	if(w >= screen.width || h >= screen.height) {
		win.document.write (js_url);
		var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n ÀÌ¹ÌÁö »çÀÌÁî°¡ È­¸éº¸´Ù Å®´Ï´Ù. \n ¿ÞÂÊ ¹öÆ°À» Å¬¸¯ÇÑ ÈÄ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¼­ º¸¼¼¿ä. \n\n ´õºí Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '";
	}
	else
		var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '";
	win.document.write ("<style>.dragme{position:relative;}</style> \n");
	win.document.write ("</head> \n\n");
	win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n");
	win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
	win.document.write ("</body></html>");
	win.document.close();

	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
