function $html5Init() {
	var elements = ("abbr, article, aside, audio, canvas, datalist, details, fingure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video").split(",");
	var count = elements.length;
	for(var i = 0; i < count; i++) {
		document.createElement(elements[i]);
	}
}

// JavaScript Document
/**
 * ID °ªÀ¸·Î ¿ÀºêÁ§Æ® Ã£¾Æ ¹ÝÈ¯ÇØÁÖ´Â ÇÔ¼ö
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
 */
function $(tar) {
	if(tar && document.getElementById(tar)) {
		return document.getElementById(tar);
	} else {
		return null;
	}
}

/**
 * Å×±× »ý¼º ÇÔ¼ö
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
 */
function $C(tag) {
	return document.createElement(tag);
}

/**
 * A ¸µÅ©¸¦ °­Á¦·Î °É¾îÁÖ´Â ÇÔ¼ö
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
 */
function $L(urls, tar) {
	//alert(urls);
	if(!$("linkA")) {
		var oA = document.createElement("a");
		oA.id = "linkA";
		document.body.appendChild(oA);
		//alert(oA.href);
	} else {
		var oA = $("linkA");
	}
	oA.href = urls;
	if(tar != null && tar != "") {
		oA.target = tar;
	}
	oA.click();
}

/**
 * ÀÌ¹ÌÁö º¯°æÇØÁÖ´Â ÇÔ¼ö
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
 */
function $EC(target, url, time) {
	if(!time) time = 0.5;
	target.style.cursor = "hand";
	target.style.filter = "blendTrans(duration=" + time + ")";
	if(target.filters) target.filters.blendTrans.apply();
	target.src = url;
	if(target.filters) target.filters.blendTrans.play();
}

/**
 * ÅÜ ¹öÆ° »ý¼º Å¬·¡½º
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
 * ¼öÁ¤ÀÏ
 * 2011. 01. 24 : Å¬¸¯½Ã ¹öÆ° ¼±ÅÃ À¯¹« ¿É¼Ç ( $clickType ºÎºÐ Ãß°¡ )
 *
 * // ±âº»»ý¼º¹æ¹ý : var className = new $TSet('className', 'targetName');
 * className : Å¬·¡½º ÀÌ¸§À» Á¤ÇÏ¿© º¯¼ö·Î ¸¸µç´Ù.
 * 'className' : '' »çÀÌ¿¡ º¯¼ö·Î Á¤ÇÑ Å¬·¡½Ã ¸íÀ» ³Ö´Â´Ù
 * 'targetName' : '' »çÀÌ¿¡ Ãâ·ÂÇÒ °÷ÀÇ id °ªÀ» ÀÔ·ÂÇÑ´Ù ( ¿¹ <td id="yhView"></td> °¡ ÀÖÀ» °æ¿ì new $TSet('className', 'yhView');
 * // ¾ÆÀÌÅÛ Ãß°¡ ¹æ¹ý
 * className.AddItem(object); ÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¿© Ãß°¡
 * object ¼³Á¤ ¹æ¹ý : { name : 'tabName01....', over : '¿À¹öµÉ ÀÌ¹ÌÁö°æ·Î', out : '¾Æ¿ôµÉ ÀÌ¹ÌÁö°æ·Î', link : '¸µÅ©ÁÖ¼Ò', target : '¸µÅ©µÉ Å¸°Ù ÁöÁ¤', script : '½ºÅ©¸³Æ® ÇÔ¼ö' }
 * object °ªÁß script °ªÀÌ ÀÖÀ» °æ¿ì¿¡´Â link °ªÀÌ ¹«½ÃµÈ´Ù.
 * object °ªÁß name °ªÀ» ¹Ýµå½Ã ´Þ¶ó¾ß ÇÑ´Ù.
 * // Ãâ·ÂÇÏ±â
 * ¼±ÅÃµÇÁö ¾Ê°í Ãâ·ÂÇÏ±â : className.Init();
 * ¼±ÅÃÇÏ¸é¼­ Ãâ·ÂÇÏ±â : className.Select('ÅÜÀÌ¸§'); ÅÜ ÀÌ¸§ÀÌ¶õ - object °ªÁß name °ªÀ» ¸»ÇÑ´Ù.
	* -- ex --
			var className = new $TSet('className', 'targetName');
			className.AddItem({ name : 'tabName01', over : '/include/jgp/jpg.jpg', out : '/include/jgp/jpg.jpg', link : '#', target : '_self', script : 'show()' });
			className.Init();
 		className.Select('tabName01');
 */

function $TSet($className, $targetName) {
	this.clickType = true;
	this.classText = $className;
	this.objectArray = new Array();
	this.targetName = $targetName;
	this.choiceName = "";
	this.tabCount = 0;
	this.time = 0.1;
}

$TSet.prototype = {
	Init : function() {
		var oDiv = $(this.targetName);
		oDiv.innerHTML = "";
		
		if(this.objectArray == "undefined") return;
		
		var count, oTable, oTbody, oTr, oTd, i, oImg, oA;
		
		this.tabCount = this.objectArray.length;
		
		if(this.tabCount == 0) return;
		
		oTable = $C("table");
		oTable.cellSpacing = 0;
		oTable.cellPadding = 0;
		oTable.border = 0;
		oTbody = $C("tbody");
		oTr = $C("tr");
		
		for(i = 0; i < this.tabCount; i++) {
			oTd = $C("td");
			oA = $C("a");
			oA.href = this.objectArray[i].link;
			oA.target = this.objectArray[i].target;
			if(this.objectArray[i].out != "") {
				oImg = $C("img");
				oImg.src = (this.objectArray[i].name == this.choiceName && this.clickType) ? this.objectArray[i].over : this.objectArray[i].out;
				oImg.border = 0;
				oImg.id = this.classText + "" + this.objectArray[i].name;
				var over = this.objectArray[i].over;
				var out = this.objectArray[i].out;
				if(this.objectArray[i].name != this.choiceName || !this.clickType) {
					oImg.attachEvent("onmouseout", new Function("$EC($('" + oImg.id + "'), '" + out + "', '" + this.time + "');"));
					oImg.attachEvent("onmouseover", new Function("$EC($('" + oImg.id + "'), '" + over + "', '" + this.time + "');"));
				}
				clickFunction = (this.clickType) ? this.classText + ".Select('" + this.objectArray[i].name + "');" : "";
				if(this.objectArray[i].script != "") {
					clickFunction += " " + this.objectArray[i].script;
				}
				oImg.attachEvent("onclick", new Function(clickFunction));
			} else {
				oImg = $C("span");
				oImg.innerText = this.objectArray[i].name;
			}
			if(this.objectArray[i].name != this.choiceName && this.objectArray[i].script == "") {
				oA.appendChild(oImg);
				oTd.appendChild(oA);
			} else {
				oTd.appendChild(oImg);
			}
			oTr.appendChild(oTd);
		}
		
		oTbody.appendChild(oTr);
		oTable.appendChild(oTbody);
		
		oDiv.appendChild(oTable);
	},
	Select : function($choiceName) {
		this.choiceName = $choiceName;
		this.Init();
	},
	AddItem : function($object) {
		this.objectArray.push($object);
	},
	GetItem : function($index) {
		if(this.objectArray[$index] == "undefined") return "";
		else return this.objectArray[$index];
	},
	SetClickType : function(value) {
		this.clickType = value;
	},
	GetClickType : function() {
		return this.clickType;
	}
}

/**
 * ÇÃ·¡½Ã IE º¯°æÁ¡¿¡ ´ëÇÑ ¼¼ÆÃ Å¬·¡½º
 * Á¦ÀÛÀÏ : 2009. 11. 23
 * Á¦ÀÛÀÚ : lainTohoya
 * ¼öÁ¤ÀÏ
 * 2010.01.04 - FF ¹× SR¿¡¼­ µ¿ÀÛÇÏÁö ¾Ê´ø ¹®Á¦ ÇØ°á
	* -- ex --
			var className = new FlashInsert("id_name", "path", "width", "height");
			className.ObjectAdd("parameter Name", "value");
			className.EmbedAdd("embed Attribute Name", "value");
			className.Show();
 */

