//¼ýÀÚ °Ë»ö ÀÚ¹Ù½ºÆ®¸³Æ®
function Check_Num(tocheck) {
	var isnum = true;

	if (tocheck == null || tocheck == "") {
		isnum = false;
		return isnum;
	}
		
	for (var j = 0 ; j < tocheck.length; j++) {
		if (tocheck.substring(j, j + 1) != "0" &&
			tocheck.substring(j, j + 1) != "1" &&
			tocheck.substring(j, j + 1) != "2" &&
			tocheck.substring(j, j + 1) != "3" &&
			tocheck.substring(j, j + 1) != "4" &&
			tocheck.substring(j, j + 1) != "5" &&
			tocheck.substring(j, j + 1) != "6" &&
			tocheck.substring(j, j + 1) != "7" &&
			tocheck.substring(j, j + 1) != "8" &&
			tocheck.substring(j, j + 1) != "9") {
				isnum = false;
		}
	}
	return isnum;

}

// ¿ÀÇÂÃ¢1
function openWindow(url,width,height){
	
    //document.domain = "b1mall.com"; 
	
	var hWin=null;
    if(hWin !=null){
		hWin.close();
        hWin=null;
    }
   
	hWin = window.open( url , 'title' ,"toolbar=no,scrollbars=yes,left=10,top=10,width="+width+",height="+height+",resizable=no");
    hWin.focus();
}
// ¿ÀÇÂÃ¢3
function openWindow3(url,width,height){
	
    var hWin3=null;
    if(hWin3 !=null){
		hWin3.close();
        hWin3=null;
    }
   
	hWin3 = window.open( url , 'title3' ,"toolbar=no,scrollbars=yes,left=10,top=10,width="+width+",height="+height+",resizable=no");
    hWin3.focus();
}
// ¿ÀÇÂÃ¢4
function openWindow4(url,width,height){
	
    var hWin4=null;
    if(hWin4 !=null){
		hWin4.close();
        hWin4=null;
    }
   
	hWin4 = window.open( url , 'title4' ,"toolbar=no,scrollbars=yes,left=10,top=10,width="+width+",height="+height+",resizable=no");
    hWin4.focus();
}
// ¿ÀÇÂÃ¢2
/*
function openWindow2(url,title,opt)
{
	
    var hWin2=null;
    if(hWin2 !=null){
		hWin2.close();
        hWin2=null;
    }
    hWin2 = window.open( url , title ,opt);
	if (hWin2 == null)
	    {
		    alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À.");
	    }
	//window.open( url , title ,eval(opt));
	//window.open( url , 'title' ,"toolbar=no,scrollbars=yes,left=1,top=1,width=100,height=100,resizable=yes");
    hWin2.focus();
}
*/
function openWindow2(url,title,opt)
{
	
    var hWin2=null;
				 if(hWin2 !=null){
		         hWin2.close();
                 hWin2=null;
                 }
    hWin2 = window.open( url , title ,opt);
	//hWin2.focus();
	if (hWin2 == null)
	    {
		    alert("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À.");
	             
	            // hWin2.focus();
		
		}
}

function photoWindow(url)
{
    var hWin=null;
    if(hWin !=null){
		hWin.close();
        hWin=null;
    }
    hWin = window.open( url , 'up' ,"toolbar=no,scrollbars=auto,left=1,top=1,width=100,height=100,resizable=no");
    hWin.focus();
}

function photoView(imgurl)
{
    var hWinPhoto = null;
    if(hWinPhoto !=null){
		hWinPhoto.close();
        hWinPhoto=null;
    }

    hWinPhoto = window.open( '' , 'PHOTOVIEW' ,"location=no, toolbar=no,left=10,top=10,width=10,height=10");
    hWinPhoto.focus();
	var strTmp='';
	strTmp += "<html>\n\r";
	strTmp += "<head>\n\r";
	strTmp += "<title>»çÁøº¸±â</title>\n\r";
	strTmp += "<SCRIPT language=JavaScript>\n\r";
	strTmp += "function window_resize(){\n\r";
	strTmp += "img = new Image();\n\r";
	strTmp += "img.src = '" + imgurl + "';\n\r";
	strTmp += "H_size = parseInt(img.width) + 10;\n\r";
	strTmp += "V_size = parseInt(img.height) + 30;\n\r";
	strTmp += "this.resizeTo(H_size,V_size);\n\r";
	strTmp += "}\n\r</SCRIPT>\n\r";
	strTmp += "</head>\n\r";
	strTmp += "<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onload='window_resize()'>\n\r"
	strTmp += "<table cellpadding='0' cellspacing='0' >\n\r";
	strTmp += "<tr><td>\n\r";
	strTmp += "<a href='javascript:close();'><img name='u' src='"+imgurl+"' alt='´©¸£½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.' border='0'></a>\n\r";
	strTmp += "</td></tr>\n\r";
	strTmp += "</table>\n\r";
	strTmp += "<SCRIPT language=JavaScript>\n\r";
	strTmp += "setTimeout('window_resize()',1000)";
	strTmp += "</SCRIPT>\n\r";
	strTmp += "</body>\n\r</html>\n\r"
	hWinPhoto.document.write(strTmp);
}

