function opacityDivInit()
{
	var opacityDiv = null;
	var popupBoxDiv = null;

	if(!document.getElementById("opacityDiv")) 
	{
		opacityDiv = document.createElement('div');
		opacityDiv.id = "opacityDiv";		
		document.body.appendChild(opacityDiv);				
	}

	opacityDiv = document.getElementById("opacityDiv");

	opacityDiv.style.height = document.body.scrollHeight;
	opacityDiv.style.width = document.body.scrollWidth;
	opacityDiv.style.zIndex = "1000";
	opacityDiv.style.position = "absolute";
	opacityDiv.style.left = 0;
	opacityDiv.style.top = 0;		
	opacityDiv.style.background = "black";		
	opacityDiv.style.filter = "alpha(opacity=40, style=2, finishopacity=70)";		
	opacityDiv.style.display = "none";		

	if(!document.getElementById("popupBoxDiv")) 
	{
		popupBoxDiv = document.createElement('div');
		popupBoxDiv.id = "popupBoxDiv";		
		document.body.appendChild(popupBoxDiv);				
	}

	opacityDiv = document.getElementById("opacityDiv");
	popupBoxDiv = document.getElementById("popupBoxDiv");

	popupBoxDiv.style.top = 0;
	popupBoxDiv.style.height = "100%";
	popupBoxDiv.style.width = "100%";
	popupBoxDiv.style.zIndex = "1001";
	popupBoxDiv.style.position = "absolute";
	popupBoxDiv.style.display = "none";		


	popupBoxDiv.innerHTML = creagePopUpBox();
}

function startPopup(strTitle, strContents, callBackOk, callBackCancel, strOkBtn, strCancelBtn) {

	opacityDivInit();

	var opacityDiv = document.getElementById("opacityDiv");
	var popupBoxDiv = document.getElementById("popupBoxDiv");
	var btnClose = document.getElementById("popup_btn_close");
	var btnOk = document.getElementById("popup_btn_ok");
	var btnCancel = document.getElementById("popup_btn_cancel");
	var popup_title = document.getElementById("popup_title");
	var popup_contents = document.getElementById("popup_contents");
	var popup_btn_ok_str = document.getElementById("popup_btn_ok_str");
	var popup_btn_cancel_str = document.getElementById("popup_btn_cancel_str");


	popup_title.innerHTML = strTitle;
	popup_contents.innerHTML = strContents;
	popup_btn_ok_str.innerHTML = strOkBtn;
	popup_btn_cancel_str.innerHTML = strCancelBtn;
	
	opacityDiv.style.display = "block";		
	popupBoxDiv.style.display = "block";	


	btnClose.onclick = function()
	{
		opacityDiv.style.display = "none";		
		popupBoxDiv.style.display = "none";	
	}

	btnOk.onclick = function()
	{
		callBackOk();
		opacityDiv.style.display = "none";		
		popupBoxDiv.style.display = "none";	
	}

	btnCancel.onclick = function()
	{
		callBackCancel();
		opacityDiv.style.display = "none";		
		popupBoxDiv.style.display = "none";	
	}	
}