function FlashInsert(id, url, width, height, query, add) {
	this.addTop = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0\" width=\"" + width + "\" height=\"" + height + "\" id=\"" + id + "Object\">";
	this.addMiddle = "";
	this.addEmbedTop = "<embed src=\"" + url + "\" width=\"" + width + "\" height=\"" + height + "\" name=\"" + id + "Embed\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\"";
	this.addEmbedMiddle = "";
	this.addEmbedBottom = "/>";
	this.addBottom = "</object>";
	
	this.ObjectAdd("movie", url);
	
	/* 2011. 01. 24 Ãß°¡ Á¦ÀÛ */
	/* ³»¿ë : appendChild ¸¦ ÀÌ¿ëÇÏ¿© Ãß°¡ ÇÏ´Â ¹æ½Ä */
	/*this.oObject = this.$C("object");
	this.oObject.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
	this.oObject.codeBase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0";
	this.oObject.width = width;
	this.oObject.height = height;
	this.oObject.id = id + "Object";

	this.oEmbed = this.$C("<embed pluginspage=\"http://www.adobe.com/go/getflashplayer\">");
	this.oEmbed.id = id + "Embed";
	this.oEmbed.type = "application/x-shockwave-flash";
	this.oEmbed.src = url;
	this.oEmbed.width = width;
	this.oEmbed.height = height;*/
	//this.oEmbed.pluginspage = "http://www.adobe.com/go/getflashplayer";
	//this.oObject.innerHTML(this.oEmbed.outerHTML);

}

FlashInsert.prototype = {
	$ : function(tar) {
		if(tar && document.getElementById(tar)) {
			return document.getElementById(tar);
		}
	},
	$C : function(tag) {
		return document.createElement(tag);
	},
	ObjectAdd : function(name, value) {
		this.addMiddle += "<param name=\"" + name + "\" value=\"" + value + "\"/>\n";
		if(this.oObject != undefined) {
			var oParam = this.$C("param");
			oParam.name = name;
			oParam.value = value;
			this.oObject.appendChild(oParam);
		}
	},
	EmbedAdd : function(name, value) {
		this.addEmbedMiddle += " " + name + "=\"" + value + "\"";
		if(this.oEmbed != undefined && this.oEmbed[name] != undefined) {
			this.oEmbed[name] = value;
		}
		/*
		switch(name) {
			case "width":
				this.oEmbed.width = value;
			break;
			case "height":
				this.oEmbed.height = value;
			break;
		}*/
	},
	Show : function() {
		var htmls = "";
		htmls = this.addTop;
		htmls += this.addMiddle;
		htmls += this.addEmbedTop;
		htmls += this.addEmbedMiddle;
		htmls += this.addEmbedBottom;
		htmls += this.addBottom;
		document.write(htmls);
		//alert(htmls);
	},
	AppendChild : function($targetName) {
		var target = this.$($targetName);
		if(target != null) {
			target.appendChild(this.oOjbect);
		}
	}
}


/**
 * ½ºÅ©·Ñ½Ã ¾Æ·¡ À§·Î ¿òÁ÷ÀÌ´Â ·¹ÀÌ¾î Å¬·¡½º
 * Á¦ÀÛÀÏ : 2011. 01. 20
 * Á¦ÀÛÀÚ : lainTohoya
	* -- ex --
			var className = new Class_Scroll_Layer("layerId", "className");
 */
function Class_Scroll_Layer(id, className) {
	this.String_ClassName = className;
	this.String_Browser = "IE";
	if(document.layers) this.String_Browser = "NS";
	if(document.all) this.String_Browser = "IE";
	
	this.Object_Tar = $(id);
	this.Int_LastY = 0;
	this.Int_LastX = 0;
	this.Int_LimitY = 0;
	this.setInter;
	
	if(this.Object_Tar != null) {
		this.Init();
	}
}
Class_Scroll_Layer.prototype = {
	Init : function() {
		this.Int_LimitY = (document.body.scrollHeight) ? document.body.scrollHeight : 0;
		this.setInter = window.setInterval(this.String_ClassName + ".ScrollLoop()", 1);
	},
	
	ScrollLoop : function() {
		var Int_DifferentY = 0;
		var Int_Percent = 0;
		switch(this.String_Browser) {
			case "IE":
				Int_DifferentY = document.body.scrollTop;
			break;
			case "NS":
				Int_DifferentY = self.pageYOffset;
			break;
		}
		if(Int_DifferentY != this.Int_LastY) {
			Int_Percent = .1 * (Int_DifferentY - this.Int_LastY);
			if(Int_Percent > 0) Int_Percent = Math.ceil(Int_Percent);
			else Int_Percent = Math.floor(Int_Percent);
			
			switch(this.String_Browser) {
				case "IE":
					this.Object_Tar.style.pixelTop += Int_Percent;
				break;
				case "NS":
					this.Object_Tar.top += Int_Percent;
				break;
			}
			
			this.Int_LastY = this.Int_LastY + Int_Percent;
		}
	}
}


/**
	* create by LAINtoHOYA
	* create Date : 2011. 03. 28
	* -- ex --
			var ajax = new $AjaxjHo("ajax");
			ajax.Method_Type = "GET";
			ajax.Get_Out(divBody, $url, "html");
	*/
function $AjaxjHo($className) {
	this.name = $className;
	this.XMLHTTP = null;
	this.String_Method = "POST";
	this.Boolean_Sync = false;
	this.target = null;
}

$AjaxjHo.prototype = {
	XML_HTTP_SET : function() {
		try{
			if(window.XMLHttpRequest) {
				this.XMLHTTP = new XMLHttpRequest();

				if(this.XMLHTTP.readyState == null ) {
					this.XMLHTTP.readyState = 1;
					
					this.XMLHTTP.addEventListener("load", function () {
						this.XMLHTTP.readyState = 4;
						if(typeof this.XMLHTTP.onreadystatechange == "function") {
							this.XMLHTTP.onreadystatechange();
						}
					}, false);
					
				}
			} else {
				this.XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
			}
		} catch (e) {
			alert('No Brawser');
		}
	},
	
	Method_Type : function(_value) {
		if(typeof _value != "string") {
			this.String_Method = "GET";
		} else if(_value.toUpperCase() != "POST") {
			this.String_Method = "GET";
		} else {
			this.String_Method = _value;
		}
	},
	
	Sync_Type : function(_value) {
		if(typeof _value != "boolean") this.Boolean_Sync = false;
		else this.Boolean_Sync = _value;
	},
	
	Get_Out : function(_target, _url, _type, _encode, _request) {
		this.target = (typeof _target == "string") ? $(_target) : _target;
		if(this.target == null) return;
		if(!_encode) _encode = "utf-8";
		if(!_request) _request = "";
		if(!_type) _type = "";
		if(typeof _url == "string") {
			this.XML_HTTP_SET();
			if(_type != null && _type != "" && _type == "html") this.String_Method = "GET"
			this.XMLHTTP.open(this.String_Method, _url, this.Boolean_Sync);
			
			if(_type != null && _type != "" && _type == "html") {
				this.XMLHTTP.setRequestHeader('Content-Type', 'text/xml; charset=' + _encode);
			} else {
				this.XMLHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=' + _encode);
			}
			
			if((_request == null || _request == "") && this.String_Method.toUpperCase() == "POST") this.XMLHTTP.send(_request);
			else this.XMLHTTP.send(null);
			
			if(this.Boolean_Sync) {
				var This = this;
				this.XMLHTTP.onreadystatechange = function() { This.Set_CollBack(); }
			} else {
				this.Set_CollBack();
			}
		}
	},
	
	Set_CollBack : function() {
		if(this.XMLHTTP.readyState == 4) {
			//if(this.XMLHTTP.status == 200 || this.XMLHTTP.status == 304) {
				this.target.innerHTML = this.XMLHTTP.responseText;
			//}
		} else {
			this.target.innerHTML = "wait";
		}
	}
}

/**
	* create Date : 2011. 03. 24
 * window popup Class
	* -- ex --
			// index file
			var oPop = new $PWClass("oPop");
			oPop.SetFeatures({ top : 0, left : 0, width : 376, height : 470, resizable : 1, scrollbars : 0 });
			oPop.Popup("/include/html/popup110323.html", "mainPopup", false);
			
			// popup file
			var oPop = new $PWClass("oPop");
			 - script setting -
				oPop.CloseWindow("mainPopup", 1);
 */
function $PWClass($className) {
	this.className = $className;
	this.features = {}; //top : "", left : "", width : "", height : "", toolbar : "", directories : "", status : "", menubar : "", scrollbars : "", resizable : ""};
	this.wArr = new Array();
	this.domain = document.domain;
	this.date_Start = "";
	this.date_End = "";
	this.String_CloseText = "ÇÏ·çµ¿¾È Ã¢´Ý±â";
	this.Int_Day = 1;
}

