// flash link ******************************************************************
function ClickMenu(b_no, m_no, s_no)
{
	b_no = Number(b_no);
	m_no = Number(m_no);
	s_no = Number(s_no);

	var url = "";
	if (m_no == 0) m_no = 1;

	//alert(b_no + ", " + m_no + ", " + s_no);

	// Chicken Story
	if (b_no == 1)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=CHICKEN/chicken01"; break;
			case 2	: url = "USR_main.asp??=CHICKEN/chicken02"; break;
			case 3	:
			{
				if (s_no == 0) s_no = 1;
				switch (s_no)
				{
					case 1	: url = "USR_main.asp??=CHICKEN/MENU/menu00"; break;
					case 2	: url = "USR_main.asp??=CHICKEN/MENU/menu01"; break;
					case 3	: url = "USR_main.asp??=CHICKEN/MENU/menu02"; break;
					case 4	: url = "USR_main.asp??=CHICKEN/MENU/menu03"; break;
				}
				break;
			}
			case 4	: url = "USR_main.asp??=CHICKEN/FRANCHISE/list"; break;
		}
	}

	// Event Story
	else if (b_no == 2)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=EVENT/EVENTM/list"; break;
			case 2	: url = "USR_main.asp??=EVENT/EVENTS/list"; break;
			case 3	: url = "USR_main.asp??=EVENT/EVENTOFFER/write"; break;
		}
	}

	// Happy Story
	else if (b_no == 3)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=HAPPY/HAPPYBBS/list"; break;
			case 2	: url = "USR_main.asp??=HAPPY/DICA/list"; break;
		}
	}

	// Mexicana Story
	else if (b_no == 4)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=MEXICANA/mexicana"; break;
			case 2	: url = "USR_main.asp??=MEXICANA/cf"; break;
			case 3	: url = "USR_main.asp??=MEXICANA/ADSCHEDULE/calendar"; break;
			case 4	: url = "USR_main.asp??=MEXICANA/SMPPARTY/calendar"; break;
			case 5	: url = "USR_main.asp??=MEXICANA/PRESS/list"; break;
			case 6	: url = "USR_main.asp??=MEXICANA/MEXINEWS/list"; break;
		}
	}

	// °¡¸ÍÁ¡ °³¼³ ¾È³»
	else if (b_no == 5)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=GUIDE/guide01"; break;
			case 2	: url = "USR_main.asp??=GUIDE/guide02"; break;
			case 3	: url = "USR_main.asp??=GUIDE/CONSULT/list"; break;
			case 4	: url = "USR_main.asp??=GUIDE/CONSULTCLM/list"; break;
			case 5	: url = "USR_main.asp??=GUIDE/OPENFRNC/list"; break;
			case 6	: url = "USR_main.asp??=GUIDE/BESTFRNC/view"; break;
			
		}
	}

	// °í°´¼¾ÅÍ
	else if (b_no == 6)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=CUSTOMCENTER/NOTICE/list"; break;
			case 2	: url = "USR_main.asp??=CUSTOMCENTER/FAQ/list"; break;
			case 3	: url = "USR_main.asp??=CUSTOMCENTER/QNA/list"; break;
		}
	}

	// È¸»ç¼Ò°³
	else if (b_no == 7)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=ABOUTUS/aboutus01"; break;
			case 2	: url = "USR_main.asp??=ABOUTUS/aboutus06"; break;
			
			case 3	: url = "USR_main.asp??=ABOUTUS/aboutus02"; break;
			case 4	: url = "USR_main.asp??=ABOUTUS/aboutus03"; break;
			case 5	: url = "USR_main.asp??=ABOUTUS/aboutus04"; break;
			case 6	: url = "USR_main.asp??=ABOUTUS/aboutus05"; break;
			case 7 :
			{
				if (s_no == 0) s_no = 1;
				switch (s_no)
				{
					case 1	: url = "USR_main.asp??=ABOUTUS/RECRUITM/list"; break;
					case 2	: url = "USR_main.asp??=ABOUTUS/RECRUITS/list"; break;
				}
				break;
			}
		}
	}

	// °¡¸ÍÁ¡ °ø°£
	else if (b_no == 8)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=FRANCHISE/FR_NOTICE/list"; break;
			case 2	: url = "USR_main.asp??=FRANCHISE/FR_BBS/list"; break;
			case 3	: url = "USR_main.asp??=FRANCHISE/ORDER/item_list"; break;
			case 4	: url = "USR_main.asp??=FRANCHISE/ORDER/order_list"; break;
		}
	}

	// My Mexicana
	else if (b_no == 9)
	{
		switch (m_no)
		{
			case 1	: url = "USR_main.asp??=PASSPORT/user_login"; break;
			case 2	: url = "USR_main.asp??=PASSPORT/pw_find"; break;
			case 3	: url = "USR_main.asp??=JOIN/join01"; break;
			case 4	: url = "USR_main.asp??=MYPAGE/MYINFO/view"; break;
			case 5	: url = "USR_main.asp??=MYPAGE/MYBBS/list"; break;
			case 6  : url = "USR_main.asp??=MYPAGE/MYINFO/withdrawal"; break;
		}
	}

	if (url == "")
		alert("ÆäÀÌÁö¸¦ ÁØºñÁßÀÔ´Ï´Ù.");
	else
		location.href = url;
}