function openWindowPrn(mode,width,height)
{
	
    var hWinPrn=null;
    if(hWinPrn !=null){
		hWinPrn.close();
        hWinPrn=null;
    }

    hWinPrn = window.open('' , 'openWindowPrn' ,"toolbar=no,scrollbars=auto,left=1,top=1,width="+width+",height="+height+",resizable=yes");
    hWinPrn.focus();
	
	return 'openWindowPrn';
}
// °ø¹éÃ¼Å©
function isSpace(strTmp) {
	var atChar,tmpAtChar = ''
	
	if(strTmp.length == 0) return true;
	for ( i = 0 ; i < strTmp.length ; i ++){
		atChar = strTmp.substring(i, i+1);
		if(atChar != ' ')tmpAtChar += atChar ;
	}
	if(tmpAtChar.length == 0)return true;
	return false;
}
function Zip_Search(ref) {
		var window_left = (screen.width-640)/2;
		var window_top = (screen.height-480)/2;
		window.open(ref,"checkIDWin",'width=516,height=450,status=no,scrollbars=yes,top=' + window_top + ',left=' + window_left + '');
}
function email_chk(word) {
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-._@";
	
	for (i=0; i< word.length; i++)
	{
		idcheck = word.charAt(i);
		
		for ( j = 0 ;  j < str.length ; j++){
		
			if (idcheck == str.charAt(j)) break;
				
     			if (j+1 == str.length){
   				return false;
     			}
     		}
     	}
     	return true;
}
// ÇÑ±Û ÀÔ·Â °Ë»ö
function hangul_chk(word) {
	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";
	
	for (i=0; i< word.length; i++)
	{
		idcheck = word.charAt(i);
		
		for ( j = 0 ;  j < str.length ; j++){
		
			if (idcheck == str.charAt(j)) break;
				
     			if (j+1 == str.length){
   				return false;
     			}
     		}
     	}
     	return true;
}
// Å¸ÀÌ¸Ó
function Timer(day,hour,min,sec,frm,TimeOutFunc){
	this.day = day;
	this.hour = hour;
	this.min = min;
	this.sec = sec;
	this.returnObj = frm;
	this.returnValue;
	//methods
	this.display = Timer_display;
	this.LastTimeValue = Timer_returnValue;
	this.TimeOut = eval(TimeOutFunc);
}

function Timer_display(){
	objFrm = eval(this.returnObj);
	objFrm.value = this.returnValue;
	objFrm.value = this.returnValue;
}
function Timer_returnValue(){ 
	this.sec=this.sec-1;         //1ÃÊ½Ä °¨¼Ò ÇÏ´Ù°¡ -1ÀÌµÇ¸é 1ºÐÀ» »«´ÙÀº ÃÊ¸¦ 59ÃÊ·Î ÃÊ±âÈ­ 
	if(this.sec == -1){ 
		this.sec = 59; 
		this.min = this.min-1; 
	} 
	if(this.min == -1){    //1ºÐ¾¿ °¨¼Ò ÇÏ´Ù°¡ -1ÀÌµÇ¸é 1½Ã°£À» »«´ÙÀ½ ºÐÀ» 59ºÐÀ¸·Î ÃÊ±âÈ­ 
		this.min=59; 
		this.hour = this.hour - 1; 
	} 
	if(this.hour == -1){    //1½Ã°£¾¿ °¨¼Ò ÇÏ´Ù°¡ -1ÀÌµÇ¸é 1ÀÏÀ» »«´ÙÀ½ ³¯Â¥ ÃÊ±âÈ­ 
		this.hour = 23; 
		this.day = this.day - 1; 
	} 
	if(this.sec == 0 && this.min == 0 && this.hour == 0 && this.day == 0){ 
		//ÀÏ:0 ½Ã°£:0 ºÐ:0 ÃÊ:0 ÀÌ¶ó¸é Á¾·á¸Þ¼¼Áö Ãâ·Â 
		this.returnValue= '°øµ¿±¸¸Å°¡ ¸¶°¨µÇ¾ú½À´Ï´Ù.';     
		return; 
	} 
	this.returnValue =  this.day + 'ÀÏ ' + this.hour + '½Ã°£ ' + this.min + 'ºÐ ' + this.sec + 'ÃÊ '; 
	this.display();
	//1ÃÊ´ç ÇÑ¹ø¾¿ timer1()À» È£ÃâÇÏ¿© ½ÇÇà 
		
}