$PWClass.prototype = {
	Popup : function($url, $id, $title, $open, $type) {
		var nowDate = new Date();
		var date = nowDate.getTime();
		if($url == "" || $url == undefined) return;
		if($id == "" || $id == undefined) $id = this.wArr.length;
		if(!$type) $type = "window";
		if(!$title) $title = this.className + "_" + $id;
		if($open == undefined) $open = false;
		if(this.date_Start != "" && this.date_Start != 0) {
			if(this.date_Start > date) return;
		}
		if(this.date_End != "" && this.date_End != 0) {
			if(this.date_End <= date) return;
		}
		if($open || this.Get_CookiePop($id) != "Y") {
			var divBody = $C("div");
			
			var ajax = new $AjaxjHo("ajax");
			ajax.Method_Type = "GET";
			ajax.Get_Out(divBody, $url, "html");
					
			var bDiv = $C("div");
			bDiv.style.width = "100%";
			bDiv.style.height = "22px";
			bDiv.style.textAlign = "right";
			bDiv.style.position = "relative";
			bDiv.style.display = "inline-block";
			//var bA = ($type == "div") ? $C("<a onclick=\"" + this.className + ".CloseWindow('" + $id + "',1 ,'" + $type + "');\">") : $C("<a onclick=\"opener." + this.className + ".CloseWindow('" + $id + "',1 ,'" + $type + "', window);\">");
			var bA = $C("a");
			var This = this;
			var clickEvent = ($type == "div") ? "" : "opener.";
			clickEvent += "" + this.className + ".CloseWindow('" + $id + "',1 ,'" + $type + "'";
			clickEvent += ($type == "div") ? "" : ", window";
			clickEvent += ")";
			
			bA.href = "javascript:" + clickEvent + ";";
			
			bA.style.display = "inline-block";
			bA.innerHTML = "<span>" + this.String_CloseText + "</span>&nbsp;<span style=\"font-family:Tahoma; line-height:12px; font-weight:bolder; font-size:8pt; display:inline-block; border:1px #DBDBDB solid; padding-left:2px; padding-right:2px;\">X</span>";
			
			bA.noWrap = true;
			bA.style.color = "#DBDBDB";
			bA.style.height = "17px";
			bA.style.cursor = "pointer";
			bA.style.textDecoration = "none";
			bA.style.paddingLeft = "10px";
			bA.style.paddingRight = "10px";
			bA.style.paddingTop = "5px";
			bDiv.style.backgroundColor = "#999999";
			bDiv.appendChild(bA);
			
			switch($type) {
				case "div":
					var oDiv = $C("div");
					oDiv.id = this.className + "_" + $id;
					
					var tDiv = $C("div");
					tDiv.style.width = "100%";
					tDiv.style.height = "23px";
					tDiv.style.position = "relative";
					tDiv.style.textAlign = "right";
					
					var oA = $C("a");
					oA.href = "javascript:;";
					if(oA.attachEvent) {
						oA.attachEvent("onclick", new Function(this.className + ".CloseDivNoCookie($('" + oDiv.id + "'), 'hidden');"));
					} else if(oA.addEventListener) {
						oA.addEventListener("click", new Function(this.className + ".CloseDivNoCookie($('" + oDiv.id + "'), 'hidden');"), false);
					}
					oA.style.float = "right";
					oA.style.display = "inline-block";
					oA.style.position = "relative";
					oA.style.color = "#999999";
					oA.style.backgroundColor = "#DBDBDB";
					oA.style.border = "1px #999999 solid";
					oA.style.decoration = "none";
					oA.style.cursor = "pointer";
					oA.style.textAlign = "center";
					oA.style.fontSize = "12pt";
					oA.style.fontWeight = "bolder";
					oA.style.paddingTop = "4px";
					oA.style.width = "20px";
					oA.style.height = "15px";
					oA.title = "Ã¢´Ý±â";
					oA.style.lineHeight = "12px";
					oA.innerHTML = "X";
					
					oDiv.style.position = "absolute";
					switch($BS()) {
						default:
							oDiv.style.top = this.features.top + "px";
							oDiv.style.left = this.features.left + "px";
					}
					oDiv.style.zIndex = 9999;
					oDiv.style.width = this.features.width + 4;
					oDiv.style.backgroundColor = "#999999";
					oDiv.style.padding = "3px";
					
					tDiv.appendChild(oA);
					oDiv.appendChild(tDiv);
					oDiv.appendChild(divBody);
					oDiv.appendChild(bDiv);
					document.body.appendChild(oDiv);
				break;
				case "window":
				default:
					var wins = window.open("", this.className + "_" + $id, this.Get_Features());
					var oDiv = $C("div");
					oDiv.appendChild(divBody);
					oDiv.appendChild(bDiv);
					
					var htmls = "";
					htmls += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
					htmls += "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
					htmls += "<head>";
					htmls += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
					htmls += "<title>" + $title + "</title>";
					htmls += "<style type=\"text/css\">";
					htmls += "body, div, span, ul, li, a { margin:0; padding:0; font-size:9pt; }";
					htmls += "body { margin-left: 0px; margin-top: 0px;	margin-right: 0px;	margin-bottom: 0px; }";
					htmls += "body, html { width:100%; height:100%; }";
					htmls += "</style>";
					htmls += "</head>";
					htmls += "<body>";
					wins.document.write(htmls);
					wins.document.write(oDiv.innerHTML);
					wins.document.write("</body></html>");
			}
		}
	},
	
	CloseDivNoCookie : function(obj, type) {
		if(obj != null) {
			obj.style.visibility = type;
			obj.style.display = "none";
		}
	},
	
	/**
		* $id ÄíÅ°·Î ³²±æ ¾ÆÀÌµð¸í
		* $day ÄíÅ°¸¦ ³²±æ ½Ã°£
		*/
	CloseWindow : function($id, $day, $type, $window) {
		if($day == undefined) $day = 1;
		this.Set_PopCookie(this.className + "_" + $id, "Y", $day);
		switch($type) {
			case "div":
				if($(this.className + "_" + $id)) {
					$(this.className + "_" + $id).style.visibility = "hidden";
					$(this.className + "_" + $id).style.display = "none";
				}
			break;
			case "window":
			default:
				if($window != null) {
					$window.close();
				} else {
					window.close();
				}
		}
	},
	
	Set_Day : function(value) {
		if(typeof value == "number" || typeof value == "int") this.Int_Day = value;
		else this.Int_Day = 1;
	},
	
	Set_CloseText : function(value) {
		if(typeof value != "string") this.String_CloseText = "ÇÏ·çµ¿¾È Ã¢´Ý±â";
		else this.String_CloseText = value;
	},
	
	Cut_Text : function(str, start, limit) {
		var text = "";
		var len = str.length;
		if(!start) start = 0;
		if(!limit) limit = 1;
		for(var i=start; i < start + limit; i++) {
			text += "" + str.charAt(i);
		}
		return text;
	},
	
	Set_Timer : function(start, end) {
		var saveDate = new Date(this.Cut_Text(start, 0, 4), Number(this.Cut_Text(start, 4, 2)) - 1, this.Cut_Text(start, 6, 2), this.Cut_Text(start, 8, 2), this.Cut_Text(start, 10, 2), this.Cut_Text(start, 12, 2));
		this.date_Start = (start == "") ? "" : saveDate.getTime();
		saveDate = new Date(this.Cut_Text(end, 0, 4), Number(this.Cut_Text(end, 4, 2)) - 1, this.Cut_Text(end, 6, 2), this.Cut_Text(end, 8, 2), this.Cut_Text(end, 10, 2), this.Cut_Text(end, 12, 2));
		this.date_End = (end == "") ? "" : saveDate.getTime();
	},
	Set_StartDate : function(date) {
		var saveDate = new Date(this.Cut_Text(date, 0, 4), Number(this.Cut_Text(date, 4, 2)) - 1, this.Cut_Text(date, 6, 2), this.Cut_Text(date, 8, 2), this.Cut_Text(date, 10, 2), this.Cut_Text(date, 12, 2));
		this.date_Start = (date == "") ? "" : saveDate.getTime();
	},
	Set_EndDate : function(date) {
		var saveDate = new Date(this.Cut_Text(date, 0, 4), Number(this.Cut_Text(date, 4, 2)) - 1, this.Cut_Text(date, 6, 2), this.Cut_Text(date, 8, 2), this.Cut_Text(date, 10, 2), this.Cut_Text(date, 12, 2));
		this.date_End = (date == "") ? "" : saveDate.getTime();
	},
	Set_Domain : function($domain) {
		if($domain == undefined) $domain = document.domain;
		this.domain = $domain;
	},
	Set_PopCookie : function($name, $value, $expiredays) {
		var todayDate = new Date();
		todayDate.setDate( todayDate.getDate() + $expiredays );
		document.cookie = $name + "=" + escape($value) + "; path=/; domain=." + this.domain + "; expires=" + todayDate.toGMTString() + ";"
	},
	
	Get_Features : function() {
		var str = "";
		var features = "";
		for(str in this.features) {
			features += (features == "") ? "" : ", ";
			features += str + "=" + this.features[str];
		}
		return features;
	},
	
	Get_CookiePop : function($id) {
		var prefix = this.className + "_" + $id + "=";
		var cookieStartIndex = document.cookie.indexOf(prefix);
		if (cookieStartIndex == -1) 	return null;
		var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
		if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
		return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
	},
	
	Set_Top : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.top = $value;
		}
	},
	Set_Left : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.left = $value;
		}
	},
	Set_Width : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.width = $value;
		}
	},
	SetHeight : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.height = $value;
		}
	},
	Set_Toolbar : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.toolbar = value;
		}
	},
	Set_Directories : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.directories = $value;
		}
	},
	Set_Status : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.status = $value;
		}
	},
	Set_Menubar : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.menubar = $value;
		}
	},
	Set_Scrollbars : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.scrollbars = $value;
		}
	},
	Set_Resizable : function($value) {
		if($value != undefined && $value != "" || $value == 0) {
			this.features.resizable = $value;
		}
	},
	Set_Features : function($object) {
		if($object != undefined && $object != "" && $object != null) {
			this.features = $object;
		}
	}
}

