ID = escape(getCookie("IMBCID"))
PASSWORD = escape(getCookie("IMBCPASSWORD"))
tUrl = document.location

wi=740;
hi=480;      
wi_1=490;
hi_1=330;   
wi_2=400;
hi_2=30;




function PopMCheck() {

	ID = escape(getCookie("IMBCID"))
	if (ID != "" ){
		
		OpenPop = getCookie("IMBCPURL")
		if (OpenPop != ""){

			delCookie("IMBCPURL")
			window.open(OpenPop,'event','scrollbars=yes,width=757,height=600')
		}
	}

}


function PopGoPAzuma() {
    
	ID = escape(getCookie("IMBCID"))

	if (ID == ""){
		tUrl = opener.location
		pUrl = document.location
		SetUrl("IMBCURL",tUrl)
		
		SetUrl("IMBCPURL",pUrl)		
		SetUrl("IMBCPPURL","http://ent05.imbc.com/ent/imbc/quiz/main.htm")		
    	
    	opener.location="http://login.imbc.com/imbc/login/login.asp"
    	this.close()

	}
	else {
	
		window.open('http://ent05.imbc.com/ent/imbc/quiz/main.htm','event','scrollbars=yes,width=740,height=580')

	
	}
	

}


function PopCheck() {

	ID = escape(getCookie("IMBCID"))
	if (ID != "" ){
		
		OpenPop = getCookie("IMBCPPURL")	
			if (OpenPop != ""){
			delCookie("IMBCPPURL")
			window.open(OpenPop,'quiz','scrollbars=yes,width=740,height=580')
		}
	}

}





function getCookie(strName)
{

	var strArg = new String(strName + "=");	
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;
	
	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;
	
	if(nCookieLen > 0) {
	
		while(i < nCookieLen) {
		
			j = i + nArgLen;
			
			if(document.cookie.substring(i, j) == strArg) {
			
				nEnd = document.cookie.indexOf (";", j);
				
				if(nEnd == -1) nEnd = document.cookie.length;
				
				return unescape(document.cookie.substring(j, nEnd));
			 
			}
			
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}
	
	return("");
}

function setCookie(strName, strValue, dateExpires, strPath, strDomain, isSecure)
{
   
	var strCookie;
	
	if(strName == "") return ;
		   
	strCookie = strName + "=" + escape(strValue) + 
		    ((dateExpires) ? "; expires=" + dateExpires.toGMTString() : "")  + 
	      	    ((strPath)     ? "; path="    + strPath : "") + 
	      	    ((strDomain)   ? "; domain="  + strDomain : "") + 
		    ((isSecure)    ? "; secure" : "");
	
	document.cookie = strCookie; 

}



function delCookie( name )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate()-1 );
	document.cookie = name+"=; domain=imbc.com; path=/; expires="+todayDate.toGMTString()+";";
}

function SetUrl(name,value) 
{
		setCookie(name,value,null,"/","imbc.com")			
}	

function SetLogin() {
	
	ID = escape(getCookie("IMBCID"))

	if (ID == ""){

		document.write('<a href="http://login.imbc.com/imbc/login/Login.asp" onClick="SetUrl()"><font color=white size=2>·Î±×ÀÎ</font></a>')
	}	
	else
		document.write('<a href="javascript:iMbc_logout()"><font color=white size=2>·Î±×¾Æ¿ô</font></a>')
	
}

function iMbc_logout () {
    
    delCookie("IMBCID");
    document.location = tUrl;
}

// ÆË¾÷À» È£ÃâÇÏ±â Àü¿¡ ÀÎÁõ Ã³¸®...!!!!!




