/* <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> */

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.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_showHideLayers() { //v6.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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function styleFlip(selObj,strClassName){
	selObj.className = strClassName;
}

function dspChange(){
  var j,pj,vj,objSpan,argsj=dspChange.arguments;
  for (j=0; j<(argsj.length-2); j+=3) if ((objSpan=MM_findObj(argsj[j]))!=null) { v=argsj[j+2];
    if (objSpan.style) { objSpan=objSpan.style; v=(v=='show')?'':(v=='hide')?'none':v; }
    objSpan.display=v; }
}

function DisplayDirect(index) {
	for (i=1; i<3; i++){
		if ( i==index ) {
			document.images['img'+index].src="/images/notice_tit_"+index+"_on.gif";
			document.getElementById('direct' + index).style.display='';
			document.getElementById('direct' + index + '_more').style.display='';
		}
		else {
			document.images['img'+i].src="/images/notice_tit_"+i+".gif";
			document.getElementById('direct' + i).style.display='none';
			document.getElementById('direct' + i + '_more').style.display='none';
		}
	}
}


function DisplayDirect2(index) {
	for (i=1; i<4; i++){
		if ( i==index ) {
			document.getElementById('direct' + index).style.display='';			
		}
		else {
			document.getElementById('direct' + i).style.display='none';
			eval("document.find_id_form.groups"+i+".checked=false"); 
		}
	}
}



// ¼ýÀÚ¸¸ ÀÔ·Â Ã¼Å©
function onlyNum() {
	if(((event.keyCode<48)||(event.keyCode>57))&&(event.keyCode!=13)) {
		event.returnValue=false;
	}

	len = event.srcElement.value.length; 
	if(len > 1) {
		var ch = event.srcElement.value;
		
		if (Isnum_c(ch) == false) {
			alert(ch + " ¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
			event.srcElement.value = "";     
            event.returnValue=false;
        }       
    }
}

function goto_content_in_submain(contentUrl, leftUrl)
{
	contentUrl = escape(contentUrl);
	var url = "/jumpmain.htm?&left=" + leftUrl + "&content=" + contentUrl;
	try
	{
		top.iflg_body.iflg_main.location.href = url;
	} catch(e) { alert(e);}
}

function Isnum_c(ch) {   
    return ((ch > 0));
}

function setLeftPage() {
	var leftPath = getLeftPath();
	if( arguments.length >= 1 ) leftPath = arguments[0];
	var iflg_left = parent.iflg_left;
	try
	{
		if ( iflg_left.location.pathname != leftPath ) {
			iflg_left.location.replace("http://"+location.hostname+leftPath);
		}
	}
	catch(exception)
	{	// left°¡ ºóÆäÀÌÁöÀÏ °æ¿ì ¹ß»ý °¡´É.
		iflg_left.location.replace("http://"+location.hostname+leftPath);
	}
}



function mainflash(Str1, Str2, Str3){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+Str2+'" height="'+Str3+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
+'<param name="movie" value="'+Str1+'">'
+'<param name="quality" value="high">'
+'<param name="wmode" value="transparent">'
+'<embed src="'+Str1+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+Str2+'" height="'+Str3+'" type="application/x-shockwave-flash"></embed>'
+'</object>');
}



function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{ 
toolbar_str = toolbar ? 'yes' : 'no'; 
menubar_str = menubar ? 'yes' : 'no'; 
statusbar_str = statusbar ? 'yes' : 'no'; 
scrollbar_str = scrollbar ? 'yes' : 'no'; 
resizable_str = resizable ? 'yes' : 'no'; 
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); 
}

function bigMode(code,img,width,height) {
	var url="../product/viewBig.php?goods_code="+code+"&img="+img;
	window.open(url,'zoom','menubars=no,width='+width+',height='+height+' , top=10 , left=10 ,scrollbars=no');
}



	// ¼ýÀÚ ÀÌ¿Ü ¹®ÀÚ Ã¼Å© :: »ç¿ë¿¹ ==> <input type="password" name="_jmno2" value="" class="input" size="14" REQUIRED hname="ÁÖ¹Îµî·Ï¹øÈ£" onfocus="chknum()" onKeyUp="chknum();chkEnter(check_ins)">
	function chknum()
	{
		var e1 = event.srcElement;
		var num ="0123456789";
		var flag=true;

		for (var i=0;i<e1.value.length;i++)
		{
			if(-1 == num.indexOf(e1.value.charAt(i)))
				flag = false;
		}
		if (!flag) {
			alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼¼¿ä;");
			e1.value="";
			return;
		}
	}





function number_format(number,decimals ) {
    var number_str = String(number);
    var new_number_str = '';
    number_info = number_str.split('.');
    number_info_int = number_info[0];
    if (decimals != null ) {
        if (decimals > 0) new_number_str ='.' + ((decimals > 0) ?Math.round(Number('0.' +number_info[1]) * Math.pow(10, decimals)):'');
        else if (decimals < 0) number_info_int = String(Math.round(Number(number_info[0]) / Math.pow(10, decimals *(-1))) *Math.pow(10, decimals*(-1)));
    }
    len = number_info_int.length;
    for (i = len; i >= 0; i--) {
        if ( (len - i) > 1 && (len - i) % 3 == 1) new_number_str = ',' + new_number_str;
        new_number_str = number_info_int.substring(i, i+1) + new_number_str;
    }
    return new_number_str;
}



function del($href) {
  if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
    document.location.href = $href;
  }
}

function del_msg(href , msg) {
  if(confirm(msg)) {
    document.location.href = href;
  }
}
