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 number_check(number){
	var comp="0123456789";  
	var str=number; 
	for(i=0;i<str.length;i++) { 
		if(comp.indexOf(str.substring(i,i+1))<0) { 	
			return false;
		}
	}return true;
}

/****************************************/
/*	´ÙÀ½ÀÔ·ÂÃ¢À¸·Î ÀÌµ¿					*/
/****************************************/
function next(here,to,len) { if(here.value.length==len) to.focus(); }

/****************************************/
/* ÁÖ¹Îµî·Ï¹øÈ£(KOREA) Ã¼Å© ·çÆ¾		*/
/****************************************/
function checkresno(str)  {
       num = 0;                                                                   
       num7 = 0;                                                                  
       num13 = 0;                                                                 
       totalnum = 0;                                                              
       chknum = 0;                                                                
       num7 = parseInt(str.substring(6,7),10) ;
       num  = parseInt(str.substring(0,1),10)   * 2 +
              parseInt(str.substring(1,2),10)   * 3 +
              parseInt(str.substring(2,3),10)   * 4 +
              parseInt(str.substring(3,4),10)   * 5 +
              parseInt(str.substring(4,5),10)   * 6 +
              parseInt(str.substring(5,6),10)   * 7 +
              parseInt(str.substring(6,7),10)   * 8 +
              parseInt(str.substring(7,8),10)   * 9 +
              parseInt(str.substring(8,9),10)   * 2 +
              parseInt(str.substring(9,10),10)  * 3 +
              parseInt(str.substring(10,11),10) * 4 +
              parseInt(str.substring(11,12),10) * 5;
      num13 = parseInt(str.substring(12,13),10);
      totalnum = num%11;
      chknum   = 11 - totalnum;

     if(chknum >= 10 ) chknum = chknum - 10;
      if((num13 == chknum) && ( num7 == 1 || num7 == 2 ))
                return true;
       else   return false;                                                   
}

/****************************************/
/* ÆË¾÷Ã¢								*/
/****************************************/
function popWin(url, name, w, h, s){
	var win = window.open(url, name, "width="+w+",height="+h+",scrollbars="+s+",top=10,left=10,");
	win.focus();
}

/****************************************/
/* ·Î±×ÀÎÃ¢	¹è°æÀÌ¹ÌÁö »èÁ¦				*/
/****************************************/
function clearInput(frm){
	//frm.style.background = "#9AC4E2";
	frm.style.backgroundImage='';
}

/****************************************/
/* ·Î±×ÀÎ½Ã ¾ÆÀÌµðÀúÀå					*/
/****************************************/
var todayDate = new Date(); 
todayDate.setDate( todayDate.getDate() + 365 ); 

function setLoginCookie(name, value) {
	document.cookie = name + "=" + value + "; path=/; expires=" + todayDate.toGMTString();
}

