
//ÄÄ¸¶³Ö¾îÁÖ±â.
function setComma(str) 
{ 
  var retValue = "";  
  if (str.length <= 0 || !checknumber_value(str, ""))
  { 
	return retValue;
  } 
  for(i=0; i<str.length; i++) 
  {  
		  if(i > 0 && (i%3)==0) { 
				  retValue = str.charAt(str.length - i -1) + "," + retValue; 
		   } else { 
				  retValue = str.charAt(str.length - i -1) + retValue; 
		  } 
  }  
  return retValue;
} 
// µ·°ú °°Àº °æ¿ì , ¸¦ »©´Â  ½ºÅ©¸³Æ®.
function commafilter(str)
{
  var re = /^\$|,/g;
  return str.replace(re, "");
}

// ¹®ÀÚ¿­¿¡¼­ Æ¯Á¤ ¹®ÀÚ¸¦ Ã£¾Æ º¯È¯.
function ReplaceAll(str, oldch, newch)
{
 	while(str.indexOf(oldch) > -1) 
  		str = str.replace(oldch, newch);  
 	
 	return str;
}

// Æ¯¼ö¹®ÀÚ Á¦°Å
function CheckSearch(obj)
{
   var per = /.*\%+/g;	
	var condition = obj.value;
	
	if (per.test(condition ))
	{
		alert("°Ë»ö¾î·Î '%'¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
  		condition = condition.replace(new RegExp("%", "g"), "");
		if (condition == null || trim(condition) == "")
			return condition;
	}
	
 	return condition;
}

function hanCheck(obj, message, focusing)
{ 
	var objValue = obj.value+"";
	
	for(i=0;i<objValue.length;i++) 
	{
		var a=objValue.charCodeAt(i);
		if (a > 128) 
		{
		alert(message);
		if (focusing)
			obj.focus();
		return false;
		}
	} 
	return true; 
}
 
function goPage ( pageno , pageurl, pageSize )
{
  var form = document.frm;
  form.page.value = pageno;
  if (form.pageSize)
  	form.pageSize.value = pageSize;
  form.action = pageurl;
  form.submit();
}

function goListPage (pageno, pageurl, pageSize)
{
  var form = document.sortForm;
  form.page.value = pageno;
  if (form.pageSize)
  	form.pageSize.value = pageSize;
  form.action = pageurl;
  form.submit();  
}

function goContractAssetListPage (pageno, pageurl, pageSize)
{
  var form = document.contract_mnt_form;
  form.page.value = pageno;
  if (form.pageSize)
  	form.pageSize.value = pageSize;
  form.action = pageurl;
  form.submit();  
}

function goDistributeAssetPage ( pageno , pageurl, pageSize)
{
  var form = document.frm;
  form.dripage.value = pageno;
  if (form.dripageSize)
  	form.dripageSize.value = pageSize;
  form.action = pageurl;
  form.submit();
}

var checkflag = "false";
function check(field) 
{
	if(field == null)
		return "";
		
	if (checkflag == "false") 
	{
		if(field.length == null)
		{
			field.checked = true;
			checkflag = "true";
		}						
		else
		{		
			for (i = 0; i < field.length; i++) 
				field[i].checked = true;
			checkflag = "true";
		}
		return ""; 
	}
	else 
	{
		if(field.length == null)
		{
			field.checked = false;
			checkflag = "false";			
		}
		else		
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = false; 
			checkflag = "false";
		}
		return ""; 
	}
}

var checkflag2 = "false";
function check2(field) 
{
	if(field == null)
		return "";
		
	if (checkflag2 == "false") 
	{
		if(field.length == null)
		{
			field.checked = true;
			checkflag2 = "true";
		}						
		else
		{		
			for (i = 0; i < field.length; i++) 
				field[i].checked = true;
			checkflag2 = "true";
		}
		return ""; 
	}
	else 
	{
		if(field.length == null)
		{
			field.checked = false;
			checkflag2 = "false";			
		}
		else		
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = false; 
			checkflag2 = "false";
		}
		return ""; 
	}
}

function getCheckCount(objForm) {
	var nCount = 0;
	var elms = objForm.elements;
	for (var i = 0; i < elms.length; i++) 
	{
		if ((elms[i].type == "checkbox") && (elms[i].checked == true)) 
			nCount++;
	}
	return nCount;
}

function check_obj(obj, message, focusing)
{
	var objValue = obj.value+"";
	if (objValue == null || trim(objValue) == "")
	{
	  if (message != null && trim(message) != "")
		alert(message);
	  if (focusing)
		obj.focus();
	  return false;
	}
	return true;
}

function check_email(obj, message, focusing) 
{
   var objValue = obj.value+"";   
   var EMAIL = /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
   
   if(!EMAIL.test(objValue))
   {
	  alert(message);
	  if(focusing)
		 obj.focus();
	  return false;
   }
   return true;   
} 

function check_han(obj, message, focusing) 
{ 
   var objValue = trim(obj.value)+"";  
	for(i=0;i<objValue.length;i++) 
	{
		var a=objValue.charCodeAt(i);
		if (a > 128) 
		{
			alert(message);
		  if(focusing)
			 obj.focus();
	  	return false;
		}
	} 
   return true;   
}

function check_alpha(obj, message, focusing) 
{
   var objValue = obj.value+"";   
   var ALPHA = /^[a-z]+$/i;
   
   if(!ALPHA.test(objValue))
   {
	  alert(message);
	  if(focusing)
		 obj.focus();
	  return false;
   }
   return true;   
}

function checknumber_value(obj, message)
{ 
   var NUM = /^[0-9]+$/i;   // 0À» Æ÷ÇÔÇÏ´Â ¾ç¼ö 
	if (NUM.test(obj))
		return true; 
	else{
		if(message != "")
			alert(message)
		return false;
	}
	return true; 
}


function checknumber(obj, message, focusing)
{
	var x=obj.value;

   var NUM = /^[0-9]+$/i;   // 0À» Æ÷ÇÔÇÏ´Â ¾ç¼ö 
	if (NUM.test(x))
		return true; 
	else{
		if(message != "")
			alert(message)
		if (focusing)
			obj.focus();
		return false;
	}
	return true; 
}

function check_numeric(obj, message1, message2, focusing, min, max) 
{
   var objValue = obj.value+"";   

   var per = /.*\,+/g;	
   
	if (per.test(objValue))
			objValue = objValue.replace(new RegExp(",", "g"), "");
			
	if (objValue.length <= 0)
	  return true;
   
   var NUM = /^[0-9]+$/i;   // 0À» Æ÷ÇÔÇÏ´Â ¾ç¼ö
   var val;
   
   if(!NUM.test(objValue))
   {
	  alert(message1);
	  if(focusing)
		 obj.focus();
	  return false;
   }
	
   if(objValue != "0")
	  val = parseInt(strip_front_zero(objValue));
   else
	  val = objValue;

   if((min != null && val < min) || (max != null && val > max))
   {
	  alert(message2);
	  if(focusing)
		 obj.focus();
	  return false;
   }   
   return true;   
}

function strip_front_zero(str)
{
  while (str.charAt(0)=="0")
	str = str.substring(1, str.length);
  return str;
}


// ¹®ÀÚ¿­À» ³Ñ°Ü¼­ ¼ýÀÚ ¶Ç´Â ¾ËÆÄºªÀÎÁö Ã¼Å©ÇÏ´Â ½ºÅ©¸³Æ®
function checknumberStr(obj, message, focusing)
{
  var x = trim(obj.value);
  var NUM = /^[0-9a-zA-Z_\-]+$/i;   // 0À» Æ÷ÇÔÇÏ´Â ¾ç¼ö
  
  if (NUM.test(x))
  	return true; 
  else{
	if(message != "")
		alert(message)
	if(focusing)
	 obj.focus();
	return false;
  }
  return true; 
}

function checkfloat(obj, message, focusing)
{
	var x=obj.value;

	if (!isNaN(x))
		return true; 
	else{
		alert(message);
		obj.value = obj.value.substring(0, obj.value.length-1);
		if(focusing)
			obj.focus();
		return false;
	}
	return true; 
}

function checkassetfloat(obj, message, focusing , func)
{
	var x=obj.value;

  CheckKeys();
	if (!isNaN(x))
		return true; 
	else{
		alert(message);
		obj.value = obj.value.substring(0, obj.value.length-1);
		if (focusing)
			obj.focus();
		return false;
	}
	return true; 
}

function checkconsumvol(obj, message, focusing , func)
{
	var x=obj.value;
  CheckKeys();
	if (!isNaN(x))
		return true; 
	else{
		alert(message);
		obj.value = "";
		if (focusing)
			obj.focus();
		return false;
	}
	return true; 
}

function checkphone(obj, message, focusing)
{
	var x=obj.value;

	if(x.length == 0)
		return true; 
	
   var NUM = /^([0-9]|-)+$/i;   // 0À» Æ÷ÇÔÇÏ´Â ¾ç¼ö 
	if (NUM.test(x))
		return true; 
	else{
		if(message != "")
			alert(message)
		if (focusing)
			obj.focus();
		return false;
	}
	return true; 
}


function check_special(obj, message, focusing) 
{
   var objValue = obj.value+"";   
   var SPECIAL = /(!|@|#|\$|\%|\^|&|;|:|`|~|\'|\"|<|>)/i;   // !@#$%^&;:`~'" ÀÇ Æ¯¼ö CHARACTER
   
   if(SPECIAL.test(objValue))
   {
	  alert(message);
	  if(focusing)
		 obj.focus();
	  return false;
   }
   return true;   
}

// ¼±ÅÃµÈ checkboxÀÇ Ç×¸ñÀ» ¸®ÅÏÇÑ´Ù.
function count_checkbox(field)
{
   var count = 0;

   // ¼±ÅÃµÈ ÇÊµå°¡ 2°³ ÀÌ»ó Á¸ÀçÇÒ¶§
   if (field != null && field[0] != null)
   {
	   for(i = 0; i < field.length; i++)
	   {
		  if(field[i].checked)
		  {
			 count++;
			 continue;
		  }
	   }
   }
   else if (field != null && field.checked)	// ¼±ÅÃµÈ ÇÊµå°¡ 1°³ Á¸ÀçÇÒ¶§
	  count++;

   return count;
}

function trim(str) {
  while (str.charAt(str.length - 1)==" ")
	str = str.substring(0, str.length - 1);
  while (str.charAt(0)==" ")
	str = str.substring(1, str.length);
  return str;
}

function create_datefrom_string(syear, smonth, sday)
{
  var datestring = "";
  var today = new Date();
  var pyear, pmonth, pday;
  
  if (syear.value != "")
	 pyear = syear.value;
  else
	 return "";

  if (smonth.value != "")
  {
	 if (smonth.value.length > 1)
	   pmonth = smonth.value;
	 else
	   pmonth = "0"+smonth.value;
   }
  else
	 pmonth = "01";

  if (sday.value != "")
  {
	 if (sday.value.length > 1)
	   pday = sday.value;
	 else
	   pday = "0"+sday.value;
   }
  else
	 pday = "01";

  datestring = pyear + "-" + pmonth + "-" + pday;
  
  return datestring;
}

function create_dateto_string(syear, smonth, sday)
{
  var datestring = "";
  var today = new Date();
  var pyear, pmonth, pday;
  
  if (syear.value != "")
	 pyear = syear.value;
  else
	 return "";

  if (smonth.value != "")
	 pmonth = smonth.value;
  else
	 pmonth = "12";

  if (sday.value != "")
	 pday = sday.value;
  else
	 pday = getMonthLastDay(pmonth, pyear)

  datestring = pyear + "-" + pmonth + "-" + pday;
  
  return datestring;
}


function openCalendarByField(formobj, year, month, day, week, func)
{
   var newurl = "/common/single_calendar.html?form=" + formobj;
   
   if(year != null)
	  newurl += "&syear=" + year;
   if(month != null)
	  newurl += "&smonth=" + month;
   if(day != null)
	  newurl += "&sday=" + day
   if(week != null)
	  newurl += "&sweek=" + week;
   if(func != null)
	  newurl += "&func=" + func;
   
   
   objWin = window.open(newurl, "calendar_field", "width=220,height=320,scrollbars=no,resizable=no");
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin); 
	
   return objWin;
}

