	
function script_init(){
	//ÆÐÅ°ÁöÁ¾·ù
	var pack = ['JavaScript'];

	//°æ·Î¼³Á¤
	if(null!=document.styleSheets&&0<document.styleSheets.length) {
		var _csspath = document.styleSheets[0].href.replace(new RegExp('::[\\\\/:](\\.\\.[\\\\/:])+'),'::/').replace(new RegExp('[^\\\\/:]+$'),'');
		var path = _csspath.replace('css','js')
	} else {
		
	}
	var path="/include/js"||'';
	if (path.substr(path.length-1) != "/") path += "/";

	//ÆÐÅ°Áöµî·Ï
	//1.JavaScript
	pack['JavaScript']	= [
		"javascript.js",	//°øÅë½ºÅ©¸³Æ®
		"calendar.js",				//´Þ·Â
		"frmCheck.js"		//validate
		];

	//ÆÐÅ°Áö include
	for (var k=0;k<pack.length;k++) {
		libs = pack[pack[k]];
		
		for (var i=0;i<libs.length;i++)
			if(typeof(libs[i]) != 'undefined')
				document.write('<script language="'+pack[k]+'" src="'+path+libs[i]+'"><\/script>');
	}
}
//½ºÅ©¸³Æ®°æ·Î ¼³Á¤
script_init();

//Ã¼Å© ¹Ú½º¸¦ ÀüÃ¼ Ã¼Å©ÇÏ´Â ÇÔ¼ö
function checkedall(frm){

	for(var i=0; i<frm.elements.length; i++)
	{
		var e = frm.elements[i];
		
		if(e.type == "checkbox")
		{
			if(frm.all.checked){
				e.checked = true;
			} else {
				e.checked = false;
			}
		}
	}
}
//inpru Box¿¡ ¼ýÀÚ¸¸ ÀÔ·ÂµÇ°Ô ÇÏ´Â ÇÔ¼ö 
function allowNumberOnly(event){
	if (event.keyCode < 45 || event.keyCode > 57) {
		event.returnValue = false;
	}
}

/* ¸®½ºÆ®Æû¿¡¼­ÀÇ °¢ ROW´ç mouse Event */
function LIST_OVER(obj){
	obj.className = "listCont MOVER"
}
function LIST_OUT(obj){
	obj.className = "listCont";
}


//============================================================================ 
// ÀÌ¹ÌÁö ÀÚµ¿ ¸®»çÀÌÁî 
//============================================================================ 
function image_auto_resize(this_s,width,height){ 
 var ta_image = new Image(); 
 ta_image.src = this_s.src; 
  if(!width){this_s.removeAttribute('width'); 
  this_s.style.width='auto';} 
  else if(width < ta_image.width){ 
  this_s.width = width; 
  }else{ 
  this_s.width = ta_image.width; 
  } 
  if(!height){this_s.removeAttribute('height'); 
  this_s.style.height='auto';} 
  else if(height < ta_image.height){ 
  this_s.height = height; 
  }else{ 
  this_s.height = ta_image.height; 
  } 
} 

function image_auto_resize_inarea(this_s,width,height,view){ 
//this_s¾ÈÀÇ ¸ðµç ÀÌ¹ÌÁö´Â ÀÚµ¿ ¸®»çÀÌÁî µÈ´Ù. 
 //alert(this_s.childNodes.length); 
 if(!view){view=true;} 
 if(!this_s){return;} 
 if(this_s.nodeType!=1){return;} 
 for(var i=0,m=this_s.childNodes.length;i<m;i++){ 
  var ta = this_s.childNodes[i]; 
  
  if(ta.nodeName=='IMG'){ 
  //ta.style.border='1px solid #333333';  
  image_auto_resize(ta,width,height); 

  if(view){ 
    if(!ta.title){ta.title=ta.src;} 
    if(!ta.onclick){ 
    ta.style.cursor='pointer'; 
    ta.onclick=function(){js_image_view(this,1);} 
    } 
    if(!ta.onload) 
    ta.onload=function(){image_auto_resize(this,width,height);} 
    if(!ta.onmouseover)  
    ta.onmouseover=function(){image_auto_resize(this,width,height);} 
  } 
  } 
  if(ta.childNodes.length>0){ 
  image_auto_resize_inarea(ta,width,height); 
  } 
 } 
 return; 

} 

function Product(a,b,c,d,e)
{
	this.code		=a;//ÄÚµå
	this.name		=b;//Á¦Ç°¸í
	this.cost		=c;//ÆÇ¸Å°¡
	this.surplus	=d;//ÀÜ¿©±Ý¾×
	this.method	=e;//°áÁ¦¹æ¹ý
}

var pinfo = new Array();