/****************************************/
/* ·Î±×ÀÎ½Ã ¾ÆÀÌµð°¡Á®¿À±â				*/
/****************************************/
function getLoginCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else {
    begin += 2;
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

/****************************************/
/* Ã¼Å©¹Ú½º Ã¼Å©ÇÏ±â					*/
/****************************************/

function defaultCheck(strSelect,strSelectName)
{
	intExitFlag = false;				
	
	if(strSelectName != null)
	{			
		if(strSelectName.length == undefined)
		{			
			if(strSelect == strSelectName.value)
				strSelectName.checked = true;
		} else {
			for(i=0;i<strSelectName.length;i++)
			{				
				if(strSelect == strSelectName[i].value)
				{			
					//strSelectName[i].defaultChecked = true;
					strSelectName[i].checked = true;																		
					intExitFlag = true
				} 					
				if(intExitFlag) break;		
			}
		}
	}    		
}	

function changeMenuLayer(mode){
	if (mode=="A")
	{
		leftMenuLayer1.style.display = "";
		leftMenuLayer2.style.display = "none";
	}else {
		leftMenuLayer1.style.display = "none";
		leftMenuLayer2.style.display = "";
	}
}

function resizephoto(){
wsize = document.photo.width+20;
hsize = document.photo.height+30;
window.resizeTo(wsize,hsize); 
}

/****************************************/
/* TRIM									*/
/****************************************/
function ltrim(value)
{
  var LeftTrimValue = "";
  var i=0;
  if( value == "" )
        return "";
  strLen = value.length;
  while(i<strLen)
  {
    if(value.charAt(i) != " ") break;
    i++;
  }
  for(s=i;s<strLen;s++)
  {
    LeftTrimValue = LeftTrimValue + value.charAt(s);
  }
  return LeftTrimValue;
}
function rtrim(value)
{
  var RightTrimValue = "";
  if( value == "" )
        return "";
  strLen = value.length;
  --strLen;
  while( 0 <= strLen)
  {
    if(value.charAt(strLen) != " ") break;
    --strLen;
  }
  for(s=0;s<=strLen;s++)
  {
    RightTrimValue = RightTrimValue + value.charAt(s);
  }
  return RightTrimValue;
}
function trim(value)
{
  return rtrim(ltrim(value));
}

//¼Ò¹®ÀÚ·Î º¯È¯
function goChangeStr(obj) {
		obj.value = obj.value.toLowerCase();
}

//ÄÞº¸¹Ú½º ÀÚµ¿¼±ÅÃ
function setSelectBoxValue(obj, val){
	for (i = 0;i < obj.length;i++)
	{
		if (obj[i].value == val)
		{
			obj[i].selected = true;
			break;
		}
	}
}

//»óÇ°¼ö·® ÀÚµ¿Áõ°¡
function fnUpAmount(obj){
	if (!number_check(obj.value))
	{
		obj.value = "1";
		return;
	}

	var tmpValue = parseInt(obj.value) + 1;

	obj.value = tmpValue;
}

//»óÇ°¼ö·® ÀÚµ¿°¨¼Ò
function fnDownAmount(obj){
	if (!number_check(obj.value))
	{
		obj.value = "1";
		return;
	}

	if (parseInt(obj.value) <= 1)
	{
		obj.value = "1";
		return;
	}

	var tmpValue = parseInt(obj.value) - 1;

	obj.value = tmpValue;
}

function goProductList(lcode){
	var scode;
	var mcode;

	scode = lcode.substring(0,1);
	mcode = lcode.substring(0,2);

	document.location.href = "/product/product_list.asp?scode=" + scode + "&mcode=" + mcode + "&lcode=" + lcode;
}

function ProductInfoView(obj, flag){

	if (flag == "Y")
	{
		document.all("DivProductInfo"+obj).style.display = "";
	}
	else
	{
		document.all("DivProductInfo"+obj).style.display = "none";
	}
}

function showLeftMenu(){

	if (document.all["divLeftMenu1"].style.display == "")
	{
		document.all("divLeftMenu1").style.display = "none";
		document.all("divLeftMenu2").style.display = "none";
		document.all("divLeftMenu3").style.display = "none";
		document.all("divLeftMenu4").style.display = "none";
	}
	else
	{
		document.all("divLeftMenu1").style.display = "";
		document.all("divLeftMenu2").style.display = "";
		document.all("divLeftMenu3").style.display = "";
		document.all("divLeftMenu4").style.display = "";
	}
}

function showMorebyMenu(){

	document.all("divLeftMenu1").style.display = "";
	document.all("divLeftMenu2").style.display = "";
	document.all("divLeftMenu3").style.display = "";
	document.all("divLeftMenu4").style.display = "";
}

function mainPopup(cnj_width,cnj_height,flag) { 
	cookiedata = document.cookie; 

	var url = "";
	if (flag == 1)
	{
		str = "MainPop1=done";
		url = "/popup/popUp1.asp";
	}else if (flag == 2)
	{
		str = "MainPop2=done";
		url = "/popup/popUp2.asp";
	}else if (flag == 3)
	{
		str = "MainPop3=done";
		url = "/popup/popUp3.asp";
	}
	
	if ( cookiedata.indexOf(str) < 0 ){ 
	   mywin = open("","MainPop","top=70,left=100,width="+cnj_width+",height="+cnj_height+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no");
	   with (mywin.document) { 
	        location.href = url; 
	   }
	}
}

//***************************************************************** 
// Web Site: http://www.CginJs.Com 
// CGI ¿Í JavaScript°¡ ¸¸³µÀ» ¶§ = C.n.J ¢Ñ http://www.CginJs.Com 
// CGI ¿Í JavaScript°¡ ¸¸³µÀ» ¶§ = C.n.J ¢Ñ webmaster@CginJs.Com 
// C.n.J ÀÚ¹Ù½ºÅ©¸³Æ® ÀÚµ¿ »ý¼º ¸¶¹ý»ç ¢Ñ http://www.CginJs.Com 
// C.n.J ÀÚ¹Ù½ºÅ©¸³Æ®(JavaScript) °¡ÀÌµå ¢Ñ http://www.CginJs.Com 
// C.n.J CSS(Cascading Style Sheet) °¡ÀÌµå ¢Ñ http://www.CginJs.Com 
// Editer : Web Site: http://www.CginJs.Com 
//***************************************************************** 
/////////////////////////////////////////////////////////////// --> 
var cnj_img_view = null; 
function cnj_win_view(img, flag){ 
img_conf1= new Image(); 
img_conf1.src=(img); 
cnj_view_conf(img, flag); 
} 

function cnj_view_conf(img, flag){ 
if((img_conf1.width!=0)&&(img_conf1.height!=0)){ 
cnj_view_img(img, flag); 
} else { 
funzione="cnj_view_conf('"+img+"','"+flag+"')"; 
intervallo=setTimeout(funzione,20); 
} 
} 

function cnj_view_img(img, flag){ 
if(cnj_img_view != null) { 
if(!cnj_img_view.closed) { cnj_img_view.close(); } 
} 
cnj_width=img_conf1.width; 
cnj_height=img_conf1.height+30; 
str_img="width="+cnj_width+",height="+cnj_height; 
mainPopup(cnj_width,cnj_height,flag);
return; 
} 

function navControll(obj, hname)
{
	if (document.all[obj].style.display == "" || document.all[obj].style.disPlay == "show")
	{
		document.all[obj].style.display = "none";
	}
	else if (document.all[obj].style.display == "none")
	{
		document.all[obj].style.display = "";
		location.href = hname
	}
}

function stripHTMLtag(string) { 

var str = string;
var RegExpTag = "<[^<|>]*>";  
str = str.replace(RegExpTag,"");  
//result : ÇÑ±Û window.a lert('hellow'); td {font-size:9pt;} Hellow Blog  
  
  
//½ºÅ©¸³Æ® Á¦°Å  
var RegExpJS = "<script[^>]*>(.*?)</SCRIPT>";   
str = str.replace(RegExpJS,"");   
//result : ÇÑ±Û <!-- ÁÖ¼® --> <STYLE type=text/css>  td {font-size:9pt;} </STYLE> <BR> <H3>Hellow Blog</H3>   
  
  
//½ºÅ¸ÀÏ Á¦°Å   
var RegExpCSS = "<STYLE[^>]*>(.*?)</STYLE>";   
str = str.replace(RegExpCSS,"");   
//result : ÇÑ±Û <!-- ÁÖ¼® --> <SCRIPT type=text/javascript>window.a lert('hellow');</SCRIPT><BR><H3>Hellow Blog</H3>   
   return str; 
} 



