function opnWin( strURL, width, height ) {
	window.open ( strURL, "newWin", "width=" + width + ",height=" + height + ",scrollbars=yes" );
}

function Check_ssn(id1, id2)
{
	var codesum = 0;
	var coderet = 0;
	
	if (id1.length != 6 || isNaN(id1) || id1 == "111111")
	{
		alert("");
		return false;
	}
		else if (id2.length != 7 || isNaN(id2) ||  id2 == "1111118")
	{
		alert("");
		return false;
	}
	    
	    codesum = (eval(id1.substring(0, 1)) * 2)
	            + (eval(id1.substring(1, 2)) * 3)
	            + (eval(id1.substring(2, 3)) * 4)
	            + (eval(id1.substring(3, 4)) * 5)
	            + (eval(id1.substring(4, 5)) * 6)
	            + (eval(id1.substring(5, 6)) * 7)
	            
	            + (eval(id2.substring(0, 1)) * 8)
	            + (eval(id2.substring(1, 2)) * 9)
	            + (eval(id2.substring(2, 3)) * 2)
	            + (eval(id2.substring(3, 4)) * 3)
	            + (eval(id2.substring(4, 5)) * 4)
	            + (eval(id2.substring(5, 6)) * 5);
	    coderet = 11 - (eval(codesum % 11));
	    if (coderet >= 10)
	        coderet = coderet - 10;
	    if (coderet >= 10)
	        coderet = coderet - 10;
			
	    if (eval(id2.substring(6, 7)) != coderet)
	    {
			alert("");
			return false;
	    }
		return true;
	}
	
	function validate(field) {
		var valid = "0123456789";
		var ok = "yes";
		var temp;
			for (var i=0; i<field.value.length; i++) {
				temp = "" + field.value.substring(i, i+1);
				if (valid.indexOf(temp) == "-1") ok = "no";
			}
		if (ok == "no") {
			alert("ONLY Number!!");
			field.focus();
			field.select();
  			}			
	}
	

	function searchPr() {
		if ( document.frmSearchPr.prname.value == "" ) {
			alert("Please, Input Product Name");
			document.frmSearchPr.prname.focus();
			return;
		}
		location.href="../product/search.asp?prname=" + document.frmSearchPr.prname.value;
	}

	function enter()
	{
		if (event.keyCode == 13)
		{
		if ( document.frmSearchPr.prname.value == "" ) {
			alert("Please, Input Product Name"); 
			document.frmSearchPr.prname.focus();
			return;
			}
			document.frmSearchPr.action = "../product/search.asp?prname=" + document.frmSearchPr.prname.value;
			document.frmSearchPr.submit();
		} 
	}

	function goSelPr() {
		if ( document.frmSearchPr.prCodeSel.value == "" ) {
			alert("Please, Select Product Code");
			document.frmSearchPr.prCodeSel.focus();
			return;		
		}
		location.href="../product/classB_list.asp?classB=" + document.frmSearchPr.prCodeSel.value;
	}
	function del(idx){
		if (window.confirm('DELETE?'))
		{
			location.href = "memo_delete.asp?idx="+idx;
		}
	}
	function send_del(idx){
		if (window.confirm('DELETE?'))
		{
			location.href = "send_delete.asp?idx="+idx;
		}
	}
	function del_cart(idx){
		if (window.confirm('DELETE?'))
		{
			location.href = "cart_del.asp?idx="+idx;
		}
	}
	function all_del(uid){
		if (window.confirm('DELETE?'))
		{
			location.href = "cart_del.asp?uid="+uid;
		}
	}