function openCalendarByText(formobj, formfield)
{
   var newurl = "/common/single_text_calendar.html?form=" + formobj;
   
   if(formfield != null)
	  newurl += "&setdate=" + formfield;
   
   objWin = window.open(newurl, "calendar_text", "width=220,height=320,scrollbars=no,resizable=no");
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå 
   setPop(objWin);
   
   return objWin;
}

function openCalendarByFunc(func)
{
   var newurl = "/common/single_calendar.html?func=" + func;
   
   objWin = window.open(newurl, "calendar_func", "width=220,height=320,scrollbars=no,resizable=no");
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin); 
   
   return objWin;
}

function openRangeCalendarByField(formobj, syear, smonth, sday, eyear, emonth, eday)
{
   var newurl = "/common/range_calendar.html?form=" + formobj;
   
   if(syear != null)
	  newurl += "&syear=" + syear;
   if(smonth != null)
	  newurl += "&smonth=" + smonth;
   if(sday != null)
	  newurl += "&sday=" + sday
   if(eyear != null)
	  newurl += "&eyear=" + eyear;
   if(emonth != null)
	  newurl += "&emonth=" + emonth;
   if(eday != null)
	  newurl += "&eday=" + eday

	var winw = 400;
	var winh = 350;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	winprops = 'height='+winh+',width='+winw+',top='+wint+',left='+winl+', scrollbars=no,resizable=no';
   objWin = window.open(newurl, "calendar_field_range", winprops);
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin); 
   
   return objWin;
}

function openRangeCalendarByFunc(func)
{
   var newurl = "/common/range_calendar.html?func=" + func;
   
   objWin = window.open(newurl, "calendar_func_range", "width=400,height=314,scrollbars=no,resizable=no");
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin); 
   
   return objWin;
}
 
 

function str2int(str)
{
  // ÁÂÃø¿¡ 0ÀÌ ³ª¿À´Â °æ¿ì´Â ¾ø¿¡ ÁØ´Ù.
  while (str.charAt(0)=="0")
	str = str.substring(1, str.length);
  return parseInt(str);
}



