/******************************************************************************************************************************
* ÀÛ¼ºÀÏ : 2006-11-20
* ÀÛ¼ºÀÚ : ÀåÀç±¹


1. ÆË¾÷¿¡ °ü·ÃµÈ ÆÄÀÏ¸íÀº ¹Ýµå½Ã ³âµµ_¿ù_ÀÏ_½Ã°£.È®ÀåÀÚ ¼øÀ¸·Î ºÙ¿©ÁØ´Ù
		¿¹)2006_11_20.php
		¿¹)2006_11_20_13.php (½Ã°£À» Æ÷ÇÔ)



2. ÀÏ¹ÝÀûÀÎ ÆË¾÷Àº ./popup/default Æú´õ¿¡ DIV ÆË¾÷Àº div Æú´õ¿¡ ÀúÀåÇÑ´Ù.


3. ÆË¾÷¿¡ °øÅëÀûÀ¸·Î »ç¿ëÇÒ ¼ö ÀÖ´Â ÀÌ¹ÌÁö´Â ./popup/images/ ¿¡ ÀúÀåÇÏ°í
   
    ±× ¿Ü´Â ÇØ´ç µð·ºÅÍ¸®/images/ ¿¡ ÀúÀåÇÑ´Ù.




* »ç¿ë¹ý (À©µµ¿ìÆË¾÷ ¶Ç´Â Div ÆË¾÷À» ¶ç¿ì´Â °÷¿¡¼­)
	1. ¹Ýµå½Ã ´ÙÀ½ÀÇ ¸®¼Ò½º¸¦ Æ÷ÇÔÇÒ°Í : $_POST['include_javascript'] = Array('window', 'cook'); 
	2. iframe ÀÎ °æ¿ì ¾Æ·¡ÀÇ ¼Ò½º¸¦ Æ÷ÇÔ ÇÒ°Í

		window.onload = function(){
			var cook = get_cook("20061120");
			if(typeof cook == "undefined" || cook == false || cook < 1){
				var _addr = "../popup/default/2006_11_20.php";
				var _w = 300;
				var _h = 300;
				window_open(_addr, _w, _h, 0);
				document.getElementById("ifrm_popup1").style.display = "block";
			}
		}


		<link rel="stylesheet" type="text/css" href="<?=$_POST['httpd_root_dir']?>/popup/css/popup_css.css" />
		<iframe class="popup_iframe" style="width:537px;height:250px;top:200px;left:200px" id="ifrm_popup1" src="../popup/div/2006_11_20.php" frameborder="0" scrolling="no"></iframe>




* »ç¿ë¹ý (ÆË¾÷ÆÄÀÏ ¿¡¼­)
	1. ¹Ýµå½Ã ´ÙÀ½ÀÇ ¸®¼Ò½º¸¦ Æ÷ÇÔÇÒ°Í : $_POST['include_javascript'] = Array('cook'); 
	2. ¿À´ÃÀº ´Ù½Ã ¿­Áö ¾ÊÀ½À» »ç¿ëÇÒ °æ¿ì ¾Æ·¡ÀÇ ¼Ò½º¸¦ Æ÷ÇÔ ÇÒ°Í

			<link rel="stylesheet" type="text/css" href="<?=$_POST['httpd_root_dir']?>/popup/css/popup_css.css" />

			<div class="div_chk">
					<input type="checkbox" id="chk" name="chk" value="" onclick="check_cook(this, '<?=$form_type?>', '<?=$form_name?>')" />
					<label for="chk">¿À´ÃÀº ´Ù½Ã ¿­Áö ¾ÊÀ½</label>
			</div>
******************************************************************************************************************************/



function set_cook(){
	var expire_date = new Date()
	expire_date = new Date(expire_date.getTime() + (86400000 * arguments[2]));   
	document.cookie = arguments[0] + "=" + escape(arguments[1]) + "; expires=" + expire_date.toGMTString() +"; path=/"; 
}

function get_cook(){
	var _found = false;
	var _start, _end;
	var i = 0 ;
	// cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö 
	while(i <= document.cookie.length){ 
		_start = i;
		_end = _start + arguments[0].length;
		// name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é 
		if(document.cookie.substring(_start, _end) == arguments[0]) { 
			return true;
			break;
		} 
		++i;
	} 
	return _found;
}

function check_cook(){
	var chk = arguments[0];
	var popup_type = document.getElementById("popup_type").value;
	var popup_name = document.getElementById("popup_name").value;
	var cook_name = document.getElementById("cook_name").value;

	if(popup_type == "" || typeof popup_type == "undefined"){
		alert("ÆË¾÷ÀÇ Å¸ÀÔÀÌ ¾ø½À´Ï´Ù");
		arguments[0].checked = false;
		return;
	}

	if(popup_name == "" || typeof popup_name == "undefined"){
		alert("ÆË¾÷ÀÇ ÀÌ¸§ÀÌ ¾ø½À´Ï´Ù");
		arguments[0].checked = false;
		return;
	}


	if(cook_name == "" || typeof cook_name == "undefined"){
		alert("ÄíÅ°ÀÇ ÀÌ¸§ÀÌ ¾ø½À´Ï´Ù");
		arguments[0].checked = false;
		return;
	}

	set_cook(cook_name, 1, 1);

	if(popup_type == "window"){
		window.close();		
	}else if(popup_type == "iframe"){
		parent.document.getElementById(popup_name).style.display = "none";
	}
}	





/****
// ÄíÅ° ÀÐ°í, ¾²±â
function WriteCookie(CName, CValue, CHours, CPath) {
	var Expire = "";
	var Url = "";
	if(CHours != null && CHours != "") {// 1½Ã°£ ´ÜÀ§(3600)
		Expire = new Date((new Date()).getTime() + eval(CHours) * 3600000);
		Expire = "; expires=" + Expire.toGMTString();
	}
	if(CPath != null) {
		Url = "; path=" + CPath;
	}
	else {
		Url = "; path=/";
	}
	document.cookie = CName + "=" + CValue + Url + Expire;
//	document.cookie = CName + "=" + escape( CValue ) + Url + Expire;
}

function ReadCookie(CName) {
	var CookiesArr = document.cookie.split("; ");
	for(i = 0; i < CookiesArr.length; i++) 	{
		var CookieArr, _Name, _Value;
		CookieArr = CookiesArr[i].split("=");
		_Name = CookieArr[0];
		_Value = CookieArr[1];
		if(CName == _Name) {
			return _Value;
		}
	}
	return "";
//	return false;	
}
/**/

