
function zoom(path)
{
     open(path,"zoom","menubars=no scrollbars=no width=0 height=0");
}

function chk_Value(obj,mtype,vstr){
  var str = "À»";
  if(mtype==1)
    str = "¸¦";
  if(obj.value==""){
    alert(vstr + str +" ÀÔ·ÂÇÏ¼¼¿ä");
    obj.focus();
    return false;
  }else
    return true;
}

function chk_Length(obj,TotalLen,vstr){
  if(obj.value.length > TotalLen){
    alert(vstr + "ÀÇ ±ÛÀÚ¼ö´Â "+ TotalLen +"ÀÚÀÌÇÏ¸¸ °¡´ÉÇÕ´Ï´Ù\r\n\rÇöÀç: "+obj.value.length +"ÀÚ");
    obj.focus();
    return false;
  }else
    return true;
}

function isNumber(obj){
	var Pattern2 = /([^0-9])/;
	if(obj.value.match(Pattern2)!=null){
		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;
	}else{
		return true;
	}
}

function CheckLen(obj, max){
	var temp;
	var memocount = 0;
	var tot_count  = 0;
	
	len = obj.value.length;
	for(k=0;k<len;k++){
	 temp = obj.value.charAt(k);
	 if(escape(temp).length > 4)
	  memocount += 2;
	 else
	  memocount++;

	}
	if(memocount/2> max)
	  return false;
	else
		return true;
}

function onlyNumber(){
 if (event.keyCode < 45 || event.keyCode > 57 || ((event.keyCode > 32 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 65) || (event.keyCode > 90 && event.keyCode < 97)))
  event.returnValue = false;
}


function CheckLength(obj){
	var temp;
	var memocount = 0;
	var tot_count  = 0;
	
	len = obj.value.length;
	for(k=0;k<len;k++){
	 temp = obj.value.charAt(k);
	 if(escape(temp).length > 4)
	  memocount += 2;
	 else
	  memocount++;

	}

	return memocount/2;
}

//Ã¼Å© ¹Ú½º°¡ ÇÑ°³¶óµµ Á¸ÀçÇÒ¶§ Ã¼Å©µÈ °¹¼ö ¸®ÅÏ
function selectboxCheckCnt2(bx) {
	var fcount = bx.length;
	var chcount = 0;
	for(var i=0;i<fcount;i++) {
		if (bx[i].checked) chcount++;
	}
	return chcount;
}

//Ã¼Å© ¹Ú½º°¡ ÇÑ°³µµ ¾øÀ»¼öµµ ÀÖÀ»¶§ Ã¼Å©µÈ °¹¼ö ¸®ÅÏ
function selectboxCheckCnt(f,bx,ename) {
	var chcount = 0;
	var bxcount = 0;
	for (i = 0; i < f.elements.length; i++ ) {
		var el = f.elements[i];
		if (el.getAttribute("NAME") == ename) {
			bxcount++;
		}
	}
	if (bxcount==1)	{
		if (bx.checked) {
			chcount = 1;
		}
	}
	if (bxcount > 1) {
		chcount = selectboxCheckCnt2(bx);
	}
	return chcount;
}


//Popup 		
function popup(Fn, Win,X, Y, Scroll){
l = (screen.width) ?	(screen.width- X) / 4	: 0;
t = (screen.height) ?	(screen.height- Y) / 4 : 0;	
	NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top='+t+',left='+l+',scrollbars='+Scroll+',toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no');
}


//list iframe ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°¸·±â
function cmdNoMouse_list(){
	var strScript = "var message=''; function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers)   {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function('return false')";
	window.document.write("<script>"+strScript+"</script>");
}

//view iframe ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°¸·±â
function cmdNoMouse_view(){
	var strScript = "var message=''; function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers)   {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function('return false')";
	window.document.write("<script>"+strScript+"</script>");
}

//quizwin iframe ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°¸·±â
function cmdNoMouse_quizwin(){
	var strScript = "var message=''; function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers)   {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function('return false')";
	window.document.write("<script>"+strScript+"</script>");
}

function openWin(dir,inputname,form1){
	window.open("/common/upload.php?dir="+dir+"&inputname="+inputname+"&Func=setfname&openerform="+form1,"filepopup","scrollbars=no,resizable=no,status=no,width=301,height=150,left=0,top=0");
}

function setfname(form1, fname, inputname)
{
	frmtarget = eval(form1 +"." + inputname);
	frmtarget.value = fname;
}

function onClick_del(idx,lfile){
	if(confirm("do you want delete?"))
		location.href=lfile;
}

function CheckEmail(strEmail)
{
    /** ±ÝÁö»çÇ×
     - @°¡ 2°³ÀÌ»ó
     - .ÀÌ ºÙ¾î¼­ ³ª¿À´Â °æ¿ì
     -  @.³ª  .@ÀÌ Á¸ÀçÇÏ´Â °æ¿ì
     - ¸ÇÃ³À½ÀÌ.ÀÎ °æ¿ì **/
    var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; 
    /** ÇÊ¼ö»çÇ×
     - @ÀÌÀü¿¡ ÇÏ³ªÀÌ»óÀÇ ¹®ÀÚ°¡ ÀÖ¾î¾ß ÇÔ
     - @°¡ ÇÏ³ªÀÖ¾î¾ß ÇÔ
     - Domain¸í¿¡ .ÀÌ ÇÏ³ª ÀÌ»ó ÀÖ¾î¾ß ÇÔ
     - Domain¸íÀÇ ¸¶Áö¸· ¹®ÀÚ´Â ¿µ¹®ÀÚ 2~3°³ÀÌ¾î¾ß ÇÔ **/
    var regMust = /^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$/;
    if(strEmail==""){
		alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä");
		return false;
	}else if ( !regDoNot.test(strEmail) && regMust.test(strEmail) )
        return true;
    else{
		alert("Àß¸øµÈ ÀÌ¸ÞÀÏÇü½ÄÀÔ´Ï´Ù.");
		return false;
	}
}

function openWinFront(dir,inputname,form1){
	window.open("/common/pop_find.php?dir="+dir+"&inputname="+inputname+"&Func=setfname&openerform="+form1,"filepopup","scrollbars=no,resizable=no,status=no,width=383,height=253,left=0,top=0");
}

// °³ÀÎ Æ÷ÀÎÆ® ³»¿ª º¸±â
function popUPointList(id){
	window.open("/_sitemanager/point_mgr/pop_user_point.php?userid="+id,"filepopup","scrollbars=no,resizable=no,status=no,width=470,height=500,left=0,top=0");
}

function popView(file_path){
	window.open("/common/pop_img.php?file_path="+file_path,"asdasdsad","width=500,height=500");
}

function excel(){
	var f = document.excelForm;
	f.content.value = document.all.excelTable.innerHTML;
	f.submit();
}

function OnClickZipcode(frm, zip1, zip2, addr1, addr2){
	window.open("/common/popup_search_zipcode.php?formName="+ frm +"&zip1="+ zip1 +"&zip2="+ zip2 +"&addr1="+ addr1 +"&addr2="+ addr2,"popzip","width=385,height=300");
}
