function modeless_popup(url,width, height, scroll, status, resizable)
{
	// scroll : 1/0
	// status : 1/0
	// resizable : 1/0
	// Usage : modeless_popup('http://www.empas.com',300,400,0,1,1)

	scroll=(scroll==1) ? 'yes': 'no';
	status=(status==1) ? 'yes': 'no';
	resizable=(resizable==1) ? 'yes': 'no';

  	dialogWidth = width;
  	dialogHeight = height;  

	var oWin=showModelessDialog( url, window, 'status:false; dialogWidth:' + dialogWidth  + 'px; dialogHeight: ' + dialogHeight + 'px; help:no; dialogLeft:0px; dialogTop:0px; status:'+status+'; resizable:'+resizable+'; scroll:'+scroll);	
}

function popupwindow(link,w,h)
{
	var popwin=window.open(link,"pw","width="+w+",height="+h+",scrollbars=no,resizable=yes,left=0,top=0,status=yes")
	popwin.focus()
}

function popupwindows(link,w,h,s)
{
	var popwin=window.open(link,"pw2","width="+w+",height="+h+",scrollbars="+s+",resizable=yes,left=0,top=0,status=yes")
	popwin.focus()
}

function namepoupwin(link,w,h,s,name)
{
	var popwin=window.open(link,name,"width="+w+",height="+h+",scrollbars="+s+",resizable=yes,left=0,top=0,status=yes")
	popwin.focus()
}

function TRIM(str)
{
	str = str.replace(/^\s*/,'').replace(/\s*$/, '');
	return str;
} 


function IME_CONTROL(f,flag)
{
	f.style.imeMode=(flag==1) ? "active" : "inactive";
}

function convertNum(intPrice) 
{ 
	if(parseInt(intPrice)>0)
	{
		intPrice=intPrice+""
		var length_of_number = intPrice.length; 
		var new_number = ''; 

		for(position=0; position < length_of_number; position++)
		{
			new_number += intPrice.substring(position,position+1);         
			if(((length_of_number - position)-1 )%3==0 && ((length_of_number-position)-1)>0)
			new_number += ','; 
		} 
		return new_number;
	} else return "";
} 

function CheckEmail(str) //¸ÞÀÏÁÖ¼ÒÃ¼Å©
{
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str)) { return true; }
    else { return false; }
}

function autoTab(obj1, intVal, obj2) 
{
	if (TRIM(obj1.value).length == parseInt(intVal)) 
	{
		obj1.value=TRIM(obj1.value)
		obj2.focus();
	}
}

function CheckJumin(jumin1,jumin2) 
{
	var jno1 = jumin1.value;
	var jno2 = jumin2.value;
	var len1 = jno1.length;
	var len2 = jno2.length; 
	var allno = jno1.concat(jno2); 

	if (!jno1 || len1 != 6) 
	{
		alert("Wrong Number!!");
		jumin1.focus();
		return false;
	}
	else if (!jno2 || len2 != 7) 
	{
		alert("Wrong Number!!");
		jumin2.focus();
		return false;
	}
	else
	{
		if (!validCheck(allno)) 
		{
			alert("Wrong Number!!");
			jumin1.value = "";
			jumin2.value = "";
			jumin1.focus();
			return false;
		}
	}
	return true;
}

function validCheck(regno) 
{
	var temp = 0;
	strno = regno.toString(); 
	checktemp = strno.substring(12, 13);
	for (var i = 0; i <=11 ; i++)
	{
		temp = temp + ((i % 8 + 2) * parseInt(strno.substring(i, i+1)))
	}
	temp = 11 - (temp % 11);
	temp = temp % 10;
	if (temp == checktemp)
	return 1;
	else
	return 0;
}

// Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å© 
function check_fgnno(fgnno)
{ 
   var sum=0; 
   var odd=0; 
   buf = new Array(13); 
   for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); } 
   odd = buf[7]*10 + buf[8]; 
   if(odd%2 != 0) { return false; } 
   if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) { 
		   return false; 
   } 
   multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; 
   for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); } 
   sum = 11 - (sum%11); 
   if(sum >= 10) { sum -= 10; } 
   sum += 2; 
   if(sum >= 10) { sum -= 10; } 
   if(sum != buf[12]) { return false } 
   return true; 
} 


// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å© 
function CheckBiznum(vencod) 
{ 
	if(TRIM(vencod).length < 1) return 1;
	if(isNaN(vencod)) return 2;
	var sum = 0; 
	var getlist =new Array(10); 
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5"); 
	for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); } 
	for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; } 
	sum = sum + parseInt((getlist[8]*5)/10); 
	sidliy = sum % 10; 
	sidchk = 0; 
	if(sidliy != 0) { sidchk = 10 - sidliy; } 
	else { sidchk = 0; } 
	if(sidchk != getlist[9]) { return 3; } 
	return true; 
} 

/* ÀÌ¹ÌÁö ¸¶¿ì½º ¿À¹ö½Ã È¸»öÅæ ¾ø¾Ö±â
 <img src="path" style="filter:gary;" onmouseover="ImageOverGray(this,1);"
 onmouseout="ImageOverGray(this,2);"> 
*/

function ImageOverGray(objImg,flag)
{
	if(flag==1) objImg.style.filter='';
	else objImg.style.filter='gray';
}

