//ÆË¾÷
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(name,value) {
	var todayDate = new Date();
	todayDate.setTime(todayDate.getTime() + (1000 * 3600) * 24 * 1); 	//1ÀÏ
	document.cookie = name+"="+escape(value)+"; path=/;expires="+todayDate.toGMTString()+";";
}	

function closeWin(pop_seq) {
	var temp = pop_seq;
	setCookie(pop_seq, "checked");
	eval(temp).style.visibility = "hidden";
}
	
function divClose(pop_seq) {
	var temp = pop_seq;
	eval(temp).style.visibility = "hidden";
}	

function openDiv(no_seq, pop_left, pop_top, pop_width, pop_height, img_name, link_url, target) {

		var bottom_width;
		bottom_width = parseInt(pop_width) + 2;
		document.write("<div id='"+no_seq+"' style='position:absolute; left:"+pop_left+"; top:"+pop_top+"; width:"+pop_width+"px; height:"+pop_height+"px; z-index:9999; visibility:visible;'>   "+
                             "    <div align='center'>  "+
                             "            <table bgcolor='#000' width='"+pop_width+"' border='0' align='center' cellpadding='1' cellspacing='0'> "+
	                         "            <form name='frm1'> "+
                             "                <tr>  "+
                             "                    <td  colspan='3'><a href='"+link_url+"' target='"+target+"'><img src='/popup/images/"+img_name+"' width='"+pop_width+"' height='"+pop_height+"' border='0'></a></td> "+
                             "                </tr> "+
                             "                <tr bgcolor='#000'>  "+
                             "                    <td width='80%' align='left' height='25'><INPUT type='checkbox' name='check' style='cursor:pointer;' onclick=\"closeWin('"+no_seq+"');\" ><font color='#FFFFFF'>¿À´ÃÇÏ·ç ´Ý±â</font></td> "+
                             "                    <td width='15%' >&nbsp;</td> "+
                             "                    <td width='5%'><a href='javascript:divClose("+no_seq+");'><img src='/popup/images/btn_close.gif' width='11' height='11' border='0'></a></td> "+
                             "                </tr> "+
	                         "		       </form> "+
                             "            </table> "+
                             "    </div> "+
                             "</div>   ");
}



function openDiv_flash(no_seq, pop_left, pop_top, pop_width, pop_height, img_name, link_url, target) {

		var bottom_width;
		bottom_width = parseInt(pop_width) + 2;
		document.write("<div id='"+no_seq+"' style='position:absolute; left:"+pop_left+"; top:"+pop_top+"; width:"+pop_width+"px; height:"+pop_height+"px; z-index:9999; visibility:visible;'>   "+
                             "    <div align='center'>  "+
                             "            <table bgcolor='#000' width='"+pop_width+"' border='0' align='center' cellpadding='1' cellspacing='0'> "+
	                         "            <form name='frm1'> "+
                             "                <tr>  "+
                             "                    <td  colspan='3'>" + FlashObject("/flash/20100428.swf", 300, 300) + "</td> "+
                             "                </tr> "+
                             "                <tr bgcolor='#000'>  "+
                             "                    <td width='80%' align='left' height='25'><INPUT type='checkbox' name='check' style='cursor:pointer;' onclick=\"closeWin('"+no_seq+"');\" ><font color='#FFFFFF'>¿À´ÃÇÏ·ç ´Ý±â</font></td> "+
                             "                    <td width='15%' >&nbsp;</td> "+
                             "                    <td width='5%'><a href='javascript:divClose("+no_seq+");'><img src='/popup/images/btn_close.gif' width='11' height='11' border='0'></a></td> "+
                             "                </tr> "+
	                         "		       </form> "+
                             "            </table> "+
                             "    </div> "+
                             "</div>   ");
}


//·£´ýÇÔ¼ö ¸¸µé±â
var num1 ;
var rn_count = 2 ; 
num1 = Math.round(Math.random()* rn_count);

//if(num1 == 1){
//	if(getCookie("pop100527" ) != "checked"){
//		window.open("/popup/20100527.html","pop100527", "left=320, top=0, width=400, height=325,scrollbars=no,resizable=no");
//	}
//}
//else{
//	if(getCookie("pop100602" ) != "checked"){
//		openDiv("pop100602", "320", "0", "250", "561", "20100601.jpg", "/news/view.php?gisa_uniq=20100601191245&key=&page=1&field=&section_code=10", "");
//	}
//}



if(getCookie("pop20100728" ) != "checked"){
	openDiv("pop20100728", "0", "0", "350", "400", "20100728_pop.jpg", "/hboard/hboard.php?bname=T_free&work=read&seq=1549&page=1&key=&field=&snum=1549", "");
}


//´º½º¾Ë¸®¹Ì
//if(getCookie("pop100707" ) != "checked"){
//	openDiv("pop100707", "50", "50", "350", "400", "20100707.jpg", "http://sportalkoreanews.spaceclick.co.kr/news/ap/install.exe", "");
//}
