// SubChangeÇÔ¼ö »ç¿ëÇÏÁö ¾ÊÀ½
// Onload¿¡¼­ È£ÃâÇÏ´Â °æ¿ì°¡ Á¾Á¾ÀÖÀ¸³ª ¿¹Àü¹öÁ¯¿¡¼­ ¾²ÀÌ´ø °ÍÀ¸·Î ÇöÀç´Â ´õÀÌ»ó »ç¿ëÇÏÁö ¾ÊÀ½
// ±âÁ¸ ÆäÀÌÁö¿¡¼­ ¹«½ÉÄÚ È£ÃâÇÏ´Â °æ¿ì°¡ ÀÖÀ¸´Ï..ÀÏ´Ü Áö¿ìÁö´Â ¸¶¼¼¿ä
function SubChange(str) {
	return;
}

// ¿À¹ö //
function MM_reloadPage(init) { // reloads the window if Nav4 resized
	if (init == true)
		with (navigator) {
			if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
				document.MM_pgW = innerWidth;
				document.MM_pgH = innerHeight;
				onresize = MM_reloadPage;
			}
		}
	else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH)
		location.reload();
}
MM_reloadPage(true);

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() { // v6.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;
		}
}

// ¿À¹ö //

// ÆË¾÷
function MM_openBrWindow(theURL, winName, features) { // v2.0
	window.open(theURL, winName, features);
}
// ÆË¾÷

function OpenPopUp(url, tit, wid, hei) {
	var tp = (window.screen.Height - hei) / 2;
	var lt = (window.screen.Width - wid) / 2;

	openWindow = window.open(url, 'tit', 'scrollbars=no,width=' + wid
			+ ',height=' + hei + ',top=' + tp + ',left=' + lt);
	openWindow.focus();

	return;
}

function memo_delete(obj) {
	if (obj.userpw.value.length < 4) {
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚ¸® ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		return false;
	}
	obj.submit();
	return;
}

function memo_notice_popup(memo) {
	url = "/snews/memo_notice.php?memo=" + memo;
	url += "&dirnews=" + document.TMEMO.dirnews.value;
	url += "&news=" + document.TMEMO.news.value;
	url += "&year=" + document.TMEMO.year.value;

	OpenPopUp(url, "¸Þ¸ð ½Å°í", 248, 148);
	return;
}

function memo_delete_popup(memo) {
	url = "/snews/memo_passwd.php?memo=" + memo;
	url += "&dirnews=" + document.TMEMO.dirnews.value;
	url += "&news=" + document.TMEMO.news.value;
	url += "&year=" + document.TMEMO.year.value;

	OpenPopUp(url, "¸Þ¸ð »èÁ¦", 248, 148);
	return;
}

function memo_insert(obj) {
	if (obj.userid.value.length < 1) {
		alert("ÀÛ¼ºÀÚ ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä");
		obj.userid.focus();
		return;
	}
	if (obj.userpw.value.length < 4) {
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚ¸® ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		obj.userpw.focus();
		return;
	}
	if (obj.body.value.length < 1) {
		alert("ÀÇ°ßÀ» ÀÛ¼ºÇØ ÁÖ¼¼¿ä");
		obj.body.focus();
		return;
	}
	obj.action = '/snews/memoinsert.php';
	obj.submit();
	return;
}

// Ä«Å÷
function cartoonmemo_delete(obj) {
	if (obj.userpw.value.length < 4) {
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚ¸® ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		return false;
	}
	obj.submit();
	return;
}

function cartoonmemo_delete_popup(memo) {
	url = "/scartoon/memo_passwd.php?memo=" + memo;
	url += "&dir=" + document.TMEMO.dir.value;
	url += "&news=" + document.TMEMO.news.value;

	OpenPopUp(url, "¸Þ¸ð »èÁ¦", 248, 148);
	return;
}

