﻿<!-- Most frequently required validations-->

// Following methods are used for Trimming of a String


// This function checks for white space and is useful for checking whether a textbox has any value or not

function isWhitespace(s)
{
		 var whitespace = " \t\n\r";
	 for (var i=0; i<s.length; i++)
		 {
				// Check that current character isn't whitespace.
						 var c = s.charAt(i);
				if (whitespace.indexOf(c) == -1)
					{
				 return false;
			}
			}
			// All characters are whitespace.
				return true;
}

// This function is used for removing any leading white spaces in a string

function LTrim(s)
{
		 // trim lefthand spaces
			while(''+s.charAt(0)==' ')
			{
					 s = s.substring(1,s.length);
			}
			return s;
}

// This function is used for removing any trailing white spaces in a string


function RTrim(s)
{
	//trim righthand spaces

	if(s.length >1)
	{
		while(''+s.charAt(s.length-1)==' ')
		{
			s = s.substring(0,s.length-1);
		}

		return s;
	}

	return s;
}

/*
	This function will trim both leading and trailing spaces.
*/

function Trim(s)
{
		return LTrim(RTrim(s));
}


// This function checks whether a given string contains only numbers or not
// Returns true if the passed string numeric only and false otherwise

function isNumeric(string)
{
	if(!string) return false;

	var Chars = "0123456789";

	for(var i=0;i<string.length;i++)
	{
		if(Chars.indexOf(string.charAt(i))==-1)
		return false;
	}

	return true;
}

function isDouble(string)
{
	if(!string) return false;

	var Chars = ".0123456789";

	for(var i=0;i<string.length;i++)
	{
		if(Chars.indexOf(string.charAt(i))==-1)
		return false;
	}

	return true;
}

// for checking isEmpty
function isEmpty(value)
{
	var s = value;
	s = LTrim(s);
	s = RTrim(s);

	if( s.length == 0 )
	{
		return true;
	}
	return false;
}


// This function validates the e-mail id passed as a string.
function isSpecialChar(string)
{
	var Chars = "`~!@#$%^&*()|?><'\".,";
	for(var i=0;i<string.length;i++)
	{
			var c =  string.charAt(i) ;
		if(Chars.indexOf(c)!=-1)
				{
			 return true;
			 }
	 }
	 return false;
}

function isValidText(text)
{

	if(text == null  || text.length == 0  )
	 {
		return false;
	 }
	 else
	 {
				if(isWhitespace(text)==true || isSpecialChar(text)==true)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}

function isValidEmail(str)
{
	return (str.indexOf("@") > 0);
}

function isDirty(formname)
{
	var form = formname;
	for(var i=0; i<form.elements.length; i++)
	{
		var control = form.elements[i];

		if (control.type == 'submit' || control.type == 'hidden' ) { continue; }


		if (control.type == 'select-multiple') { continue; }

		if (getControlValue(control) != getControlDefaultValue(control))
		{
			return true;
		}
	}
	return false;
}

function getControlValue(control)
{
	if (control.type == 'checkbox')
	{
		return control.checked;

	}
	if(control.type == 'radio')
	{
			return control.checked;
		}
	else if (control.type == 'select-one')
	{
		var val;
		var def;
		for(var i=0; i<control.options.length; i++)
		{
			if (control.options[i].selected)
			{
				return control.options[i].value;
			}
		}
		return null;
	}
	else
	{
		return control.value;
	}
}


function getControlDefaultValue(control)
{
	if (control.type == 'checkbox')
	{
		return control.defaultChecked;
	}
	if(control.type =='radio')
	{
		 return control.defaultChecked;
	}

	else if (control.type == 'select-multiple')
	{
			return null;
	}
	else if (control.type == 'select-one')
	{
		var val;
		var def;
	for (var i=0; i<control.options.length; i++)
	{
		if (control.options[i].defaultSelected)
		{
			return control.options[i].value;
		}
	}
	return null;
	}
	else
	{
		return control.defaultValue;
	}
}



var dtCh= "/";

function isInteger(s)
{
	var i;
		for (i = 0; i < s.length; i++){
				// Check that current character is number.
				var c = s.charAt(i);
				if (((c < "0") || (c > "9"))) return false;
		}
		// All characters are numbers.
		return true;
}

function stripCharsInBag(s, bag)
{
	var i;
		var returnString = "";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < s.length; i++){
				var c = s.charAt(i);
				if (bag.indexOf(c) == -1) returnString += c;
		}
		return returnString;
}

