/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ µå¸²À§¹ö »ðÀÔ ÀÚµ¿ ½ºÅ©¸³Æ® ÄÚµå ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function MM_preloadImages()		//v3.0
{
	var d = document;
	
	if (d.images)
	{
		if (!d.MM_p) d.MM_p = new Array();

		var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		
		for (i = 0; i < a.length; i++)
		{
			if (a[i].indexOf("#") != 0)
			{
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
		}
	}
}

function MM_swapImgRestore()	//v3.0
{
	var i, x, a = document.MM_sr;
	
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
		x.src = x.oSrc;
}

function MM_findObj(n, d)		//v4.01
{
	var p, i, x;
	
	if (!d) d = document;
	if ((p = n.indexOf("?")) > 0 && parent.frames.length)
	{
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0, p);
	}

	if (!(x = d[n]) && d.all) x = d.all[n];

	for (i = 0; !x && i < d.forms.length; i++)
		x = d.forms[i][n];

	for (i = 0; !x && d.layers && i < d.layers.length; i++)
		x = MM_findObj(n, d.layers[i].document);

	if (!x && d.getElementById) x = d.getElementById(n);
	
	return x;
}

function MM_swapImage()			//v3.0
{
	var i, j = 0, x, a = MM_swapImage.arguments;
	
	document.MM_sr = new Array;
	
	for (i = 0; i < (a.length - 2); i += 3)
	{
		if ((x = MM_findObj(a[i])) != null)
		{
			document.MM_sr[j++] = x;
			if (!x.oSrc) x.oSrc = x.src;
			{
				x.src = a[i + 2];
			}
		}
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ µ¿¿µ»ó »ðÀÔ ÄÚµå ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function PutEmbed(objects)
{
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		document.write(objects.text);
		objects.id = "";
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÇÃ·¡½Ã »ðÀÔ ÄÚµå ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function CFlash(swf, width, height)
{
	this.swf = swf;
	this.width = width;
	this.height = height;

	this.wmode = "";
	this.id = "";
	this.quality = "high";
	this.menu = "false";
	this.swliveconnect = "";
	this.bgcolor = "";

	this.Apply = function()
	{
		var option = "";
		var html = "";
		
		if (this.id != "")
		{
			option += " id='" + this.id + "'";
			option += " name='" + this.id + "'";
		}

		if (this.wmode != "")
			option += " wmode='" + this.wmode + "'";

		if (this.swliveconnect != "")
			option += " swliveconnect='" + this.swliveconnect + "'";

		if (this.bgcolor != "")
			option += " bgcolor='" + this.bgcolor + "'";

		html += "<embed src='" + this.swf + "' " + option + " menu='" + this.menu + "' quality='" + this.quality + "' swLiveConnect=true pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + this.width + "' height='" + this.height + "'></embed>";

		document.write(html);
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÇÃ·¡½¬ ±¸ÇöÇÔ¼ö¦¢
  ¦§¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ª¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢s	: url                                         ¦¢
  ¦¢d	: flash id                                    ¦¢
  ¦¢w	: source width                                ¦¢
  ¦¢h	: source height                               ¦¢
  ¦¢t	: wmode ("" for none, transparent, opaque ...)¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function FlashPrint(s, d, w, h, t)
{
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+ w +" height="+ h +" id="+ d +">"
	+ "<param name=wmode value="+ t +" />"
	+ "<param name=movie value="+ s +" />"
	+ "<param name=quality value=high />"
	+ "<embed src="+ s +" quality=high wmode="+ t +" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+ w +" height="+ h +">"
	+ "</embed></object>";
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ³»¿ë Ãâ·Â ÇÔ¼ö ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function documentwrite(src)
{
	document.write(src);
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÆË¾÷Ã¢ Å©±â Á¶ÀýÇÔ¼ö ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function resize_pop()
{
	window.resizeTo(document.getElementById("pop_size").clientWidth + 10, document.getElementById("pop_size").clientHeight + 80);
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÆË¾÷Ã¢ ¿ÀÇÂ ÇÔ¼ö ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function open_pop(url)
{
	var newWin = window.open(url, 'pop', 'scrollbars=no, toolbars=no, menubars=no, left=100, top=100, width=150, height=150');
	newWin.focus();
}


/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ÁÖ¹Îµî·Ï¹øÈ£ ÀÎÁõ Ã¼Å© ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function jumin_chk(jumin1, jumin2)
{
	var jumin	= jumin1.value + jumin2.value;

	var weight	= "234567892345";			// ÀÚ¸®¼ö weight ÁöÁ¤
	var val		= jumin.replace("-", "");	// "-"(ÇÏÀÌÇÂ) Á¦°Å
	var sum		= 0;

	if (val.length != 13)	// ÁÖ¹Î¹øÈ£°¡ 13±ÛÀÚ°¡ ¾Æ´Ï¶ó¸é ¿À·ù¸Þ¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
	{
		alert("ÁÖ¹Îµî·Ï¹øÈ£ 13ÀÚ¸®¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä.");
		jumin1.select();

		return false;
	}															

	for (i = 0; i < 12; i++)
	{
		sum += parseInt(val.charAt(i)) * parseInt(weight.charAt(i));
	}

	var result		= (11 - (sum % 11)) % 10;
	var check_val	= parseInt(val.charAt(12));

	if (result != check_val)	//ÁÖ¹Î¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾ÊÀ¸¸é ¿À·ù¸Þ¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
	{
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
		jumin2.select();	

		return false;
	}

	return;
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¼ýÀÚÅ°¸¸ ÀÔ·Â°¡´É Ã¼Å© ¦¢
  ¦§¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ª¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ style="ime-mode:disabled" onKeyPress="NumObj(this,'-');" Ãß°¡¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function NumObj(objname, addStr)
{
	if (event.keyCode >= 48 && event.keyCode <= 57)
	{
		return true;
	}
	else if (event.keyCode == 45 && addStr == "-")
	{
		return true;
	}
	else if (event.keyCode == 46 && addStr == ".")
	{
		return true;
	}
	else
	{
		event.returnValue = false;
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¼ýÀÚ¿Í ¿µ¹®¸¸ ÀÔ·Â°¡´É Ã¼Å©¦¢
  ¦§¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ª¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ style="ime-mode:disabled" onKeyPress="EngNum(this);" Ãß°¡¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function EngNum(str)
{
	if (event.keyCode >= 48 && event.keyCode <= 57)
	{
		return true;
	}
	else if (event.keyCode >= 65 && event.keyCode <= 90)
	{
		return true;
	}
	else if (event.keyCode >= 97 && event.keyCode <= 122)
	{
		return true;
	}
	else if (event.keyCode == 95)
	{
		return true;
	}
	else
	{
		event.returnValue = false;
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¼ýÀÚ¿Í ¿µ¹®¸¸ @, _¸¸ ÀÔ·Â°¡´É Ã¼Å© ¦¢
  ¦§¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ª¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ style="ime-mode:disabled" onKeyPress="EngNum(this);" Ãß°¡¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function EngNumMail(str)
{
	if (event.keyCode >= 48 && event.keyCode <= 57)
	{
		return true;
	}
	else if (event.keyCode >= 65 && event.keyCode <= 90)
	{
		return true;
	}
	else if (event.keyCode >= 97 && event.keyCode <= 122)
	{
		return true;
	}
	else if ((event.keyCode == 45) || (event.keyCode == 95) || (event.keyCode == 46) || (event.keyCode == 64))
	{
		return true;
	}
	else
	{
		event.returnValue = false;
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ Null Ã¼Å© - °Ë»çÇÒ °´Ã¼ Ã¼Å© (objname = °Ë»çÇÒ °´Ã¼) ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function null_chk(objname, error_message)
{
	var obj = objname;		// obj °´Ã¼¿¡ ¹Þ¾Æ¿Â °´Ã¼¸¦ ³Ö´Â´Ù.
	if (obj.value == "")	// ¸¸¾à obj°¡ ºñ¾îÀÖ´Ù¸é
	{
		msg = error_message;
		alert(msg);			// ¿À·ù ¸Þ¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
		obj.focus();		// ÇØ´çÄÁÆ®·Ñ·Î Ä¿¼­¸¦ ÀÌµ¿ÇÑ´Ù.

		return false;
	}
}

/*¦£¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¤
  ¦¢ ¸ÞÀÏÁÖ¼Ò À¯È¿¼º Ã¼Å© ½ÃÀÛ - °Ë»çÇÒ °´Ã¼ Ã¼Å© (objname = °Ë»çÇÒ °´Ã¼) ¦¢
  ¦¦¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¥*/
function mail_chk(objname)
{
	var obj = objname.value;

	if (!(obj.match(/[\w\-\~]+\@[\w\-\~]+(\.[\w\-\~]+)+/g) == obj))
	{
		alert("¸ÞÀÏ ÁÖ¼Ò°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
		objname.focus();	//°´Ã¼¿¡ Æ÷Ä¿½º¸¦ ¸ÂÃá´Ù.

		return false;
	}

	var chk_obj		= objname.createTextRange();
	var check_word	= "daum.net".toLowerCase();
	var check_word1	= "hanmail.net".toLowerCase();

	if (chk_obj.findText(check_word) || chk_obj.findText(check_word1))
	{
		alert("ÇÑ¸ÞÀÏÀº »ç¿ëÇÏ½Ç¼ö ¾ø½À´Ï´Ù.");
		objname.focus();

		return false;
	}
}

function viewFlash(src, width, height, wmode)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write('<param name=movie value="' + src + '">');
	document.write('<param name=quality value=high>');
	document.write('<param name=scale value=noscale>');
	document.write('<param name=allowScriptAccess value=always>');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="' + src + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '">');
	document.write('</embed> ');
	document.write('</object>');
}

function imgPopup(data)
{
	window.open("/common/popImage.php?imgpath="+ data, "zoom", "width=600, height=600, scrollbars=no, toolbar=no, resizable=no, status=no, menubar=no");
}

function isXPSP2()
{
	var strVerStr = window.navigator.appVersion;
	var arrVerStr = strVerStr.split('; ');

	if (arrVerStr.length >= 4)
	{
		var arrOsVer = arrVerStr[2].split(' ');
		if (arrOsVer.length >= 3 && arrOsVer[0] == "Windows")
		{
			var osVerNum = new Number(arrOsVer[2]);
			if (osVerNum >= 5.1 && strVerStr.indexOf("SV1") >= 35) // »õ·Î¿î Windows Version ³ª¿Ã¶§ ¼öÁ¤ÇÊ¿ä
				return true;
		}
	}

	return false;
}

function numberOnly()
{
	if (((event.keyCode==190) || (event.keyCode>=96 && event.keyCode<=105) || (event.keyCode==110) || (event.keyCode>47 && event.keyCode<58) || event.keyCode==8 || event.keyCode==16 || event.keyCode==116 || event.keyCode==18 || event.keyCode==9 || (event.keyCode>=37 && event.keyCode<=40) || event.keyCode==46) == false)
	{
		event.returnValue=false;
	}
 }

 function MiniHomepy(ucode)
 {
	 window.open("/mini/?uCode="+ ucode, "_mini_hompy", "width=930, height=530, status=no, scrollbars=no");
	 return false;
 }