function cartoonmemo_insert(obj) {
	if (obj.userid.value.length < 1) {
		alert("ÀÛ¼ºÀÚ ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä");
		obj.userid.focus();
		return;
	}
	if (obj.userpw.value.length < 4) {
		alert("ºñ¹Ð¹øÈ£´Â 4ÀÚ¸® ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		obj.userpw.focus();
		return;
	}
	if (obj.body.value.length < 1) {
		alert("ÀÇ°ßÀ» ÀÛ¼ºÇØ ÁÖ¼¼¿ä");
		obj.body.focus();
		return;
	}
	obj.action = '/scartoon/memoinsert.php';
	obj.submit();
	return;
}

// ´ñ±Û
function strlen_check(maxlen, field) {
	var temp;
	var msglen;
	msglen = maxlen * 2;
	var value = field.value;

	l = field.value.length;
	tmpstr = "";

	if (l == 0) {
		value = maxlen * 2;
	} else {
		for (k = 0; k < l; k++) {
			temp = value.charAt(k);
			if (escape(temp).length > 4)
				msglen -= 2;
			else
				msglen--;

			if (msglen < 0) {
				alert("ÃÑ ¿µ¹® " + (maxlen * 2) + "ÀÚ ÇÑ±Û " + maxlen
						+ "ÀÚ ±îÁö º¸³»½Ç¼ö ÀÖ½À´Ï´Ù.");
				field.value = tmpstr;
				break;
			} else {
				tmpstr += temp;
			}
		}
	}
}

function resizeFontSize(val) {
	var cbody;
	cbody = document.getElementById("cbody");
	if (val > 0) {
		if (fontSize <= 18) {
			fontSize = fontSize + val;
			cbody.style.fontSize = fontSize + "px";
		}
	} else {
		if (fontSize > 12) {
			fontSize = fontSize + val;
			cbody.style.fontSize = fontSize + "px";
		}
	}
}
var fontSize = 14;

// ////////////////////////////////////////////////////////////////////////////////////
//
// CheckLen
// ±â´É : ÀÔ·ÂÃ¢¿¡ ¸Å°³º¯¼ö·Î ¹ÞÀº lenÀÌÇÏÀÇ ¹®ÀÚ¼ö¸¸ µé¾î°¡µµ·Ï ÇÑ´Ù.
// »ç¿ëÀÌº¥Æ® : onKeyup
// ÁÖÀÇ»çÇ× : checklenÇÔ¼ö¸¦ »ç¿ëÇÏ±â À§ÇØ¼­´Â
// º¯¼ö(MaxLen)¿Í ÇÔ¼ö(ReplaceChars,GetLength, CutText)°¡ ÇÊ¿äÇÏ´Ù.
//
// ////////////////////////////////////////////////////////////////////////////////////

var MaxLen;

function CheckLen(len) {
	// µé¾î¿Â ÄÚµå°¡ '³ª"ÀÏ¶§¸¦ ¸·´Â´Ù.
	/*
	 * if(event.keyCode == 222) { var temp1; temp1 = event.srcElement.value;
	 * temp1 = ReplaceChars("\"","£¢",temp1); temp1 =
	 * ReplaceChars("'","£§",temp1); event.srcElement.value = temp1; }
	 */

	MaxLen = parseInt(len);
	templ = GetLength(event.srcElement);
	templ = templ.toString();
	t2 = templ.split(",");
	if (t2[0] > MaxLen) {
		alert("ÀÔ·Â»óÀÚ¿¡ Çã¿ë ±æÀÌ ÀÌ»óÀÇ ±ÛÀ» ¾²¼Ì½À´Ï´Ù.\nº» ÀÔ·Â»óÀÚ¿¡´Â ÇÑ±Û "
				+ Math.floor(MaxLen / 2) + "ÀÚ, ¿µ¹®" + (MaxLen)
				+ "ÀÚ±îÁö¸¸ ¾²½Ç ¼ö ÀÖ½À´Ï´Ù.");
		event.returnValue = '';
		event.srcElement.value = CutText(event.srcElement.value);
		return false;
	}
	return true;
}

function CheckLenPrint() {
	var isExist = document.getElementById("reply_comment_length");
	templ = GetLength(event.srcElement);
	templ = templ.toString();
	t2 = templ.split(",");

	isExist.innerHTML = t2[0];
}

function CheckLenPrint2(id) {
	var isExist = document.getElementById(id);
	templ = GetLength(event.srcElement);
	templ = templ.toString();
	t2 = templ.split(",");

	isExist.innerHTML = t2[0];
}

function CheckTextAreaRow(id, maxHegiht, minHeight) {

	if (id.scrollHeight < minHeight) {
		id.style.height = minHeight;
		id.style.overflowY = "hidden";
	} else if (id.scrollHeight > maxHegiht) {
		id.style.height = maxHegiht;
		id.style.overflowY = "auto";
	} else {
		id.style.height = id.scrollHeight + 10;
		id.style.overflowY = "hidden";
	}

	// ¾ÆÀÌÄÜ ·¹ÀÌ¾î À§Ä¡ Á¶Á¤ ¸·³ëµ¿ÀÌ µû·Î ¾ø±º.
	document.getElementById("iconList").style.bottom = document
			.getElementById("replyBodyText").offsetHeight - 24;
	iframeSize("PARAN_MEDIA_REPLY", 0);
}

function ReplaceChars(out, add, entry) {

	temp = "" + entry; // temporary holder

	while (temp.indexOf(out) > -1) {
		pos = temp.indexOf(out);
		temp = ""
				+ (temp.substring(0, pos) + add + temp.substring(
						(pos + out.length), temp.length));
	}

	return temp;
}

function GetLength(obj) {
	temp2 = obj.value;
	temp4 = ""
	var l = 0;
	for (i = 0; i < temp2.length; i++) {
		temp3 = temp2.charAt(i);

		if (escape(temp3).length > 4)
			l += 2;
		else if (temp3 != '\r')
			l++;
	}

	if (l > MaxLen)
		return l + "," + i;
	temp = ""
	return l;
}

function CutText(aquery) {
	var tmpStr;
	var temp = 0;
	var onechar;
	var tcount;
	tcount = 0;
	tmpStr = new String(aquery);
	l = tmpStr.length;

	for (k = 0; k < l; k++) {
		onechar = tmpStr.charAt(k);

		if (escape(onechar).length > 4) {
			tcount += 2;
		} else if (onechar != '\r') {
			tcount++;
		}
		if (tcount > MaxLen) {
			tmpStr = tmpStr.substring(0, k);
			break;
		}
	}

	return tmpStr;
}

// ////////////////////////////////////////////////////////////////////////////////////
//
// CheckNum
// ±â´É : ¼ýÀÚ¸¸ ÀÔ·Â¹Þ°Ô ÇÔ.
// »ç¿ëÀÌº¥Æ® : onKeyup
//
// ////////////////////////////////////////////////////////////////////////////////////

function CheckNum() {
	var e1 = event.srcElement;
	var num = "0123456789";
	var tmp = "";
	var str_yb = false;
	var first_yb = true;

	if (e1.value == "0") {
		return;
	}
	for ( var i = 0; i < e1.value.length; i++) {
		if ((e1.value.charAt(i) == '0') && (first_yb)) {
			// ¾Õ¿¡ '0'ÀÌ ÀÖÀ¸¸é »èÁ¦
			tmp = tmp + e1.value.charAt(i);
			first_yb = false;
		} else if (-1 == num.indexOf(e1.value.charAt(i))) {
			// ÇÏ³ªÀÌ»ó ÀÖÀ¸¸é ¸Þ¼¼Áö
			str_yb = true;
		} else {
			tmp = tmp + e1.value.charAt(i);
			first_yb = false;
		}
	}

	if (str_yb) {
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		e1.value = tmp;
		return false;
	}

	e1.value = tmp;
	return;
}
function popupPimsUserinfo() {
	var popupurl = "https://user.paran.com/userAction.do?method=infoUserFormNew&reqType=popup";
	// var popupurl =
	// "http://user.paran.com/userAction.do?method=paranChangeBasicInfoForm&reqType=popup";

	var param = getCenterWinStr(820, 700);
	var registerCPTestWin = window.open(popupurl, "registerCPTest", param
			+ ",menubar=no,scrollbars=yes,statusbar=yes");
	registerCPTestWin.focus();
}
function popupDWUserinfo() {
	var popupurl = "http://dwuser.d.paran.com/AUTH/pnickname.cgi";
	var param = getCenterWinStr(760, 700);
	var registerCPTestWin = window.open(popupurl, "registerCPTest", param
			+ ",menubar=no,scrollbars=yes,statusbar=yes");
	registerCPTestWin.focus();
}
function getCenterWinStr(width, height) {
	var str = "";
	str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
	}
	return str;
}