// ÆË¾÷Ã¢ Á¦¾î
var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;

function zoomBox(evt,zlink,maxw,maxh,tox,toy) {
	if (arguments.length > 2) zNew=1;
	scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
	maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
	maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
	toX=tox?tox:0;
	toY=(toy?toy:0)+scrollH;
	fromX=evt.pageX?evt.pageX:evt.clientX;
	fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
	adjX=toX+evt.screenX-fromX;
	adjY=toY+evt.screenY-fromY;
	if (document.createElement && document.body.appendChild && !zBox) {
		zBox=document.createElement("div");
		zBox.style.position="absolute";
		document.body.appendChild(zBox);
	} else if (document.all && !zBox) {
		document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
		zBox=document.all.zBoxDiv;
		} else if (document.layers && !zBox) {
			zBox=new Layer(maxW);
			zBox.style=zBox;
			}
	zLink=zlink;
	doZoom();
}

function doZoom() {
	zStep+=1;
	zPct=(10-zStep)/10
	if (document.layers) {
		zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
		zBox.document.open();
		zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
		zBox.document.close();
	} else {
		zBox.style.border="2px solid #999999";
		zBox.style.left=toX+zPct*(fromX-toX);
		zBox.style.top=toY+zPct*(fromY-toY);
		zBox.style.width=maxW*(1-zPct);
		zBox.style.height=maxH*(1-zPct);
	}
	zBox.style.visibility="visible";
	if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
	else {
		zBox.style.visibility='hidden';
		zStep=0;
		if (zLink && !zNew) location.href=zLink.href;
		else if (zLink && zNew) {
			var w=window.open(zLink.href,'','width='+maxW+',height='+maxH+',left='+adjX+',top='+adjY+',scrollbars,resizable');
			zNew=null;
			}
		}
}

// ÀÌ¹ÌÁö Á¦¾î
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_findObj(n, d) { //v4.01
	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 && d.getElementById) x=d.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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

 /* ÇÏ·çµ¿¾È Ã¢¿­Áö ¾Ê±â ÄíÅ° */
function GetCookie(NameCookie) {
      var i = document.cookie.indexOf( NameCookie+'=' );
      if (i != -1) {
              i += NameCookie.length + 1;
              NameEnd = document.cookie.indexOf(';', i);
              if (NameEnd == -1) {
                NameEnd = document.cookie.length;
              }
              return  unescape(document.cookie.substring(i, NameEnd));
      } else {
        return "";
      }
  
}

browser_type = 1;
var bAllCheckFlag = 0;
function allselect(obj){
	for( var i=0; i<document.proc_sel.length; i++) {
		var element = document.proc_sel.elements[i];
		if ( element.name.indexOf('act_chk') != -1 ) {
			tmp = element.name;
			if ( bAllCheckFlag == 1 ) {
				document.getElementById(tmp).checked = 0;
				ChgColor(tmp);
			} else {
				document.getElementById(tmp).checked = 1;
				ChgColor(tmp);
			}
		}
	}
	
	if ( bAllCheckFlag == 1 ) {
		obj.btn_select.value = "¸ðµÎ¼±ÅÃ";
		bAllCheckFlag = 0;
	} else {
		obj.btn_select.value = "¼±ÅÃÃë¼Ò";
		bAllCheckFlag = 1;
	}
}

function ChgColor(line) {
	var f = "divTr_" + line;
	var sObj = document.getElementById(f);
	var sObj2 = document.getElementById(line).checked;
	if ( browser_type == 1 )	{
		if (sObj2 == 0)	{
			sObj.style.backgroundColor ='White';
		} else {
			sObj.style.backgroundColor ='#E8ECDC';
		}
	}
}