function daysInFebruary (year)
{
	// February has 29 days in any year evenly divisible by four,
		// EXCEPT for centurial years which are not also divisible by 400.
		return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n)
{
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
	 }
	 return this
}

function isDate(dtStr)
{
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++)
	{
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1)
	{
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12)
	{
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month])
	{
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 )
	{
		alert("Please enter a valid 4 digit year")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
	{
		alert("Please enter a valid date")
		return false
	}
	var date = new Date();
	var now = new Date(dtStr);
	var diff = date.getTime() - now.getTime();
	if(diff > 0 )
	{
		 alert("Date is less than current Date");
		 return false;
		}
	return true
}

// Transfering selected items into two list boxes (This function move the one item or all the items

function setValues(){
	var fromObject=document.f1.existingUsers;
	var selectedValues=new Array();
	var selectedKeys=new Array();
	for (var i=0, l=fromObject.options.length;i<l;i++)
	{
		selectedKeys[i]=fromObject.options[i].value;
		selectedValues[i]=fromObject.options[i].text;
	}
	opener.setValues(selectedKeys,selectedValues);
	self.close();
}
function transferAllOption(fromObject,toObject) {

	var indexes = new Array();
	var ctr=0;
	for (var i=0, l=fromObject.options.length;i<l;i++)
	{
						var newoption = new Option(fromObject.options[i].text, fromObject.options[i].value, true, false);
					toObject.options[toObject.length] = newoption;
		}
	deleteAllOptions(fromObject);
}
function deleteAllOptions(fromObject){
	for (var i=0, l=fromObject.options.length;i<l;i++) {
		fromObject.options[i] = null;
		fromObject.selectedIndex = 0;
	}
	if(fromObject.options.length>0)
		deleteAllOptions(fromObject);
}
function transferOption(fromObject,toObject) {
	var indexes = new Array();
	var ctr=0;
	for (var i=0, l=fromObject.options.length;i<l;i++) {
				if (fromObject.options[i].selected){
						var newoption = new Option(fromObject.options[i].text, fromObject.options[i].value, true, false);
					toObject.options[toObject.length] = newoption;
					indexes[ctr]=fromObject.options[i].value;
			ctr++;
				}
		}
	for (var i=0,l=indexes.length;i<l;i++) {
		deleteOption(fromObject,indexes[i])
	}
	//Sorting the contents of the selection box

	sorter(toObject,genArray(toObject));
}
function deleteOption(fromObject,deleteOptionValue){
	for (var i=0, l=fromObject.options.length;i<l;i++) {
		if(fromObject.options[i].value ==deleteOptionValue){
				fromObject.options[i] = null;
				fromObject.selectedIndex = 0;
				break;
		}
	}
}
function noenter()
{
	return !(window.event && window.event.keyCode == 13);
}

// This function helps to sort the contents of a selection box
function sorter(listbox,ranarray) {
	var x, y, holder;
	// The Bubble Sort method.
	for(x = 0; x < ranarray.length; x++) {
		for(y = 0; y < (ranarray.length-1); y++) {
			if(ranarray[y].toUpperCase() > ranarray[y+1].toUpperCase()) {
				holder = ranarray[y+1];
				ranarray[y+1] = ranarray[y];
				ranarray[y] = holder;
			}
		}
	}

	// Update the select box list.
	updateList(listbox,ranarray);
}

// Assign values in array to values in the select box.
// This function is used by the sorter
function updateList(listbox,ranarray) {
	var i;
	for(i = 0; i < ranarray.length; i++) {
		if(listbox.options[i] == null) {
			listbox.options[i] = new Option(ranarray[i]);
		} else {
			listbox.options[i].text = ranarray[i];
		}
	}

}
// This function populates the array called ranarray with the text of
// the selection box . This function is used by the sorter function.
function genArray(listbox) {
	var i;
	var ranarray = new Array();
	for(i = 0; i < listbox.options.length; i++) {
		ranarray[i] = listbox.options[i].text;

	}

	// Update the select box list.
	updateList(listbox,ranarray);
	return ranarray;
}