function WinOpen(url, name, width, height) {
	window.open(url, name, "width=" + width + ",height=" + height
			+ ",scrollbars=yes");
}

// ÅØ½ºÆ®ÀÇ Áß°£ºÎºÐÀÇ ¿¹¾à¾î¸¦ ¹Ù²ãÄ¡±â ÇÔ
function ClickCodeReplace(topcode, subcode) {
	var code = '';

	// Å¾ÄÚµå ÃÊ±âÈ­
	if (topcode == '') {
		topcode = 'none';
	}

	// ¼­ºêÄÚµå ÃÊ±âÈ­
	if (subcode == '') {
		subcode = 'none';
	}

	// Å¾ÄÚµå ºÙÀÌ°í
	if (topcode != '') {
		code = topcode;
	}

	// ¼­ºêÄÚµå ºÙÀÌ±â
	if (subcode != '') {
		if (code != '') {
			code = code + '^';
		}
		code = code + subcode;
	}

	atag = document.getElementsByTagName('a');
	var click_cd = "::Å¬¸¯¼½¼Ç::";
	for (i = 0; i < atag.length; i++) {
		if (atag[i].href.match(click_cd)) {
			atag[i].href = atag[i].href.replace(/::Å¬¸¯¼½¼Ç::/gi, code);
		}
	}
}