// ¸ÞÀÎ º£³Ê ¸µÅ© **************************************************************
function ClickBanner(menu_no)
{
	var url = "";
	switch (menu_no)
	{
		case 1 : url = "/USR_main.asp??=EVENT/EVENTM/view&bbs_no=11660&page=1&search_option=&search_value"; break;
		case 2  : url = "/USR_main.asp??=EVENT/EVENTM/view&bbs_no=11572&page=1&bbs_option_cd=&search_option=&search_value="; break;
		case 3  : url = "/USR_main.asp??=EVENT/EVENTM/view&bbs_no=11520&page=1&bbs_option_cd=&search_option=&search_value="; break;
		case 4  : url = "/USR_main.asp??=EVENT/EVENTM/view&bbs_no=11514&page=1&bbs_option_cd=&search_option=&search_value="; break;
		
	
		default	: url = ""; break;
	}

	if (url != "")
		location.href = url;
}

// ¼ýÀÚ¸¸ ÀÔ·Â (INPUT) *********************************************************
function num_only()
{
	if((event.keyCode < 48) || (event.keyCode > 57))
	{
		event.returnValue=false;
	}
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© ***********************************************************
function numbercheck(theform)
{
	var chk	= 0;
	var yy	= theform.id_no1.value.substring(0,2);
	var mm	= theform.id_no1.value.substring(2,4);
	var dd	= theform.id_no1.value.substring(4,6);
	var sex	= theform.id_no2.value.substring(0,1);

	// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
	for (var i = 0; i <= 5 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(theform.id_no1.value.substring(i, i + 1)));
	}
	for (var i = 6; i <= 11 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(theform.id_no2.value.substring(i - 6, i - 5)));
	}
	chk = 11 - (chk % 11);
	chk = chk % 10;

	if (chk != theform.id_no2.value.substring(6, 7))
	{
		alert ("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù.");
		theform.id_no1.value = "";
		theform.id_no1.focus();
		return false;
	}

	else if ((theform.id_no1.value.length != 6) || (yy < 25 || mm < 1 || mm >12 || dd < 1))
	{
		alert ("ÁÖ¹Îµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù.");
		theform.id_no1.value = "";
		theform.id_no1.focus();
		return false;
	}

	else if ((sex != 1 && sex !=2 )||(theform.id_no2.value.length != 7 ))
	{
		alert ("ÁÖ¹Îµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù.");
		theform.id_no2.value = "";
		theform.id_no2.focus();
		return false;
	}

	else
		return true;
}


// ¼ýÀÚÆ÷¸Ë (,) ³Ö±â ***********************************************************
function number_format(number)
{
	unit		= 3;
	i			= 0;
	rst			= '';
	number		= number + '';
	len			= number.length;
	arr			= new Array(len);

	while(i <len){
		arr[i]	= number.charAt(len-i-1);
		rst		= arr[i] + rst;
		i++;
		if(i % unit == 0 && i != len)
			rst	= ',' + rst;
	}
	return rst;
}


// ÆË¾÷Ã¢ ¶ç¿ì±â ***************************************************************
function popup_win(url, target, width, height, left, top, scrollbars)
{
	if (left == "")
		left	= 0;
	if (top == "")
		top		= 0

	setting = 'width='+ width +', height='+ height +', left='+ left +', top='+ top +', scrollbars='+ scrollbars;
	window.open(url, target, setting);
}