/**
	* BROWSE OUT
	*/
function $BS() {
	var browse = "IE";
	if(navigator.userAgent.indexOf("Chrome") >= 0) {
		browse = "CR";
	} else if(navigator.userAgent.indexOf("Safari") >= 0) {
		browse = "SR";
	} else if(navigator.userAgent.indexOf("Firefox") >= 0) {
		browse = "FF";
	} else if(navigator.userAgent.indexOf("Opera") >= 0) {
		browse = "OP";
	}
	return browse;
}

/**
	* Å¬·¡½º¸í : Xml ·Îµù Å¬·¡½º
	* Á¦ÀÛÀÏ : 11-03-14
	* ¼öÁ¤ÀÏ : 11-03-14
	* ÀúÀÛÀÚ : send@tohoya.com
	* -- ex --
			var xmlLoader = new $XMLoad("/include/xml.xml");
			xmlLoader.GetMenuArray("mainMenu", "depth"); // special Get Out
			xmlLoader.GetXml() // original Xml Get Out
*/
function $XMLoad(url) {
	this.xmlDoc = null;
	this.xmlArray = new Array();
	this.menuArray = new Array();
	this.XMLData = null;
	this.park = 1;
	if(String(url) != "undefined") {
		this.Load(url);
	}
}

$XMLoad.prototype = {
	Load : function(url) {
		if(String(url) == "undefined" || String(url) == "") {
			return;
		}
		if(document.implementation && document.implementation.createDocument) {
			this.xmlDoc = document.implementation.createDocument("","",null);
		} else if (window.ActiveXObject) {
			this.xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		}
		if(this.xmlDoc != null) {
			try {
				this.xmlDoc.async = false;
				this.xmlDoc.load(url);
			} catch(e) {
				var xmlHttp = new window.XMLHttpRequest();
				xmlHttp.open("GET", url, false);
				xmlHttp.send(null);
				this.xmlDoc = xmlHttp.responseXML;
			}
			this.XMLData = this.xmlDoc.documentElement;
		}
	},
	
	GetMenuArray : function(mainMenu, depthType) {
			return this.GetNodeSub(this.XMLData.getElementsByTagName(mainMenu)[0], depthType, 1);
	},
	
	GetXml : function() {
			return this.XMLData;
	},
	
	GetNodeSub : function(xml, depthType, depth) {
		var arr = new Array();
		var i = 0;
		var j = 0;
		var xmlMenu = xml.getElementsByTagName(depthType + "" + depth);
		var count = xmlMenu.length;
		while(i < count) {
			var obj = new Object(); //{ subMenu : new Array() };
			var node = xmlMenu[i];
			var attr = node.attributes;
			var aCount = attr.length;
			j = 0;
			while(j < aCount) {
				var attrData = attr[j];
				obj[attrData.name] = attrData.value;
				j++;
			}
			var sCount = node.getElementsByTagName(depthType + "" + (depth + 1)).length;
			if(obj.subMenu == "undefined") {
				obj.subMenu = new Array();
			}
			if(sCount > 0) {
				obj.subMenu = this.GetNodeSub(node, depthType, (depth + 1));
			}
			arr.push(obj);
			i++;
		}
		return arr;
	}
}

/**
	* Menu Module
	* create Date : 2011. 03. 24
	* create by LAINtoHOYA
	* -- ex --
			var className = new MenuInsert("className", "/include/xml.xml");
			className.Init("innerObjectId");
			
			// xml type
			<?xml version="1.0" encoding="euc-kr"?>
			<data>
			<mainMenu>
				<depth1 nameKr="depthName" out="/include/gif/leftMenuBtnOut04.gif" over="/include/gif/leftMenuBtnOver04.gif" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
					<depth2 nameKr="Scope" out="/include/gif/subMenuBtnOut04-01.gif" over="/include/gif/subMenuBtnOver04-01.gif" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
						<depth3 nameKr="MSA pro" out="/include/gif/subMenuBtnOut04-01-01.gif" over="/include/gif/subMenuBtnOver04-01-01.gif" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self"/>
					</depth2>
				</depth1>
			</mainMenu>
	*/
function MenuInsert(className, url) {
	this.name = className;
	this.intervalArr = new Array();
	this.XMLoad = null;
	this.menuArray = null;
	this.menuCount = 0;
	this.choiceNo = 0;
	this.choiceNoSub = 0;
	this.interval = "";
	if(String(url) != "undefined") {
		this.XMLoad = new $XMLoad(url);
	}
}

