//-----------------------------------------------------------------------------
// ºÒÆß¹æÁö
//-----------------------------------------------------------------------------

// Clipboard Copy Alert 
function contents_cp() 
{ 
    if (window.event) 
    { 
        window.event.returnValue = true; 
        window.setTimeout('attach_kinref()', 25); 
    } 
} 
function attach_kinref() 
{ 
    if (window.clipboardData) // IE 
    { 
        // get data from clipboard 
        var txt = window.clipboardData.getData('Text'); 

        // attach the source at the end of text 
        txt = txt + '\r\n\r\n¨Ï È¨¹Ú½º, ¹«´Ü ÀüÀç ¹× Àç¹èÆ÷ ±ÝÁö\r\n<´ëÇÑ¹Î±¹ ÀúÀÛ±Ç¹ý¿¡ µû¸¥ ÀúÀÛ±ÇÀ» Çà»çÇÕ´Ï´Ù>\r\n\r\n'; 

        // set data to clibboard 
        var result = window.clipboardData.setData('Text', txt); 
    } 
} 

 


//-----------------------------------------------------------------------------
// onfocus
//-----------------------------------------------------------------------------


function allblur() {
			for (i = 0; i < document.links.length; i++)
				  document.links[i].onfocus = document.links[i].blur;
	 }

function bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
} 
document.onfocusin=bluring;


//-----------------------------------------------------------------------------
// À©µµ¿ì È­¸é °¡¿îµ¥ Á¤·Ä
//-----------------------------------------------------------------------------

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


//-----------------------------------------------------------------------------
// ÀÌ¿ë¾à°ü
//-----------------------------------------------------------------------------

function memberCheck(str){
var form = document.agreeForm;
if(form.agreement.checked == false){
  alert("ÀÌ¿ë¾à°ü µ¿ÀÇ¿¡ Ã¼Å©ÇÏ¼¼¿ä");
}
else{
  form.memberType.value = str;
  form.submit();
}
}


//-----------------------------------------------------------------------------
// img_change
//-----------------------------------------------------------------------------

	function img_change(n){ // ¸Þ´º ÀÌ¹ÌÁö ¹Ù²Ù±â..      
	   for(var i = 1; i <= 2; i++) {         
		 img = document.getElementById('q'+i);
		 img.src = "images/tab_tit0"+i+"_off.gif";   
		 eval("document.all.qna"+i+".style.display = 'none'")

		 if ( n == i ) {
		  img.src = "images/tab_tit0"+i+"_on.gif";     
		 eval("document.all.qna"+i+".style.display = ''")
		 }         
	   }     
	}

	function js_dbRead(seq, url)
	{
		var frm = document.frmRun;
		frm.hidDocuID.value=seq;
		frm.action=url;
		frm.submit();
	}

//-----------------------------------------------------------------------------
// ¸ÞÀÎ¿¡ ÅÇ¸Þ´º(°øÁö»çÇ×, ´º½º&ÀÌº¥Æ®)
//-----------------------------------------------------------------------------

	function nimg_change(notice){ // ¸Þ´º ÀÌ¹ÌÁö ¹Ù²Ù±â..      
	   for(var i = 1; i <= 7; i++) {         
		 img = document.getElementById('notice'+i);
		 img.src = "images/showlist/notice_tit0"+i+"_off.gif";   
		 eval("document.all.noticediv"+i+".style.display = 'none'")

		 if ( notice == i ) {
		  img.src = "images/showlist/notice_tit0"+i+"_on.gif";
		 eval("document.all.noticediv"+i+".style.display = ''")
		 }         
	   }     
	}


//-----------------------------------------------------------------------------
// ¸ÞÀÎ¿¡ ÅÇ¸Þ´º(Å×¸¶¼¥)
//-----------------------------------------------------------------------------

	function themeimg_change(theme){ // ¸Þ´º ÀÌ¹ÌÁö ¹Ù²Ù±â..      
	   for(var i = 1; i <= 10; i++) {         
		 img = document.getElementById('theme'+i);
		 img.src = "images/showlist/theme_tit0"+i+"_off.gif";   
		 eval("document.all.themediv"+i+".style.display = 'none'")
		 eval("document.all.more"+i+".style.display = 'none'")

		 if ( theme == i ) {
		  img.src = "images/showlist/theme_tit0"+i+"_on.gif";
		 eval("document.all.themediv"+i+".style.display = ''")
		 eval("document.all.more"+i+".style.display = ''")
		 }         
	   }     
	}


