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

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

function 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=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n);
  return x;
}

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

function address_popup(f)
 {
   window.open('../zipcode/search.php?fname='+f.name,'searchaddress','width=470,height=300,scrollbars=yes');
 }

function idpw_popup()
 {
   window.open('/member/idpw_search.php','','width=490,height=300,scrollbars=no');
 }

//ÀÌº¥Æ® °ü·Ã ÇÔ¼ö
function event_popup(url,width,height)
{
	cookiedata = document.cookie; 
	if ( cookiedata.indexOf("event=done") < 0 ){
		window.open(url,'event','width='+width+',height='+height+',scrollbars=no');
	}
}
function move_event(url){
        opener.document.location=url;
        window.close();
}

//»ç¿ë·® È®ÀÎ ÆË¾÷
function open_win(url,width,height){
	window.open(url,'event','width='+width+',height='+height+',scrollbars=no');
}

//ÄíÅ° ¸¸µé±â
function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function over_point(obj){
	obj.style.cursor="pointer";
}

function num_format(number) {
        var num=String(number);
        var cnt = Math.ceil(num.length/3);
        var offset = num.length%3;
        var out="";
        
        offset=(offset==0)?3:offset;
        out = num.substring(0, offset);
        
        for(i=1;i<cnt;i++) {
                out += "," + num.substring(offset, offset+3);
                offset += 3;
        }
        return out;
}

function go_service(svc){
		if(svc=="A"){
			window.location="service_list.php";
			}
		else if(svc){
	  		elem=svc.split("-");
			service=elem[0];
			num=elem[1];
			window.location="service_info.php?num="+num+"&service="+service;
			}
		else {
			return false;
			}
}


function print_flash(url,width,height){
	classid='D27CDB6E-AE6D-11cf-96B8-444553540000';
	codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0';
	pluginspace='https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash';

	document.write('<object classid="clsid:'+classid+'" codebase="'+codebase+'" width="'+width+'" height="'+height+'">');
        document.write('<param name=movie value="'+url+'">');
	document.write('<param name=quality value=high>');
        document.write('<embed src="'+url+'" quality=high pluginspage="'+pluginspace+'" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'">');
	document.write('</embed></object>');
}

function print_receipt(num){
	window.open('http://nims.ksnet.co.kr:7001/pg_infoc/src/bill/credit_view.jsp?tr_no='+num,'','width=440,height=610, scrollbars=no');
}

//Ä«µå¹øÈ£,ÁÖ¹Î¹øÈ£µî 2°³ÀÌ»óÀÇ ÀÔ·Â¶õÀÌ ÀÖÀ»¶§ ÀÚµ¿À¸·Î ´ÙÀ½ Ä­À¸·Î ³Ñ¾î°¡´Â ÇÔ¼ö
function move_elem(eCur,eNext){
        f=eCur.form;

        maxlen=eCur.maxLength;
        curlen=eCur.value.length+1;

        if(maxlen < curlen){
                eNext.focus();
        }
}

function openwin(popUrl, popName, popStatus) {
        window.open(popUrl, popName, popStatus)
}