MenuInsert.prototype = {
	
	/**
		* Menu Setting
		*/
	Init : function(id) {
		var target = $(id);
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		this.menuArray = this.XMLoad.GetMenuArray("mainMenu", "depth");
		this.menuCount = this.menuArray.length;
		vDiv = $C("div");
		for(var i=0; i < this.menuCount; i++) {
			oDiv = $C("div");
			oDiv.id = "leftMenuDiv" + (i + 1);
			oDiv.className = "leftMenuDivBack";
			oImg = $C("img");
			oImg.src = this.menuArray[i].out;
			oImg.alt = this.menuArray[i].nameKr;
			oImg.id = "leftMenuImage" + (i + 1);
			oImg.style.cursor = "hand";
			oImg.border = 0;
			var rollOverFunction = this.name + ".Motion_Controller('" + (i + 1) + "');";
			var rollOutFunction = this.name + ".Motion_Controller('');";
			if(oImg.attachEvent) {
				oImg.attachEvent("onmouseover", new Function(rollOverFunction));
				oImg.attachEvent("onmouseout", new Function(rollOutFunction));
			} else if(oImg.addEventListener) {
				oImg.addEventListener("mouseover", new Function(rollOverFunction), false);
				oImg.addEventListener("mouseout", new Function(rollOutFunction), false);
			}
			oA = $C("a");
			oA.href = this.menuArray[i].link;
			oA.target = this.menuArray[i].target;
			//$("testView").value += "\n ¸Þ´º : " + this.menuArray[i].over;
			
			oA.appendChild(oImg);
			if(this.menuArray[i].subMenu.length > 0) {
				sDiv = $C("div");
				this.intervalArr["leftMenuImage" + (i + 1) + "Sub"] = { interval : "", alpha : 0 };
				sDiv.id = "leftMenuImage" + (i + 1) + "Sub";
				sDiv.className = "subMenuDiv";
				sDiv.style.display = "none";
				sDiv.style.filter = "alpha(opacity=0)";
				if(sDiv.attachEvent) {
					sDiv.attachEvent("onmouseover", new Function(rollOverFunction));
					sDiv.attachEvent("onmouseout", new Function(rollOutFunction));
				} else if(oImg.addEventListener) {
					sDiv.addEventListener("mouseover", new Function(rollOverFunction), false);
					sDiv.addEventListener("mouseout", new Function(rollOutFunction), false);
				}
				this.Sub_Init(sDiv, this.menuArray[i].subMenu, (i + 1));
				oDiv.appendChild(sDiv);
			}
			oDiv.appendChild(oA);
			vDiv.appendChild(oDiv);
		}
		
		target.appendChild(vDiv);
	},
	Test : function() {
	},
	/**
		* Add Sub Menu
		*/
	Sub_Init : function(target, array, no) {
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		var count = array.length;
		for(var i=0; i < count; i++) {
			oImg = $C("img");
			oImg.src = array[i].out;
			oImg.alt = array[i].nameKr;
			oImg.id = "leftMenuSubImage" + no + "-" + (i + 1);
			oImg.style.cursor = "hand";
			oImg.border = 0;
			var rollOverFunction = this.name + ".Motion_Controller('" + no + "');" + " " + this.name + ".Motion_Controller_Sub('" + no + "', '" + (i + 1) + "');";
			var rollOutFunction = this.name + ".Motion_Controller_Sub('" + no + "', '');";

			if(oImg.attachEvent) {
				oImg.attachEvent("onmouseover", new Function(rollOverFunction));
				oImg.attachEvent("onmouseout", new Function(rollOutFunction));
			} else if(oImg.addEventListener) {
				oImg.addEventListener("mouseover", new Function(rollOverFunction), false);
				oImg.addEventListener("mouseout", new Function(rollOutFunction), false);
			}
			
			oA = $C("a");
			oA.href = array[i].link;
			oA.target = array[i].target;
			//$("testView").value += "\n ¸Þ´º : " + array[i].over;
			
			oA.appendChild(oImg);
			target.appendChild(oA);
		}
	},
	
	/**
		* Main Menu Controller
		*/
	Motion_Controller : function(no) {
		this.choiceNo = no;
		var i;
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		for(i = 0; i < this.menuCount; i++) {
			oImg = $("leftMenuImage" + (i + 1));
			if(no == (i + 1)) {
				this.Effect_Button(oImg, this.menuArray[i].over, "rollOver", true);
			} else {
				this.Effect_Button(oImg, this.menuArray[i].out, "rollOut", true);
			}
		}
	},
	
	/**
		* Sub Menu Controller
		*/
	Motion_Controller_Sub : function(mNo, sNo) {
		this.choiceNoSub = sNo;
		var i;
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		var count = this.menuArray[mNo - 1].subMenu.length;
		for(i = 0; i < count; i++) {
			oImg = $("leftMenuSubImage" + mNo + "-" + (i + 1));
			if(sNo == (i + 1)) {
				this.Effect_Button(oImg, this.menuArray[mNo - 1].subMenu[i].over, "rollOver", false);
			} else {
				this.Effect_Button(oImg, this.menuArray[mNo - 1].subMenu[i].out, "rollOut", false);
			}
		}
	},
	
	/**
		* Button Effect
		*/
	Effect_Button : function(oImg, url, type, subView) {
		var oDiv;
		$EC(oImg, url, 0.2);
		if($(oImg.id + "Sub") != null && subView == true) {
			this.Tweens($(oImg.id + "Sub"), type);
		}
	},
	
	/**
		* Sub Effect Function
		*/
	Tweens : function(obj, type) {
		/**/
		clearInterval(this.intervalArr[obj.id].interval);
	 var interval = "";
		var alpha = this.intervalArr[obj.id].alpha;
		switch(type) {
			case "rollOver":
				obj.style.display = "block";
				if(obj.attachEvent && $BS() != "OP") {
					if(obj.style.filter != "alpha(opacity=100)") {
						this.intervalArr[obj.id].interval = setInterval(function() {
							var tmpArr = obj.style.filter.split("=");
							tmpArr = tmpArr[1].split(")");
							var alpha = Number(tmpArr[0]);
							if(alpha < 100) {
								alpha += (100 - alpha) * 0.50;
								obj.style.filter = "alpha(opacity=" + alpha + ")";
							} else {
								clearInterval(interval);
							}
						}, 50);
						interval = this.intervalArr[obj.id].interval;
					}
				}
			break;
			case "rollOut":
				if(obj.attachEvent && $BS() != "OP") {
					clearInterval(this.intervalArr[obj.id].interval);
					this.intervalArr[obj.id].interval = setInterval(function() {
						var tmpArr = obj.style.filter.split("=");
						tmpArr = tmpArr[1].split(")");
						var alpha = Number(tmpArr[0]);
						if(alpha > 0) {
							alpha += Math.floor((0 - alpha) * 0.5);
							obj.style.filter = "alpha(opacity=" + alpha + ")";
						} else {
							obj.style.display = "none";
							clearInterval(interval);
						}
					}, 50);
					interval = this.intervalArr[obj.id].interval;
				} else {
					obj.style.display = "none";
				}
			break;
		}
		/**/
	}
}

/**
	* Menu Module
	* create Date : 2011. 03. 24
	* create by LAINtoHOYA
	* -- ex --
			var className = new MenuNewInsert("className", "/include/xml.xml");
			className.Init("innerObjectId");
			
			// xml type
			<?xml version="1.0" encoding="euc-kr"?>
			<data>
			<mainMenu>
				<depth1 nameKr="depthName" button="/include/png/leftMenuBtn04.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
					<depth2 nameKr="Scope" button="/include/png/subMenuBtn04-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
						<depth3 nameKr="MSA pro" button="/include/png/subMenuBtn04-01-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self"/>
					</depth2>
				</depth1>
			</mainMenu>
	*/
function MenuNewInsert(className, url) {
	this.name = className;
	this.intervalArr = new Array();
	this.XMLoad = null;
	this.menuArray = null;
	this.menuCount = 0;
	this.choiceNo = 0;
	this.choiceNoSub = 0;
	this.selectNo = 0;
	this.interval = "";
	if(String(url) != "undefined") {
		this.XMLoad = new $XMLoad(url);
	}
}