function OpenZipcode(formname,objzip1,objzip2,objaddr)
{
	url="/member/zipcode/zipcode.php?form="+formname+"&zip1="+objzip1+"&zip2="+objzip2+"&address="+objaddr;
	window.open(url,"zipwin","width=520,height=260,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

function AlertFocus()
{
	tmpobj=arguments[0];	// object
	ment=arguments[1];		// Alert Msg
	flag=arguments[2];		// °ªÀÌ true ÀÌ¸é °ª Áö¿ì±â
	alert(ment)
	if(flag) tmpobj.value=""
	tmpobj.focus()
	return false;
}

function imageMagnify(file)
{
	imgWindows=window.open("/products/prodView.php?fn="+file,"PVIEW","left=0,top=0,width=200,height=200");
	imgWindows.focus();
}




function goscript(url) {
document.location=url
}
//calendarbox(2005,3,'13','2|4|12|14|30|','/SachangCalendar/')
//usage ==> calendarbox(Æ¯Á¤³â,Æ¯Á¤¿ù, Æ¯Á¤ÀÏ, ÀÏÁ¤ÀÖ´Â³¯, ¸µÅ©(Äõ¸®°ªÀÌÀü ? ³ÖÁö¸»°Í)

function deco(form){

  var InStr = form.ar1.value;
  var len_1 = InStr.length;
  var ttb = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  var len_res = InStr.length % 4;
  var len_div = len_1 - len_res;
  var re = new makeArray(3);
  var In  = new makeArray(4);
  var DecNum = new makeArray(4);
  var i=0;
  var Stat = "";
  var tmp16, tmp16s;
  var EnB=4;
  var str="";

  while(1)
  {
    if( i >= len_1 )
         break; 

    for(k=1;k<=4;k++)
    {
      In[k] = InStr.charAt(i++);
      DecNum[k] = ttb.indexOf(In[k]);
    } 

    if( i >= len_div )
    {
        Stat = "End";  
        if( len_res == 3 || DecNum[4] == 64 )
          EnB = 3;
        if( len_res == 2 || DecNum[3] == 64 )
          EnB = 2;
    }

    re[1] = ( DecNum[1] << 2 ) + ( DecNum[2] >> 4);
    re[2] = ( ( DecNum[2] & 15 ) << 4 ) + ( DecNum[3] >> 2);
    re[3] = ( ( DecNum[3] & 3 ) << 6 ) | DecNum[4] ;

    for(k=1;k<=3;k++)
    {
       if( k < EnB )
       { 
          tmp16 = re[k].toString(16);
          tmp16s = "%" + tmp16;
          str = str + tmp16s  ; 
       }
    }
   }
  str = unescape(str); 
  form.ar1.value = str;
}

function enco(form){

  var InStr = form.ar1.value;
  var ttb = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  var len_1 = InStr.length;
  var len_res = InStr.length % 3;
  var len_div = len_1 - len_res;
  var ra = new makeArray(4);
  var i=0;
  var Stat = "";

  var str="";
  while(1)
  {
    if( i >= len_1 )
         break; 


    if( i >= len_div )
         Stat = "End";  

    A = eval(InStr.charCodeAt(i++));
    B = eval(InStr.charCodeAt(i++));
    C = eval(InStr.charCodeAt(i++));

    if( i > len_div )
    {
        Stat = "End";  

        if( len_res >= 1)
          C = 0;
        if( len_res == 1 )
          B = 0;
    }
    ra[1] = A >> 2;
    ra[2] = ( (A & 3) << 4 ) + (B >> 4);
    ra[3] = ( ( B & 15 ) << 2 ) + ( C >> 6);
    ra[4] = C & 63;

    if( Stat == "End" && len_res >= 1 )
          ra[4] = 64; 
    if( Stat == "End" && len_res == 1 )
          ra[3] = 64;

    for(k=1;k<=4;k++)
       str = str + ttb.substr(ra[k],1); 
 }  
 form.ar1.value = str;
}

function makeArray(n){
    this.length=n
    for(var i=1; i<=n; i++){
            this[i]=null;
    }
    return this
}
///////////////////////////////////////////////////////////////////////////////////////////////////
var SpecSummLphoto, SpecSummSphoto, SpecSummTitle, SpecSummMoreLink, SpecSummToolTip,global_sm_size;
var SpecSummItems=new Array();
///////////////////////////////////////////////////////////////////////////////////////////////////
function ProductsSpecSummary()
{
	var sm_size=150;
	if((global_sm_size) && global_sm_size !=="") sm_size=global_sm_size;
	document.write('<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=95% Align=center>');
	document.write('<TR>');
	document.write('<TD WIDTH=30% ALIGN=CENTER><img src=/products/images/' + SpecSummSphoto + ' width=' + sm_size + ' border=0><BR>');
	document.write('<a href="javascript:imageMagnify(\'' + SpecSummLphoto +'\');"><img src=/images/LargeImage.gif border=0 VSPACE=20></a></TD>');
	document.write('<TD WIDTH=70% VALIGN=TOP>');
	document.write('<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>');
	document.write('<TR BGCOLOR=#FAFAFA>');
	document.write('<TD COLSPAN=2 HEIGHT=20 CLASS=TITLE2><img src=/images/block3.gif border=0 hspace=10><B>'+SpecSummTitle+'</TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD COLSPAN=2 HEIGHT=2 BGCOLOR=#B7B7B7></TD>');
	document.write('</TR>');

	for(i=0;i<SpecSummItems.length;i++)
	{
		document.write('<TR>');
		document.write('<TD WIDTH=5% HEIGHT=20><img src=/images/arrow01.gif border=0></TD>');
		document.write('<TD WIDTH=95% CLASS=TD7 ALIGN=LEFT>');
		document.write(SpecSummItems[i]);
		document.write('</TD>');
		document.write('</TR>');
		document.write('<TR>');
		document.write('<TD COLSPAN=2 HEIGHT=1 BACKGROUND=/images/dot.gif></TD>');
		document.write('</TR>');
	}
	document.write('<TR>');
	document.write('<TD COLSPAN=2 HEIGHT=30 ALIGN=RIGHT><a href=' + SpecSummMoreLink + ' alt="' + SpecSummMoreLink + '"><img src=/images/more3.gif border=0></a></TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	document.write('</TD>');
	document.write('</TR>');
	document.write('</TABLE>');
}