pinfo['ºñÅ¸½º DXM-760']= new Product('ºñÅ¸½º DXM-760','ºñÅ¸½º DXM-760','600000','100000',['ÀÏ½ÃºÒ','2°³¿ùÀ¯ÀÌÀÚ','Çö±Ý']);
pinfo['¾ÆÀÌ½ºÅ×ÀÌ¼Ç T43NaviDMB']= new Product('¾ÆÀÌ½ºÅ×ÀÌ¼Ç T43NaviDMB','¾ÆÀÌ½ºÅ×ÀÌ¼Ç T43NaviDMB','599000','99000',['3°³¿ù¹«ÀÌÀÚ']);
pinfo['Çö´ë¿ÀÅä³Ý HND-7011']= new Product('Çö´ë¿ÀÅä³Ý HND-7011','Çö´ë¿ÀÅä³Ý HND-7011','500000','0',[]);
pinfo['LG NC100(¿É¼ÇÆ÷ÇÔ)']= new Product('LG NC100(¿É¼ÇÆ÷ÇÔ)','LG NC100(¿É¼ÇÆ÷ÇÔ)','570000','70000',['ÀÏ½ÃºÒ']);
pinfo['LG NC100(¿É¼Ç¹ÌÆ÷ÇÔ)']= new Product('LG NC100(¿É¼Ç¹ÌÆ÷ÇÔ)','LG NC100(¿É¼Ç¹ÌÆ÷ÇÔ)','500000','0',[]);
pinfo['ÀÎÄÌ¿ÍÀÌµåÅÍÄ¡W-7.0-DMB']= new Product('ÀÎÄÌ¿ÍÀÌµåÅÍÄ¡W-7.0-DMB','ÀÎÄÌ¿ÍÀÌµåÅÍÄ¡W-7.0-DMB','500000','0',[]);
pinfo['·Îµå¸ÞÀÌÆ® RNM-T100']= new Product('·Îµå¸ÞÀÌÆ® RNM-T100','·Îµå¸ÞÀÌÆ® RNM-T100','500000','0',[]);
pinfo['ÆÄÀÎµå¶óÀÌºêM730']= new Product('ÆÄÀÎµå¶óÀÌºêM730','ÆÄÀÎµå¶óÀÌºêM730','500000','0',[]);
pinfo['¹ÌÁöÁ¤']= new Product('¹ÌÁöÁ¤','¹ÌÁöÁ¤','0','0',[]);

/** Á¦Ç°¼±ÅÃ½Ã ¿É¼Ç °¡°Ý¹× ¿É¼Ç Ãâ·Â **/
function setCO(obj)
{
	var frm = document.forms['frm'];
	var _obj = document.getElementById('model-option');
	frm.elements['cost'].value = '0';
	_obj.innerHTML = "";
	if( obj.value == "" ) return;

	_pinfo = pinfo[obj.value];
	//°¡°Ý¼ÂÆÃ
	frm.elements['cost'].value = _pinfo.cost.number_format();

	if( _pinfo.surplus == '0' ){
		_obj.innerHTML = "";
	}else{
		_obj.innerHTML = "500,000 ¿ø(36°³¿ù À¯ÀÌÀÚ) + ÀÜ¿©±Ý¾× <input type='text' name='surplus' value='" + _pinfo.surplus.number_format() + "' style='border:none' size='7'> ¿ø ";
		str = "<select name='surplus_method'>";
		for( var i = 0 ; i < _pinfo.method.length ; i++ ){
			str += "<option value='"+_pinfo.method[i]+"'>"+_pinfo.method[i]+"</option>";
		}
		str += "<select>";
		_obj.innerHTML += str;
	}
}

String.prototype.number_format=function(){
    return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,');
}


//============================================================================ 
// ÀÌ¹ÌÁö ÀÚµ¿ ¸®»çÀÌÁî 
//============================================================================ 
function image_auto_resize(this_s,width,height){ 
 var ta_image = new Image(); 
 ta_image.src = this_s.src; 
  if(!width){this_s.removeAttribute('width'); 
  this_s.style.width='auto';} 
  else if(width < ta_image.width){ 
  this_s.width = width; 
  }else{ 
  this_s.width = ta_image.width; 
  } 
  if(!height){this_s.removeAttribute('height'); 
  this_s.style.height='auto';} 
  else if(height < ta_image.height){ 
  this_s.height = height; 
  }else{ 
  this_s.height = ta_image.height; 
  } 
} 

function image_auto_resize_inarea(this_s,width,height,view){ 
//this_s¾ÈÀÇ ¸ðµç ÀÌ¹ÌÁö´Â ÀÚµ¿ ¸®»çÀÌÁî µÈ´Ù. 
 //alert(this_s.childNodes.length); 
 if(!view){view=true;} 
 if(!this_s){return;} 
 if(this_s.nodeType!=1){return;} 
 for(var i=0,m=this_s.childNodes.length;i<m;i++){ 
  var ta = this_s.childNodes[i]; 
  
  if(ta.nodeName=='IMG'){ 
  //ta.style.border='1px solid #333333';  
  image_auto_resize(ta,width,height); 

  if(view){ 
    if(!ta.title){ta.title=ta.src;} 
    if(!ta.onclick){ 
    ta.style.cursor='pointer'; 
    ta.onclick=function(){js_image_view(this,1);} 
    } 
    if(!ta.onload) 
    ta.onload=function(){image_auto_resize(this,width,height);} 
    if(!ta.onmouseover)  
    ta.onmouseover=function(){image_auto_resize(this,width,height);} 
  } 
  } 
  if(ta.childNodes.length>0){ 
  image_auto_resize_inarea(ta,width,height); 
  } 
 } 
 return; 

} 

function ButtonProcessing() {
	try {
		oPopup = window.createPopup();
		var oPopBody = oPopup.document.body;
		oPopBody.style.backgroundColor = "white";
		oPopBody.style.border = "solid #dddddd 1px";
		oPopBody.innerHTML = "<table width='100%' height='100%'><tr><Td align='center' style='font-size:9pt;'>Ã³¸®ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä...<br></td></tr></table>";
		var leftX = document.body.clientWidth/2 - 150;
		var topY = (document.body.clientHeight/2) - (oPopBody.offsetHeight/2);
		oPopup.show(leftX,topY,300,150,document.body);
		oPopBody.attachEvent("onblur",ButtonProcessing);
	} catch(e) {}
}