MenuNewInsert.prototype = {
	
	/**
		* Menu Setting
		*/
	Init : function(id) {
		var target = $(id);
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv, oEm, oSpan, oMenu, oLi;
		this.menuArray = this.XMLoad.GetMenuArray("mainMenu", "depth");
		this.menuCount = this.menuArray.length;
		oMenu = $C("menu");
		oMenu.className = "navi_btn";
		for(var i=0; i < this.menuCount; i++) {
			oLi = $C("li");
			oA = $C("a");
			oA.id = "leftMenuImage" + (i + 1);
			oA.className = "_menu out";
			oA.href = this.menuArray[i].link;
			oA.target = this.menuArray[i].target;
			oA.title = this.menuArray[i].nameKr;
			oA.style.backgroundImage = "url(" + this.menuArray[i].button + ")";
			
			var rollOverFunction = this.name + ".Motion_Controller('" + (i + 1) + "', false);";
			var rollOutFunction = this.name + ".Motion_Controller('', false);";
			if(oA.attachEvent) {
				oA.attachEvent("onmouseover", new Function(rollOverFunction));
				oA.attachEvent("onmouseout", new Function(rollOutFunction));
			} else if(oA.addEventListener) {
				oA.addEventListener("mouseover", new Function(rollOverFunction), false);
				oA.addEventListener("mouseout", new Function(rollOutFunction), false);
			}
			
			//vDiv = $C("div");
			if(this.menuArray[i].subMenu && this.menuArray[i].subMenu.length > 0) {
				sDiv = $C("div");
				this.intervalArr["leftMenuImage" + (i + 1) + "Sub"] = { interval : "", alpha : 0 };
				sDiv.id = "leftMenuImage" + (i + 1) + "Sub";
				sDiv.className = "subMenuDiv";
				sDiv.style.display = "none";
				sDiv.style.filter = "alpha(opacity=0)";
				if(sDiv.attachEvent) {
					sDiv.attachEvent("onmouseover", new Function(rollOverFunction));
					sDiv.attachEvent("onmouseout", new Function(rollOutFunction));
				} else if(sDiv.addEventListener) {
					sDiv.addEventListener("mouseover", new Function(rollOverFunction), false);
					sDiv.addEventListener("mouseout", new Function(rollOutFunction), false);
				}
				this.Sub_Init(sDiv, this.menuArray[i].subMenu, (i + 1));
				oLi.appendChild(sDiv);
			}
			oLi.appendChild(oA);
			oMenu.appendChild(oLi);
		}
		target.appendChild(oMenu);
	},
	/**
		* Add Sub Menu
		*/
	Sub_Init : function(target, array, no) {
		var oTable, oTbody, oTr, oTd, oImg, oA, oLi, oMenu, sDiv;
		var count = array.length;
		oMenu = $C("menu");
		oMenu.className = "navi_btn_sub";
		for(var i=0; i < count; i++) {
			oLi = $C("li");
			oA = $C("a");
			oA.id = "leftMenuSubImage" + no + "-" + (i + 1);
			oA.className = "_subMenu out";
			oA.href = array[i].link;
			oA.target = array[i].target;
			oA.title = array[i].nameKr;
			oA.style.backgroundImage = "url(" + array[i].button + ")";
			
			var rollOverFunction = this.name + ".Motion_Controller('" + no + "', false);" + " " + this.name + ".Motion_Controller_Sub('" + no + "', '" + (i + 1) + "');";
			var rollOutFunction = this.name + ".Motion_Controller_Sub('" + no + "', '');";
			
			if(oA.attachEvent) {
				oA.attachEvent("onmouseover", new Function(rollOverFunction));
				oA.attachEvent("onmouseout", new Function(rollOutFunction));
			} else if(oA.addEventListener) {
				oA.addEventListener("mouseover", new Function(rollOverFunction), false);
				oA.addEventListener("mouseout", new Function(rollOutFunction), false);
			}
			oLi.appendChild(oA);
			oMenu.appendChild(oLi);
		}
		target.appendChild(oMenu);
	},
	
	Focus_Menu : function(pgCode) {
		var pg = pgCode.split("/");
		this.selectNo = pg[0];
		this.Motion_Controller("", true);
	},
	
	/**
		* Main Menu Controller
		*/
	Motion_Controller : function(no, style) {
		this.choiceNo = no;
		var i;
		var oA;
		var type = (style == false) ? true : false;
		if(no == "") {
			no = this.selectNo;
			type = (no == 0) ? true : false;
			if(this.selectNo > 0) {
				oA = $("leftMenuImage" + this.selectNo);
				this.Tweens($(oA.id + "Sub"), "rollOut");
			}
		}
		for(i = 0; i < this.menuCount; i++) {
			oA = $("leftMenuImage" + (i + 1));
			if(no == (i + 1)) {
				this.Effect_Button(oA, "rollOver", type);
			} else {
				this.Effect_Button(oA, "rollOut", true);
			}
		}
	},
	
	/**
		* Sub Menu Controller
		*/
	Motion_Controller_Sub : function(mNo, sNo) {
		this.choiceNoSub = sNo;
		var i;
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		var count = this.menuArray[mNo - 1].subMenu.length;
		var type = (this.selectNo != 0) ? true : false;
		
		for(i = 0; i < count; i++) {
			oA = $("leftMenuSubImage" + mNo + "-" + (i + 1));
			if(sNo == (i + 1)) {
				this.Effect_Button(oA, "rollOver", false);
			} else {
				this.Effect_Button(oA, "rollOut", type);
			}
		}
	},
	
	/**
		* Button Effect
		*/
	Effect_Button : function(oA, type, subView) {
		var oDiv;
		switch(type) {
			case "rollOver":
				oA.className = "_menu over";
			break;
			case "rollOut":
				oA.className = "_menu out";
			break;
			case "click":
				oA.className = "_menu click";
			break;
		}
		if($(oA.id + "Sub") != null && subView == true) {
			this.Tweens($(oA.id + "Sub"), type);
		}
	},
	
	/**
		* Sub Effect Function
		*/
	Tweens : function(obj, type) {
		/**/
		clearInterval(this.intervalArr[obj.id].interval);
	 var interval = "";
		var alpha = this.intervalArr[obj.id].alpha;
		switch(type) {
			case "rollOver":
				obj.style.display = "block";
				if(obj.attachEvent && $BS() != "OP") {
					if(obj.style.filter != "alpha(opacity=100)") {
						this.intervalArr[obj.id].interval = setInterval(function() {
							var tmpArr = obj.style.filter.split("=");
							tmpArr = tmpArr[1].split(")");
							var alpha = Number(tmpArr[0]);
							if(alpha < 100) {
								alpha += (100 - alpha) * 0.50;
								obj.style.filter = "alpha(opacity=" + alpha + ")";
							} else {
								clearInterval(interval);
							}
						}, 50);
						interval = this.intervalArr[obj.id].interval;
					}
				}
			break;
			case "rollOut":
				if(obj.attachEvent && $BS() != "OP") {
					clearInterval(this.intervalArr[obj.id].interval);
					this.intervalArr[obj.id].interval = setInterval(function() {
						var tmpArr = obj.style.filter.split("=");
						tmpArr = tmpArr[1].split(")");
						var alpha = Number(tmpArr[0]);
						if(alpha > 0) {
							alpha += Math.floor((0 - alpha) * 0.5);
							obj.style.filter = "alpha(opacity=" + alpha + ")";
						} else {
							obj.style.display = "none";
							clearInterval(interval);
						}
					}, 50);
					interval = this.intervalArr[obj.id].interval;
				} else {
					obj.style.display = "none";
				}
			break;
		}
		/**/
	}
}

/**
	* Gallery List Type
	* create Date : 2011. 03. 24
	* create by LAINtoHOYA
	* -- ex --
			var className = new GalleryMotion("className", "/include/xml.xml");
			className.Init("innerListId", "innerPhotoId");
			
			// xml Type
			<?xml version="1.0" encoding="utf-8"?>
			<data>
				<list>
					<product button="/include/png/mainMotionTitle01.png" nameKr="i-Scope" link="#1" target="_self">
						<photo url="/include/jpg/mm01-02.jpg" nameKr="#1"/>
						<photo url="/include/jpg/mm01-01.jpg" nameKr="#2"/>
					</product>
					<product button="/include/png/mainMotionTitle01.png" nameKr="i-Scope" link="#1" target="_self">
						<photo url="/include/jpg/mm01-02.jpg" nameKr="#1"/>
						<photo url="/include/jpg/mm01-01.jpg" nameKr="#2"/>
					</product>
				</list>
			</data>
	*/
function GalleryMotion(className, url) {
	this.name = className;
	this.url = url;
	this.listCount = 0;
	this.targetList = null;
	this.targetView = null;
	this.XMLData = null;
	this.XMLList = null;
	this.choiceNo = 0;
	this.animationNo = 1;
	this.animationInter = "";
	this.intervalArr = new Array();
	this.oldFunction = new Array();
	this.gifUrl = "/include/gif/";
	this.jpgUrl = "/include/jpg/";
	if(String(url) != "undefined") {
		this.XMLoad = new $XMLoad(url);
	}
}