// This function arrives at the timeZoneID using javascript from the client machine
function setTimeZoneID()
{
	var date = new Date();
	var id = "GMT";

	var dateString = new String(date);
	var index = dateString.indexOf("+");

	if(index != -1)
	{
		var plus = dateString.substring(index, (index + 1 ));

		index = index + 1;
		var first = dateString.substring(index, (index + 2 ));

		index = index + 2;
		var second = dateString.substring(index, (index + 2 ));
		id = id + plus + first + ":" + second;

	}

	document.forms[0].timeZoneID.value = id;
}



/************************************** ?쒓뎅 ?쒖옉******************************************/


/* div 蹂댁????덈낫???*/
function viewDiv(div_name){

	var div = eval("document.all."+div_name);

	if(div.style.display == 'none') div.style.display = "";
	else div.style.display = "none";
}//view_div


/* ?ъ썝 ?뺣낫 ?앹뾽 ?⑸룄 */
function viewEmployeeInfo(employeeNumber){
	window.open("/partner.user.retrieveUserInfoPopup.laf?value="+employeeNumber,"empPop","toolbar=no,menubar=no, width=450, height=400, scrollbars=no, resizable=no, locationbar=no, left=50, top=0");

}

/* ?ъ썝 ?뺣낫 ?앹뾽 ?⑸룄 */
function viewEmployeeInfoAll(){
	window.open("http://gw.lgericsson.com/enovator/common/memberinfo/address.aspx","empPop","toolbar=no,menubar=no, width=792, height=670, scrollbars=yes, resizable=yes, locationbar=no, left=0, top=0");

}


/*
 * iframe?덉そ??content height???곕씪??Iframe ??由ъ궗?댁쫰 ?댁빞 ??寃쎌슦 ?ъ슜?쒕떎.
 * ?꾨떖?섎뒗 ?몄옄??<IFrame name="XXX" ???곹엺 iframe 紐낆씠??
 */
function resizeIFrame(iframeName){

		var frame = eval(iframeName);
			var ParentFrame	    =	frame.document.body;
			var ContentFrame	=	document.all[iframeName];

			ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
}

// 而ㅻ??덊떚濡??대룞
function gotoCommunityMain(copId, menuId){

	var frm = document.leftGotoForm;
	frm.method = "post";
	frm.action = "/partner.cmn.com.initializeCommunity.laf";
	frm.copId.value = copId;
	frm.menuId.value = menuId;

	frm.submit();

	//this.location.href = "/partner.cmn.com.initializeCommunity.laf?cop_id="+copId+"&menuId="+menuId;
	//this.location.href = "/partner.cmn.com.initializeCommunity.laf";
}

// 而ㅻ??덊떚濡??대룞
function gotoCommunity(){
	top.main.location.href = "/partner.cmn.com.retrieveCommunityList.laf";
}

// Policy Main濡??대룞
function gotoPlicy(){
	top.main.location.href = "/partner.pol.com.retrieveMain.laf";
}

// Resource Main濡??대룞
function gotoResource(){
	top.main.location.href = "/partner.res.com.retrieveRequestList.laf";
}

// ContactUs 濡??대룞
function gotoContactUs(){
	window.open("/partner.com.contact.retrieveContactList.laf","contactus","toolbar=no,menubar=no, width=700, height=616, scrollbars=yes, resizable=no, locationbar=no, left=50, top=0");
}

// ?뺣룄寃쎌쁺 ?대룞
function gotoRightManage(){
	window.open("http://ethics.lg.co.kr/","hr","toolbar=no,menubar=no, width=960, height=616, scrollbars=yes, resizable=yes, locationbar=no, left=50, top=0");
}

// HR 臾몄쓽
function gotoHRQNA(){
	window.open("","hr","toolbar=no,menubar=no, width=700, height=616, scrollbars=yes, resizable=no, locationbar=no, left=50, top=0");

	var frm = document.hrGotoForm;
	frm.action = "http://itservice.lge.com:8080/itscsr/select_nt2.jsp";
	frm.target = "hr";
	frm.submit();

}

// ?쒖뒪??留곹겕 愿由?
function gotoMySystemLink(){
	window.open("/partner.com.system.retrieveMySystemList.laf","mySystemLink","toolbar=no,menubar=no, width=700, height=616, scrollbars=yes, resizable=no, locationbar=no, left=50, top=0");
}

