function popup(url, name, width, height) 
{
	window.open(url, name, "width="+width+",height="+height+",scrollbars=0");
}

function popup_s(url, name, width, height) 
{
	window.open(url, name, "width="+width+",height="+height+",scrollbars=1");
}

/*ÀüÃ¼ÀÌ¸ÞÀÏ¿¡¼­ È¸¿øº° ¼±ÅÃÃ¢*/
function popup_real_ids() 
{
	window.open("popup_real_ids.php", "popup_real_ids", "width=800,height=600,scrollbars=1");
}
/*ÀüÃ¼ÀÌ¸ÞÀÏ¿¡¼­ ¼­ºñ½ºº° ¼±ÅÃÃ¢*/
function popup_service_ids() 
{
	window.open("popup_service_ids.php", "popup_service_ids", "width=800,height=600,scrollbars=1");
}
function input_ids(val)
{
	opener.document.form_write.to_email.value=val;
	this.close();
}

function checkall(form) 
{
	if(form.all.checked) 
	{
		for(i=1;i<(form.length);i++)
			form.elements[i].checked=true; 
	} else {
		for(i=1;i<(form.length);i++)
			form.elements[i].checked=false;
	}
}

/*
function checkallbyname(name, checkall_box) 
{
	name[][0].checked=true; 
	return;
	if(checkall_box.checked) 
	{
		for(i=0;i<(name.length);i++)
			name[i].checked=true; 
	} else {
		for(i=0;i<(name.length);i++)
			name[i].checked=false;
	}
}
*/
/**************************************************************  °¡ÀÔ Æû ***********************************************/
/* Id »ç¿ë°¡´É¿©ºÎ ÆÇ´Ü */
function popup_check_id() 
{
	window.open("popup_check_id.php", "popup_check_id", "width=400,height=200,scrollbars=0");
}

function input_real_id(val)
{
	opener.document.user_form.real_id.value=val;
	opener.document.user_form.real_pw.focus();
	this.close();
}

function input_service_id(val)
{
	opener.document.user_form.service_id.value=val;
	this.close();
}

/* ¿ìÆí¹øÈ£ */
function popup_find_zipcode()
{
	var url="popup_find_zipcode.php";
	window.open(url,'popup_find_zipcode','width=416,height=300,scrolling=1, scrollbars=1,toolbar=0,status=0');
}


function popup_find_company_zipcode()
{
	var url="popup_find_company_zipcode.php";
	window.open(url,'popup_find_zipcode','width=416,height=300,scrolling=1, scrollbars=1,toolbar=0,status=0');
}



function input_zipcode(zipcode, address)
{
	zip1 = zipcode.substring(0,3);
	zip2 = zipcode.substring(4,7);
	opener.document.user_form.zipcode1.value = zip1;
	opener.document.user_form.zipcode2.value = zip2;
	opener.document.user_form.address_kor_1.value = address;
	opener.document.user_form.address_kor_2.focus();
	this.close();
}

function input_company_zipcode(zipcode, address)
{
	zip1 = zipcode.substring(0,3);
	zip2 = zipcode.substring(4,7);
	opener.document.user_form.company_zipcode1.value = zip1;
	opener.document.user_form.company_zipcode2.value = zip2;
	opener.document.user_form.company_address_kor_1.value = address;
	opener.document.user_form.company_address_kor_2.focus();
	this.close();
}

function verify_ip(IPvalue) 
{
	var errorString = "";
	var theName = "";

	var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var ipArray = IPvalue.match(ipPattern); 

	if (IPvalue == "0.0.0.0")
	errorString = errorString + IPvalue+' Àº Á» Æ¯º°ÇÑ ÁÖ¼Ò±º¿ä. ¿©±â¼­´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù';

	else if (IPvalue == "255.255.255.255")
	errorString = errorString + IPvalue+' Àº Á» Æ¯º°ÇÑ ÁÖ¼Ò±º¿ä. ¿©±â¼­´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù';

	if (ipArray == null)
	errorString = errorString + IPvalue+' ´Â Àß¸øµÈ ÁÖ¼Ò ÀÔ´Ï´Ù';

	else 
	{
		for (i = 0; i < 4; i++) 
		{
			thisSegment = ipArray[i];

			if (thisSegment > 255) 
			{
				errorString = errorString + theName + ': '+IPvalue+' Àº Àß¸øµÈ ÁÖ¼Ò ÀÔ´Ï´Ù';
				i = 4;
			}

			if ((i == 0) && (thisSegment > 255)) 
			{
				errorString = errorString + theName + ': '+IPvalue+' Àº Á» Æ¯º°ÇÑ ÁÖ¼Ò±º¿ä. ¿©±â¼­´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù';
				i = 4;
			}
		}
	}

	extensionLength = 3;

	if (errorString == "")
	{
		add_form.submit();
	}
	else
	{
		alert (errorString);
	}

}