function ecatalog(docu, kd, dir){
	if(screen.width < 1024){
		alert("È­¸é»çÀÌÁî 1,024*768 ÀÌ»ó¿¡¼­¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		return;
	}

	if(kd == "fixed"){
		x = 1024; y = 768;
		wname = "fixed_ecatalog";
	}
	else{
		x = screen.width; y = screen.height;
		r = screen.height / screen.width;

		if(r > 0.75) y = screen.width * 0.75;
		else if( r < 0.75) x = screen.height / 0.75;
		wname = "ecatalog";
	}

	x = x - 10; y = y - 58;

	property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,";
	property += "width=" + x + ",height=" + y + ",left=" + 0 + ",top=" + 0;
	docu = docu + "/ecatalog.php?Dir=" + dir + "&w=" + x + "&h=" + y;
	window.open(docu, wname, property);
}
function selc_ecata(obj, kd){		// AloneÀÇ multi Èä³»
	if(obj.selectedIndex == -1 || obj[obj.selectedIndex].value == "") return;
	ecatalog(obj[obj.selectedIndex].value, kd, '');
}

function newWindow(winSet,docu,width,height,left,top,winname){
	if(winSet == 1)
	    property = "toolbar=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,scrollbars=yes,copyhistory=no,";
	else if(winSet == 2)
		property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,copyhistory=no,";
	else if(winSet == 3)
		property = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,copyhistory=no,";

	property += "width=" + width +",height=" + height + ",left=" + left + ",top=" + top;
	window.open(docu,winname,property);
}

function TrmObj(Object,message){
	if(Object.value == "" || trimVal(Object.value) == ""){
		if(message != "") alert(message);
		Object.focus();
		return false;
	}
	else
		return true;
}

function trimVal(Tempo){
	Tstring = "";

	for(var i = 0;i < Tempo.length;i++){
		Temp = Tempo.substring(i,i+1);
		if(Temp != ' ' && Temp != '\n' && Temp != '\r')
			Tstring += Temp;
	}

	return Tstring;
}

function check_memlog(dm){
	if(TrmObj(dm.mid,"È¸¿ø¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.") == false)
		return false;
	else if(TrmObj(dm.passwd,"ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.") == false)
		return false;
}

function mailTest(mail){
	myRe = /^[\w\._-]+@[\w_-]+(\.\w+)+/;

	if(myRe.test(mail)) return true;
	else return false;
}

function telnumTrm(string,kind){
	Rstr = "";

	for(var i = 0;i < string.length;i++){
		Jstr = string.charAt(i);
		if((Jstr >= "0" && Jstr <= "9"))
			Rstr += Jstr;
	}

	if(kind == "n") return Rstr.length;
	else if(kind == "s") return Rstr;
}

function nextFocus(thisObj,thatObj,num){
	if(thisObj.value.length == num)
		thatObj.focus();
}

function isNotnum(string){
	for(var i = 0;i < string.length;i++){
		Jstr = string.charAt(i);
		if(Jstr < "0" || Jstr > "9") return false;
	}
	return true;
}