function urlencode(str) {
	var ansi_system = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i",
			"j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
			"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I",
			"J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
			"W", "X", "Y", "Z", " ", "0", "1", "2", "3", "4", "5", "6", "7",
			"8", "9", "0", "-", "=", "[", "]", ";", "\\", "\'", ",", ".", "/",
			"`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_",
			"+", "|", "<", ">", "?", ":", "\"", "{", "}");
	var chr = "", han_yn = "";
	var result = "";

	for (i = 0; i < str.length; i++) {
		han_yn = "Y";
		chr = str.charAt(i);

		// ÀÌ¹Ì ¿£ÄÚµùµÈ ¾Ö´Â ±×³É ºÙÀÌ±â
		if (chr == "%") {
			result += chr;
			result += str.charAt(i + 1);
			result += str.charAt(i + 2);
			i += 2;
			continue;
		}

		// ¾È½ÃÄÚµå¿¡ ÀÖÀ¸¸é º¯È¯ÇÑ´Ù..
		for (ia = 0; ia < ansi_system.length; ia++) {
			if (chr == ansi_system[ia]) {
				han_yn = "N"
			}
		}

		if (han_yn == "N") {
			// ÇÑ±ÛÀÌ ¾Æ´Ï¸é º¯È¯ÇØ¼­ ºÙÀÎ´Ù.
			result += escape(chr);
		} else {
			// ÇÑ±ÛÀÌ¸é ±×³É ºÙÀÎ´Ù.
			result += chr;
		}
	}
	return result;
}

/*******************************************************************************
 * ÇÔ¼ö¼³¸í : Åë°èÄÚµå¿Í URLÀ» ¹Þ¾Æ¼­ Å¬¸¯Åë°è¸¦ Ã³¸®ÇÑµÚ ÇØ´ç URL·Î º¸³»ÁØ´Ù. ¸Å°³º¯¼ö : peye_link - peyeÄÚµåÀÇ
 * ¸µÅ©À§Ä¡ÄÚµå - frmClickCode¿¡¼­ ÇöÀçÀ§Ä¡ÄÚµå¸¦ È¹µæÇÏ¿© peyeÄÚµå¸¦ ¿Ï¼ºÇÑ´Ù. rurl - Å¬¸¯Åë°è Ã³¸®ÈÄ º¸³»ÁÙ URL
 * etc - ±âÅ¸ ¸µÅ©¿¡ ÇÊ¿äÇÑ Á¤º¸¸¦ ±¸ºÐÀÚ¸¦ µÐ ¹®ÀÚ¿­ÇüÅÂ·Î Àü´ÞÇÑ´Ù. - ¿¹) target=_blank,Å°=°ª,Å°=°ª,... È£Ãâ¹æ¹ý :
 * Àü´Þ¹®ÀÚ¿­ ¾ø´Â °æ¿ì GoClickCode('´Ü¶ô^Ä®·³^¼³¸í','URL°æ·Î') Àü´Þ¹®ÀÚ¿­ ÀÖ´Â °æ¿ì
 * GoClickCode('´Ü¶ô^Ä®·³^¼³¸í','URL°æ·Î', 'Å°=°ª,Å°=°ª') ÁÖÀÇ»çÇ× : ³Ñ°ÜÁÖ´Â °ª¿¡ ÀÎÄÚµùµÈ ¹®ÀÚ¿­ÀÌ ÀÖ´Â °æ¿ì ¹Ýµå½Ã
 * onclick¿¡¼­ È£ÃâÇØ¾ß ÇÕ´Ï´Ù. onclick¿¡¼­ È£ÃâÇÏ´Â °æ¿ì href="#clickcode"·Î ÅëÀÏÇÕ½Ã´Ù..^^
 ******************************************************************************/
