/**
 * ¾Õ, µÚ °ø¹é Á¦°Å
 */
String.prototype.trim = function(str)
{ 
	str = this != window ? this : str; 
	return str.replace(/^\s*|\s*$/g,"");
}

/**
 * ,¸¦ »ðÀÔ
 */
String.prototype.numberFormat = function(str)
{ 
	str = this != window ? this : str; 
	str+="";
	var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
	while(objRegExp.test(str))
		str = str.replace(objRegExp, '$1,$2');
	return str;
}

/**
 * ½ÇÁ¦ ¹®ÀÚ¿­ ±æÀÌ
 */
String.prototype.bytes = function(str)
{
	str = this != window ? this : str;
	for(j=0; j<str.length; j++) {
		var chr = str.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1
	}
	return len;
}

/**
 *  µµ¸ÞÀÎ Á¤º¸ °Ë»ö Ã¢
 */
function domainSearchPopup(domain)
{
	var thistime= new Date()
	var h=thistime.getHours()
	var m=thistime.getMinutes()
	var s=thistime.getSeconds()
	var path = '/domain2/library/html/domainsearch/?domain=' + domain + '&time=' + h + m + s;

	window.showModalDialog(path, window,'dialogWidth:530px; dialogHeight:500px; scroll:yes; status:no; help:no; center:yes');	
}

function domainInfoPopup(url, domain, pro_code)
{
	var thistime= new Date()
	var h=thistime.getHours()
	var m=thistime.getMinutes()
	var s=thistime.getSeconds()
	var path = url + '?domain=' + domain + '&time=' + h + m + s;

	// pro_code°¡ ÀÖ´Ù¸é ÇÑÀÎÁÖ, Å°¿öµå, À®Å©¸¦ ±¸º°ÇÑ´Ù. by param 2005.12.14
	if (pro_code)
	{
		path = path + '&pro_code=' + pro_code;
	}

	// »õÃ¢ÀÌ Ç×»ó ¾ÕÀ¸·Î ³ª¿Àµµ·Ï by param 2005.12.15
	var result = window.open(path, 'whois', 'width=530px, height=500px, scrollbars=yes, status=yes');
	result.focus();
	//	window.showModalDialog(path, window,'dialogWidth:530px; dialogHeight:500px; scroll:yes; status:no; help:no; center:yes');
}

function modalPopup(url,width,height)
{
	var thistime= new Date()
	var h=thistime.getHours()
	var m=thistime.getMinutes()
	var s=thistime.getSeconds()
	var path = url + '&time=' + h + m + s;

	window.showModalDialog(path, window,'dialogWidth:'+width+'px; dialogHeight:'+height+'px; scroll:yes; status:no; help:no; center:yes');	
}

/**
 * ÅØ½ºÆ®¸¦ Å¬¸³º¸µå·Î º¹»ç
 */
function copyText(obj)
{
	var txtSelect = obj.createTextRange();
	obj.select();
	txtSelect.execCommand('copy');

	alert('º¹»çÇÏ¿´½À´Ï´Ù.\n\n»ç¿ëÇÒ °÷¿¡ ºÙ¿©³Ö±â(Ctrl + v)ÇÏ½Ã¸é µË´Ï´Ù.');
}

/**
 * ¹®ÀÚ¿­ ±æÀÌ °è»ê(ÇÑ±Û 2byte)
 */
function checkByte(tmp)
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;

	tmpStr = new String(tmp);
	temp = tmpStr.length;

	for (k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);

		if (escape(onechar).length > 4)
		{
			tcount += 2;
		}
		else if (onechar!='\r')
		{
			tcount++;
		}
	}
	return tcount;
}


function checkOctect(tmp) 
{
	var counter = 0;
	for(var i=0;i<tmp.length;i++) 
	{
		if(tmp.charAt(i) == '.') 
		{
			++counter
		}
		if(tmp.charAt(i) == '.' && tmp.charAt(i+1) == '.') {	return 0;	}
	}
	return counter;
}

/**
 * object¸¦ È­¸é¿¡ Ãâ·Â(flash, activex..)

	<script>
		printObject('<object></object>')
	</script>

 */
function printObject(data)
{
	document.write (data);
}

/**
 * ÇÃ·¡½Ã¸¦ Ãâ·Â
 *
 */
function printFlash(src, width, height)
{
	if(!src || !width || !height)
	{
		return null;
	}

	var classid  = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
	var codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0";
	var wmode    = "transparent";
	var quality  = "high";
	var plugin   = "http://www.macromedia.com/go/getflashplayer";
	var type     = "application/x-shockwave-flash";

	var html = "<object classid='" + classid + "' "
			 + "codebase='" + codebase + "' "
			 + "width='" + width + "' height='" + height + "'> "
			 + "<param name='wmode' value='" + wmode + "'>"
			 + "<param name='movie' value='" + src + "'>"
			 + "<param name='quality' value='" + quality + "'>"
			 + "<embed src='" + src + "' "
			 + "quality='" + quality + "' pluginspage='" + plugin + "' type='" + type + "' "
			 + "width='" + width + "' height='" + height + "'></embed></object>";

	printObject(html);
}


/**
 * object¸¦ È­¸é¿¡ Ãâ·Â(flash, activex..)

	<textarea id=flash1 style="display:none;" rows="0" cols="0">
		<object>
		</object>
	<textarea>
	<script>
		PrintEmbed('flash1')
	</script>
 */
function PrintEmbed(EmbID) 
{ 
    document.write(document.getElementById(EmbID).value); 
} 
function exportflash(str)
{
	document.write(str);
}