function creagePopUpBox() {
	var strHTML = "";
	strHTML +='<table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">';
	strHTML +='	<tr>';
	strHTML +='		<td align="center">';
	strHTML +='			<table width="334" border="0" cellspacing="0" cellpadding="0" >';
	strHTML +='				<tr>';
	strHTML +='					<td width="10"><img src="http://www.cookfile.co.kr/images/popup_box_p_head_l.gif" width="10" height="30"></td>';
	strHTML +='					<td valign="bottom" background="http://www.cookfile.co.kr/images/popup_box_p_head_bg.gif">';
	strHTML +='						<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	strHTML +='							<tr>';
	strHTML +='								<td id="popup_title" height="22" align="left" style="filter : dropshadow(color=#ffffff, offx=1, offy=1, positive=1); font-family:µ¸¿ò,±¼¸²,tahoma; font-size:8pt; letter-spacing:-1px; color:#222222; padding= 3 0 0 8;"></td>';
	strHTML +='								<td align="right" valign="top"><img style="cursor:pointer;" id="popup_btn_close" src="http://www.cookfile.co.kr/images/popup_box_p_head_x.gif" width="23" height="15" border="0"></td>';
	strHTML +='					 		</tr>';
	strHTML +='						</table>';
	strHTML +='					</td>';
	strHTML +='					<td width="10"><img src="http://www.cookfile.co.kr/images/popup_box_p_head_r.gif" width="10" height="30"></td>';
	strHTML +='		 		</tr>';
	strHTML +='				<tr>';
	strHTML +='					<td width="10" background="http://www.cookfile.co.kr/images/popup_box_p_side_l.gif"></td>';
	strHTML +='					<td bgcolor="FAFAFA" style="BACKGROUND-IMAGE: url(http://www.cookfile.co.kr/images/popup_box_p_bg.gif); BACKGROUND-POSITION: top; BACKGROUND-REPEAT: repeat-x;">';
	strHTML +='						<table width="100%" border="0" cellspacing="8" cellpadding="0">';
	strHTML +='							<tr>';
	strHTML +='								<td>';
	strHTML +='									<table width="100%" border="0" cellpadding="0" cellspacing="0">';
	strHTML +='										<tr>';
	strHTML +='											<td width="4" height="4"><img src="http://www.cookfile.co.kr/images/popup_box_p_inbox_head_l.gif" width="4" height="4"></td>';
	strHTML +='											<td height="4" background="http://www.cookfile.co.kr/images/popup_box_p_inbox_head_bg.gif"></td>';
	strHTML +='											<td width="4" height="4"><img src="http://www.cookfile.co.kr/images/popup_box_p_inbox_head_r.gif" width="4" height="4"></td>';
	strHTML +='								 		</tr>';
	strHTML +='										<tr>';
	strHTML +='											<td width="4" background="http://www.cookfile.co.kr/images/popup_box_p_inbox_side_l.gif"></td>';
	strHTML +='											<td height="80" id="popup_contents"  style="filter : dropshadow(color=#ffffff, offx=1, offy=1, positive=1); font-family:±¼¸²,tahoma; font-size:9pt; color:#222222; padding= 3 0 0 3;" align="center">												';
	strHTML +='											</td>';
	strHTML +='											<td width="4" background="http://www.cookfile.co.kr/images/popup_box_p_inbox_side_r.gif"></td>';
	strHTML +='								 		</tr>';
	strHTML +='										<tr>';
	strHTML +='											<td width="4" height="4"><img src="http://www.cookfile.co.kr/images/popup_box_p_inbox_foot_l.gif" width="4" height="4"></td>';
	strHTML +='											<td height="4" background="http://www.cookfile.co.kr/images/popup_box_p_inbox_foot_bg.gif"></td>';
	strHTML +='											<td width="4" height="4"><img src="http://www.cookfile.co.kr/images/popup_box_p_inbox_foot_r.gif" width="4" height="4"></td>';
	strHTML +='								 		</tr>';
	strHTML +='									</table>';
	strHTML +='								</td>';
	strHTML +='					 		</tr>';
	strHTML +='							<tr>';
	strHTML +='								<td align="center">';
	strHTML +='									<table border="0" cellspacing="0" cellpadding="0">';
	strHTML +='										<tr>';
	strHTML +='											<!-- loop -->';
	strHTML +='											<td style="padding= 0 2 0 2;">';
	strHTML +='												<table id="popup_btn_ok" border="0" cellspacing="0" cellpadding="0" style="word-break:break-all; cursor:hand;">';
	strHTML +='													<tr>';
	strHTML +='														<td><img src="http://www.cookfile.co.kr/images/popup_box_p_button_l.gif" width="3" height="22"></td>';
	strHTML +='														<td background="http://www.cookfile.co.kr/images/popup_box_p_button_bg.gif" style="filter : dropshadow(color=#ffffff, offx=1, offy=1, positive=1); font-family:µ¸¿ò,±¼¸²,tahoma; font-size:8pt; letter-spacing:-1px; color:#6256C4; font-weight:bold; padding= 3 5 0 5;" id="popup_btn_ok_str"></td>';
	strHTML +='														<td><img src="http://www.cookfile.co.kr/images/popup_box_p_button_r.gif" width="3" height="22"></td>';
	strHTML +='													</tr>';
	strHTML +='												</table>';
	strHTML +='											</td>';
	strHTML +='											<!-- loop -->';
	strHTML +='											<td style="padding= 0 2 0 2;">';
	strHTML +='												<table id="popup_btn_cancel" border="0" cellspacing="0" cellpadding="0" style="word-break:break-all; cursor:hand;">';
	strHTML +='													<tr>';
	strHTML +='														<td><img src="http://www.cookfile.co.kr/images/popup_box_p_button_l.gif" width="3" height="22"></td>';
	strHTML +='														<td background="http://www.cookfile.co.kr/images/popup_box_p_button_bg.gif" style="filter : dropshadow(color=#ffffff, offx=1, offy=1, positive=1); font-family:µ¸¿ò,±¼¸²,tahoma; font-size:8pt; letter-spacing:-1px; color:#6256C4; font-weight:bold; padding= 3 5 0 5;" id="popup_btn_cancel_str"></td>';
	strHTML +='														<td><img src="http://www.cookfile.co.kr/images/popup_box_p_button_r.gif" width="3" height="22"></td>';
	strHTML +='													</tr>';
	strHTML +='												</table>';
	strHTML +='											</td>';
	strHTML +='										</tr>';
	strHTML +='									</table>';
	strHTML +='								</td>';
	strHTML +='					 		</tr>';
	strHTML +='							</table>';
	strHTML +='						</td>';
	strHTML +='					<td width="10" background="http://www.cookfile.co.kr/images/popup_box_p_side_r.gif"></td>';
	strHTML +='		 		</tr>';
	strHTML +='				<tr>';
	strHTML +='					<td width="10" height="10"><img src="http://www.cookfile.co.kr/images/popup_box_p_foot_l.gif" width="10" height="10"></td>';
	strHTML +='					<td height="10" background="http://www.cookfile.co.kr/images/popup_box_p_foot_bg.gif"></td>';
	strHTML +='					<td width="10" height="10"><img src="http://www.cookfile.co.kr/images/popup_box_p_foot_r.gif" width="10" height="10"></td>';
	strHTML +='		 		</tr>';
	strHTML +='			</table>';
	strHTML +='		</td>';
	strHTML +='	</tr>';
	strHTML +='</table>';
	return strHTML;
}