function GoClickCode(peye_link, rurl, etc) {
	var peye_curr = '';
	var peye = '';
	var click_url = '';
	var option = "";

	// etc¿¡¼­ ³Ñ°ÜÁÖ´Â ¸ðµç º¯¼ö ¹Ì¸® ¼±¾ð ¹× ÃÊ±âÈ­(Á¤¸®Â÷¿ø)
	var target = "";
	var width = "";
	var height = "";
	var left = "";
	var top = "";
	var scrollbars = "";
	var resizeable = "";

	// etc¿¡¼­ ¹ÞÀº ¹®ÀÚ¿­À» º¯¼ö¿¡ ´ã±â
	if (etc) {
		arrEtc = etc.split(','); // ÄÄ¸¶(,)¿¡¼­ ºÐÇÒÇÏ¿© ¹è¿­º¯¼ö¿¡ ÀúÀåÇÑ´Ù.
		for ( var i = 0; i < arrEtc.length; i++) {
			arrEtcVal = arrEtc[i].split('=');
			eval(arrEtcVal[0] + " = arrEtcVal[1];");
		}
	}

	// À©µµ¿ì ¿É¼Ç ¸ðÀ¸±â
	if (width != "") {
		if (option != "")
			option += ",";
		option += "width=" + width;
	}
	if (height != "") {
		if (option != "")
			option += ",";
		option += "height=" + height;
	}
	if (left != "") {
		if (option != "")
			option += ",";
		option += "left=" + left;
	}
	if (top != "") {
		if (option != "")
			option += ",";
		option += "top=" + top;
	}
	if (scrollbars != "") {
		if (option != "")
			option += ",";
		option += "scrollbars=" + scrollbars;
	}
	if (resizeable != "") {
		if (option != "")
			option += ",";
		option += "resizeable=" + resizeable;
	}

	// ¿¹¿ÜÃ³¸®
	if (document.frmClickCode) {
		var topcode = document.frmClickCode.topcode.value;
		var subcode = document.frmClickCode.subcode.value;
	} else if (target != "") {
		// °¡·Î,¼¼·Î°¡ ÀÖ´Â °æ¿ì
		if (option != "") {
			window.open(click_url, target, option);
		} else {
			window.open(click_url, target);
		}
		return;
	} else {
		location = rurl;
		return;
	}

	// Å¾ÄÚµå ÃÊ±âÈ­
	if (topcode == '') {
		topcode = 'none';
	}

	// ¼­ºêÄÚµå ÃÊ±âÈ­
	if (subcode == '') {
		subcode = 'none';
	}

	// Å¾ÄÚµå ºÙÀÌ°í
	if (topcode != '') {
		peye_curr = topcode;
	}

	// ¼­ºêÄÚµå ºÙÀÌ±â
	if (subcode != '') {
		if (peye_curr != '') {
			peye_curr = peye_curr + '^';
		}
		peye_curr = peye_curr + subcode;
	}

	// Å¬¸¯¸µÅ© »ý¼º
	peye = "news^" + peye_curr + '^' + peye_link;
	rurl = urlencode(rurl);
	click_url = "http://click.paran.com/paran.php?p_eye=" + peye + '&rurl='
			+ rurl
	// alert(peye);

	if (target != "") {
		// °¡·Î,¼¼·Î°¡ ÀÖ´Â °æ¿ì
		if (option != "") {
			window.open(click_url, target, option);
		} else {
			window.open(click_url, target);
		}
		return;
	} else {
		location = click_url;
		return;
	}
}

function rightpopbeanball() {
	window.open("http://club.paran.com/bluebogy");
	return;
}

/*
 * [Rollover] ½ÃÀÛ
 * ###############################################################################
 */
function MM_swapImgRestore() { // v3.0
	var i, x, a = document.MM_sr;
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++)
		x.src = x.oSrc;
}

function MM_preloadImages() { // v3.0
	var d = document;
	if (d.images) {
		if (!d.MM_p)
			d.MM_p = new Array();
		var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		for (i = 0; i < a.length; i++)
			if (a[i].indexOf("#") != 0) {
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
	}
}

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_swapImage() { // v3.0
	var i, j = 0, x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3)
		if ((x = MM_findObj(a[i])) != null) {
			document.MM_sr[j++] = x;
			if (!x.oSrc)
				x.oSrc = x.src;
			x.src = a[i + 2];
		}
}
/*
 * [Rollover] ³¡
 * #################################################################################
 */

