﻿
String.prototype.getBytes = function()
{
	var		nLength	= this.length;
	var		nBytes	= 0;
	var		i;

	for (i = 0; i < nLength; i ++)
	{
		if (this.charCodeAt(i) < 128)
			nBytes ++;
		else
			nBytes += 2;
	}

	return nBytes;
}


String.prototype.smsLength = function(intMaxByte)
{
	var		nLength	= this.length;
	var		nBytes	= 0;
	var		i;

	for (i = 0; i < nLength; i ++)
	{
		if (this.charCodeAt(i) < 128)
			nBytes ++;
		else
			nBytes += 2;
			
		if (nBytes > intMaxByte)
		{
			break ;
		}
	}
	
	return i;
}

function open_zip(zipId, addrId)
{
	window.open("/zip/searchZipCode.aspx?zipId=" + zipId + "&addrId=" + addrId,
	"searchZip", "scrollbars=yes,width=400,height=500,resizable=no");
}