function creagePopUpBoxLogin() {
	var strHTML = "";
	strHTML +='<iframe id="execFrameLoginPopup" name="execFrameLoginPopup" src="about:blank;" width="0" height="0"></iframe>';
	strHTML +='<form method="post" action="/login/" name="login_form_popup" target="execFrameLoginPopup">';
	strHTML +='<input type="hidden" name="todo" value="login_exec">';
	strHTML +='<input type="hidden" name="backurl" value="">';
	strHTML +='<table border="0" align="center" cellpadding="0" cellspacing="5">';
	strHTML +='	<tr>';
	strHTML +='		<td><img src="http://www.cookfile.co.kr/images/popup_box_p_text_id.gif" width="49" height="19"></td>';
	strHTML +='		<td><input type="text" name="userid" class="input" style="width:130px; height:18px;" value=""  tabindex="100"></td>';
	strHTML +='		<td width="42" rowspan="2"><img src="http://www.cookfile.co.kr/images/popup_box_p_button_login.gif" width="42" height="44" border="0" tabindex="103" id="popup_btn_login" style="cursor:pointer;"></a></td>';
	strHTML +='	</tr>';
	strHTML +='	<tr>';
	strHTML +='		<td><img src="http://www.cookfile.co.kr/images/popup_box_p_text_pw.gif" width="49" height="19"></td>';
	strHTML +='		<td><input type="password" name="userpw" class="input" style="width:130px; height:18px;"  tabindex="101"></td>';
	strHTML +='	</tr>';
	strHTML +='	<tr>';
	strHTML +='		<td colspan="3" style="padding:0 0 0 50"><input name="flag_saveid" value="1"  type="checkbox" class="no"><img src="http://www.cookfile.co.kr/images/text_idsave.gif" width="49" height="10" align="absmiddle"></td>';
	strHTML +='	</tr>';
	strHTML +='</table>';
	strHTML +='</form>';
	return strHTML;
}