/*
ÀÛ¼ºÀÚ : ±è³²¹è
ÀÛ¼ºÀÏ : 2008.07.18
³»  ¿ë : ¾ÆÁÖ Æ¯º°ÇÑ ¼ö¹Ú¾¾ ¹æ¹®ÀÚ Ä«¿îÆÃ
*/
function xmlHttpGoUrl(idx, s_url, key) {
	var xmlHttp = Ajax.getTransport();
	var frmobj = document.getElementById("theForm");

	if (idx != "" && s_url != "") {
		var url = "./index_special_count.asp?idx="+idx;
		xmlHttp.Open("GET", url, true);//	xmlHttp.Open("POST", url, true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.onreadystatechange = xmlCallback;
		xmlHttp.send(null);//	xmlHttp.send("a=1&b=1"); // "POST"·Î ³Ñ±æ¶§ »ç¿ë
	}

	function xmlCallback() {
		if (xmlHttp.readyState == 4) {
			if (xmlHttp.status == 200) {
				//alert("start callback method");
				var xmlDoc = xmlHttp.responseXML;//	var xmlDoc = xmlHttp.responseText;
				var msg = xmlDoc.getElementsByTagName("msg")[0].firstChild.nodeValue;
				if (msg == "OK") {
					setCookie('MidMainSpecial', key, 1000);
					document.location.href = s_url;
				} else {
					alert(msg);
				};
			} else if (xmlHttp.status == 204) {
				alert("Àü´ÞµÈ µ¥ÀÌÅÍ°¡ ¾ø½À´Ï´Ù.");
			} else if (xmlHttp.status == 404) {
				alert("URLÀ» È®ÀÎÇÏ¼¼¿ä.");
			} else if (xmlHttp.status == 500) {
				alert("³»ºÎ ¿¡·¯!.");
			};
		};
	};
};

function getSpecial() {
	var key = getCookie('MidMainSpecial');

	if (key == '2')	{
		n1('2');
	} else if (key == '3') {
		n1('3');
	} else {
		n1('1');
	}
};

function QuizAnswerCheck(){ 
 var frm = document.theQuizAnswerForm; 
	var flag = 0; 
	for (i=0; i < frm.elements.length; i++){ 
		if (frm.elements[i].name == 'qz_answer'){ 
			if (frm.elements[i].checked == true){ 
				flag = 1; 
				break; 
			}; 
		}; 
	}; 
	if (flag == 0) { 
		alert('´ä¾ÈÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä'); 
		return; 
	}; 
	var myWin = window.open('','Quiz','width=518,height=455,resizable=no,scrollbars=yes'); 
	frm.action = '/Story/Quiz_Chal_List_OX_popup.asp'; 
	frm.method = 'post'; 
	frm.target = 'Quiz'; 
	frm.submit(); 
	myWin.focus(); 
}; 