//ÇØ´ç ³â, ¿ùÀÇ ¸¶Áö¸· ³¯Â¥¸¦ ±¸ÇÏ´Â ÇÔ¼ö
function getMonthLastDay(M, Y)
{
   Months= new Array(31,28,31,30,31,30,31,31,30,31,30,31);
   Leap  = false;
   if((Y % 4 == 0) && ((Y % 100 != 0) || (Y %400 == 0)))
   {
	  Leap = true;
	  if(M==2) return(29);
	  else
		 return(Months[M-1]);
   }
   else
	  return(Months[M-1]);
}

	
function pass_modif_pop()
{
	var winl = (screen.width - 330) / 2;
	var wint = (screen.height - 220) / 2;
	
	var url = "/member/modifyPassForm.do";
	newWindow = window.open(url, 'pass_modify_pop', 'width=330,height=220,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow); 
}

function member_modif_pop(Member_Id)
{
	var winl = (screen.width - 330) / 2;
	var wint = (screen.height - 220) / 2;
	
	var url = "/member/getMemberDetail.do?Member_Id=" + Member_Id;

	newWindow = window.open(url, 'member_modify_pop', 'width=600,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow); 
}

//Ã¼Å© ¹Ú½ºÀÇ ÀüÃ¼ ¼±ÅÃ ÇÔ¼ö
var checkFlag = false;
function selectAll(field)
{
	
	if(field == null)
		return "";
	if(!checkFlag)
	{
		if(field.length == null)
		{
			if(field.disabled == false)
			{
				field.checked = true;
				checkFlag = true;
			}
		}else
		{
			for(i=0; i<field.length;i++)
			{
				if(field[i].disabled == false)
					field[i].checked = true;
			}
			checkFlag = true;
		}
		return "";
	}else
	{
		if(field.length == null)
		{
			field.checked = false;
			checkFlag = false;			
		}
		else		
		{
			for (i = 0; i < field.length; i++)
				field[i].checked = false; 
			checkFlag = false;
		}
		return ""; 
	}
} 

extArray1 = new Array(".gif", ".jpg");
extArray = new Array(".gif", ".jpg", ".dat");
function LimitAttach( file, message) 
{
	allowSubmit = false;
	if (!file) return;
	while (file.indexOf("\\") != -1)
	file = file.slice(file.indexOf("\\") + 1);
	ext = file.slice(file.indexOf(".")).toLowerCase();
	for (var i = 0; i < extArray.length; i++) 
	{
		if (extArray[i] == ext)
		{  
			allowSubmit = true; 
			break;
		}  
	}
	if (!allowSubmit) 
	{
		alert(message+ "\n ("+(extArray1.join("  "))+")"); 
		return false;   
	}
	
	return true;
}



// code - ÀÌµ¿ÇÒ ¸Þ´ºÀÇ ÄÚµå
// id - ÆÄ¶ó¹ÌÅÍ·Î ³Ñ°ÜÁÙ id °ª.
// etc_url - ÆÄ¶ó¹ÌÅÍ¸¦ get ¹æ½ÄÀ¸·Î ³Ñ±æ¶§ Ãß°¡ url.
// id_name : id¸¦ ³Ñ±â±â À§ÇÑ ÆÄ¶ó¹ÌÅÍ ÀÌ¸§.
// selected_no : ÇØ´ç ¸Þ´º id.
// target_no: ÇØ´ç ¸Þ´ºÀÇ °¡Àå ÃÖ»óÀ§ ¸Þ´º id (top menu id)
function hnoh_menu_jump(code, id, etc_url, centerid)
{
	var oURL = "";

  if (code == 'sitemap')
  {
		oURL = "contenturl=/sitemap/amsismv_main_frame.do&selected_no=67&bDescendant=true&target_no=75";				
		parent.body.location.href = "/bodyframe.do?"+oURL+etc_url;
		return;
  }
  else if(code == 'cmrequest')
  {
  	var pUrl = "/asset/register/amatarv_asset_frame.do?Cm_ID="+id+"&selected_no=20&bDescendant=true&target_no=21&Center_Id="+centerid;
		oURL = "contenturl="+pUrl;		
		oURL = ReplaceAll(oURL, "&", "~");
		parent.opener.parent.parent.location.href = "/bodyframe.do?"+oURL+etc_url;
		return;
	
  }
  else
  {	
	if ( code == 'asset' )
	  oURL = "&contenturl=/asset/manage/amatatv_asset_moved_frame.do?Asset_ID="+id+"&selected_no=20&bDescendant=true&target_no=22";
	else if ( code == 'asset_reg' )
	  oURL = "&contenturl=/asset/register/amatarv_asset_frame.do&selected_no=20&bDescendant=true&target_no=21";	  
	else if (code == 'company')
  		oURL = "&contenturl=/company/amhrccv_main_frame.do&selected_no=29&bDescendant=true&target_no=32";
	else if (code == 'code')
  		oURL = "contenturl=/code/main_frame.do?CodeGroupKey="+id+"&selected_no=36&bDescendant=true&target_no=41";
	else if (code == 'class')
  		oURL = "contenturl=/abase/amaiatv_class_frame.do?Class_Code="+id+"&selected_no=36&bDescendant=true&target_no=38";
	else if (code == 'model')
  		oURL = "contenturl=/abase/amaiamv_model_frame.do?Model_Code="+id+"&selected_no=29&bDescendant=true&target_no=34";	
	else if (code == 'product')
  		oURL = "contenturl=/plan/product/amitmtv_main_frame.do?Product_ID="+id+"&selected_no=36&bDescendant=true&target_no=61";	
	   else if (code == 'itsm')
  		oURL = "contenturl=/plan/stratagem/amitsmv_main_frame.do&selected_no=36&bDescendant=true&target_no=60";	
	else if (code == 'atac')
  		oURL = "contenturl=/contract/amatacv_contract_frame.do&selected_no=20&bDescendant=true&target_no=27";		
	else if (code == 'atatei')
  		oURL = "contenturl=/asset/cmrequest/amatateiv_asset_toms_request_frame.do&selected_no=20&bDescendant=true&target_no=223";		
	else if (code == 'arps')
  		oURL = "contenturl=/report/amarpsv_main_frame.do&selected_no=1&bDescendant=true&target_no=8";
	else if (code == 'aryi')
  		oURL = "contenturl=/report/amaryiv_main_frame.do&selected_no=1&bDescendant=true&target_no=11";	
	else if (code == 'ards')
  		oURL = "contenturl=/report/amardsv_main_frame.do&selected_no=1&bDescendant=true&target_no=14";	
	else if (code == 'ataq')
  		oURL = "contenturl=/asset/request/amataqv_request_frame.do&selected_no=20&bDescendant=true&target_no=23";
	else if (code == 'atat')
  		oURL = "contenturl=/asset/manage/amatatv_asset_frame.do&selected_no=20&bDescendant=true&target_no=22";	
	else if (code == 'atar')
  		oURL = "contenturl=/asset/register/amatarv_asset_frame.do&selected_no=20&bDescendant=true&target_no=21";	
	else if (code == 'atar')
  		oURL = "contenturl=/asset/register/amatarv_asset_frame.do&selected_no=20&bDescendant=true&target_no=21";
	else if (code == 'ataq')
  		oURL = "contenturl=/asset/request/amataqv_request_frame.do&selected_no=20&bDescendant=true&target_no=23";	
	else if (code == 'ittm')
  		oURL = "contenturl=/plan/trm/amittmv_trm_search_mainframe.do&selected_no=36&bDescendant=true&target_no=57";	
	else if (code == 'hrma')
  		oURL = "contenturl=/ituser/amhrmav_main_frame.do&selected_no=29&bDescendant=true&target_no=31";	
	else if (code == 'rrpd')
  		oURL = "contenturl=/itdoc/amrrpdv_main_frame.do&selected_no=29&bDescendant=true&target_no=30";	
	else if (code == 'aiam')
  		oURL = "contenturl=/abase/amaiamv_model_frame.do&selected_no=29&bDescendant=true&target_no=34";	
	else if (code == 'hrcc')
  		oURL = "contenturl=/company/amhrccv_main_frame.do&selected_no=29&bDescendant=true&target_no=32";	
	else if (code == 'pcmc')
  		oURL = "contenturl=/contract/ampcmcv_main_frame.do&selected_no=20&bDescendant=true&target_no=28";	
	else if (code == 'sgdi')
  		oURL = "contenturl=/systemlink/amsgdiv_asset_import_frame.do&selected_no=36&bDescendant=true&target_no=65";	
	else if (code == 'marq')
  		oURL = "contenturl=/mtn/ammarqv_main_frame.do?proc_order=1&start_order=1&selected_no=36&bDescendant=true&target_no=52";	
	else if (code == 'atpi')
  		oURL = "contenturl=/asset/inspection/amatpiv_main_frame.do&selected_no=36&bDescendant=true&target_no=47";	
	else if (code == 'rrpd_class')
  		oURL = "contenturl=/itdoc/amrrpdv_class_main_frame.do&selected_no=36&bDescendant=true&target_no=42";	
	else if (code == 'bzbz')
  		oURL = "contenturl=/business/ambzbzv_class_main_frame.do&selected_no=36&bDescendant=true&target_no=45";	
	else if (code == 'cmgm')
  		oURL = "contenturl=/code/main_frame.do&selected_no=36&bDescendant=true&target_no=41";	
	else if (code == 'aipc')
  		oURL = "contenturl=/abase/amaipcv_property_class_frame.do&selected_no=36&bDescendant=true&target_no=39";	
	else if (code == 'aiat')
  		oURL = "contenturl=/abase/amaiatv_class_frame.do&selected_no=36&bDescendant=true&target_no=38";	
	else if (code == 'aiap')
  		oURL = "contenturl=/abase/amaiapv_property_frame.do&selected_no=36&bDescendant=true&target_no=40";	
	else if (code == 'umom')
  		oURL = "contenturl=/org/amumomv_main_frame.do&selected_no=67&bDescendant=true&target_no=68";	
	else if (code == 'umum')
  		oURL = "contenturl=/user/amumumv_main_frame.do&selected_no=67&bDescendant=true&target_no=69";	
	else if (code == 'rmrm')
  		oURL = "contenturl=/role/role_main_frame.do&selected_no=67&bDescendant=true&target_no=70";	
	else if (code == 'mnmg')
  		oURL = "contenturl=/menu/main_frame.do&selected_no=67&bDescendant=true&target_no=71";	
	else if (code == 'umom_admin')
  		oURL = "contenturl=/org/amumomv_admin_org_main_frame.do&selected_no=67&bDescendant=true&target_no=76";	
	else if (code == 'bmbm')
  		oURL = "contenturl=/board/ambmbmv_main_frame.do&selected_no=67&bDescendant=true&target_no=73";	
	else if (code == 'main')
  		oURL = "/mainframe.do";	
  		
  	if (code != 'main')
  		parent.parent.location.href = "/bodyframe.do?"+oURL+etc_url;
  	else
  		parent.parent.location.href = oURL;
  }
} 

//ÀÎÀûÀÚ¿ø ÆË¾÷
function view_ituser_popup(Employee_ID)
{
	var winw = 700;
	var winh = 550; 
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	
   var newurl = "";
   
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		oURL = "";
	else
		prog_id = prog_id.substr(idx+3, 4);			
			
	if(prog_id == 'isha') 
		newurl = "/unionview/human/amishav_it_user_pop_frame.do";  //ÅëÇÕÁ¶È¸

   newurl = newurl+"?Employee_ID="+Employee_ID;
   objWin = window.open(newurl, "ituser_popup", "width="+winw+",height="+winh+", top="+wint+", left="+winl+", scrollbars=yes");
   objWin.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin); 
   
   return objWin;
}

 

function code_pop(id)
{ 
	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 

	var url = "/code/code_pop_frame.do?CodeGroupKey=" + id;
	newWindow = window.open(url, 'code_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);  
}

//***********************************
// A/S ´ã´çÀÚ ÆË¾÷
//************************************
 
function as_user_pop(form, func, id, name, as_type, as_org, pro_name)
{ 

	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
		// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
		if (prog_id == "mars") 
			newurl = "/mtn/ammarsv_as_user_pop_frame.do"; 
		else if (prog_id == "marc") 
			newurl = "/mtn/ammarcv_as_user_pop_frame.do"; 
		else if (prog_id == "marp") 
			newurl = "/mtn/ammarpv_as_user_pop_frame.do";  

	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name + "&AS_TYPE=" + as_type  + "&ORG_ID=" + as_org ;
	myPopup = window.open(newurl, 'as_user_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	myPopup.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(myPopup);  
}

//***********************************
// »ç¿ëÀÚ ÆË¾÷
//************************************
 
function user_pop(form, func, id, name, pro_name)
{ 

	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	if(!pro_name)	
	{			
		// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
		if (prog_id == "atar") 
			newurl = "/asset/register/amatarv_user_pop_frame.do";  
		else if (prog_id == "atad") 
			newurl = "/asset/amatatv_user_pop_frame.do"; 
		else if (prog_id == "atam") 
			newurl = "/asset/amatatv_user_pop_frame.do"; 
		else if (prog_id == "atat") 
			newurl = "/asset/amatatv_user_pop_frame.do"; 
		else if (prog_id == "ataq") 
			newurl = "/asset/amatatv_user_pop_frame.do"; 
		else if (prog_id == "atda") 
			newurl = "/asset/disuse/amatdav_user_pop_frame.do"; 
		else if (prog_id == "atas") 
			newurl = "/asset/modify/amatasv_user_pop_frame.do"; 
		else if (prog_id == "atac") 
			newurl = "/contract/amatacv_user_pop_frame.do"; 
		else if (prog_id == "pcmc") 
			newurl = "/contract/ampcmcv_user_pop_frame.do"; 
		else if (prog_id == "itmt") 
			newurl = "/plan/product/amitmtv_user_pop_frame.do";
		else if (prog_id == "itsp") 
			newurl = "/plan/profile/amitspv_user_pop_frame.do";
		else if (prog_id == "ittm") 
			newurl = "/plan/trm/amittmv_user_pop_frame.do";
 		else if (prog_id == "bzbu") 
			newurl = "/business/ambzbuv_user_pop_frame.do"; 
		else if (prog_id == "marq")
			newurl = "/mtn/ammarqv_user_pop_frame.do"; 
		else if (prog_id == "marc")
			newurl = "/mtn/ammarcv_user_pop_frame.do"; 
		else if (prog_id == "marp")
			newurl = "/mtn/ammarpv_user_pop_frame.do"; 
		else if (prog_id == "mars")
			newurl = "/mtn/ammarsv_user_pop_frame.do"; 
	}else{						   
		if (pro_name == "asset_inspection_print") 
			newurl = "/asset/inspection/amatpiv_inpr_user_pop_frame.do";
		else if (pro_name == "asset_inspection_regist") 
		   newurl = "/asset/inspection/amatpiv_inre_user_pop_frame.do";
 		else if (pro_name == "asset_inspection_action") 
		   newurl = "/asset/inspection/amatpiv_inac_user_pop_frame.do";
 	}				
 	
 
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	myPopup = window.open(newurl, 'user_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	myPopup.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(myPopup);  
}

function user_1_pop(form, func, id, name)
{ 

	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "atar") 
		newurl = "/asset/amatarv_pop_1_frame.do";  
	else if (prog_id == "atat") 
		newurl = "/asset/amatatv_pop_1_frame.do";  
	else if (prog_id == "ataq") 
		newurl = "/asset/amatatv_pop_1_frame.do";  		
	else if (prog_id == "marw") 
		newurl = "/mtn/worker/ammarwv_user_pop_frame.do";
	else if (prog_id == "marq") 
		newurl = "/mtn/ammarqv_user_pop_frame.do"; 
	else if (prog_id == "marc") 
		newurl = "/mtn/ammarcv_user_pop_frame.do"; 
	else if (prog_id == "marp") 
		newurl = "/mtn/ammarpv_user_pop_frame.do";  
	else if (prog_id == "mars") 
		newurl = "/mtn/ammarsv_user_pop_frame.do"; 
	else if (prog_id == "pcmc") 
		newurl = "/contract/ampcmcv_user_pop_frame.do"; 		

	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name; 
	myPopup = window.open(newurl, 'user_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	myPopup.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(myPopup);   
}

function user_2_pop(form, func, id, name)
{ 

	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "atar") 
		newurl = "/asset/amatarv_pop_2_frame.do";  
	else if (prog_id == "atat") 
		newurl = "/asset/amatatv_pop_2_frame.do";  
 
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	myPopup = window.open(newurl, 'user_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	myPopup.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(myPopup);   
}


function user_view_pop(id, pro_name)
{ 
	var winw = 580;
	var winh = 240;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	if(!pro_name)	
	{	  
		// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
		if (prog_id == "atar") 
			newurl = "/asset/register/amatarv_user_view_pop.do"; 
		else if (prog_id == "atad") 
			newurl = "/asset/amatatv_user_view_pop.do";   
		else if (prog_id == "atat") 
			newurl = "/asset/amatatv_user_view_pop.do";	
		else if (prog_id == "atda") 
			newurl = "/asset/disuse/amatdav_user_view_pop.do";   
		else if (prog_id == "atrl") 
			newurl = "/asset/amatatv_user_view_pop.do";	 
		else if (prog_id == "atac") 
			newurl = "/contract/amatacv_user_view_pop.do";	 
		else if (prog_id == "pcmc") 
			newurl = "/contract/ampcmcv_user_view_pop.do";	 
		else if (prog_id == "marc") 
			newurl = "/mtn/ammarcv_user_view_pop.do";		
		else if (prog_id == "marp") 
			newurl = "/mtn/ammarpv_user_view_pop.do";	 
		else if (prog_id == "marq") 
			newurl = "/mtn/ammarqv_user_view_pop.do";	 
		else if (prog_id == "mars") 
			newurl = "/mtn/ammarsv_user_view_pop.do";	 
		else if (prog_id == "isma") 
			newurl = "/uview/amismv_user_view_pop.do";		 
		else if (prog_id == "ista") 
			newurl = "/unionview/trm/amistav_user_view_pop.do";		 
 
	}else{						   
		if (pro_name == "asset_inspection_print") 
			newurl = "/asset/inspection/amatpiv_inpr_user_view_pop.do"; 
		else if (pro_name == "asset_inspection_regist") 
		   newurl = "/asset/inspection/amatpiv_inre_user_view_pop.do"; 
 		else if (pro_name == "asset_inspection_action") 
		   newurl = "/asset/inspection/amatpiv_inac_user_view_pop.do"; 
 	}
	newurl += "?Employee_ID="+id;
	newWindow = window.open(newurl, 'user_view_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=no,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}
 
//***********************************
// »ç¿ëÀÚ ÆË¾÷ ³¡
//************************************


//À¯Áöº¸¼ö °è¾à 
function contract_mnt_pop(form, func, id, name)
{ 
	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	var url = "/asset/manage/amatatrmv_pcmc_list.do?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	newWindow = window.open(url, 'contract_mnt_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	
}
//À¯Áöº¸¼ö °è¾à 
function view_contract_mnt_pop(id)
{ 
	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");
  var newurl = "";
  
	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);		
	
	if (prog_id == "atat") 
			newurl = "/asset/manage/amatatrmv_contract_mnt_info_pop_frame.do"; 	
	else if (prog_id == "mtnrp") 
			newurl = "/mtn/ammarpv_contract_mnt_info_pop_frame.do"; 	
	  
	newurl += "?Mnt_Contract_No=" + id;
	newWindow = window.open(newurl, 'contract_mnt_info_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}

//ÀÚ¿ø ÀÌ·Â
function asset_history_pop(id)
{
	var winw = 800;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;  
	  var newurl = "";	
	  
  	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
  	var prog_id = document.location+"";
  	var idx = prog_id.lastIndexOf("/");
  
  	if (idx < 0)
  		newurl = "";
  	else
  		prog_id = prog_id.substr(idx+3, 4);		  
	  
	newurl = "/asset/manage/amatatv_history_lisp_pop_frame.do"; 
	newurl += "?Asset_ID=" + id;
	
	newWindow = window.open(newurl, 'asset_history_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}

function asset_itdoc_pop(id)
{
	var winw = 800;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;  
	
	var newurl = "";	
	  
  	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
  	var prog_id = document.location+"";
  	var idx = prog_id.lastIndexOf("/");
  
  	if (idx < 0)
  		newurl = "";
  	else
  		prog_id = prog_id.substr(idx+3, 4);		  
	  
	newurl = "/asset/manage/amatatv_itdoc_list_pop_frame.do"; 
	newurl += "?Asset_ID=" + id;
	
	newWindow = window.open(newurl, 'asset_itdoc_list_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	

}


// º¸°í¼­ °áÀç ¿¬µ¿.
function report_approval_pop()
{ 
	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 

  var oURL = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		oURL = "";
	else
		prog_id = prog_id.substr(idx+3, 6);		 


	var url = "/report/am"+prog_id+"v"+"_approval_pop_frame.do";
	newWindow = window.open(url, 'report_approval_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	  
}

// º¸°í¼­ °áÀç ¿¬µ¿.
function report_approval_pop_1()
{ 
	var winw = 700;
	var winh = 500;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 

  var oURL = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		oURL = "";
	else
		prog_id = prog_id.substr(idx+3, 4);		 


	var url = "/report/am"+prog_id+"v"+"_approval_pop_frame.do";
	newWindow = window.open(url, 'report_approval_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
   
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	  
}

function g2b_pop(form, id)
{
	var winw = 800;
	var winh = 410;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;  
	var newurl = "";	
	  
  	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
  	var prog_id = document.location+"";
  	var idx = prog_id.lastIndexOf("/");
  
  	if (idx < 0)
  		newurl = "";
  	else
  		prog_id = prog_id.substr(idx+3, 4);		  
	  
 
	if (prog_id == "atac")
  		newurl = "/contract/amatacv_g2b_pop_frame.do"; 

	newurl += "?g2bcontractno=" + id;
	
	newWindow = window.open(newurl, 'contract_g2b', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	

}

function org_history_pop(form, func, id, name, path, year, month)
{ 
	var winw = 400;
	var winh = 600;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	var url = "/org/amumomv_org_history_pop_frame.do?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name + "&path=" + path + "&year=" + year + "&month=" + month;
	newWindow = window.open(url, 'org_history_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}

// ¼±ÅÃÈÄ ´ÝÈ÷´Â ÆË¾÷.condition
function org_pop(form, func, id, name, path, pro_name, rpt_yn)
{ 
	var winw = 400;
	var winh = 600;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
  var oURL = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		oURL = "";
	else
		prog_id = prog_id.substr(idx+3, 4);		 
  
	if(!pro_name)	
	{	  
  	if (prog_id == "marq")
			oURL = "/mtn/ammarqv_org_select_pop_frame.do";
		else if (prog_id == "marc")
			oURL = "/mtn/ammarcv_org_select_pop_frame.do";
		else if (prog_id == "marp")
			oURL = "/mtn/ammarpv_org_select_pop_frame.do";
		else if (prog_id == "mars")
			oURL = "/mtn/ammarsv_org_select_pop_frame.do";
		else if (prog_id == "marw")
			oURL = "/mtn/worker/ammarwv_org_select_pop_frame.do";
		else if (prog_id == "marc")
			oURL = "/mtn/ammarcv_org_select_pop_frame.do";
		else if (prog_id == "marp")
			oURL = "/mtn/ammarpv_org_select_pop_frame.do";
		else if (prog_id == "mars")
			oURL = "/mtn/ammarsv_org_select_pop_frame.do";
		else if (prog_id == "atat")
			oURL = "/asset/amatatv_org_select_pop_frame.do";
		else if (prog_id == "atda")
			oURL = "/asset/amatatv_org_select_pop_frame.do";			
		else if (prog_id == "atar")
			oURL = "/asset/amatarv_org_select_pop_frame.do";
		else if (prog_id == "ataq")
			oURL = "/asset/amataqv_org_select_pop_frame.do";
		else if (prog_id == "atas")
			oURL = "/asset/amataqv_org_select_pop_frame.do";		
		else if (prog_id == "atac")
			oURL = "/contract/amatacv_org_select_pop_frame.do";					
		else if (prog_id == "arps")
			oURL = "/report/amarpsv_org_select_pop_frame.do";
		else if (prog_id == "aryi")
			oURL = "/report/amaryiv_org_select_pop_frame.do";
		else if (prog_id == "bzbz")
			oURL = "/business/ambzbzv_org_select_pop_frame.do";
		else if (prog_id == "hrma")
			oURL = "/ituser/amhrmav_org_select_pop_frame.do";
		else if (prog_id == "isma")
			oURL = "/unionview/asset/amismav_org_select_pop_frame.do";
		else if (prog_id == "ista")
			oURL = "/unionview/trm/amistav_org_select_pop_frame.do";
		else if (prog_id == "mram")
			oURL = "/report/ammramv_org_select_pop_frame.do";
		else if (prog_id == "rrur")
			oURL = "/userrpt/amrrurv_org_select_pop_frame.do";
		else if (prog_id == "umum")
			oURL = "/user/amumumv_org_select_pop_frame.do";
		else if (prog_id == "ards")
			oURL = "/report/amardsv_org_select_pop_frame.do";
		else if (prog_id == "artt")
			oURL = "/report/amaratv_org_select_pop_frame.do";
		else if (prog_id == "rrur")
			oURL = "/userrpt/amrrurv_org_select_pop_frame.do";
		else if (prog_id == "arad")
			oURL = "/report/arad/amaradv_org_select_pop_frame.do";
		else if (prog_id == "acoc")
			oURL = "/acl/amacocv_org_select_pop_frame.do";		
		else if (prog_id == "pcmc")
			oURL = "/contract/ampcmcv_org_select_pop_frame.do";				
	}else{						   
		if (pro_name == "asset_inspection_print") 
			oURL = "/asset/inspection/amatpiv_inpr_org_select_pop_frame.do";
		else if (pro_name == "asset_inspection_regist") 
		   oURL = "/asset/inspection/amatpiv_inre_org_select_pop_frame.do";
 		else if (pro_name == "asset_inspection_action") 
		   oURL = "/asset/inspection/amatpiv_inac_org_select_pop_frame.do";
 		else if (pro_name == "hrma") 
		   oURL = "/ituser/amhrmav_list_org_select_pop_frame.do";
 	}
	if (oURL.length > 0)
	{
  		oURL += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
		if(rpt_yn == "Y")
			oURL += "&bRPT_YN=true"
			
		newWindow = window.open(oURL, 'org_common_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
		newWindow.focus();
	
	   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
  		setPop(newWindow);   
	}
}


// ¾È´ÝÈ÷´Â ÆË.
function org_pop_1(form, func, id, name, path, pro_name, rpt_yn)
{ 
	var winw = 400;
	var winh = 600;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 

	var oURL = "";

		// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
		var prog_id = document.location+"";
		var idx = prog_id.lastIndexOf("/");

		if (idx < 0)
			oURL = "";
		else
			prog_id = prog_id.substr(idx+3, 4);			
		
		// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
		if (prog_id == "arat")
			oURL = "/report/amaratv_org_select_pop_frame_1.do";
		else if (prog_id == "arwk")
			oURL = "/report/amarwkv_org_select_pop_frame_1.do";
		else if (prog_id == "ards")
			oURL = "/report/amardsv_org_select_pop_frame_1.do";
		else if (prog_id == "arpm")
			oURL = "/report/amarpmv_org_select_pop_frame_1.do";
		else if (prog_id == "marw")
			oURL = "/mtn/worker/ammarwv_org_select_pop_frame_1.do";

		if (oURL.length > 0)
		{
			oURL += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	  	if(rpt_yn == "Y")
	  		oURL += "&bRPT_YN=true"
			newWindow = window.open(oURL, 'org_common_pop_1', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
			newWindow.focus();
	
		   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   		setPop(newWindow);   
		}
}

//**************************
// À¯°ü¾÷Ã¼ ÆË¾÷
//***************************	
function company_pop(form, func, id, name)
{ 
	var winw = 710;
	var winh = 550;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2; 
	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "aiam") 
		newurl = "/abase/amaiamv_compnay_pop_frame.do"; 
	else if (prog_id == "atar")
		newurl = "/asset/register/amatarv_compnay_pop_frame.do"; 
	else if (prog_id == "atat") 
		newurl = "/asset/amatatv_compnay_pop_frame.do"; 
	else if (prog_id == "atac") 
		newurl = "/contract/amatacv_compnay_pop_frame.do"; 
	else if (prog_id == "pcmc") 
		newurl = "/contract/ampcmcv_compnay_pop_frame.do"; 
	else if (prog_id == "itmt") 
		newurl = "/plan/product/amitmtv_compnay_pop_frame.do"; 
	else if (prog_id == "hrct") 
		newurl = "/company/contract/amhrctv_compnay_pop_frame.do"; 
 	else if (prog_id == "ista") 
		newurl = "/unionview/trm/amistav_compnay_pop_frame.do"; 
 	else if (prog_id == "istm") 
		newurl = "/unionview/trm/amistmv_compnay_pop_frame.do"; 
 
 
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	newWindow = window.open(newurl, 'company_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}

function company_pop1(form, func, id, name, class_code)
{ 
	var winw = 700;
	var winh = 550;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "aiam") 
		newurl = "/abase/amaiamv_company_1_pop_frame.do";  
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name+ "&SearchClass_Name=" + class_code;
	newWindow = window.open(newurl, 'company_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);   
}

function view_compnay_popup(Company_ID)
{
	var winw = 700;
	var winh = 550; 
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;

	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "hrct")
		newurl = "/compnay/contact/amhrctv_company_view_frame.do";
	else if (prog_id == "aiam")
		newurl = "/abase/amaiamv_company_view_frame.do";  
	else if (prog_id == "atam")
		newurl = "/asset/amatatv_company_view_frame.do";  
	else if (prog_id == "atap")
		newurl = "/asset/amatatv_company_view_frame.do";   
	else if (prog_id == "atat")
		newurl = "/asset/amatatv_company_view_frame.do";  
	else if (prog_id == "atua")
		newurl = "/asset/amatatv_company_view_frame.do";  		
	else if (prog_id == "atar")
		newurl = "/asset/amatatv_company_view_frame.do";  		
	else if (prog_id == "atda")
		newurl = "/asset/amatatv_company_view_frame.do";  		
	else if (prog_id == "atac")
		newurl = "/contract/amatacv_company_view_frame.do";   
	else if (prog_id == "pcmc")
		newurl = "/contract/ampcmcv_company_view_frame.do";  
	else if (prog_id == "marc")
		newurl = "/mtn/ammarcv_company_view_frame.do";   
	else if (prog_id == "mars")
		newurl = "/mtn/ammarsv_company_view_frame.do"; 
	else if (prog_id == "istm")
		newurl = "/unionview/trm/amistmv_company_view_frame.do";
  else if(prog_id == "isma")
	newurl = "/uview/amismav_company_view_frame.do";  
	else if (prog_id == "ittm")
		newurl = "/unionview/trm/amistmv_company_view_frame.do";	
	else if (prog_id == "isia")
		newurl = "/uview/amisiav_company_view_frame.do";   
	else if (prog_id == "rrpd")
		newurl = "/itdoc/amrrpdv_company_view_frame.do";  
	else if (prog_id == "hrcc")
		newurl = "/company/amhrccv_company_view_frame.do";  				 		
	else if (prog_id == "bzbz")
		newurl = "/business/ambzbzv_company_view_frame.do";  	
	else if (prog_id == "marq")
		newurl = "/mtn/ammarqv_company_view_frame.do";  					 		
	else if (prog_id == "marp")
		newurl = "/mtn/ammarpv_company_view_frame.do";  		
	else if (prog_id == "umum")
		newurl = "/user/amumumv_company_view_frame.do"; 

	
	newurl += "?Company_ID=" + Company_ID+"&pop=1&viewtarget=compnay_popup"; 
   objWin = window.open(newurl, "company_pop", "width="+winw+",height="+winh+", top="+wint+", left="+winl+", scrollbars=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	
   
   return objWin;
} 
//**************************
// À¯°ü¾÷Ã¼ Âý¾÷ ³¡ 
//***************************	
 
//**************************
// ÀÚ¿øÀ¯Çü ÆË¾÷
//***************************	
function class_tree_pop(form, func, id, name, rpt_yn, pro_name)
{
	var winl = (screen.width - 350) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if(!pro_name)	
	{				

		if (prog_id == "aiat")
			newurl = "/abase/amaiatv_class_pop_tree_frame.do"; 
		else if (prog_id == "atar")
			newurl = "/asset/register/amatarv_class_pop_tree_frame.do"; 
		else if (prog_id == "atat")
			newurl = "/asset/amatatv_class_pop_tree_frame.do"; 
		else if (prog_id == "atda")
			newurl = "/asset/amatatv_class_pop_tree_frame.do"; 	
		else if (prog_id == "ataq")
			newurl = "/asset/amatatv_class_pop_tree_frame.do"; 					
		else if (prog_id == "mppc")
			newurl = "/report/ammppcv_class_pop_tree_frame.do";  
		else if (prog_id == "ittm")
			newurl = "/plan/trm/amittmv_class_pop_tree_frame.do"; 
		else if (prog_id == "marq")
			newurl = "/mtn/ammarqv_class_pop_tree_frame.do"; 
		else if (prog_id == "marc")
			newurl = "/mtn/ammarcv_class_pop_tree_frame.do"; 
		else if (prog_id == "marp")
			newurl = "/mtn/ammarpv_class_pop_tree_frame.do"; 
		else if (prog_id == "mars")
			newurl = "/mtn/ammarsv_class_pop_tree_frame.do"; 
	   else if (prog_id == "pcmc")
			newurl = "/contract/ampcmcv_class_pop_tree_frame.do"; 
	}else{						   
		if (pro_name == "asset_inspection_print") 
			newurl = "/asset/inspection/amatpiv_inpr_class_pop_tree_frame.do"; 
		else if (pro_name == "asset_inspection_regist") 
		   newurl = "/asset/inspection/amatpiv_inre_class_pop_tree_frame.do"; 
 		else if (pro_name == "asset_inspection_action") 
		   newurl = "/asset/inspection/amatpiv_inac_class_pop_tree_frame.do"; 
 	}				
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	
	if(rpt_yn == "Y")
		newurl += "&SelectedRpt_YN=Y"
		 
	newWindow = window.open(newurl, 'treeListForm', 'width=350,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus(); 
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
	
}
function class_tree_pop_1(form, func, id, name, rpt_yn)
{
	var winl = screen.width - 400;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "aiam")
		newurl = "/abase/amaiamv_class_pop_tree_frame_1.do"; 
	else if (prog_id == "hrcc")
		newurl = "/company/amhrccv_class_pop_tree_frame_1.do"; 
	else if (prog_id == "ittm")
		newurl = "/plan/trm/amittmv_class_pop_tree_frame_1.do"; 
	else if (prog_id == "ista")
		newurl = "/unionview/trm/amistav_class_pop_tree_frame_1.do"; 
	else if (prog_id == "istm")
		newurl = "/unionview/trm/amistmv_class_pop_tree_frame_1.do"; 
	 
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	
	if(rpt_yn == "Y")
		newurl += "&SelectedRpt_YN=Y"
		 
	newWindow = window.open(newurl, 'treeListForm_1', 'width=350,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus(); 
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}
 
function class_tree_pop_2(form, func, id, name, rpt_yn)
{
	var winl = (screen.width - 350) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "aiam")
		newurl = "/abase/amaiamv_class_pop_tree_2_frame.do"; 
	else if (prog_id == "arpm")
		newurl = "/report/amarpmv_class_pop_tree_2_frame.do"; 
	else if (prog_id == "arat")
		newurl = "/report/arat/amaratv_class_pop_tree_2_frame.do"; 
	else if (prog_id == "ards")
		newurl = "/report/ards/amardsv_class_pop_tree_2_frame.do"; 
	else if (prog_id == "arwk")
		newurl = "/report/arwk/amarwkv_class_pop_tree_2_frame.do"; 
	else if (prog_id == "ittm")
		newurl = "/plan/trm/amittmv_class_pop_tree_frame_2.do"; 
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	
	if(rpt_yn == "Y")
		newurl += "&SelectedRpt_YN=Y"
		 
	newWindow = window.open(newurl, 'treeListForm_2', 'width=350,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus(); 
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}
 
function class_old_tree_pop(form, func, id, name, year, month, rpt_yn)
{
	var winl = (screen.width - 350) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "arba")
		newurl = "/report/amarbav_class_old_pop_tree_frame.do";  
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name+ "&year=" + year+ "&month=" + month;
	
	if(rpt_yn == "Y")
		newurl += "&SelectedRpt_YN=Y"
		 
	newWindow = window.open(newurl, 'treeListForm_old', 'width=350,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus(); 
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}
 
function class_tree_pop_allselect(form, func, id, name, rpt_yn, pro_name)
{
	var winl = (screen.width - 350) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";  
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");
 
	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		 
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if(!pro_name)	
	{				
		if (prog_id == "arad")
			newurl = "/report/arad/amaradv_class_pop_tree_frame.do";  
		else if (prog_id == "arpm")
			newurl = "/report/arpm/amarpmv_class_pop_tree_2_frame.do";  
		else if (prog_id == "ards")
			newurl = "/report/ards/amardsv_class_pop_tree_frame.do";   
  	else if (prog_id == "arps")
  		newurl = "/report/amarpsv_class_pop_tree_folder_frame.do"; 
  	else if (prog_id == "aryi")
  		newurl = "/report/amaryiv_class_pop_tree_folder_frame.do"; 
  	else if (prog_id == "arat")
  		newurl = "/report/amaratv_class_pop_tree_folder_frame.do"; 
  	else if (prog_id == "arwk")
  		newurl = "/report/amarwkv_class_pop_tree_folder_frame.do"; 
		else if (prog_id == "mram")
			newurl = "/report/mram/ammramv_class_pop_tree_frame.do";   
  	else if (prog_id == "rrur")
  		newurl = "/report/amrrurv_class_pop_tree_folder_frame.do"; 
  	else if (prog_id == "rrur")
  		newurl = "/userrpt/amrrurv_class_pop_tree_folder_frame.do"; 
	}else{						   
		if (pro_name == "asset_inspection_print") 
			newurl = "/asset/inspection/amatpiv_inpr_class_pop_tree_allselect_frame.do";  
 	}				
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	
	if(rpt_yn == "Y")
		newurl += "&SelectedRpt_YN=Y"
		 
	newWindow = window.open(newurl, 'treeListForm', 'width=350,height=500,top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus(); 
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
	
}

//**************************
// ÀÚ¿øÀ¯Çü ÆË¾÷ ³¡ 
//***************************	

//**************************
// ÀÚ¿ø¸ðµ¨ ÆË¾÷
//***************************	
function model_pop(form, func, id, name)
{ 
	var winw = 700;
	var winh = 620; 
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "atar")
		newurl = "/asset/register/amatarv_model_pop_frame.do";  
	else if (prog_id == "atat") 
		newurl = "/asset/amatatv_model_pop_frame.do";  
	else if (prog_id == "atua") 
		newurl = "/asset/amatatv_model_pop_frame.do"; 
	else if (prog_id == "ataq") 
		newurl = "/asset/amatatv_model_pop_frame.do";		 		
	else if (prog_id == "rrpd") 
		newurl = "/itdoc/amrrpdv_model_pop_frame.do";  
	else if (prog_id == "marq")
		newurl = "/mtn/ammarqv_model_pop_frame.do";  
	else if (prog_id == "marc")
		newurl = "/mtn/ammarcv_model_pop_frame.do";  
	else if (prog_id == "marp")
		newurl = "/mtn/ammarpv_model_pop_frame.do";  
	else if (prog_id == "mars")
		newurl = "/mtn/ammarsv_model_pop_frame.do";  
	else if (prog_id == "aiam")
		newurl = "/abase/amaiamv_model_pop_frame.do";  
	else if (prog_id == "pcmc")
		newurl = "/contract/ampcmcv_model_pop_frame.do"; 		
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	newWindow = window.open(newurl, 'model_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

function model_pop_1(form, func, id, name)
{ 
	var winw = 700;
	var winh = 620; 
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "atat") 
		newurl = "/asset/amatatv_model_pop_frame_1.do"; 
	else if (prog_id == "atap") 
		newurl = "/asset/amatatv_model_pop_frame_1.do"; 
	else if (prog_id == "atac") 
		newurl = "/contract/amatacv_model_pop_frame_1.do"; 
	
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;
	newWindow = window.open(newurl, 'model_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	

}

 
function model_view_pop(id )
{ 
	var winw = 700;
	var winh = 450; 
	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 400) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if (prog_id == "atat") 
		newurl = "/asset/amatatv_model_view_pop_frame.do"; 
	if (prog_id == "atar") 
		newurl = "/asset/amatatv_model_view_pop_frame.do"; 		
	else if (prog_id == "atua") 
		newurl = "/asset/unassign/amatuav_model_view_pop_frame.do"; 
	else if (prog_id == "atap") 
		newurl = "/asset/amatatv_model_view_pop_frame.do"; 
	else if (prog_id == "atda") 
		newurl = "/asset/disuse/amatdav_model_view_pop_frame.do";  
	else if (prog_id == "isma") 
		newurl = "/uview/amismav_model_view_pop_frame.do";  
	else if (prog_id == "ista") 
		newurl = "/unionview/trm/amistav_model_view_pop_frame.do";  
	else if (prog_id == "istm") 
		newurl = "/unionview/trm/amistmv_trm_model_view_pop_frame.do";  
	else if (prog_id == "aiam")
		newurl = "/abase/amaiamv_model_view_pop_frame.do";  
	else if (prog_id == "ittm")
		newurl = "/trm/amittmv_model_view_pop_frame.do";  
	else if (prog_id == "isia")
		newurl = "/itdoc/amisiav_model_view_pop_frame.do";  
	else if (prog_id == "rrpd")
		newurl = "/itdoc/amrrpdv_model_view_pop_frame.do";  		
	else if (prog_id == "hrcc")
		newurl = "/company/amhrccv_model_view_pop_frame.do";  
	else if (prog_id == "hrct")
		newurl = "/company/amhrctv_model_view_pop_frame.do";  	
	else if (prog_id == "bzbz")
		newurl = "/business/ambzbzv_model_view_pop_frame.do";  					
	else if (prog_id == "marq")
		newurl = "/mtn/ammarqv_model_view_pop_frame.do";  
	else if (prog_id == "marc")
		newurl = "/mtn/ammarcv_model_view_pop_frame.do";  
	else if (prog_id == "marp")
		newurl = "/mtn/ammarpv_model_view_pop_frame.do";  		
	else if (prog_id == "mars")
		newurl = "/mtn/ammarsv_model_view_pop_frame.do";  
	else if (prog_id == "umum")
		newurl = "/user/amumumv_model_view_pop_frame.do"; 		
		

	newurl += "?Model_Code=" + id;
	newWindow = window.open(newurl, 'model_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}
//**************************
// ÀÚ¿ø¸ðµ¨ ÆË¾÷ ³¡
//***************************	

function asset_tree_select(assetid, partid, status, type)
{ 
	var winw = 800;
	var winh = 400; 
	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 400) / 2;
	
	var url = "/asset/amatatv_asset_tree_pop_asset.do?Class_Path=&Class_Code=&Asset_ID="+ assetid +"&Part_ID="+ partid +"&Asset_Status="+ status +"&RegType="+ type;
	newWindow = window.open(url, 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

function contract_select(form, func, id, name)
{ 
	var winw = 750;
	var winh = 550; 
	  var winl = (screen.width - 700) / 2;
	  var wint = (screen.height - 400) / 2;
	  var newurl = "";	
	  
  	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
  	var prog_id = document.location+"";
  	var idx = prog_id.lastIndexOf("/");
  
  	if (idx < 0)
  		newurl = "";
  	else
  		prog_id = prog_id.substr(idx+3, 4);		  
  		
	if (prog_id == "atat") 
	  newurl = "/asset/manage/amatatv_search_contract_list_popup_frame.do";
	if (prog_id == "ataq") 
	  newurl = "/asset/manage/amatatv_search_contract_list_popup_frame.do";	  
	else if(prog_id == "atar")
	  newurl = "/asset/register/amatarv_search_contract_list_popup_frame.do";
	else if(prog_id == "atac")
	  newurl = "/contract/amatacv_search_contract_list_popup_frame.do";
	else if(prog_id == "marq")
	  newurl = "/mtn/ammarqv_search_contract_list_popup_frame.do";
	else if(prog_id == "marc")
	  newurl = "/mtn/ammarcv_search_contract_list_popup_frame.do";
	else if(prog_id == "marp")
	  newurl = "/mtn/ammarpv_search_contract_list_popup_frame.do";
	else if(prog_id == "mars")
	  newurl = "/mtn/ammarsv_search_contract_list_popup_frame.do";
	else if(prog_id == "pcmc")
	  newurl = "/contract/ampcmcv_search_contract_list_popup_frame.do";	  
	  
	newurl += "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name;

	newWindow = window.open(newurl, 'contract_select', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

function contract_view(contractid, title)
{ 
	var winw = 750;
	var winh = 600; 
	  var winl = (screen.width - 700) / 2;
	  var wint = (screen.height - 400) / 2;

	  var newurl = "";	
	  
  	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
  	var prog_id = document.location+"";
  	var idx = prog_id.lastIndexOf("/");
  
  	if (idx < 0)
  		newurl = "";
  	else
  		prog_id = prog_id.substr(idx+3, 4);		  
  		
	if (prog_id == "atat") 
	  newurl = "/asset/manage/amatatv_get_contract_detail_view_pop_frame.do";
	else if(prog_id == "atac")
	  newurl = "/contract/amatacv_get_contract_detail_view_pop_frame.do";  	
	else if(prog_id == "atar")
	  newurl = "/asset/register/amatarv_get_contract_detail_view_pop_frame.do";  	
	else if(prog_id == "atda")
	  newurl = "/asset/disuse/amatdav_get_contract_detail_view_pop_frame.do";	  	
	else if(prog_id == "isma")
	  newurl = "/uview/amismav_get_contract_detail_view_pop_frame.do";		
	else if(prog_id == "ittm")
	  newurl = "/uview/amistav_get_contract_detail_view_pop_frame.do";	  
	else if(prog_id == "isia")
	  newurl = "/uview/amisiav_get_contract_detail_view_pop_frame.do";   
	else if(prog_id == "rrpd")
	  newurl = "/itdoc/amrrpdv_get_contract_detail_view_pop_frame.do";	   
	else if(prog_id == "bzbz")
	  newurl = "/business/ambzbzv_get_contract_detail_view_pop_frame.do";	   
	else if(prog_id == "hrcc")
	  newurl = "/company/amhrccv_get_contract_detail_view_pop_frame.do";	   
	else if(prog_id == "hrct")
	  newurl = "/company/amhrctv_get_contract_detail_view_pop_frame.do";	
	else if(prog_id == "marq")
	  newurl = "/mtn/ammarqv_get_contract_detail_view_pop_frame.do";	  
	else if(prog_id == "marc")
	  newurl = "/mtn/ammarcv_get_contract_detail_view_pop_frame.do";	   
	else if(prog_id == "marp")
	  newurl = "/mtn/ammarpv_get_contract_detail_view_pop_frame.do";						   
	else if(prog_id == "mars")
	  newurl = "/mtn/ammarsv_get_contract_detail_view_pop_frame.do";	
	else if(prog_id == "umum")
	  newurl = "/user/amumumv_get_contract_detail_view_pop_frame.do";	
	else if(prog_id == "atua")
	  newurl = "/unassign/amatuav_get_contract_detail_view_pop_frame.do";			   
	 
	  newurl += "?ContractID="+ contractid;

	newWindow = window.open(newurl, 'contract_view_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

function asset_tree_select_popup(form, func, id, name, classid, status)
{ 
	var winw = 900;
	var winh = 575; 
	  var winl = (screen.width - 800) / 2;
   	var wint = (screen.height - 500) / 2;
   	var newurl = "";  
	
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);		
	
  if(prog_id == "atat")
	newurl="/asset/manage/amatatv_asset_list_pop_frame.do";  
  else if (prog_id == "ataq")
	newurl="/asset/request/amataqv_asset_list_pop_frame.do";
	else if (prog_id == "marq") 
	  newurl= "/mtn/ammarqv_asset_list_pop_frame.do"; 
	else if (prog_id == "marc") 
	  newurl= "/mtn/ammarcv_asset_list_pop_frame.do"; 
	else if (prog_id == "marp") 
	  newurl= "/mtn/ammarpv_asset_list_pop_frame.do"; 
	else if (prog_id == "mars") 
	  newurl= "/mtn/ammarsv_asset_list_pop_frame.do"; 
	else if (prog_id == "rrpd") 
	  newurl= "/itdoc/amrrpdv_asset_list_pop_frame.do"; 
		
	newurl = newurl + "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name + "&classname="+ classid + "&status=" + status;

	newWindow = window.open(newurl, 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}


function asset_contract_select_popup(form, func, id, name, classid, status, contractno)
{ 
	var winw = 900;
	var winh = 700; 
	  var winl = (screen.width - 800) / 2;
   	var wint = (screen.height - 500) / 2;
   	var newurl = "";  
	
	
	newurl="/contract/ampcmcv_asset_list_pop_frame.do";  
	
   
	newurl = newurl + "?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name + "&classname="+ classid + "&status=" + status +"&Mnt_Contract_No=" + contractno;

	newWindow = window.open(newurl, 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}


function asset_owner_select_popup(form, func, id, name, classid, owner, ownername)
{ 
	var winw = 900;
	var winh = 575; 
	  var winl = (screen.width - 800) / 2;
   	var wint = (screen.height - 500) / 2;
   	var status = 2;
   	var dourl = "/asset/manage/amatatv_asset_mnt_list_pop.do";
		
		var url = "/asset/manage/amatatv_asset_list_pop_frame.do?form=" + form + "&func=" + func + "&id=" + id + "&name=" + name + "&classname="+ classid + "&status=" + status + "&Sch_Asset_Owner=" + owner +"&dourl="+ dourl;
	newWindow = window.open(url, 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}


function getAssetDetailViewPop(assetid, title, pro_name)
{
	var winw = 750;
	var winh = 600; 
	  var winl = (screen.width - 650) / 2;
   	var wint = (screen.height - 500) / 2;
   	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if(!pro_name)	
	{	 
		if (prog_id == "atpi") 
			newurl = "/asset/inspection/amatpiv_asset_view_pop_frame.do?Asset_ID="+ assetid; 
		else if (prog_id == "marq") 
			newurl = "/mtn/ammarqv_asset_view_pop_frame.do?Asset_ID="+ assetid; 
		else if (prog_id == "marc") 
			newurl = "/mtn/ammarcv_asset_view_pop_frame.do?Asset_ID="+ assetid; 
		else if (prog_id == "marp") 
			newurl = "/mtn/ammarpv_asset_view_pop_frame.do?Asset_ID="+ assetid; 
		else if (prog_id == "mars") 
			newurl = "/mtn/ammarsv_asset_view_pop_frame.do?Asset_ID="+ assetid; 
	  else if (prog_id == "isma")
		newurl = "/uview/asset/amismav_asset_view_pop_frame.do?Asset_ID="+ assetid; 
	  else if (prog_id == "ataq")
		newurl = "/asset/request/amataqv_asset_view_pop_frame.do?Asset_ID="+ assetid; 		
	else if (prog_id == "ista")
			newurl = "/unionview/trm/amistav_asset_view_pop_frame.do?Asset_ID="+ assetid;
		else if (prog_id == "isia")
			newurl = "/unionview/itdoc/amisiav_asset_view_pop_frame.do?Asset_ID="+ assetid;
		else if (prog_id == "rrpd")
			newurl = "/itdoc/amrrpdv_asset_view_pop_frame.do?Asset_ID="+ assetid;
		else if (prog_id == "bzbz")
			newurl = "/business/ambzbzv_asset_view_pop_frame.do?Asset_ID="+ assetid;
		else if (prog_id == "ittm")
			newurl = "/plan/trm/amittmv_asset_view_pop_frame.do?Asset_ID="+ assetid;		
		else
	   		newurl = "/asset/manage/amatatv_asset_view_pop_frame.do?Asset_ID="+ assetid;
	}else{						   
		if (pro_name == "asset_inspection_print") 
			newurl = "/asset/inspection/amatpiv_inpr_asset_view_pop_frame.do?Asset_ID="+ assetid+ "&title="+ title; 
		else if (pro_name == "asset_inspection_regist") 
		   newurl = "/asset/inspection/amatpiv_inre_asset_view_pop_frame.do?Asset_ID="+ assetid+ "&title="+ title; 
 		else if (pro_name == "asset_inspection_action") 
		   newurl = "/asset/inspection/amatpiv_inac_asset_view_pop_frame.do?Asset_ID="+ assetid+ "&title="+ title; 
 	}
	newWindow = window.open( newurl , 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

//ÀÚ¿øÀÇ ¼º´ÉÁ¤º¸ ÆË¾÷À» °¡Á®¿Â´Ù.
function asset_daily_perf_pop(id)
{ 
	var winw = 750;
	var winh = 500; 
	var winl = (screen.width - 750) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	

		newurl = "/asset/perf/amatateiv_asset_daily_perf_pop_frame.do"; 
	
	  newurl += "?Asset_ID=" + id;
	newWindow = window.open(newurl, 'asset_perf_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

//ÀÚ¿øÀÇ ±¸¼ºÁ¤º¸ ÆË¾÷À» °¡Á®¿Â´Ù.
function asset_linked_config_pop(id, classtoms)
{ 
	var winw = 750;
	var winh = 600; 
	var winl = (screen.width - 650) / 2;
	var wint = (screen.height - 500) / 2;
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	

  //if (prog_id == "atat") 
		newurl = "/asset/config/amatateiv_asset_linked_config_info_frame.do"; 
	//else if (prog_id == "atda") 
	//	newurl = "/asset/config/amatateiv_asset_linked_config_info_frame.do"; 
	
	  newurl += "?Asset_ID=" + id + "&Class_Toms=" + classtoms;

	newWindow = window.open( newurl  , 'asset_config_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
}

function unassignAssetDetailView(seq, assetid)
{
  var form = document.frm;
  var winw = 750;
  var winh = 600; 
  var winl = (screen.width - 650) / 2;
 	var wint = (screen.height - 500) / 2;
	 	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";  
	else
		prog_id = prog_id.substr(idx+3, 4);			  

	if (prog_id == "atua") 
	  newurl = "/asset/unassign/amatuav_asset_modify_view_pop_frame.do?Asset_Seq="+ seq +"&Asset_ID="+ assetid;

	newWindow = window.open(newurl , 'unassign_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);  		 	

}

function assetTomsRequestDetail(cm_id, centerid)
{
  var form = document.frm;
  var winw = 750;
  var winh = 600; 
  var winl = (screen.width - 650) / 2;
 	var wint = (screen.height - 500) / 2;
	 	
	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";  
	else
		prog_id = prog_id.substr(idx+3, 4);			  

	if (prog_id == "atat") 
	  newurl = "/asset/cmrequest/amatateiv_asset_toms_requst_view_pop_frame.do?Cm_ID="+ cm_id +"&Center_Id="+ centerid; 

	newWindow = window.open(newurl , 'cmrequest_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	//ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
	setPop(newWindow);  	   
}

function getAssetDetailModifyPop(assetid, title, pro_name)
{
	var winw = 750;
	var winh = 600; 
	  var winl = (screen.width - 650) / 2;
   	var wint = (screen.height - 500) / 2;
   	var newurl = "";

	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);	
		
	// ÇÁ·Î±×·¥ ÄÚµåº°·Î Á¢±ÙÁ¦ÇÑ do ÁÖ¼Ò¸¦ º¯°æÇÏ¿©ÁØ´Ù.
	if(!pro_name)	
	{	 
		if (prog_id == "ataq") 
			newurl = "/asset/request/amataqv_asset_modify_view_pop_frame.do?Asset_ID="+ assetid; 
	}
	newWindow = window.open( newurl , 'asset_modify_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=yes,resizable=no');
	newWindow.focus();
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);		
}

function unassign_asset_tree_select(assetseq, status, type)
{ 
	var winw = 800;
	var winh = 400; 
	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 400) / 2;
	
	var url = "/asset/amatatv_asset_tree_pop_asset.do?Class_Path=&Class_Code=&Asset_Seq=" + assetseq +"&Asset_Status="+ status + "&RegType="+ type;
	newWindow = window.open(url, 'asset_tree_pop', 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',scrollbars=auto,resizable=no');
	newWindow.focus();
	
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(newWindow);	 
}

function openProductSelect(formobj, product_id, product_name)
{
   var newurl = "/plan/trm/amittmv_trm_product_select_frame_popup.do?form=" + formobj;
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");
   
	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);
   
   if(product_id != null)
	  newurl += "&product_id=" + product_id;
   if(product_name != null)
	  newurl += "&product_name=" + product_name;
   
   objWin = window.open(newurl, "product_popup", "width=870,height=450, top=300, left=300, scrollbars=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	  
   
   return objWin;
}

function view_product_popup(product_id)
{
	var newurl = "";
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);
	if (prog_id == "itmt")
	   newurl = escape("/plan/product/amitmtv_product_view_popup.do?Product_ID=" + product_id);
	else if (prog_id = "ittm")
		newurl = escape("/plan/trm/amittmv_product_view_popup.do?Product_ID=" + product_id);
	else if (prog_id = "itcp")
		newurl = escape("/plan/component/amitcpv_product_view_popup.do?Product_ID=" + product_id);
	else if (prog_id = "itsm")
		newurl = escape("/plan/stratagem/amitsmv_product_view_popup.do?Product_ID=" + product_id);
	else
		newurl = escape("/plan/product/amitmtv_product_view_popup.do?Product_ID=" + product_id);

	

   objWin = window.open("/common/common_popup_frame.do?url=" + newurl + "&title=hnoh.web.product.navigation.view", "product_popup", "width=700,height=600, top=100, left=100, resizable=yes,scrollbars=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	 
   
   return objWin;
}

function view_profile_popup(profile_id)
{
   var newurl = "";
   	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);
	
	if (prog_id == "itsp")
	   newurl = escape("/plan/profile/amitspv_profile_view_popup.do?Standard_ID=" + profile_id);
	else if (prog_id = "ittm")
		newurl = escape("/plan/trm/amittmv_profile_view_popup.do?Standard_ID=" + profile_id);
	else
		newurl = escape("/plan/profile/amitspv_profile_view_popup.do?Standard_ID=" + profile_id);

   objWin = window.open("/common/common_popup_frame.do?url=" + newurl + "&title=hnoh.web.profile.navigation.view", "profile_popup", "width=700,height=600, top=100, left=100, resizable=yes,scrollbars=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	 
   
   return objWin;
}

function view_itdoc_popup(doc_id)
{
   var newurl = "";
   	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");

	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);

	if (prog_id == "atat") 
		newurl = "/asset/manage/amatatv_itdoc_view_popup.do?DocID=" + doc_id;
	else if (prog_id == "rrpd") 
		newurl = "/itdoc/amrrpdv_itdoc_view_popup.do?DocID=" + doc_id;

   newurl = escape(newurl);

   objWin = window.open("/common/common_popup_frame.do?url=" + newurl + "&title=hnoh.web.itdoc.info.lable.itview", "itdoc_popup", "width=700,height=600, top=100, left=100, resizable=yes,scrollbars=yes");
   objWin.focus(); 
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	 
   
   return objWin;
}

var base64list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function base64encode(s)
{
  var t = '', p = -6, a = 0, i = 0, v = 0, c;

  while ( (i < s.length) || (p > -6) ) {
	if ( p < 0 ) {
	  if ( i < s.length ) {
		c = s.charCodeAt(i++);
		v += 8;
	  } else {
		c = 0;
	  }
	  a = ((a&255)<<8)|(c&255);
	  p += 8;
	}
	if ( v > 0 )
	  t += base64list.charAt((a>>p)&63);
	else
	  t += base64list.charAt(64);
	p -= 6;
	v -= 6;
  }
  return t;
}


function base64decode(s)
{
  var t = '', p = -8, a = 0, q = 0, c, m, n;

  for( var i = 0; i < s.length; i++ ) {
	c = base64list.indexOf(s.charAt(i));
	if ( c < 0 )
	  continue;
	a = (a<<6)|(c&63);
	p += 6;
	if ( p >= 0 ) {
	  c = (a>>p)&255;
	  if ( c > 0 )
		t += String.fromCharCode(c);
	  a &= 63;
	  p -= 8;
	}
  }
  return t;
}


function SetCookie(cookieName, value) {
	
		var expireDate = new Date(2011,1,1);
		//tmp_val = base64encode(value);  
		tmp_val = value;  
		expireDate.setMonth(expireDate.getMonth()+6)	
		document.cookie = cookieName+"="+tmp_val+";expires=" + expireDate.toGMTString()
		
} 
		
		
function GetCookie(cookieName) {
	thisCookie = document.cookie.split("; ")
	for (i=0; i<thisCookie.length; i++){
		if (cookieName == thisCookie[i].split("=")[0]){
				return thisCookie[i].split("=")[1] ;
			   // return base64decode(thisCookie[i]).split("=")[1] ;
		}
	} 
	return "";
} 
	
function DelCookie(cookieName) {
		var expireDate = new Date(2011,1,1);
		expireDate.setMonth(expireDate.getMonth()+6)	
		document.cookie = cookieName+"=;expires=" + expireDate.toGMTString()
} 
	
	
	
var flag = 1;
function FrameResize(img) { 
	if(flag==1) { 
		parent.document.body.cols = "0,20,*"; 
		img.src = "/images/menu_plus2.gif"; 
		flag=0;
	}
	else {
		parent.document.body.cols= "174,20,*"; 
		img.src = "/images/menu_minus2.gif";
		flag=1;
	}
}


function help_pop(rootid, parentid, nodeid)
{   
	var winw = 900;
	var winh = 550; 
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	
   var newurl = "/help/ahshsv_frame.do?selected_no=" + nodeid;

   objWin = window.open(newurl, "help_pop", "width="+winw+",height="+winh+", top="+wint+", left="+winl+", scrollbars=yes,resizable=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	 
   
   return objWin;
}

function hnoh_page(url)
{ 
	if(url == "")
		url = "/blank.html";
		
	if(parent)
	{ 
		if(parent.name != "hnoh_top")
			parent.hnoh_page(url);
		else
			parent.document.location.href = url;
	}else
		document.location.href = url;
}
 


 //---------------------------------------------------------
// ÀÚµ¿ ¼ø¼­¼³Á¤ °ü·Ã ÇÔ¼ö
var prevValue = 0;
function setOrder(index, field)
{
	if (field == null)
		return;

	// ÇÏ³ªÀÇ °´Ã¼ÀÏ °æ¿ì
	var prevValue1 = parseInt(prevValue, 10);
	var currValue = parseInt(field[index].value, 10);
	if(field.length != null)
	{
		for (i = 0; i < field.length; i++) 
		{
			if (i != index) {
				if (prevValue1 > currValue) {
					if ( (parseInt(field[i].value, 10) >= currValue) && (parseInt(field[i].value, 10) < prevValue1) ) {
						field[i].value++;
					}
				}
				else if (prevValue1 < currValue) {
					if ( (parseInt(field[i].value, 10) > prevValue1) && (parseInt(field[i].value, 10) <= currValue) ) {
						field[i].value = field[i].value - 1;
					}
				}
			}
		}

		//alert(field.length);
	}
}

function setPrevOrder(prev)
{
	prevValue = prev;
}
//--------------------------------------------------------------


 //---------------------------------------------------------
// ÇØ´ç valueÀÇ byte¼ö ±¸ÇÏ¸ç Á¦ÇÑ°É±â
function cal_byte(value, limit_count) 
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;
	
	if (value == null)
	{
		return false;
	}
	
	tmpStr = new String(trim(value.value));
	temp = tmpStr.length;

	for (k=0;k<temp;k++)
	{
			onechar = tmpStr.charAt(k);
			if (escape(onechar).length > 4) { tcount += 2; } else { tcount++; }
	}

	//document.write.remLen.value = tcount;
	if(tcount > limit_count) {
		reserve = tcount - limit_count;
		alert(limit_count + "¹ÙÀÌÆ® ÀÌ»óÀº ÀÔ·Â ÇÏ½Ç¼ö ¾ø½À´Ï´Ù. \n¾²½Å ³»¿ëÀº "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\nÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù."); 
		nets_check(value, limit_count);
		return false;
	}
	return true;
}

function nets_check(aquery, limit_count)
{
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	tcount = 0;

	tmpStr = new String(trim(aquery.value));
	temp = tmpStr.length;

	for(k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);

		if(escape(onechar).length > 4) {
			tcount += 2;
		} else {
			tcount++;
		}

		if(tcount > limit_count) {
			tmpStr = tmpStr.substring(0,k);
			break;
		}
	}
	aquery.value = tmpStr;
	aquery.focus();
	//cal_byte(tmpStr);
}

function reverseAvoidTag(value)
{
	if (value != null)
	{
		value.value = value.value.replace(new RegExp("&#34;", "g"), "\"");
		value.value = value.value.replace(new RegExp("&#39;", "g"), "\'");
		value.value = value.value.replace(new RegExp("&lt;", "g"), "<");
		value.value = value.value.replace(new RegExp("&gt;", "g"), ">");
	}
}

function reverseAvoidTagByValue(value)
{
	if (value != null)
	{
		value = value.replace(new RegExp("&#34;", "g"), "\"");
		value = value.replace(new RegExp("&#39;", "g"), "\'");
		value = value.replace(new RegExp("&lt;", "g"), "<");
		value = value.replace(new RegExp("&gt;", "g"), ">");
	}
	return value;
}

// ÇàÁ¤Á¶Á÷¼±ÅÃ ÆË¾÷
function admin_org_sel_popup(formobj, func, org_code, org_name)
{
   var newurl = "";
	// ÁÖ¼Ò·ÎºÎÅÍ ÇÁ·Î±×·¥ ÄÚµå¸¦ ¾Ë¾Æ¿Â´Ù.
	var prog_id = document.location+"";
	var idx = prog_id.lastIndexOf("/");
   
	if (idx < 0)
		newurl = "";
	else
		prog_id = prog_id.substr(idx+3, 4);
   
	if (prog_id == "umom") {
		newurl = "/org/amumomv_admin_org_sel_form.do?form=" + formobj;
	}
	else if (prog_id == "bzbz") {
		newurl = "/business/ambzbzv_admin_org_sel_form.do?form=" + formobj;
	}

   if (func != null)
	  newurl += "&func=" + func;
   if(org_code != null)
	  newurl += "&org_code=" + org_code;
   if(org_name != null)
	  newurl += "&org_name=" + org_name;

   objWin = window.open("/common/common_popup_frame.do?url=" + escape(newurl) + "&title=hnoh.web.org.admin.root.label", "admin_org_popup", "width=600,height=700, top=100, left=100, resizable=yes,scrollbars=yes");
   objWin.focus();
	
   //ÆË¾÷À» ¹è¿­º¯¼ö¿¡ ÀúÀå
   setPop(objWin);	  
   
   return objWin;
}

// 2008.01.21 ¿ÀÇÏ³ª 
// ¼ýÀÚÀÔ·Â½Ã 1000ÀÚ¸®¸¶´Ù ÄÞ¸¶ Âï¾îÁÖ°í ¼Ò¼ýÁ¡ 2ÀÚ¸® ±îÁö ÀÔ·Â°¡´É
function checkconsumvol(obj, message, focusing , func)
{
	var x=obj.value;
  CheckKeys();
	if (!isNaN(x)) {
		comma(obj);
		return true; 
	} else {
		var current_val = obj.value.substring(obj.value.length-1, obj.value.length);

		if (current_val == ',') {
			comma(obj);
			return true; 
		
		}

		alert(message);

		obj.value = "";
		if (focusing)
			obj.focus();
		return false;
	}
	return true; 
}

function strip_comma(data)
{
	var flag = 1;
	var valid = "1234567890";
	var output = '';
	if (data.charAt(0) == '-')
	{
		flag = 0;
		data = data.substring(1);
	}
	
	for (var i=0; i<data.length; i++)
	{
		if (valid.indexOf(data.charAt(i)) != -1)
			output += data.charAt(i)
	}
	
	if (flag == 1)
		return output;
	else if (flag == 0)
		return ('-' + output);
}

function add_comma(what)
{
	var flag = 1;
	var data = what;
	var len = data.length;
	var split1;
	var split2;
	var split3;

	if (data.charAt(0) == '-')
	{
		flag = 0;
		data = data.substring(1);
	}
	if (data.charAt(0) == '0' && data.charAt(1) == '-')
	{
		flag = 0;
		data = data.substring(2);
	}
	if (data.indexOf('.') >= 0) {
		split2 = data.substring(0,data.indexOf('.'));
		split3 = data.substr(data.indexOf('.'));
	}
	else{
		split2 = data;
		split3 = '';	
	}
	var number = strip_comma(split2);
	number = '' + number;

	if (number.length > 3)
	{
		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
		for (i=0; i<Math.floor(number.length/3); i++)
		{
			if ((mod == 0) && (i == 0))
				output += number.substring(mod+3*i, mod+3*i+3);
			else
				output += ',' + number.substring(mod+3*i, mod+3*i+3);
		}
		if (flag == 0)
		{
			if(split3.substring(0,2) == ".." || split3.substring(0,3) == "..." )
			{
				split3_1 = split3.substring(0,1);
				return '-'+output+split3_1;
			}
			else if(!(split3.substring(1,2) >= '0' && split3.substring(1,2) <='9'))
			{
				split3_1 = split3.substring(0,1);
				return '-'+output+split3_1;
			}
			else if(!(split3.substring(2,3) >= '0' && split3.substring(2,3) <='9'))
			{
				split3_1 = split3.substring(0,2);
				return '-'+output+split3_1;
			}
			else
			{
				split3_1 = split3.substring(0,3);
				return '-'+output+split3_1;
			}
		}
		else
		{
			if(split3.substring(0,2) == ".." || split3.substring(0,3) == "..." )
			{
				split3_1 = split3.substring(0,1);
				return output+split3_1;
			}
			else if(!(split3.substring(1,2) >= '0' && split3.substring(1,2) <='9'))
			{
				split3_1 = split3.substring(0,1);
				return output+split3_1;
			}
			else if(!(split3.substring(2,3) >= '0' && split3.substring(2,3) <='9'))
			{
				split3_1 = split3.substring(0,2);
				return output+split3_1;
			}
			else
			{
				split3_1 = split3.substring(0,3);
				return output+split3_1;
			}
		}
	}
	else
	{
		if(flag == 0)
		{
			if(split3.substring(0,2) == ".." || split3.substring(0,3) == "..." )
			{
				split3_1 = split3.substring(0,1);
				return '-'+number+split3_1;
			}
			else if(!(split3.substring(1,2) >= '0' && split3.substring(1,2) <='9'))
			{
				split3_1 = split3.substring(0,1);
				return '-'+number+split3_1;
			}
			else if(!(split3.substring(2,3) >= '0' && split3.substring(2,3) <='9'))
			{
				split3_1 = split3.substring(0,2);
				return '-'+number+split3_1;
			}
			else
			{
				split3_1 = split3.substring(0,3);
				return '-'+number+split3_1;
			}
		}
		else
		{
			if(split3.substring(0,2) == ".." || split3.substring(0,3) == "..." )
			{
				split3_1 = split3.substring(0,1);
				return number+split3_1;
			}
			else if(!(split3.substring(1,2) >= '0' && split3.substring(1,2) <='9'))
			{
				split3_1 = split3.substring(0,1);
				return number+split3_1;
			}
			else if(!(split3.substring(2,3) >= '0' && split3.substring(2,3) <='9'))
			{
				split3_1 = split3.substring(0,2);
				return number+split3_1;
			}
			else
			{
				split3_1 = split3.substring(0,3);
				return number+split3_1;
			}
		}
	}
		
}

function replace(str, original, replacement) 
{ 
	var result; 
	result = ""; 
	while(str.indexOf(original) != -1) 
	{ 
		if (str.indexOf(original) > 0) 
			result = result + str.substring(0, str.indexOf(original)) + replacement; 
		else 
			result = result + replacement; 
			str = str.substring(str.indexOf(original) + original.length, str.length); 
	} 
	return result + str; 
} 

function comma(what)
{
	var data = what.value;

	
	if ((event.keyCode == 107) || (event.keyCode == 187))
	{
		if ((data == "+") || (data == "0+") || (Math.floor(replace((replace(data,"+","")),",","")) == 0))
		{
		   dataval = "";
		}
		else
		{
			var dataval = data + '000';
			dataval = replace(dataval,"+","");
		}
	}
	else
	{
		if (Math.floor(data) == 0)
		{
			dataval = "";
		}
		else
		{
			var dataval = data;
		}
	}
	
	what.value = add_comma(dataval);
}
function comma_zero(what)
{
	var data = what.value;

	if ((event.keyCode == 107) || (event.keyCode == 187))
	{
		if ((data == "+") || (data == "0+") || (Math.floor(replace((replace(data,"+","")),",","")) == 0))
		{
		   dataval = "";
		}
		else
		{
			var dataval = data + '000';
			dataval = replace(dataval,"+","");
		}
	}
	else
	{
		if (data == "0")
		{
			var dataval = "0.";
		}
		else if ((data.substring(0, 1) == "0") && ((data.substring(1, 2) != ".")))
		{
			var dataval = "0.";
		}
		else
		{
			var dataval = data;
		}
	}
	
	what.value = add_comma(dataval);
}