// Cartoon Left Menu ½ÃÀÛ
function ct_leftmenu(val) {
	if (val != 999) {
		var obj = document.getElementById("left" + val);

		if (obj.style.display == "none")
			obj.style.display = "inline";
		else
			obj.style.display = "none";
	}
}
// Cartoon Left Menu ³¡

// ±â»çº¸±â ¸¹ÀÌº»±â»ç ·£´ø°ª ¸¸µé±â
function many_img() {
	var no = 0;
	var images = document.getElementsByName("manyPhoto");
	var num = images.length;
	no = Math.floor(Math.random() * num);
	// alert(no);

	// °´Ã¼°¡ ÀÖÀ»¶§¸¸ ½ÇÇà(»èÁ¦±â»ç¿¡¼­ js¿¡·¯) 07.10.31 by djkim
	if (document.getElementById("manypho0") == undefined) {
		return false;
	}

	for (i = 0; i < num; i++) {
		eval("document.getElementById('manypho" + i
				+ "').style.display = 'none'");
	}
	eval("document.getElementById('manypho" + no
			+ "').style.display = 'inline';");
}

function addLoadEvent(func) {
	var oldonload = window.onload;

	if (typeof window.load != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function imagecheck() {
	var objImages = document.images;
	for ( var i = 0; i < objImages.length - 1; i++) {
		if (objImages[i].src.substring(0, 37) == "http://photonews.paran.com/newsphoto/") {
			if (objImages[i].complete == false) {
				var tempImage = objImages[i].src;

				if (tempImage.substring(tempImage.indexOf('/c1_'))) {
					strImage = tempImage.replace('/c1_', '/t2_');

					objImages[i].src = strImage;
				} else {
					objImages[i].src = "http://photonews.paran.com/images/noimage.gif"
				}
			}
		}
	}
}

addLoadEvent(imagecheck);

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='';
	obj.src = 'http://photonews.paran.com/images/V2/header/080723/blank_png.gif'; /* ¼öÁ¤ºÎºÐ */
	return '';
}

// IE6 ¹ö±×ÆÐÄ¡ 090206
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch (err) {
}

// ´º½º ¿ìÃø ÅÇ Layer 
function right_tab_div(id, no, itemCnt) {

	for (i = 1; i < itemCnt + 1; i++) {
		$(id + "Tab" + i).removeClassName("on");
		$(id + i).hide();
	}

	$(id+"Tab"+no).addClassName("on");
	$(id+no).show();
}

function right_tab_div_sub(id, no, itemCnt) {

	for (i = 1; i < itemCnt + 1; i++) {
		$(id + "_" + i).hide();
	}

	$(id+"_"+no).show();
}


function scrollingText(objId,sec1,sec2,speed,height) {
	this.objId=objId;
	this.sec1=sec1;
	this.sec2=sec2;
	this.speed=speed;
	this.height=height;
	this.h=0;
	this.div=document.getElementById(this.objId);
	this.htmltxt=this.div.innerHTML;
	this.div.innerHTML=this.htmltxt+this.htmltxt;
	this.div.isover=false;
	this.div.onmouseover=function(){this.isover=true;}
	this.div.onmouseout=function(){this.isover=false;}
	var self=this;
	this.div.scrollTop=0;
	window.setTimeout(function(){self.play()},this.sec1);
}
scrollingText.prototype={
	play:function(){
		var self=this;
		if(!this.div.isover){
			this.div.scrollTop+=this.speed;
			if(this.div.scrollTop>this.div.scrollHeight/2){
				this.div.scrollTop=0;
			}else{
				this.h+=this.speed;
				if(this.h>=this.height){
					if(this.h>this.height|| this.div.scrollTop%this.height !=0){
						this.div.scrollTop-=this.h%this.height;
					}
					this.h=0;
					window.setTimeout(function(){self.play()},this.sec1);
					return;
				}
			}
		}
		window.setTimeout(function(){self.play()},this.sec2);
	}
};



function showFastNews(dirnews, year, extend) 
{
	if(dirnews != '' && year != '') {
		var win = window.open('http://media.paran.com/fastnews/?dirnews='+dirnews+'&year='+year, 'fastnews', 'scrollbars=yes, location=no, menubar=no, resizable=yes, width=1170, height=950');
	} else {
		var win = window.open('http://media.paran.com/fastnews/?sdir='+extend, 'fastnews', 'scrollbars=yes, location=no, menubar=no, resizable=yes, width=1170, height=950');
	}
	
	if(win != null) { win.focus(); }
}