//-----------------------------------------------------------------------------
// MM_findObj
//-----------------------------------------------------------------------------

	function MM_findObj(n, d) { //v4.01
		var p,i,x;	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_showHideLayers() { //v3.0
		var i,p,v,obj,args=MM_showHideLayers.arguments;
		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
			obj.visibility=v; }
	}


//-----------------------------------------------------------------------------
// after
//-----------------------------------------------------------------------------

	function bt(id,after){
		eval(id+'.filters.blendTrans.stop();'); 
		eval(id+'.filters.blendTrans.Apply();'); 
		eval(id+'.src="'+after+'";'); 
		eval(id+'.filters.blendTrans.Play();'); 
	}


//-----------------------------------------------------------------------------
// scroll
//-----------------------------------------------------------------------------

	function scroll(){
		var a=document.body.scrollTop+91;
		right_menu.style.top=a;
	}


//-----------------------------------------------------------------------------
// open site link
//-----------------------------------------------------------------------------

	function selectMover(sel, moveTarget){
		var index = sel.selectedIndex;
		if(sel.options[index].value != ''){
			if(moveTarget == 'blank'){
				window.open(sel.options[index].value, 'win1');
			}
			else{
				var frameobj;
				if(moveTarget == '') moveTarget = 'self';
				if((frameobj = eval(moveTarget)) != null)
					frameobj.location = sel.options[index].value;
			}
		}
	}


//-----------------------------------------------------------------------------
// »ó´Ü select item ¸Þ´º Ãâ·Â ¿©ºÎ
//-----------------------------------------------------------------------------

	function select_item(){
		if ( selectitem.style.visibility == "hidden") {
			 selectitem.style.visibility = "visible"

		}
		else {
			selectitem.style.visibility = "hidden"
		}
	}


//-----------------------------------------------------------------------------
// gotop
//-----------------------------------------------------------------------------

function gotop() {
	window.scrollTo(0,0);
}

function gotop_Call() {
	document.body.ondblclick = Top;
}


var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.85;
var scrollPos = 0;
var oldScrollPos = 0;


function FloatMenu(){
	docWidth = document.body.clientWidth; // Update document width
	docHeight = document.body.clientHeight; // Update document height
	oldScrollPos = scrollPos;
	scrollPos = document.body.scrollTop; // Update scrollbar position

	Xpos = 962;
	//Xpos = (docWidth - floater.offsetWidth) - 10; //¿À¸¥ÂÊ ¿©¹é ¹è³Ê°¡ ¿À¸¥ÂÊ¿¡ ºÙÀ»°æ¿ì
	//Xpos = (docWidth / 2) + 410; // Áß¾ÓÁ¤·ÄÀÏ°æ¿ì. " + 410 Àº Å×ÀÌºí Å©±â / 2 "
	Yboundary = ((scrollPos + docHeight) - floater.offsetHeight) - 10; //ÇÏ´Ü¿©¹é

	if(floater.offsetTop < Yboundary - 1){ // Object is behind boundary
		Ypos += 2;
	}

	if(floater.offsetTop > Yboundary + 1){ // Object is past boundary
		Ypos -= 1;
	}

	Ypos *= Ygravity; // Slow object down

	floater.style.pixelLeft = Xpos;
	floater.style.pixelTop += Ypos; // Make object bounce
}

 //¸Å°³º¯¼öÁß µÞÂÊ ¼ýÀÚ´Â ³»·Á¿À´Â ¼Óµµ


//-----------------------------------------------------------------------------
// ¼¿·ºÆ® ÆË¾÷
//-----------------------------------------------------------------------------

