// JavaScript Document


window.oncontextmenu = function() {return true};
window.onselectstart = function() {return true};
window.ondragstart = function() {return false};
window.oncontrolselect = function() {return false};

// = = = = = = = = = = = = = = = = = = = =
/* 
ÀÌ ÇÔ¼ö´Â ¹®¼­¸¦ ÀÐÀ» ¶§ ½ÇÇàµÉ ÇÔ¼ö¸¦ È¿À²ÀûÀÎ ¹æ¹ýÀ¸·Î Â÷·Ê´ë·Î ½ÇÇàÇÕ´Ï´Ù.
onload event( body onload, window.onload)¸¦ Áßº¹ÇØ¼­ »ç¿ëÇØ¾ß ÇÏ´Â °æ¿ì¿£ ¸¶Áö¸· onload¸¸ Àû¿ëµÇ´Â ¿À·ù¸¦ ÇÇÇØ°¡±â À§ÇÑ ÇÔ¼öÀÔ´Ï´Ù.
ex)
addLoadEvent(firstFunction);
addLoadEvent(secondFunction);
*/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


// = = = = = = = = = = = = = = = = = = = =
/* 
ÀÌ ÇÔ¼ö´Â ÀÎ¿ë(blockquote) ¿ä¼ÒÀÇ cite¶ó´Â ¼Ó¼ºÀ» È­¸é¿¡ ÀûÀýÈ÷ Ç¥½ÃÇØÁÖ´Â ÇÔ¼öÀÔ´Ï´Ù. 
¶ÇÇÑ ¸µÅ©¿Í À­Ã·ÀÚ¸ð¾çÀ» ³ªÅ¸³» ÁÝ´Ï´Ù.
<blockquote cite="http://www.w3.com/DOM/">~~
*/
function displayCitations() {
	if (!document.getElementsByTagName || !document.createElement || !document.createTextNode) return false;
	//¸ðµç blockquote¿ä¼Ò¸¦ °¡Á® ¿Â´Ù.
	var quotes = document.getElementsByTagName("blockquote");
	for (var i=0; i<quotes.length; i++) {
		// cite¼Ó¼ºÀÌ ¾øÀ¸¸é ¹Ýº¹¹®À» ´Ù½Ã ½ÃÀÛ.
		if (!quotes[i].getAttribute("cite")) continue;
		// cite¼Ó¼ºÀ» ÀúÀå
		var url = quotes[i].getAttribute("cite");
		// blockquote ³» ¸ðµç ¿ä¼Ò node¸¦ °¡Á® ¿Â´Ù.
		var quoteChildren = quotes[i].getElementsByTagName('*');
		// ¸¸¾à ¿ä¼Ò node°¡ ¾øÀ¸¸é ¹Ýº¹¹®À» ´Ù½Ã ½ÃÀÛ.
		if (quoteChildren.length < 1) continue;
		// blockquote ³»¿¡ Á¦ÀÏ ¸¶Áö¸· ¿ä¼Ò ³ëµå¸¦ °¡Á® ¿Â´Ù.
		var elem = quoteChildren[quoteChildren.length-1];
		// ¸¶Å©¾÷À» »ý¼ºÇÑ´Ù.
		var linkTag = document.createElement("a");
		var linkText = document.createTextNode("SOURCE: "+ url);
		linkTag.appendChild(linkText);
		linkTag.setAttribute("href",url);
		var subscript = document.createElement("sub");
		subscript.appendChild(linkTag);
		var divTag = document.createElement("div");
		divTag.setAttribute("align","right");
		divTag.appendChild(subscript);
		// ¸¶Å©¾÷À» blockquoteÀÇ ¸¶Áö¸· ¿ä¼Ò ³ëµå µÚ¿¡ Ãß°¡ ÇÑ´Ù.
		elem.appendChild(divTag);
	}
}
addLoadEvent(displayCitations);


// IE 6 ¿¡¼­ PNG ·»´õ¸µ ÇÏ±â
// layout4ie.css ¿¡¼­ »ç¿ëÇÕ´Ï´Ù.
// <img src=***.png class="png24" />
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 ''; 
}

function imgResize() 
{ 
    // DivContents ¿µ¿ª¿¡¼­ ÀÌ¹ÌÁö°¡ maxsize º¸´Ù Å©¸é ÀÚµ¿ ¸®»çÀÌÁî ½ÃÄÑÁÜ 
    maxsize = 660; // °¡·Î»çÀÌÁî ( ´Ù¸¥°ªÀ¸·Î ÁöÁ¤ÇÏ¸éµÊ) 
    var content = document.getElementById("mainContent"); 
    var img = content.getElementsByTagName("img"); 
    for(i=0; i<img.length; i++) 
    { 

        if ( eval('img[' + i + '].width > maxsize') ) 
        { 
            var heightSize = ( eval('img[' + i + '].height')*maxsize )/eval('img[' + i + '].width') ; 
            eval('img[' + i + '].width = maxsize') ; 
            eval('img[' + i + '].height = heightSize') ; 
        } 
    } 
} 
//window.onload = imgResize; 