// 怨듯넻 ?앹뾽
function popup(url, name, width, height, isScroll, isResize){
	window.open(url, name,"toolbar=no,menubar=no, width="+width+", height="+height+", scrollbars="+isScroll+", resizable="+isResize+", locationbar=no, left=0, top=0");
}

// Self Guide
function gotoSelfGuide(){
	window.open("/jsp/lgnortel/ep/self_guide/self_guide.html","self_guide","toolbar=no,menubar=no, width=900, height=666, scrollbars=no, resizable=no, locationbar=no, left=50, top=0");
}

// SSO 荑좏궎 ??젣 ??INDEX濡??대룞?섏뿬 SSO?щ줈洹몄씤 ?좊룄
	function logout()
	{
		///// ?낅Т ?쒖뒪??濡쒓렇?꾩썐?섏씠吏 ?몄텧 //////////////////////////////
		document.execCommand("ClearAuthenticationCache","false");
		top.document.location.href = "/index.jsp";
	}


// 寃뚯떆?먯쑝濡??대룞
function gotoBoard(boardId, menuId, copId, copMenuId, subMenuName){
	var frm = document.leftGotoForm;
	frm.action="/partner.com.Board.retrieveBoardList.laf";
	frm.method = "post";
	frm.boardId.value = boardId;
	frm.menuId.value = menuId;
	frm.copId.value = copId;				// copMenu ?뚯씠釉붿쓽 PK
	frm.copMenuId.value = copMenuId;		// "" pk
	frm.subMenuName.value = subMenuName;

	frm.submit();
}

//MemberInfo濡??대룞
function gotoMemberInfo(scope_policy, menuId,copId,copMenuId){

	var frm = document.leftGotoForm;

	frm.target = "main";
	frm.action="/partner.cmn.mem.retrieveMemberList.laf";
	frm.method = "post";
	frm.scope_policy.value = scope_policy;
	frm.menuId.value = menuId;
	frm.copId.value = copId;
	frm.copMenuId.value = copMenuId;		// "" pk
	frm.submit();
}
//Community Admin?쇰줈 ?대룞
function gotoCommunityAdmin(copId){

	var frm = document.leftGotoForm;
	frm.action="/partner.cmn.boardMenu.retrieveBoardMenuList.laf";
	frm.method = "post";
	frm.copId.value = copId;

	frm.submit();
}

//Community Administration?쇰줈 ?대룞
function gotoCopAdministration(copId,copMenuId){

	var frm = document.leftGotoForm;
	frm.action="/partner.cmn.com.retrieveCommunityListForAdmin.laf";
	frm.method = "post";
	//frm.boardId.value = boardId;
	//frm.menuId.value = menuId;
	frm.copId.value = copId;
	frm.copMenuId.value = copMenuId;
	//frm.subMenuName.value = subMenuName;

	frm.submit();

}

//Member Join?쇰줈 ?대룞
	 function addMembers(menuId,copid,copname) {

		var frm = document.leftGotoForm;
		frm.action="/partner.cmn.mem.initializeMember.laf";
	frm.method = "post";
	frm.menuId.value = menuId;
		frm.copId.value=copid;
		frm.copName.value=copname;

		frm.submit();
	}

// Emp 寃?됱쑝濡??대룞
function findEmployee(){
	var srchName;
	var condition;
	srchName = "";
	var condition = "?";
			condition +="srchName="+srchName;
			condition +="&s=1";
			condition +="&retrunOIndex=-1";
			condition = encodeURI(condition);

	window.open('/partner.res.com.retrieveAppUser.laf'+condition,'srchPop','width=322,height=300,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=no,left=0,top=0');
}
// 寃뚯떆?먯쑝濡??대룞
function gotoNewListBoard(scope_policy, menuId, copId, copMenuId, subMenuName, frmObj){

	var frm = document.leftGotoForm;
	if(frmObj != '') frm = frmObj;

	frm.target = "main";
	frm.action="/partner.com.Board.retrieveBoardNewList.laf";
	frm.method = "post";
		frm.scope_policy.value = scope_policy;
	frm.menuId.value = menuId;
	frm.copId.value = copId;				// copMenu ?뚯씠釉붿쓽 PK
	frm.copMenuId.value = copMenuId;		// "" pk
	frm.subMenuName.value = subMenuName;
	frm.tp.value = "02";
	frm.lvl.value = "1";

	frm.submit();
}

