function WinView(arg1)	{
	window.open("../cgi/viewer.php?img=../img/"+ arg1, "ArmWin", "resizable=no,width=200,height=100,top=0,left=0");
}

function WinPopup(arg1, arg2)	{
	window.open(arg1 +".php?what="+ arg2, "Arm", "resizable=no,scrollbars=yes,width=475,height=520,top=20,left=20");
}

function WinNote(arg)	{
	window.open(arg, "ArmNote", "resizable=no,width=375,height=460,top=20,left=20");
}

function WinFindOne(URL)	{
	window.open(URL, "ArmFind", "resizable=no,scrollbars=yes,width=375,height=300,top=20,left=20");
}

function WinInvoice(arg1, arg2)	{
	window.open(arg1 +".php?what="+ arg2, "ArmInvoice", "resizable=no,scrollbars=yes,width=800,height=700,top=0,left=0");
}

function ResizeImage()	{
var iHeight, iWidth;
var el = document.getElementsByName('img[]');

	for(i=0; i<el.length; i++) { 
		iWidth = el[i].width;
		iHeight = el[i].height;

		if (iWidth > 600)	{
			el[i].width = 600;

		//if (iWidth > iHeight && iWidth > 600)	{
		//	el[i].width = 600;
		
		//} else if (iWidth < iHeight && iHeight > 600)	{
		//	el[i].height = 600;
		}
	}
}

function ResizeImageNail()	{
var iHeight, iWidth;
var el = document.getElementsByName('img[]');

	for(i=0; i<el.length; i++) { 
		iWidth = el[i].width;
		iHeight = el[i].height;

		if (iWidth > iHeight && iWidth > 150)	{
			el[i].width = 150;
		
		} else if (iWidth < iHeight && iHeight > 150)	{
			el[i].height = 150;
		}
	}
}

function ResizeImageNail2()	{
var iHeight, iWidth;
var el = document.getElementsByName('img[]');

	for(i=0; i<el.length; i++) { 
		iWidth = el[i].width;
		iHeight = el[i].height;

		if (iWidth > iHeight && iWidth > 75)	{
			el[i].width = 75;
		
		} else if (iWidth < iHeight && iHeight > 75)	{
			el[i].height = 75;
		}
	}
}

function SetCookie(name, val, expiredays)	{ 
var todayDate = new Date();

	todayDate.setDate(todayDate.getDate() + expiredays); 

	document.cookie = name + "=" + escape(val) + ";path=/;expires=" + todayDate.toGMTString() + ";" 
} 

function isEmail(str) {
	var atPos = str.indexOf('@');
	var atLastPos = str.lastIndexOf('@');
	var dotPos = str.indexOf('.');
	var spacePos = str.indexOf(' ');
	var commaPos = str.indexOf(',');
	var eMailSize = str.length;

	if (atPos > 1 && atPos == atLastPos && dotPos > 3 && spacePos == -1 && commaPos == -1 && atPos + 1 < dotPos && dotPos + 1 < eMailSize)	{
		return true;
	}
	return false;
}

function isNumber(key) {
	if (navigator.appName == 'Netscape') {
		keyValue = key.which;
	} else {
		keyValue = key.keyCode;
	}

	if (keyValue == 45 || (keyValue >= 48 && keyValue <= 57)) {
		return true;

	} else {
		alert("¼ýÀÚ¿Í -¸¸ ÀÔ·Â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	}
}


