function isNum(s) {
	if (parseInt(s) > 0) {
		return true;
	}
	return false;
}

function checkNumber() {
	var objEv = event.srcElement;
	var numPattern = /([^0-9])/;
	numPattern = objEv.value.match(numPattern);
	if(numPattern != null){
		window.alert("¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		objEv.value="";
		objEv.focus();
		return false;
	}
}

function checkNumEng() {
	var objEv = event.srcElement;
	var numPattern = /([^0-9a-zA-Z])/;
	numPattern = objEv.value.match(numPattern);
	if(numPattern != null){
		window.alert("¼ýÀÚ¿Í ¿µ¹®¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		objEv.value="";
		objEv.focus();
		return false;
	}
}

function checkLen(finput, minLen, maxLen, inputName) {
	len=0;

	// String ±æÀÌ¸¦ ±¸ÇÏ´Â ºÎºÐ..
	for(i=0;i < finput.value.length; i++) {
		if(finput.value.charCodeAt(i) > 255) {
			len = len + 2;
		} else {
			len = len + 1;
		}
	}
	//window.alert(len);

	// ±æÀÌ È®ÀÎ.
	if (minLen > len) {
		if(minLen == maxLen) {
			msg = "\"" + inputName + "\"ÀÇ ±ÛÀÚ¼ö´Â " + minLen + "ÀÌ¾î¾ß ÇÕ´Ï´Ù(ÇÑ±ÛÀº ±ÛÀÚ´ç 2ÀÚ·Î °è»êµË´Ï´Ù.)";
		} else {
			msg = "\"" + inputName + "\"ÀÇ ±ÛÀÚ¼ö´Â " + minLen + " ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù(ÇÑ±ÛÀº ±ÛÀÚ´ç 2ÀÚ·Î °è»êµË´Ï´Ù.)";
		}
		window.alert(msg);
		finput.focus();
		return false;
	}
	if (maxLen < len) {
		window.alert("\"" + inputName + "\"ÀÇ ±ÛÀÚ¼ö´Â " + maxLen + "ÀÌÇÏÀÌ¾î¾ß ÇÕ´Ï´Ù(ÇÑ±ÛÀº ±ÛÀÚ´ç 2ÀÚ·Î °è»êµË´Ï´Ù.)");
		finput.focus();
		return false;
	}
	return true;
}

function checkEmpty(finput,msg) {
	if(finput.value) {
		return true;
	} else {
		if(msg) {
			window.alert("\"" + msg + "\"¸¦(À») ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
			finput.focus();
		}
		return false;
	}
}

function checkSelect(finput,msg) {
	//window.alert(finput.name);
	var i = finput.selectedIndex;
	if(finput.options[i].value == 0 || finput.options[i].value == "") {
		if(msg) {
			window.alert("\"" + msg + "\"ÀÌ(°¡) ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
			finput.focus();
		}
		return false;
	} else {
		return true;
	}
}

function checkRadio(finput,msg) {
	for( i = 0; i < finput.length; i++ ) {
		if(finput[i].checked == true) {
			return true;
		}
	}
	if(msg) {
		window.alert("\"" + msg + "\"ÀÌ(°¡) Ã¼Å©µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
	}
	return false;
}

function setSelect(sel, value) {
	//window.alert(sel.name + ":" + value);
	if(value != "") {
		len = sel.length;
		for( i = 0; i < len; i++ ) {
			o = sel.options[i];
			//window.alert(o.value);
			if(o.value == value) {
				o.selected = true;
				break;
			}
		}
	}
}

function setRadio(rad, value) {
	if(value != "") {
		for( i = 0; i < rad.length; i++ ) {
			if( rad[i].value == value ) {
				rad[i].checked = true;
				break;
			}
		}
	}
}

function setCheck(chk, value) {
	if(value != "") {
		chk.checked = true;
	}
}

function setCheckComp(chk, value1, value2) {
	if(value1 == value2) {
		chk.checked = true;
	}
}

function hanCheck(finput, msg) {
	for(i=0;i<finput.value.length;i++) {
		var code=finput.value.charCodeAt(i);
		if (code > 128) {
			alert( msg + '¿¡´Â ÇÑ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.');
			finput.value="";
			finput.focus();
			return false;
		}
	}
	return true;
}

function pl(str) {
	document.write("Javascript Debug:  ");
	document.write(str + "<br>\n");
}

function popMsg(msg) {
	window.alert(msg);
}

function popUp( url,name,toolbar,location,status,menubar,scrollbars,resizable,width,height) {
	features = "toolbar=" + toolbar + ",location=" + location + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",width=" + width + ",height=" + height;
	window.open( url, name, features);
}

function popUpR( url,name,toolbar,location,status,menubar,scrollbars,resizable,width,height) {
	features = "toolbar=" + toolbar + ",location=" + location + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",width=" + width + ",height=" + height;
	return window.open( url, name, features);
}

function link( url ) {
	if(url.length > 0) {
		url = "http://" + url;
		popUp(url,"link","yes","yes","yes","yes","yes","yes",800,600);
	}
}


function goTo(url) {
	if(url != "") {
		document.location.href = url;
	}
}

function addfavorites(){
	if (document.all) {
		window.external.AddFavorite("http://www.jobcare.com","ÀâÄÉ¾î");
	}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document;if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function Login_Top(){
	window.open('/main/login_top.html','win','width=276,height=160,top=100,left=100,scrollbars=no');
}