// 寃뚯떆??NEWLIST)?쇰줈 ?대룞
function gotoBoardNewList(boardId, menuId, copId, copMenuId, subMenuName){
alert("?곌껐以?. (?⑥??쒓컙 2400遺?)");
/*
	var frm = document.leftGotoForm;
	frm.action="/partner.com.Board.retrieveBoardList.laf";
	frm.method = "post";
	frm.boardId.value = boardId;
	frm.menuId.value = menuId;
	frm.copId.value = copId;				// copMenu ?뚯씠釉붿쓽 PK
	frm.copMenuId.value = copMenuId;		// "" pk
	frm.subMenuName.value = subMenuName;

	frm.submit();
	*/
}

// 寃뚯떆???곸꽭?붾㈃?쇰줈 ?대룞
function gotoDetail(boardId, menuId, articleNum, copMenuId, subMenuName){

	var frm = document.gotoForm;

	frm.action = "/partner.com.Board.retrieveBoard.laf";
	frm.articleId.value = articleNum;
	frm.boardId.value = boardId;
	frm.menuId.value = menuId;
	frm.copMenuId.value = copMenuId;		// COP 寃뚯떆?먯씪 寃쎌슦 ?좏슚 pk
	frm.subMenuName.value = subMenuName;
	//frm.targetRow.value = document.sform2.targetRow.value;
	//frm.targetRow.value = targetRow;
	if(frm.targetRow.value == "") frm.targetRow.value = "1";
	frm.submit();
}

// ?ㅼ슫濡쒕뱶
function download(fileName,fileAbsolutePath){

	var frm = document.downloadForm;
	frm.fileName.value = fileName;
	frm.fileAbsolutePath.value = fileAbsolutePath;
	frm.action = "/jsp/common/filecontrol/download.jsp";
	frm.submit();
}

// [Policy] UpdateList list
function gotoUpdateList(menuId){
	var frm = document.leftGotoLastForm;
	frm.menuId.value = menuId;
	frm.action = "/partner.pol.com.retrieveLatestList.laf";
	frm.submit();
}

// [Policy] UpdateList Detail
function gotoUpdateListDetail(articleNum,targetRow, menuId){
	var frm = document.gotoForm;

	//frm.currBoardId.value = currIndex;
	frm.artid.value = articleNum;
	frm.prevPage.value = '/partner.pol.com.retrieveLatestList.laf';
	frm.menuId.value = menuId;
	frm.targetRow.value = targetRow;
	frm.targetRowNum.value =  targetRow;
	frm.action = "/partner.pol.com.retrieveCommonView.laf";
	frm.submit();
}

// [Policy] CancelList list
function gotoCancelList(menuId){
	var frm = document.leftGotoLastForm;
	frm.menuId.value = menuId;
	frm.targetRow = "1";
	frm.action = "/partner.pol.com.retrieveCancelList.laf";
	frm.submit();
}
// [Policy] ContentsList list
function gotoContentsList(menuId,wf,type){
	var frm = document.leftContentsList;
	frm.menuId.value = menuId;
	frm.wf.value = wf;
	frm.type.value = type;
	frm.action = "/partner.pol.com.retrieveContentsList.laf";
	frm.submit();
}
/* EB Help 硫붿씪?쇱쑝濡??대룞 */
function gotoEBHelp(){

	window.open("","mailWin","toolbar=no,menubar=no, width=740, height=500, scrollbars=yes, resizable=no, locationbar=no, left=50, top=0");

	var frm = document.mailForm;
	frm.menuId.value = "25";
	frm.target = "mailWin";
	frm.action = "/jsp/lgnortel/ep/cmc/eb/helpEdit.jsp";
	frm.method = "post";
	frm.submit();

}

/* 硫붿씪?묒꽦?쇱쑝濡?蹂대궡湲곗쟾 臾몄옄??議곗옉 ?섏씠吏 */
function gotoMail(){

	window.open("","mailWin","toolbar=no,menubar=no, width=580, height=716, scrollbars=no, resizable=no, locationbar=no, left=50, top=0");

	var frm = document.mailForm;
	frm.target = "mailWin";
	frm.content.value = document.all.div_content.innerHTML;
	frm.action = "/jsp/lgnortel/partner/com/board/mail.jsp";
	frm.method = "post";
	frm.submit();

}

