

function goUrl(maingrp,group,sub)
{
	with(document.leftform)
	{
		maingroup.value = maingrp;
		group_id.value = group;	
		sub_id.value = sub;	
		action = "/attbox/step2.asp";
		submit();
	}
}

function goRecyclePage(maingroup,gubun)
{
	document.leftform.action = "/attbox/Recycle.asp?maingroup="+maingroup+"&gubun="+gubun;
	document.leftform.submit();
}


function goAdmin(URL)
{	
	with(document.leftform)
	{
		if (URL == "auth"){	
				action ="/community/admin/GN_Manage/mgt_admin.asp";
		}
		else if (URL == "skill"){
				action ="/community/admin/GN_Manage/mgt_authority.asp";
		}
		else if(URL == "gallery"){
				action ="/community/admin/gallery/art.asp";
		}
		else{
				return;
		}
		submit();
	}
}
function goSubClick(maingrp,groupid,subid,fcode,seq)
{	
	strFcode = fcode;	
	strGroupid = groupid;
	strSubid = subid;
	strSeq	 = seq;
	with(document.submenu)
	{
		fcode.value = strFcode;
		seq.value = strSeq;
		maingroup.value = maingrp;
		group_id.value = strGroupid;
		sub_id.value = strSubid;
		if(strFcode == "gnanonymous")	
			action = "/attbox/bbs/anonymous/anonymous.asp";
		else if(strFcode == "gnvisitor")	
			action = "/attbox/bbs/visitor/visitor.asp";
		else if(strFcode == "gnnotice")	
			action = "/attbox/bbs/notice/notice.asp";
		else if(strFcode == "gnboard")	
			action = "/attbox/bbs/board/board.asp";
		else if(strFcode == "gnattboard")	
			action = "/attbox/bbs/attboard/default.asp";
		else if(strFcode == "gnalbum")	
			action = "/attbox/bbs/album/album.asp";
		else if(strFcode == "gnmemoboard")	
			action ="/attbox/bbs/memo/memo.asp";
		else if(strFcode == "gnpoll")				
			action =  "/attbox/bbs/poll/default.asp";
		else
			return;
		submit();
	}
}




function goSub1Click(maingrp,groupid,subid,fcode,seq)
{	
	strFcode = fcode;	
	strGroupid = groupid;
	strSubid = subid;
	strSeq	 = seq;
	with(document.leftform)
	{
		fcode.value = strFcode;
		seq.value = strSeq;
		maingroup.value = maingrp;
		group_id.value = strGroupid;
		sub_id.value = strSubid;
		if(strFcode == "gnanonymous")	
			action = "/attbox/bbs/anonymous/anonymous.asp";
		else if(strFcode == "gnvisitor")	
			action = "/attbox/bbs/visitor/visitor.asp";
		else if(strFcode == "gnnotice")	
			action = "/attbox/bbs/notice/notice.asp";
		else if(strFcode == "gnboard")	
			action = "/attbox/bbs/board/board.asp";
		else if(strFcode == "gnattboard")	
			action = "/attbox/bbs/attboard/default.asp";
		else if(strFcode == "gnalbum")	
			action = "/attbox/bbs/album/album.asp";
		else if(strFcode == "gnmemoboard")	
			action ="/attbox/bbs/memo/memo.asp";
		else if(strFcode == "gnpoll")				
			action =  "/attbox/bbs/poll/default.asp";
		else
			return;
		submit();
	}
}
		
function getCookie(name)
{
   var cname = name+"=";
   var dc = document.cookie;

   if(dc.length>0)
   {
      begin = dc.indexOf(cname);
      if(begin != -1)
      {
         begin += cname.length;
         end = dc.indexOf(";",begin);
         if(end == -1) end =dc.length;
         return unescape(dc.substring(begin, end));
      }
   }
}

function set_groupcookie(name, value, expiredays)
{
 	todayDate = new Date();
 	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";";
}

function setMenu(submenu,cellbar,groupopen)
{	
	if(submenu.style.display=="")
	{ 	
   		submenu.style.display="none";   
   		if(document.all[groupopen])
   		{
   			if(document.all[groupopen].totnew == '1')
   				document.all[groupopen].style.display = "";		
   		}		
   		//document.all[cellbar].src= "/community/images/club/icnFolderPlus.gif";
		groupcookieval = "0"; 			
   	}
   	else
   	{
   		submenu.style.display="";
   		if(document.all[groupopen])
   		{
	   		document.all[groupopen].style.display = "none";	
	   	}	
   		//document.all[cellbar].src="/community/images/club/icnFolderMinus.gif";
		groupcookieval = "1"; 
   	}
	cookieval = getCookie(strGNID + "?:groupid");
	
	if(cookieval == null) cookieval = "";		
   	group_id = parseInt(cellbar.substring(3,cellbar.length),10);
   	if(cookieval.length < group_id)
   	{
   		for(var i=cookieval.length;i<group_id;i++)
   		{
   			cookieval = cookieval + "1";
   		}
   	}
   	var newcookieval = "";
	for(var i=0;i<cookieval.length;i++)
	{
		if(i == group_id - 1)
			newcookieval = newcookieval + groupcookieval;
		else
   			newcookieval = newcookieval + cookieval.charAt(i);
   	}   	   	
   	set_groupcookie(strGNID + "?:groupid",newcookieval,30);
}

function goTopSearch()
{
	if(Search_form.topkey.value.split(" ").join("") == "")
	//if(Search_form.topkey.value == "")
		{
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À");
			Search_form.topkey.focus();
			return;
		}
	Search_form.action = "/attbox/bbs/search/search.asp";
	Search_form.submit();
}

function TopSearchCheck() 
{
	if(event.keyCode ==13)
	{	
		goTopSearch();
	}
}