function sw_goto_byselect(sel, targetstr)
{
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
	 if (targetstr == 'blank') {
	   window.open(sel.options[index].value, 'win1');
	 } else {
	   var frameobj;
	   if (targetstr == '') targetstr = 'self';
	   if ((frameobj = eval(targetstr)) != null)
		 frameobj.location = sel.options[index].value;
	 }
  }
}

//-----------------------------------------------------------------------------
// open_window
//-----------------------------------------------------------------------------

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';

  menubar_str = menubar ? 'yes' : 'no';

  statusbar_str = statusbar ? 'yes' : 'no';

  scrollbar_str = scrollbar ? 'yes' : 'no';

  resizable_str = resizable ? 'yes' : 'no';



  cookie_str = document.cookie;
  cookie_str.toString();


  pos_start  = cookie_str.indexOf(name);

  pos_start  = cookie_str.indexOf('=', pos_start);

  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;

  cookie_val = cookie_str.substring(pos_start + 1, pos_end);



  if (cookie_val  == "done")

	return;



  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);

}


	function moveInfo(){
		var df = document.selectForm;
		var nameF = df.groupName[df.groupName.selectedIndex].value;
		window.open('/information/'+nameF+'.php', '_self');
	}


	function scrap(popup){
		var df    = document.all;
		var title = df.titleName.value;
		var URL   = df.URL.value;
		window.open("/scrap.php?&title=" + title + "&popup=" + popup + "&thisUrl=" + URL,"_self");
	}


//-----------------------------------------------------------------------------
// °Ô½ÃÆÇ ¼¿·ºÆ® ¹Ú½º
//-----------------------------------------------------------------------------

function homebox(){
				if (document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value != "none")
								{ 
				location = document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value
								}           
}


//-----------------------------------------------------------------------------
// gotop
//-----------------------------------------------------------------------------

var stmnLEFT = 8; // ¿ÞÂÊ ¿©¹é (¸Þ´º°¡ ¿ÞÂÊ¿¡¼­ 10ÇÈ¼¿ ¶³¾îÁø °÷¿¡ º¸¿©Áý´Ï´Ù)
var stmnGAP1 = 570; // À§ÂÊ ¿©¹é (¸Þ´º°¡ À§¿¡¼­ 10ÇÈ¼¿ ¶³¾îÁø °÷¿¡ º¸¿©Áý´Ï´Ù)
var stmnGAP2 = 10; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú À§ÂÊ°ú ¶³¾îÁö´Â °Å¸®
var stmnBASE = 450; // ½ºÅ©·Ñ ½ÃÀÛÀ§Ä¡ 
var stmnActivateSpeed = 140;
var stmnScrollSpeed = 1;

var stmnTimer;

function ReadCookie(name)
{
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
	var j = i + labelLen;

	if (document.cookie.substring(i, j) == label) {
	var cEnd = document.cookie.indexOf(";", j);
	if (cEnd == -1) cEnd = document.cookie.length;

	return unescape(document.cookie.substring(j, cEnd));
	}

	i++;
}

return "";
}

function SaveCookie(name, value, expire)
{
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function Refreshhomebox()
{
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(HOMEBOX.style.top, 10);
stmnEndPoint = document.body.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
	stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
	HOMEBOX.style.top = parseInt(HOMEBOX.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
	stmnRefreshTimer = stmnScrollSpeed;
}

stmnTimer = setTimeout ("Refreshhomebox();", stmnRefreshTimer);
}

function ToggleAnimate()
{
if (ANIMATE.checked) {
	Refreshhomebox();
	SaveCookie("ANIMATE", "true", 300);
}
else {
	clearTimeout(stmnTimer);
	HOMEBOX.style.top = stmnGAP1;
	SaveCookie("ANIMATE", "false", 300);
}
}

function Initializehomebox()
{
HOMEBOX.style.left = stmnLEFT;

	if (ReadCookie("ANIMATE") == "false") {
	ANIMATE.checked = false;
	HOMEBOX.style.top = document.body.scrollTop + stmnGAP1;
}
else {
	ANIMATE.checked = true;
	HOMEBOX.style.top = document.body.scrollTop + stmnBASE;
	Refreshhomebox();
}
}




function GetCookie (name) {  
		var arg = name + "=";  
		var alen = arg.length;  
		var clen = document.cookie.length;  
		var i = 0;  
		while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
				return getCookieVal (j);    
				i = document.cookie.indexOf(" ", i) + 1;    
				if (i == 0) break;   
		}  
		return null;
}