GalleryMotion.prototype = {
	Init : function(listId, viewId) {
		if($(listId) != null) {
			this.targetList = $(listId);
		} else {
			return;
		}
		if($(viewId) != null) {
			this.targetView = $(viewId);
		} else {
			return;
		}
		this.XMLData = this.XMLoad.GetXml();
		this.XMLList = this.XMLData.getElementsByTagName("list")[0].getElementsByTagName("product");
		this.listCount = this.XMLList.length;
		this.List_Setting();
	},
	
	List_Setting : function() {
		var oMenu;
		oMenu = $C("menu");
		oMenu.id = "motion_list";
		for(var i=0; i < this.listCount; i++) {
			oMenu.appendChild(this.List_Rows(this.XMLList[i], i + 1));
		}
		this.targetList.appendChild(oMenu);
		
		this.Timer_Controller(true);
		this.ChoiceView(1);
		this.PhotoView(1, 1);
	},
	
	List_Rows : function(xmlData, no) {
		var oLi, oA, oMenu;
		this.oldFunction[no - 1] = { rollOver : "", rollOut : "", clock : "" };
		oLi = $C("li");
		oA = $C("a");
		oA.href = "javascript:;";
		oA.title = xmlData.getAttribute("nameKr");
		oA.id = "listImage" + no;
		oA.className = "_motion out";
		oA.style.backgroundImage = "url(" + xmlData.getAttribute("button") + ")";
		
		var rollOverFunction = this.name + ".Motion_Controller('" + no + "'); " + this.name + ".Timer_Controller(false);";
		var rollOutFunction = this.name + ".Motion_Controller(''); " + this.name + ".Timer_Controller(true);";
		var clickFunction = this.name + ".ChoiceView('" + no + "');";
		
		this.oldFunction[no - 1].rollOver = new Function(rollOverFunction);
		this.oldFunction[no - 1].rollOut = new Function(rollOutFunction);
		this.oldFunction[no - 1].clock = new Function(clickFunction);

		if(oA.attachEvent) {
			oA.attachEvent("onmouseover", this.oldFunction[no - 1].rollOver);
			oA.attachEvent("onmouseout", this.oldFunction[no - 1].rollOut);
			oA.attachEvent("onclick", this.oldFunction[no - 1].clock);
		} else if(oA.addEventListener) {
			oA.addEventListener("mouseover", this.oldFunction[no - 1].rollOver, false);
			oA.addEventListener("mouseout", this.oldFunction[no - 1].rollOut, false);
			oA.addEventListener("click", this.oldFunction[no - 1].clock, false);
		}
		
		oLi.appendChild(oA);
		
		pDiv = $C("div");
		pDiv.id = "photoViewDiv" + no;
		pDiv.className = "listPhotoDiv";
		pDiv.style.height = "0";
		this.intervalArr[pDiv.id] = "";
		
		var photos = xmlData.getElementsByTagName("photo");
		var pCount = photos.length;
		if(pCount > 0) {
			oMenu = $C("ul");
			oMenu.id = "photo_list";
			for(var i = 0; i < pCount; i++) {
				var xml = photos[i];
				oMenu.appendChild(this.Photo_Insert(xml, no, i + 1));
			}
			pDiv.appendChild(oMenu);
			oLi.appendChild(pDiv);
		}
		
		return oLi;
	},
	
	Photo_Insert : function(xml, mNo, no) {
		var oLi, oA, oImg;
		
		oLi = $C("li");
		oA = $C("a");
		oA.href = "javascript:;";
		oA.title = xml.getAttribute("nameKr");
		oImg = $C("img");
		oImg.id = "photoImage" + mNo + "-" + no;
		oImg.className = "photoImageOut";
		oImg.alt = xml.getAttribute("nameKr");
		oImg.src = xml.getAttribute("url");
		
		var rollOverFunction = "this.className='photoImageOver'; " + this.name + ".Timer_Controller(false);";
		var rollOutFunction = "this.className='photoImageOut'; " + this.name + ".Timer_Controller(true);";
		var clickFunction = this.name + ".PhotoView('" + mNo + "','" + no + "'); " + this.name + ".Timer_Controller(false);";

		if(oImg.attachEvent) {
			oImg.attachEvent("onmouseover", new Function(rollOverFunction));
			oImg.attachEvent("onmouseout", new Function(rollOutFunction));
			oImg.attachEvent("onclick", new Function(clickFunction));
		} else if(oA.addEventListener) {
			oImg.addEventListener("mouseover", new Function(rollOverFunction), false);
			oImg.addEventListener("mouseout", new Function(rollOutFunction), false);
			oImg.addEventListener("click", new Function(clickFunction), false);
		}
		oA.appendChild(oImg);
		oLi.appendChild(oA);
		return oLi;
	},
	Timer_Controller : function(type) {
		var thisTarget = this;
		switch(type) {
			case true:
				this.animationInter = setInterval(function() {
					if(thisTarget.animationNo + 1 <= thisTarget.listCount) {
						thisTarget.animationNo += 1;
					} else {
						thisTarget.animationNo = 1;
					}
					thisTarget.ChoiceView(thisTarget.animationNo);
					//thisTarget.PhotoView(thisTarget.animationNo, 1);
				}, 3000);
			break;
			case false:
				clearInterval(this.animationInter);
			break;
		}
	},
	
	ChoiceView : function(no) {
		
		this.animationNo = no;
		var oA, pDiv;
		pDiv = $("photoViewDiv" + no);
		oA = $("listImage" + no);
		if(oA.detachEvent) {
			oA.detachEvent("onmouseover", this.oldFunction[no - 1].rollOver);
			oA.detachEvent("onmouseout", this.oldFunction[no - 1].rollOut);
			oA.detachEvent("onclick", this.oldFunction[no - 1].clock);
		} else if(oA.removeEventListener) {
			oA.removeEventListener("mouseover", this.oldFunction[no - 1].rollOver, false);
			oA.removeEventListener("mouseout", this.oldFunction[no - 1].rollOut, false);
			oA.removeEventListener("click", this.oldFunction[no - 1].clock, false);
		}
		oA.className = "_motion click";
		this.Effect_Motion(pDiv, "show");
		
		if(this.choiceNo > 0) {
			pDiv = $("photoViewDiv" + this.choiceNo);
			oA = $("listImage" + this.choiceNo);
			if(oA.attachEvent) {
				oA.attachEvent("onmouseover", this.oldFunction[this.choiceNo - 1].rollOver);
				oA.attachEvent("onmouseout", this.oldFunction[this.choiceNo - 1].rollOut);
				oA.attachEvent("onclick", this.oldFunction[this.choiceNo - 1].clock);
			} else if(oA.addEventListener) {
				oA.addEventListener("mouseover", this.oldFunction[this.choiceNo - 1].rollOver, false);
				oA.addEventListener("mouseout", this.oldFunction[this.choiceNo - 1].rollOut, false);
				oA.addEventListener("click", this.oldFunction[this.choiceNo - 1].clock, false);
			}
			oA.className = "_motion out";
			this.Effect_Motion(pDiv, "hidden");
		}
		this.choiceNo = no;
		this.PhotoView(no, 1);
	},
	
	Effect_Motion : function(obj, type) {
		clearInterval(this.intervalArr[obj.id]);
		switch(type) {
			case "hidden":
				var interval = this.intervalArr[obj.id];
				this.intervalArr[obj.id] = setInterval(function() {
					var tmpArr = obj.style.height.split("px");
					var height = Number(tmpArr[0]);
					if(height > 0) {
						height += Math.floor((0 - height) * 0.5);
						obj.style.height = height + "px";
					} else {
						clearInterval(interval);
					}
				}, 50);
				interval = this.intervalArr[obj.id].interval;
			break;
			case "show":
				var interval = this.intervalArr[obj.id];
				this.intervalArr[obj.id] = setInterval(function() {
					var tmpArr = obj.style.height.split("px");
					var height = Number(tmpArr[0]);
					if(height < 50) {
						height += Math.floor((50 - height) * 0.5);
						obj.style.height = height + "px";
					} else {
						clearInterval(interval);
					}
				}, 50);
				interval = this.intervalArr[obj.id].interval;
			break;
	}
	},
	
	PhotoView : function(mNo, sNo) {
		var photoXml = this.XMLList[mNo - 1].getElementsByTagName("photo")[sNo - 1];
		this.targetView.alt = this.XMLList[mNo - 1].getAttribute("nameKr");
		$EC(this.targetView, photoXml.getAttribute("url"), 0.3);
	},
	
	Motion_Controller : function(no) {
		var oImg, pDiv;
		for(var i=0; i < this.listCount; i++) {
			if(no == (i + 1)) {
				this.Effect_List((i + 1), "rollOver");
			} else {
				this.Effect_List((i + 1), "rollOut");
			}
		}
	},
	
	Effect_List : function(no, type) {
		var oA, pDiv;
		pDiv = $("photoViewDiv" + no);
		oA = $("listImage" + no);
		switch(type) {
			case "rollOver":
				oA.className = "_motion over";
			break;
			case "rollOut":
				if(this.choiceNo != no) {
					oA.className = "_motion out";
				}
			break;
		}
	}
}

function RightMenuInit(url, target, menuNo) {
	var oDiv, oUl, oLi, oA, XMLoad, menuArr, choiceArray, i, j, targetMc, count;
	targetMc = $(target);
	if(String(url) != "undefined") {
		XMLoad = new $XMLoad(url);
		menuArray = XMLoad.GetMenuArray("mainMenu", "depth");
		choiceArray = menuArray[menuNo - 1].subMenu;
		count = choiceArray.length;
		oDiv = $C("div");
		oUl = $C("ul");
		oUl.className = "pointText01";
		for(i = 0; i < count; i++) {
			var subArray = choiceArray[i].subMenu;
			var subCount = subArray.length;
			for(j = 0; j < subCount; j++) {
				oLi = $C("li");
				oA = $C("a");
				oA.href = subArray[j].link;
				oA.target = subArray[j].target;
				oA.title = subArray[j].nameKr;
				oA.innerHTML = subArray[j].nameKr;
				oLi.appendChild(oA);
				oUl.appendChild(oLi);
			}
		}
		oDiv.appendChild(oUl);
	}
	targetMc.appendChild(oDiv);
}