/* GW 硫붿씪 ?묒꽦?쇱쑝濡??대룞 */
function gotoGwMail(){
	var frm = document.mailForm;
	//frm.cmd.value = "board";
	frm.content.value = document.all.div_content.innerHTML;
	//frm.action = "http://150.150.143.123/eNovator/WM/Msg/WM_NewItem.aspx?cmd=Board";
	frm.action = "http://gw.lgericsson.com/eNovator/WM/Msg/WM_NewItem.aspx?cmd=Board";
	frm.method = "post";
	frm.submit();

}

// 洹몃９?⑥뼱 硫붿씤?쇰줈 ?대룞
function gotoGWSystem(systemId){
	var gw_domain = "http://gw.lgericsson.com";
	if(systemId == 'mail') top.main.location.href="/jsp/common/include/gwSystemFrame.jsp?gwSystemUrl="+gw_domain+"/eNovator/Portal/Today/Today_body_mail.aspx";
	if(systemId == 'schedule') top.main.location.href="/jsp/common/include/gwSystemFrame.jsp?gwSystemUrl="+gw_domain+"/eNovator/Portal/Today/Today_body_schedule.aspx";
	if(systemId == 'survey') top.main.location.href="/jsp/common/include/gwSystemFrame.jsp?gwSystemUrl="+gw_domain+"/eNovator/Portal/Today/Today_body_survey.aspx";
	if(systemId == 'namecard') top.main.location.href="/jsp/common/include/gwSystemFrame.jsp?gwSystemUrl="+gw_domain+"/eNovator/Portal/Today/Today_body_contacts.aspx";
}


// TOP 硫붾돱 ?대룞
function flashmenu(menuId,subMenuId,tmp){
	if(menuId == '1' && subMenuId == '') gotoGWSystem('mail');
	if(menuId == '1' && subMenuId == '1') gotoGWSystem('mail');
	if(menuId == '1' && subMenuId == '2') gotoGWSystem('schedule');

	if(menuId == '2' && subMenuId == '')  gotoNewListBoard('company','13','','','',topGotoForm);
	if(menuId == '2' && subMenuId == '1') gotoNewListBoard('company','13','','','',topGotoForm);
	if(menuId == '2' && subMenuId == '2') gotoNewListBoard('open','27','','','',topGotoForm);
	if(menuId == '2' && subMenuId == '3') gotoNewListBoard('eb','28','','','',topGotoForm);

	if(menuId == '3' && subMenuId == '') gotoCommunity();
	if(menuId == '4' && subMenuId == '') gotoPlicy();

	if(menuId == '5' && subMenuId == '')  gotoResource();
	if(menuId == '5' && subMenuId == '1') gotoResource();
	if(menuId == '5' && subMenuId == '2') gotoGWSystem('survey');
}

/*
*	이미지 실제 크기 가져오기
*	작성자 : 윤정부
*/
function get_image_size(id) {
	img = document.body.appendChild(document.createElement('img'))
	img.src = id.src;
	var w = img.offsetWidth;
	var h = img.offsetHeight;
	document.body.removeChild(img);
	return {width:w,height:h};
}

/*
*	input box 에 통화량 형식으로 표현하기
*	윤정부
*/
function setChar2Money(obj){
	//숫자인지 확인
	num = "";

	for( i=0; i< obj.value.length; i++){
		if (obj.value.charAt(i) < '0' || obj.value.charAt(i) > '9'){
			if(obj.value.charAt(i) != ',' && obj.value.charAt(i) != '.'){
				alert("숫자만 입력 가능합니다.");
				obj.focus();
				obj.select();
				return;
			}
		}else{
			num += obj.value.charAt(i);
			//alert(num);
		}
	}

	//num = obj.value;

	if (num < 0) { num *= -1; var minus = true;}
	else var minus = false;

	var dotPos = (num+"").split(".");
	var dotU = dotPos[0];
	var dotD = dotPos[1];
	var commaFlag = dotU.length%3;

	if(commaFlag) {
		var out = dotU.substring(0, commaFlag) ;
		if (dotU.length > 3) out += ",";
	}
	else var out = "";

	for (var i=commaFlag; i < dotU.length; i+=3) {
		out += dotU.substring(i, i+3) ;
		if( i < dotU.length-3) out += ",";
	}

	if(minus) out = "-" + out;
	if(dotD){
		obj.value = out + "." + dotD;
	}else{
		obj.value = out;
	}
	return false;
}
