	//¸ðµç ÆäÀÌÁö¿¡¼­ °øÅëÀûÀ¸·Î »ç¿ëµÇ´Â js ¸ðÀ½
	
 	var hasCookies = false;


	if(document.cookie == '') {
    document.cookie = 'hasCookies=yes';
    
    if (document.cookie.indexOf('hasCookies=yes') != -1) hasCookies = true;
  	}
  	else hasCookies = true;	
  	
	var w3c = (document.getElementById) ? 1:0
	
	function showHideModule(divID, visibl) {
		
		var state = toggleFoldyPersistState(divID);
		var ok=false;

		if(w3c) {
			var divIDobj = MM_findObj(divID);
			if(divIDobj != null) {
				//if(visibl == 'show') {
				ok = true;
				if(state=="c") {
					divIDobj.style.display = "";					
				}
				else {
					divIDobj.style.display = "none";
				}				
			}
			if(!ok){
				document.location = document.location;
			}		
		}		
	}
	
	function showHide(fieldName, selectNum, totRowCnt) {//(DIV ID¸í/¼±ÅÃÇÑ ±Û¹øÈ£/ÃÑ ROW¼ö) 
		for(var i=0; i<totRowCnt; i++) 
		{
			eval(document.getElementById(fieldName+i)).style.display='none'
		}
		eval(document.getElementById(fieldName+selectNum)).style.display=''
	}

	function showHide2(fieldName) {
		if ( eval(document.getElementById(fieldName)).style.display == 'none' )
			eval(document.getElementById(fieldName)).style.display=''
		else
			eval(document.getElementById(fieldName)).style.display='none'
	}
	
	function showAll(fieldName, totRowCnt) {
		for(var i=0; i<totRowCnt; i++) 
		{
			eval(document.getElementById(fieldName+i)).style.display=''
		}
	}
			
	function MM_findObj(n, d) { //v4.0
  	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 && document.getElementById) x=document.getElementById(n); return x;
	}	

  function setCookie (name, value, hours, path) {
    if (hasCookies) {
  	  if(hours) {
  	    if ( (typeof(hours) == 'string') && Date.parse(hours) ) var numHours = hours;
  	    else if (typeof(hours) == 'number') var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
  	  }
  	document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'');
    }
  }
  
  // reads a cookie from the browser
  function readCookie(name) {
    if (document.cookie == '') return '';
    else {
    	var firstChar, lastChar;
    	var theBigCookie = document.cookie;
    	firstChar = theBigCookie.indexOf(name);
    	if (firstChar != -1) {
    	    firstChar += name.length + 1;
    	    lastChar = theBigCookie.indexOf(';', firstChar);
    	    if (lastChar == -1) lastChar = theBigCookie.length;
    	    return unescape(theBigCookie.substring(firstChar, lastChar));
    	}
      else return '';
    }
  }
  
	function toggleFoldyPersistState(divID) {
		var theCookie = readCookie(divID);
		var state="e";
		if ((theCookie == "e") || (theCookie == "")) {
			state="c";
		}
		setCookie(divID,state,'','/');
		return state;
	}
	
	function roundTable(objID) {
	       var obj = document.getElementById(objID);
	       var Parent, objTmp, Table, TBody, TR, TD;
	       var bdcolor, bgcolor, Space;
	       var trIDX, tdIDX, MAX;
	       var styleWidth, styleHeight;
	
	       // get parent node
	       Parent = obj.parentNode;
	       objTmp = document.createElement('SPAN');
	       Parent.insertBefore(objTmp, obj);
	       Parent.removeChild(obj);
	
	       // get attribute
	       bdcolor = obj.getAttribute('rborder');
	       bgcolor = obj.getAttribute('rbgcolor');
	       radius = parseInt(obj.getAttribute('radius'));
	       if (radius == null || radius < 1) radius = 1;
	       else if (radius > 6) radius = 6;
	
	       MAX = radius * 2 + 1;
	       
	       /*
	              create table {{
	       */
	       Table = document.createElement('TABLE');
	       TBody = document.createElement('TBODY');
	
	       Table.cellSpacing = 0;
	       Table.cellPadding = 0;
	
	       for (trIDX=0; trIDX < MAX; trIDX++) {
	              TR = document.createElement('TR');
	              Space = Math.abs(trIDX - parseInt(radius));
	              for (tdIDX=0; tdIDX < MAX; tdIDX++) {
	                     TD = document.createElement('TD');
	                     
	                     styleWidth = '1px'; styleHeight = '1px';
	                     if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
	                     else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
	                     else if (radius > 2) {
	                            if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
	                            if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
	                     }
	
	                     if (styleWidth != null) TD.style.width = styleWidth;
	                     if (styleHeight != null) TD.style.height = styleHeight;
	
	                     if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
	                     else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;
	                     
	                     if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
	                     TR.appendChild(TD);
	              }
	              TBody.appendChild(TR);
	       }
	
	       /*
	              }}
	       */
	
	       Table.appendChild(TBody);
	
	       Parent.insertBefore(Table, objTmp);
	}
	
	//Æ®À§ÅÍ
function sendTwitter(sTitle,sUrl){
var shref ="http://twitter.com/home?status="+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
var sWindow=window.open(shref);
if (sWindow){
sWindow.focus();
}
} //¹ÌÅõµ¥ÀÌ
function sendM2Day(sTitle,sUrl){
var shref ="http://me2day.net/posts/new?new_post[body]"+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
//++"&new_post[tags]"+encodeURIComponent(sTag);
var sWindow=window.open(shref);
if (sWindow){
sWindow.focus();
}
}

//ÆäÀÌ½ººÏ
function sendFacebook(sUrl,sTitle){
var shref ="http://www.facebook.com/share.php?u="+encodeURIComponent(sUrl)+"&t="+encodeURIComponent(sTitle);
var sWindow=window.open(shref);
if (sWindow){
sWindow.focus();
}
}
