//¼ýÀÚ °Ë»ö ÀÚ¹Ù½ºÆ®¸³Æ®
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;

}

// ³»ºÎ È¨ÆäÀÌÁö ÀÌµ¿
function openURLRedirect() {
	var F_cd = frmDiv.sltDiv.options[frmDiv.sltDiv.selectedIndex].value;
	location.href = '/.php?CID='+F_cd;
}


function openURLRedirect_SW() {
	var F_cd = frmDiv.sltDiv.options[frmDiv.sltDiv.selectedIndex].value;
	location.href = './?CID=goods_search&orderby_type=4&FrontPageType=1&srh_keyfield=&srh_keyword=&srh_maker=&srh_append_1='+F_cd;
}

function openURLRedirect_SW_1() {
	var F_cd_1 = frmDiv_1.sltDiv_1.options[frmDiv_1.sltDiv_1.selectedIndex].value;
	location.href = './?CID=SiteShopping&cat_view=Root&CODE='+F_cd_1;
}

function openURLRedirect_SW_2() {
	var F_cd_2 = frmDiv_2.sltDiv_2.options[frmDiv_2.sltDiv_2.selectedIndex].value;
	location.href = './?CID=goods_search&orderby_type=4&FrontPageType=1&srh_keyfield=&srh_keyword=&srh_maker=&srh_append_1='+F_cd_2;
}


// ¿ÜºÎ È¨ÆäÀÌÁö ÀÌµ¿
function openWindowSiteRedirect(obj) {
	var targetUrl = obj.options[obj.selectedIndex].value;

	if(targetUrl != '')
		window.open(targetUrl);

	obj.options[0].selected = true;
}



// ¿ÀÇÂÃ¢1
function openWindow(url,width,height){
	
    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=yes");
    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("Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ½Ê½Ã¿À. \nºê¶ó¿ìÀúÀÇ »ó´Ü ³ë¶õ»ö [¾Ë¸² Ç¥½ÃÁÙ]À» Å¬¸¯ÇÏ½Å ÈÄ \n[ÇöÀç »çÀÌÆ®ÀÇ ÆË¾÷À» Ç×»ó Çã¿ë]À¸·Î ¼³Á¤ÇÏ¿© ÁÖ¼¼¿ä.");
	    }
	//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 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 hWin=null;
    if(hWin !=null){
		hWin.close();
        hWin=null;
    }

    hWin = window.open('' , 'photoView' ,"toolbar=no,scrollbars=auto,left=1,top=1,width=10,height=10,resizable=yes");
    hWin.focus();
	var strTmp='';
	strTmp += "<html><body leftmargin='0' topmargin='0'>\n\r"
	strTmp += "<table WIDTH='100%' >\n\r";
	strTmp += "<tr><td>\n\r";
	strTmp += "<a href='javascript:close();'><img src='"+imgurl+"' name='u' alt='´©¸£½Ã¸é Ã¢ÀÌ ´ÝÈü´Ï´Ù.'></a>\n\r";
	strTmp += "</td></tr>\n\r";
	strTmp += "</table>\n\r";
	strTmp += "<script language='javascript'>\n\r";
	strTmp += "var temp_width=document.u.width;\n\r";
	strTmp += "var temp_height=document.u.height;\n\r";
	strTmp += "window.resizeTo(temp_width+20,temp_height+30);\n\r";
	strTmp += "</script>\n\r";
	strTmp += "</body></html>"
	hWin.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=530,height=480,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';
		}
	}
}


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_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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

// -->

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; }
}


