// ÀÏ¹Ý ¾ÞÄ¿Á¡À¸·ÎÀÇ ÀÌµ¿ÀÇ °æ¿ì ÀÔ´Ï´Ù.
function scrollToAnchor(where){
	scrollY=document.getElementById(where).offsetTop;
	scrollTo(0,scrollY);
}



// get¹æ½ÄÀ¸·Î Á¤º¸¸¦ º¸³»°í ¾ÞÄ¿¸¦ ÀÌµ¿ÇØ¾ß ÇÒ °æ¿ì ÀÔ´Ï´Ù.
// »õ·Î°íÄ§µÇ¸é¼­ »ç¶óÁö´Â ¿¨Ä¿°ªÀ» º¸°üÇÏ±â À§ÇØ ÄíÅ°¸¦ »ç¿ëÇÕ´Ï´Ù..

// ÄíÅ°»ý¼º
function setACookie( name, value, expireDate )
{
	var today = new Date();
	today.setDate( today.getDate() + parseInt( expireDate ) );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

// ÄíÅ°±¸ÇÏ±â
function getACookie(name)
{
    acookie  = document.cookie;
    name    = name + "=";
    idx     = acookie.indexOf(name);
    if(acookie && idx >= 0) {        
        
        tmp     = acookie.substring(idx, acookie.length);
        deli    = tmp.indexOf(";");
        if(deli > 0) {
            return tmp.substring(name.length, deli);
        } else {
            return tmp.substring(name.length);
        }
        
    }
}

// ÄíÅ°Áö¿ì±â
function clearACookie(name)
{
    today   = new Date();
    today.setDate(today.getDate() - 1);
    document.cookie = name + "=; path=/; expires=" + today.toGMTString() + ";";
}

// ¼ÒÆ®
function onlySort(where){
	//#´ÙÀ½¿¡ ³ª¿À´Â ¾ÞÄ¿ ÁÖ¼Ò¸¦ ÄíÅ°¿¡ ³Ö¾îÁÝ´Ï´Ù.
	var divide = where.split('#')[1];
	if(divide!=null && divide!=""){
		setACookie('ccc', divide, 1);
 		document.location.reload(where);
	}
}

// ¾ÞÄ¿ÀÌµ¿
function scrollToAnchor01(){
	if(getACookie('ccc')){
			
		var bbb = getACookie('ccc');
		scrollY=document.getElementById(bbb).offsetTop;
		scrollTo(0,scrollY);
		
		// ÀÌµ¿ÈÄ ÄíÅ°¿¡ ÀúÀåµÈ °ªÀ» Áö¿ó´Ï´Ù. ±×·¡¾ß ÆäÀÌÁö¸¦ Ã³À½ ºÒ·¯µéÀÏ¶§´Â ÁöµµºÎÅÍ ³ª¿É´Ï´Ù.
		clearACookie('ccc');
	
	}else{
		return false;
	}

}