// ÄíÅ°¸¦ ±Á´Â ÇÔ¼öÀÔ´Ï´Ù.
// php ÀÇ setcookie() ÇÔ¼ö¿Í µ¿ÀÏÇÏ°Ô »ç¿ëÇÏ¸é µË´Ï´Ù.
// SetCookie (ÄíÅ°ÀÌ¸§,°ª,º¸°ü½Ã°£,µð·ºÅä¸®,µµ¸ÞÀÎ,....);
function SetCookie (name, value) {  
		var argv = SetCookie.arguments;  
		var argc = SetCookie.arguments.length;  
		var expires = (argc > 2) ? argv[2] : null;  
		var path = (argc > 3) ? argv[3] : null;  
		var domain = (argc > 4) ? argv[4] : null;  
		var secure = (argc > 5) ? argv[5] : false;  
		document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) +  
		((domain == null) ? "" : ("; domain=" + domain)) +    
		((secure == true) ? "; secure" : "");
}


// ÄíÅ°¸¦ Áö¿ì´Â ÇÔ¼ö ÀÔ´Ï´Ù.
// DeleteCookie (ÄíÅ°ÀÌ¸§);
function DeleteCookie (name) {  
		var exp = new Date();  
		exp.setTime (exp.getTime() - 1);  
		// This cookie is history  
		var cval = GetCookie (name);  
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

//GetCookie() ¿¡¼­ »ç¿ëÇÏ´Â ÇÔ¼ö µû·Î ¾µÀÏÀº ¾ø½À´Ï´Ù.:)
function getCookieVal (offset) {  
		var endstr = document.cookie.indexOf (";", offset);  
		if (endstr == -1)    
				endstr = document.cookie.length;  
				return unescape(document.cookie.substring(offset, endstr));
}

function open_minihome(){
	userID = GetCookie("_memberCID");
	if(userID){
		window.open('/minihome/index2.php?minihomeID='+userID,'minihomeWindow','menubars=0,width=932,height=538,left=10,top=10');
	}
	else{
		alert("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØ ÁÖ½Ê½Ã¿À.");
	}
}


//-----------------------------------------------------------------------------
// ÇÏ´Ü ¼¿·ºÆ® ¸Þ´º ¹× ¸¶¿ì½º ¿À¸¥ÂÊ Å¬¸¯ Á¦¾î
//-----------------------------------------------------------------------------

var workWin;
var TempTranCode = '';
var secuCtlCheck = true;

function nomenu(){
	return false;
}
function hidestatus()
{
	window.status='';
	return true;
}
//document.oncontextmenu = nomenu;  //¿À¸¥ÂÊ¸¶¿ì½ºÅ¬¸¯
document.onmouseover=hidestatus;  //»óÅÂ¹ÙÁ¦¾î
document.onmouseout=hidestatus;   //»óÅÂ¹ÙÁ¦¾î

if(top.cibtop){
	if(top.cibtop.loginfo){
		if(top.cibtop.loginfo.length > 0){
			alert(top.cibtop.loginfo);
			top.cibtop.loginfo = "";
		}
	}
}

//ÀüÃ¼ÆäÀÌÁö Å¾ÀÇ select(combo)
function showcombo(what){
	if (what.style.display=='')
		what.style.display='none';
		   
	else if (what.style.display=='none')
		what.style.display='';
}


var msg = '';
function hideURL() {
window.status = msg;
timerID= setTimeout("hideURL()", 100);
}
hideURL();






function toggle(iObject)
{
	if (iObject.style.display != "none") {
		iObject.style.display = "none"
		}
	else {
		iObject.style.display = ""
	}
}