// ÁÖ¼ÒÃ£±â ********************************************************************
function popup_addressCheck(formName, siName, dongName,moreName, zipCodeName)
{
	var win = "/LIBS/TOOLKIT/NWS_address/address.asp?formName="+ formName +"&siName="+ siName +"&dongName="+ dongName +"&moreName="+ moreName +"&zipCodeName="+ zipCodeName;
	window.open(win, "address", "width=367, height=350, left=200, top=200, scrollbars=yes");
}


// ¾àµµº¸±â ********************************************************************
function popup_map(name, x, y)
{
	var win = "http://www.cybermap.co.kr/company/mexicana/map_frame.html?name="+ name +"&x="+ x +"&y="+ y +"&icon=761004";
	popup_win(win, "map", 800, 600, 10, 10, "no")
}


// ¾ÆÀÌµð Áßº¹È®ÀÎ *************************************************************
function check_id(formName, usr_id)
{
	var theform		= eval("document."+ formName);
	var usr_id		= eval("theform."+ usr_id);

	if(usr_id.value == "")
	{
		alert("ID¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		usr_id.focus();
	}
	else if(usr_id.value.length < 6 || usr_id.value.length > 14)
	{
		alert("¾ÆÀÌµð´Â 6-14ÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		usr_id.focus();
	}
	else
	{
		var win		= "none.asp??=JOIN/POPUP/check_id&formName="+ formName +"&usr_id="+ usr_id.value;
		window.open(win, "check_id", "width=350, height=306, left=200, top=200");
	}
}


// ´Ð³×ÀÓ Áßº¹È®ÀÎ *************************************************************
function check_nick(formName, nick_nm, mode)
{
	var theform		= eval("document."+ formName);
	var nick_nm		= eval("theform."+ nick_nm);

	if(nick_nm.value == "")
	{
		alert("´Ð³×ÀÓÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		nick_nm.focus();
	}
	else
	{
		var win		= "none.asp??=JOIN/POPUP/check_nick&formName="+ formName +"&nick_nm="+ nick_nm.value +"&mode="+ mode;
		window.open(win, "check_nick", "width=350, height=253, left=200, top=200");
	}
}


// »óÇ°ÀÌ¹ÌÁö Å©°Ôº¸±â *********************************************************
function popup_enlarge(item_idx)
{
	var url = 'none.asp??=item/popup_enlarge&item_idx=' + item_idx;
	window.open(url, "enlarge", "width=683, height=545");
}


// ·Î±×ÀÎ **********************************************************************
function login(from_url)
{
	var win = "none.asp??=PASSPORT/POPUP/user_login&mode=login&from_url="+ escape(from_url);
	window.open(win, "login", "left=20, top=25, width=350, height=230");
}


// ¾ÆÀÌµð Ã£±â *****************************************************************
function idsearch()
{
	var win = "none.asp??=PASSPORT/id_search";
	window.open(win, "login", "left=20, top=25, width=440, height=320");
}

// File Upload Ã¢ ¶ç¿ì±â *******************************************************
function popup_upload(formName, inputName, uploadType, pathType)
{
	var win = '/LIBS/TOOLKIT/NWS_upload/fileselect.asp?formName='+ formName +'&imageName='+ inputName +'&uploadType='+ uploadType +'&pathType='+ pathType;
	window.open(win, 'popup', 'width=350, height=303');
}


// ÄÚµå°ü¸® POPUP **************************************************************
function popup_code_manage(code_fg)
{
	var win = "none.asp??=DBSYSTEM/POPUP/code_manage&file_mode=mng&code_fg=" + code_fg;
	window.open(win, 'popup', 'width=366, height=400, top=50, left=100, scrollbars=yes');
}

// ¸¶ÀÌÆäÀÌÁö Á¶È¸³¯Â¥ º¯°æ ****************************************************
function change_date(str_date)
{
	var date	= new Date();

	var today_year		= date.getFullYear();
	var today_month		= date.getMonth() + 1;
	var today_day		= date.getDate();

	if (("" + today_month).length == 1)
		today_month		= "0" + today_month;
	if (("" + today_day).length == 1)
		today_day		= "0" + today_day;

	document.frm.from_year.value	= str_date.substring(0, 4);
	document.frm.from_month.value	= str_date.substring(5, 7);
	document.frm.from_day.value		= str_date.substring(8, 10);
	document.frm.to_year.value		= today_year;
	document.frm.to_month.value		= today_month;
	document.frm.to_day.value		= today_day;
}


// ·¹ÀÌ¾î View or Hidden *******************************************************
function show_layer(lname)
{
	var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
	if (lname == '') return;
	if (navigator.appName == 'Netscape') layer.visibility = 'show';
	else layer.style.visibility = 'visible';
}

function hide_layer(lname)
{
	if (lname)
	{
		var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
		if (navigator.appName == 'Netscape') layer.visibility = 'hide';
		else layer.style.visibility = 'hidden';
	}
	else
	{
		for (i = 1 ; i <= 10 ; i ++)
		{
			var lname = 'layer'+i;
			var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
			if (navigator.appName == 'Netscape') layer.visibility = 'hide';
			else layer.style.visibility = 'hidden';
		}
	}
}


// TOPMENU °Ë»ö ****************************************************************
function checkform_top_search(theform)
{
	if (theform.search_value.value == "")
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		theform.search_value.focus();
		return false;
	}
//	else if (theform.search_value1.value.length < 3)
//	{
//		alert("°Ë»ö¾î´Â 3ÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
//		theform.search_value1.focus();
//		return false;
//	}
}


// ÀÌ¹ÌÁö Å©±â Á¶ÀýÇÏ¿© img ÅÂ±× Ãâ·Â ******************************************
function change_image_size(image_url, limit_width, limit_height)
{
	imgFile					= new Image();
	imgFile.src				= image_url;

	var real_width			= imgFile.width;
	var real_height			= imgFile.height;

	if (real_width >= real_height)
	{
		if (real_width <= limit_width)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= limit_width;
			result_height	= parseInt((real_height * limit_width) / real_width);
		}
	}
	else
	{
		if (real_height <= limit_height)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= parseInt((real_width * limit_height) / real_height);
			result_height	= limit_height;
		}
	}

	document.write ("<img src='"+ image_url +"' width='"+ result_width +"' height='"+ result_height +"' border='0' style='cursor:hand' onclick='showPicture(\""+ image_url +"\")'>");
}