/**
	* Title Module
	* create Date : 2011. 03. 24
	* create By LAINtoHOYA
	* -- ex --
			var className = new TitleInsert("className", "/include/xml.xml");
			className.Init("innerObjectId", "1/1");
			
			// xml type
			<?xml version="1.0" encoding="euc-kr"?>
			<data>
			<mainMenu>
				<depth1 nameKr="depthName" button="/include/png/leftMenuBtn04.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
					<depth2 nameKr="Scope" button="/include/png/subMenuBtn04-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
						<depth3 nameKr="MSA pro" button="/include/png/subMenuBtn04-01-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self"/>
					</depth2>
				</depth1>
			</mainMenu>
	*/
function TitleInsert(className, url) {
	this.name = className;
	this.XMLoad = null;
	this.menuArray = null;
	this.menuCount = 0;
	this.pgCode = "";
	if(String(url) != "undefined") {
		this.XMLoad = new $XMLoad(url);
	}
}

TitleInsert.prototype = {
	
	/**
		* Title Setting
		*/
	Init : function(id, pgCode) {
		var target = $(id);
		this.pgCode = pgCode;
		var oTable, oTbody, oTr, oTd, oImg, oA, oDiv, vDiv, sDiv;
		this.menuArray = this.XMLoad.GetMenuArray("mainMenu", "depth");
		this.menuCount = this.menuArray.length;
		var titleObject = this.Get_Data(this.menuArray, "");
		oDiv = $C("div");
		oDiv.id = "subTitleDiv";
		if(titleObject.location != "") {
			oImg = $C("img");
			oImg.src = titleObject.location;
			oDiv.appendChild(oImg);
		} else {
			oDiv.innerHTML = titleObject.nameKr;
		}
		target.appendChild(oDiv);
		oDiv = $C("div");
		oTable = $C("table");
		oTable.id = "subTitleTable";
		oTable.width = "100%";
		oTable.cellPadding = 0;
		oTable.cellSpacing = 0;
		oTable.border = 0;
		oTbody = $C("tbody");
		oTr = $C("tr");
		oTd = $C("td");
		oTd.id = "subTitleLeft";
		if(titleObject.title != "") {
			oImg = $C("img");
			oImg.src = titleObject.title;
			oImg.width = "526";
			oTd.appendChild(oImg);
		} else {
			oTd.innerHTML = titleObject.nameKr;
		}
		oTr.appendChild(oTd);
		oTbody.appendChild(oTr);
		oTable.appendChild(oTbody);
		target.appendChild(oTable);
	},
	
	Get_Data : function(array, code) {
		var i = 1;
		var count = array.length;
		var nowCode = "";
		var viewObj = null;
		while(i <= count && viewObj == null) {
			nowCode = (code == "") ? i : code + "/" + i;
			var obj = array[i - 1];
			//$("testView").value += "\n ÇöÀçÄÚµå : " + nowCode + " - " + this.pgCode;
			if(nowCode == this.pgCode) {
				//$("testView").value += "\n OKÄÚµå : " + nowCode + " - " + this.pgCode + " / " + obj.location;
				viewObj = {
					location : obj.location,
				 title : obj.title,
					nameKr : obj.nameKr
				};
			} else {
				if(String(obj.subMenu) != "undefined") {
					var sArray = obj.subMenu;
					var sCount = sArray.length;
					//$("testView").value += "\n¼­ºêÄ«¿îÅÍ : " + sCount;
					if(sCount > 0) {
						viewObj = this.Get_Data(sArray, nowCode);
					}
				}
			}
			i++;
		}
		return viewObj
	}
}

/**
	* Sub Menu Module
	* create Date : 2011. 03. 24
	* create By LAINtoHOYA
	* -- ex --
			var className = new TitleInsert("className", "/include/xml.xml");
			className.Init("innerObjectId", "1/1");
			
			// xml type
			<?xml version="1.0" encoding="euc-kr"?>
			<data>
			<mainMenu>
				<depth1 nameKr="depthName" button="/include/png/leftMenuBtn04.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
					<depth2 nameKr="Scope" button="/include/png/subMenuBtn04-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self">
						<depth3 nameKr="MSA pro" button="/include/png/subMenuBtn04-01-01.png" location="/include/gif/subTitleLocation01-01.gif" title="/include/gif/subTitle01-01.gif" link="/subPage.php?pgCode=4/1/1" target="_self"/>
					</depth2>
				</depth1>
			</mainMenu>
	*/
function SubMenuInsert(className, url) {
	this.name = className;
	this.XMLoad = null;
	this.menuArray = null;
	this.menuCount = 0;
	this.depthCount = 0;
	this.selectNo = 0;
	this.pgCode = "";
	if(String(url) != "undefined") {
		this.XMLoad = new $XMLoad(url);
	}
}

SubMenuInsert.prototype = {
	
	Init : function(id, pgCode, depth) {
		this.depthCount = depth;
		var target = $(id);
		this.pgCode = pgCode;
		var oMenu, oLi, oA, oSpan;
		this.menuArray = this.XMLoad.GetMenuArray("mainMenu", "depth");
		var outMenu = this.Get_Data(this.menuArray, "");
		this.menuCount = outMenu.length;
		oMenu = $C("menu");
		oMenu.className = "subNavi_btn";
		for(var i = 0; i < this.menuCount; i++) {
			var obj = outMenu[i];
			oLi = $C("li");
			oA = $C("a");
			oA.id = "subMenuImage" + (i + 1);
			oA.href = obj.link;
			oA.target = obj.target;
			oA.title = obj.nameKr;
			oA.innerHTML = obj.nameKr + "&nbsp;";
			var rollOverFunction = this.name + ".Motion_Controller('" + (i + 1) + "');";
			var rollOutFunction = this.name + ".Motion_Controller('');";
			
			if(oA.attachEvent) {
				oA.attachEvent("onmouseover", new Function(rollOverFunction));
				oA.attachEvent("onmouseout", new Function(rollOutFunction));
			} else if(oA.addEventListener) {
				oA.addEventListener("mouseover", new Function(rollOverFunction), false);
				oA.addEventListener("mouseout", new Function(rollOutFunction), false);
			}
			oLi.appendChild(oA);
			oMenu.appendChild(oLi);
		}
		target.appendChild(oMenu);
		this.Button_Select(pgCode);
	},
	
	Button_Select : function(pgCode) {
		var tmpArr = pgCode.split("/");
		var no = tmpArr[(tmpArr.length - 1)];
		var oA = $("subMenuImage" + no);
		this.selectNo = no;
		this.Effect_Button(oA, "click");
	},
	
	/**
		* Sub Menu Controller
		*/
	Motion_Controller : function(no) {
		for(var i = 0; i < this.menuCount; i++) {
			oA = $("subMenuImage" + (i + 1));
			if(no == (i + 1)) {
				this.Effect_Button(oA, "rollOver");
			} else {
				if(this.selectNo == (i + 1) && no == "") this.Effect_Button(oA, "click");
				else this.Effect_Button(oA, "rollOut");
			}
		}
	},
	
	/**
		* Button Effect
		*/
	Effect_Button : function(oA, type) {
		switch(type) {
			case "rollOver":
				oA.className = "_menu over";
			break;
			case "rollOut":
				oA.className = "_menu out";
			break;
			case "click":
				oA.className = "_menu click";
			break;
		}
	},
	
	Get_Data : function(array, code) {
		var i;
		var count = array.length;
		var nowCode = "";
		var tmpArr = this.pgCode.split("/");
		var checkCode = "";
		var tmpCount = tmpArr.length - this.depthCount;
		for(i = 0; i < tmpCount; i++) {
			checkCode += (checkCode != "") ? "/" + tmpArr[i] : tmpArr[i];
		}
		i = 1;
		var viewArr = new Array();
		while(i <= count && viewArr.length == 0) {
			nowCode = (code == "") ? i : code + "/" + i;
			var obj = array[i - 1];
			if(nowCode == checkCode) {
				viewArr = (String(obj.subMenu) != "undefined") ? obj.subMenu : new Array();
			} else {
				if(String(obj.subMenu) != "undefined") {
					var sArray = obj.subMenu;
					var sCount = sArray.length;
					if(sCount > 0) {
						viewArr = this.Get_Data(sArray, nowCode);
					}
				}
			}
			i++;
		}
		return viewArr
	}
}
