//<![CDATA[
// png24 hack for ie6
function $(id) {return document.getElementById(id);}

function setPng24(obj)
{
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}
// getElementsByClassName
function getElementsByClassName(className, tag)
{
	var arr = new Array();
	if (tag)
	{
		var elems = document.getElementsByTagName(tag);
	}
	else
	{
		var elems = document.getElementsByTagName("*");
	}
	for (var i = 0; i < elems.length; i++)
	{
		if (elems[i].className == className)
		{
			arr.push(elems[i]);
		}
	}
	return arr;
}

// insertAfter
function insertAfter(newElement,targetElement)
{
	var parent = targetElement.parentNode;
	if (parent.lastChild == targetElement)
	{
		parent.appendChild(newElement);
	}
	else
	{
		parent.insertBefore(newElement,targetElement.nextSibling);
	}
}
// imgDate
function imgDate()
{
	var targetClass = getElementsByClassName('imgdate', 'span');
	for (var i=0; i<targetClass.length; i++)
	{
		var fullDate = targetClass[i].firstChild.nodeValue;
		var splitDate = fullDate.split("/");
		var splitDate2 = splitDate[2].split(" ");
		var dateMonth = splitDate[1];
		var dateDay = splitDate2[0];

		var wrapDiv = document.createElement('div');
		wrapDiv.className = 'date_image';
		wrapDiv.style.width= '44px';
		wrapDiv.style.height= '23px';
		wrapDiv.style.margin= '11px 11px 0';

		var monthArea = document.createElement('div');
		//monthArea.innerHTML = dateDay;;
		monthArea.setAttribute('class','month-'+dateMonth);
		monthArea.setAttribute('className','month-'+dateMonth);
		monthArea.style.width = '43px';
		monthArea.style.height = '15px';
		monthArea.style.overflow = 'hidden';
		wrapDiv.appendChild(monthArea);
		
		var dayImg = document.createElement('div');
		dayImg.innerHTML = dateDay;
		dayImg.style.textAlign = 'center';
		dayImg.setAttribute('class','dateScript');
		dayImg.setAttribute('className','dateScript');

		wrapDiv.appendChild(dayImg);
		insertAfter(wrapDiv,targetClass[i]);
	}
}

if (typeof window.addEventListener != 'undefined')
{
	window.addEventListener("load", imgDate, false);
}
else if (typeof window.attachEvent != 'undefined')
{
	window.attachEvent("onload", imgDate);
}
//]]>
function ranking()
{
	if (rank < 4)
	{
		document.write("<img src='http://cfs.tistory.com/custom/blog/9/92283/skin/images/rank_" + rank++ + ".gif'>");
	}
}
function MenuToggle(obj1,obj2)
{
	if (obj1.style.display == 'block')
	{
		obj1.style.display = 'none';
		obj2.style.display = 'block';
	}
	else if (obj1.style.display == 'none')
	{
		obj1.style.display = 'block';
		obj2.style.display = 'none';
	}
}
function MessageAlert()
{
	var txt="ÂÊÁö·Î Áú¹®ÇÏ½Ã±â Àü¿¡ F.A.Q´Â ¹Ýµå½Ã È®ÀÎÇØ ÁÖ¼¼¿ä.\nF.A.Q¿¡ ÀÖ´Â Áú¹®µéÀº ´äº¯ÇØ µå¸®Áö ¾Ê½À´Ï´Ù.";
	if (confirm(txt))
	{
		window.open("http://note.naver.com/note/sendForm.nhn?targetUserId=dhkim1729&popup=1", "Message", "height=400, width=400, toolbar=no, location=no");
	}
}