// ÀÌ¹ÌÁö Å©±â Á¶ÀýÇÏ¿© img ÅÂ±× Ãâ·Â ******************************************
function change_image_size2(imgFile, limit_width, limit_height)
{
	var real_width			= imgFile.width;
	var real_height			= imgFile.height;

	if (limit_width == 0)
		limit_width			= real_width;
	if (limit_height == 0)
		limit_height		= real_height;

	if (real_width >= real_height)
	{
		if (real_width <= limit_width)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= limit_width;
			result_height	= parseInt((real_height * limit_width) / real_width);
		}
	}
	else
	{
		if (real_height <= limit_height)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= parseInt((real_width * limit_height) / real_height);
			result_height	= limit_height;
		}
	}

	imgFile.width			= result_width;
	imgFile.height			= result_height;
}


// ÀÌ¹ÌÁö Á¦Å©±â·Î ÆË¾÷Ã¢ ¶ç¿ì±â ***********************************************
function popup_realsize(src)
{
	var imgObj = new Image();
	imgObj.src = src;
	var wopt = "scrollbars=no,status=no,resizable=no";
	wopt += ",width=" + imgObj.width;
	wopt += ",height=" + imgObj.height;
	var wbody = "<head><title>»çÁø º¸±â</title>";
	wbody += "<s"+"cript language='javascript'>";
	wbody += "function finalResize(){";
	wbody += "  var oBody=document.body;";
	wbody += "  var oImg=document.images[0];";
	wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody += "  window.resizeBy(xdiff,ydiff);";
	wbody += "}";
	wbody += "</"+"script>";
	wbody += "</head>";
	wbody += "<body onLoad='finalResize()' style='margin:0'>";
	wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	wbody += "</body>";
	winResult = window.open("about:blank","",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}


// TRIM ************************************************************************
function trim(str)
{
	str += '';				// ¼ýÀÚ¶óµµ ¹®ÀÚ¿­·Î º¯È¯
	return str.replace(/^\s*|\s*$/g, '');
}


// input or textarea OnFocus ³»¿ëÁö¿ì±â ****************************************
function delete_contents(input)
{
	if (input.value == input.defaultValue)
	{
		input.value = "";
	}
}


// input or textarea OnFocus ¹è°æÀÌ¹ÌÁö Áö¿ì±â *********************************
function delete_background(input)
{
	input.style.backgroundImage = "url(about:blank)";
}


// ³¯Â¥ À¯È¿¼º Ã¼Å© ************************************************************
function checkDate(date_value)
{
	var getNow				= new Date();
	var sYear				= date_value.substring(0, 4);
	var sMonth				= date_value.substring(5, 7);
	var sDay				= date_value.substring(8, 10);

	if (date_value.length != 10)
		return false;
	if (sYear == null || sYear == "" || sMonth == null || sMonth == "" || sDay == null || sDay == "")
		return false;

	var iYear				= parseInt(sYear);
	var iMonth				= sMonth.substring(0, 1) == "0"	? parseInt(sMonth.substring(1, 2)) : parseInt(sMonth);
	var iDay				= sDay.substring(0, 1) == "0"	? parseInt(sDay.substring(1, 2)) : parseInt(sDay);

	if (iMonth < 1 || iMonth > 12)
		return false;

	if (iDay < 1 || iDay > 31)
		return false;

	if (iMonth == 2)
	{
		if ((iYear % 400 == 0 || (iYear % 100 != 0 && iYear % 4 == 0)))
		{
			if (iDay > 29)
				return false;
		}
		else if (iDay > 28)
			return false;
	}
	else if (iMonth==4 || iMonth==6 || iMonth==9 || iMonth==11)
	{
		if (iDay > 30)
			return false;
	}
	else
	{
		if (iDay > 31)
			return false;
	}

//	if (iYear < 1900 || iYear > getNow.getFullYear() + 1)
//		return false;

	return true;
}


// ¹ÙÀÌÆ® ¼ö ¼¼±â **************************************************************
function calculateBytes(contents, maxBytes, bytesId)
{
	var tcount	= 0;
	var tmpStr1	= new String(contents.value);
	var tmpStr2	= "";
	var temp	= tmpStr1.length;
	var onechar;

	for (k=0; k<temp; k++)
	{
		onechar = tmpStr1.charAt(k);
		if (escape(onechar).length > 4)
		{
			tcount += 2;
		}
		else
		{
			tcount += 1;
		}

		if (tcount <= maxBytes)
		{
			tmpStr2	= tmpStr2 + onechar;
		}
	}

	if (bytesId != "")
	{
		var bytesId_input	= document.getElementById(bytesId);
		replaceText(bytesId_input, tcount);
	}

	if (tcount > maxBytes)
	{
		alert("ÃÖ´ë "+ maxBytes +"Byte ±îÁö¸¸ ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		contents.value	= tmpStr2;
		calculateBytes(contents, maxBytes, bytesId)
	}
}


function replaceText(el, text)
{
	if (el != null)
	{
		clearText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

function clearText(el)
{
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				el.removeChild(childNode);
			}
		}
	}
}

function getText(el)
{
	var text = "";
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null)
				{
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}

// ÄíÅ° Ã£±â *******************************************************************
function getCookie(name)
{
	var returnCookie		= "";
	var thisCookie			= document.cookie.split("; ") ;
	for (i = 0; i < thisCookie.length; i++)
	{
		// ÄíÅ°°¡ ¹ß°ßµÉ¶§±îÁö Ã£±â
		if(thisCookie[i].split("=")[0] == name)
			returnCookie	= thisCookie[i].split("=")[1]; // ÄíÅ°¸¦ Ã£¾Æ¼­"=" ·Î ºÐ¸®ÇÑÈÄ º¯¼ö·Î ÀúÀå
	}
	return returnCookie;
}

// ÄíÅ° ÀúÀå *******************************************************************
function setCookie(name, value, expiredays)
{
	var todayDate		= new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie		= name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


//¹é±×¶ó¿îµå
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 flash(width, height, file)
{
	var flash_tag = "";
	flash_tag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	flash_tag +='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
	flash_tag +='WIDTH="'+width+'" HEIGHT="'+height+'" >';
	flash_tag +='<param name="allowScriptAccess" value="sameDomain" />';
	flash_tag +='<param name="movie" value="/TPLS/COMMON/FLASH/'+file+'.swf">';
	flash_tag +='<param name="quality" value="high">';
	flash_tag +='<param name="wmode" value="transparent">';
	flash_tag +='<embed src="/TPLS/COMMON/FLASH/'+file+'.swf" name="'+ file +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	flash_tag +='type="application/x-shockwave-flash" allowScriptAccess="sameDomain" wmode="transparent" WIDTH="'+width+'" HEIGHT="'+height+'"></embed></object>'

	document.write(flash_tag);
}




//---------------------------------------------------------
// by Ahn 
//---------------------------------------------------------

var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

// id·Î document °³Ã¼¸¦ °¡Á® ¿À´Â ÇÔ¼ö
function getElementById(id) {

	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
	return document.getElementById(id);
}

/**
 * ÆäÀÌÁö ·ÎµåÈÄ Æ¯Á¤ ÇÔ¼ö¸¦ ¼öÇà ÇÏ°Ô ÇÏ´Â ÇÔ¼ö 
 * @ Param
 * 	functionName  - ÆäÀÌÁö ·ÎµåÈÄ ¼öÇàÇÒ ÇÔ¼öÀÇ ÀÌ¸§
 */
function creationComplete(functionName)
{
	if(window.addEventListener)
		window.addEventListener("load", functionName, false);
	else if(window.attachEvent)
		window.attachEvent('onload', functionName);
}




//---------------------------------------------------------
// µ§Æ¼¿ò Ãß°¡  
//---------------------------------------------------------

//¸ð´ÞÃ¢À» ¶ç¿î´Ù
function openModal(url, width, height, title, scroll)
{
	winstyle = "dialogWidth=" + width + "px; dialogHeight:" + height + "px; center:yes; help:no; scroll:no; status:no";
	value = window.showModalDialog("/LIBS/FUNCTION/Modal.asp?url=" + url + "&title=" + title + "&scroll=" + scroll,'_blank', winstyle);
	return value;
}

//¸ð´ÞÃ¢À» ´ÝÀ¸¸ç ºÎ¸ðÃ¢¿¡ °ª ¹ÝÈ¯
function closeModal(value)
{
	window.returnValue = value;
	window.close();
}






//---------------------------------------------------------
//  ÀÌ¹ÌÁö Å©°Ô º¸±â ÇÔ¼ö
//---------------------------------------------------------
function imgResize(img)
{
	img1 = new Image();
	img1.src = (img);
	imgControll(img);
}

function imgControll(img)
{
	if((img1.width!=0)&&(img1.height!=0))
	{
		viewImage(img);
	}
	else
	{
		controller="imgControll('"+img+"')";
		intervalID=setTimeout(controller, 20);
	}
}

function viewImage(img)
{
	var scroll = "yes";
	var W = img1.width;
	var H = img1.height;
	var AW = screen.availWidth;
	var AH = screen.availHeight;

	if (H > AH && W <= AW)
		W += 17;
	if (W > AW && H <= AH)
		H += 17;

	if (W <= AW && H <= AH)
		scroll = "no";

	var O = "width=" + W + ",height=" + H + ",scrollbars=" + scroll + ",left=0,top=0";
	imgWin=window.open("","",O);
	imgWin.document.write("<html><head><title>Image View</title></head>");
	imgWin.document.write("<body style='margin:0'>");
	imgWin.document.write("<img src='"+img+"' onclick='self.close()' style='cursor:hand;'>");
	imgWin.document.write("</body></html>");
	imgWin.document.close();
}


/************************************/
//		µ§Æ¼¿ò Àü¿ë					//
/************************************/
// Ä«Å×°í¸® °í¸® º¸±â 
function viewCategory(cateCode) {
	window.open("none.asp??=PRODUCT/POPUP/CATEGORY/ViewCategory&cateCode=" + cateCode, "popup_cata", "width=650, height=660, scrollbars=no");
	//window.open("http://eng.implantium.com/Product/ViewCategory.asp?cateCode=" + cateCode, "popup_cata", "width=650, height=660, scrollbars=no");

}


function noData()
{
	alert("Our contents will be provided as soon as possible");
}

// input °ª¿¡ ¼ýÀÚ¸¸ ³Ö±â 
function checkForNumber() {
  var key = event.keyCode;
  if(!(key==8||key==9||key==13||key==46||key==144||
      (key>=48&&key<=57)||key==110||key==190)) {
      event.returnValue = false;
  }
}
