function checkID(val)
{
	var re = /[^(A-Z)^(a-z)^(0-9)]/;
	//	alert(re.test(val));
	//	var re = /[^(A-Z)^(a-z)^(0-9)]{1,12}/;

	if (val.length > 12)
		return true;
	return re.test(val);
}

function isDigit(ev){
	//alert(ev.which);
	if(navigator.userAgent.indexOf("Firefox") >-1){ 
    	if(!((ev.which>=48 && ev.which<=57) 
			|| (ev.which>=96 && ev.which<=105)
			|| (ev.which>=35 && ev.which<=40)
			|| (ev.which==8) || (ev.which==9) 
			|| (ev.which==46)
			|| (ev.which==109)))		
		ev.preventDefault();		
		return;
	} else {
		if(!((event.keyCode>=48 && event.keyCode<=57) 
			|| (event.keyCode>=96 && event.keyCode<=105)
			|| (event.keyCode>=35 && event.keyCode<=40)
			|| (event.keyCode==8) || (event.keyCode==9) 
			|| (event.keyCode==46)
			|| (event.keyCode==109)))		
		event.returnValue = false;		
		return;
	}
}

function cfNumeric(sOrg)
{
	var nm;
	sOrg = sOrg.replace(/,/g,""); 
	nm = parseFloat(sOrg).toString();
	return (isNaN(nm)?0:nm);
} 

function number_format(num)
{
//	alert("num === "+num);
	if (num.toString().length  <= 1)
		return num;
	num = num.toString().replace(/,/g, "");
	prvNum =  parseInt(num); // 마이너스 값인지 체크
	num = num.toString().replace(/-/g, ""); // 마이너스 기호 삭제 체크

//	alert("num.replace == "+num);
	var num_str = num.toString();
	var result = '';
	for(var i=0; i<num_str.length; i++)
	{
		var tmp = num_str.length-(i+1);
		if(i%3==0 && i!=0) result = ',' + result;
		result = num_str.charAt(tmp) + result;
	}
	if (prvNum < 0)
		return "-"+result;
	return result;
}

// tabbed menu
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		thismenu = tabAnchor.item(i);

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

function tabMenuClick() {

	currentmenu = this.menuContainer.current;

	if (currentmenu != this) {

		currentmenu.targetEl.style.display = "none";

		currentmenu.getElementsByTagName("img").item(0).onmouseover = menuOver;

		currentmenu.getElementsByTagName("img").item(0).onmouseout = menuOut;

		currentmenu.getElementsByTagName("img").item(0).onmouseout();



		this.targetEl.style.display = "block";

		this.getElementsByTagName("img").item(0).onmouseover = null;

		this.getElementsByTagName("img").item(0).onmouseout = null;

		this.menuContainer.current = this;

	}

	return false;
}

//Element ID 불러쓰기
function dEI(elementID){
	return document.getElementById(elementID);
}

/* 상단메뉴 */ 
function topMenu(menu){		
  	document.getElementById(menu).className = "on";			
}

/* 플래시사용 */
function  viewFlash(sURL, sName, sFeatures){

 //플래시 ActiveX 오브젝트를 뿌려줍니다.
 var FLASHCAB = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab";
 var FLASHCID = "CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000";
 var FLASHVER = "8,0,0,0";

 var sFeature;
 var sWidth  = "100%";
 var sHeight  = "100%";
 var pmBoolean = "false";
 var sTempArray;
 var sParamTag = "";

 sFeature = sFeatures.split(/\s*,\s*/);
 for (var i=0; i< sFeature.length ; i++)
 {
  sTempArray = sFeature[i].split(/\s*=\s*/);
  if (sTempArray[0].toLowerCase() == "width"){
   //넓이
   sWidth = sTempArray[1];
  }else if (sTempArray[0].toLowerCase() == "height"){
   //높이
   sHeight = sTempArray[1];
  }else{
   //기타 파라메터 처리
   if (sTempArray[1].toLowerCase() == "yes" || sTempArray[1] == "1" || sTempArray[1].toLowerCase() == "true"){
    pmBoolean = "true";
   }else if (sTempArray[1].toLowerCase() == "no" || sTempArray[1] == "0" || sTempArray[1].toLowerCase() == "false"){
    pmBoolean = "false";
   }else{
    pmBoolean = sTempArray[1]; 
   }
   sParamTag = "<PARAM NAME='"+sTempArray[0]+"'VALUE='" + pmBoolean + "'>\n"+sParamTag;
  }
 }

 document.write("<OBJECT ID='"+sName+"' NAME='"+sName+"' CLASSID='"+FLASHCID+"' CODEBASE='"+FLASHCAB+"#version="+FLASHVER+"' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"'>");
 document.write("<PARAM NAME='movie' VALUE='" + sURL + "'>");
 document.write("<PARAM NAME='wmode' VALUE='transparent'>"); 
 document.write(sParamTag);
 document.write("<EMBED SRC='"+sURL+"' MENU='false' WIDTH='"+sWidth+"' HEIGHT='"+sHeight+"' ID='"+sName+"' NAME='"+sName+"' wmode='transparent' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' />")
 document.write("</OBJECT>");
}