<!--
//============================================================================
//¼±¾ð
//============================================================================
var WaitingDialogLoadCount = 0;
var LocalPath = "/Wait/"
function WaitingDialog(initObj,CreateObj)
{

	//property
	this.m_OpenObject = null;		//Dialog object
	this.m_CreateObjectStr = CreateObj;		//Dialog Create object string
	this.m_OpenType = (initObj != null && typeof initObj.OpenType == "string")? initObj.OpenType : "2";				//Dialog Å¸ÀÔ 1: »õÃ¢, 2:·¹ÀÌ¾î
	//¸Þ½ÃÁö ¹Ú½º ¼³Á¤
	this.m_Msg = (initObj != null && typeof initObj.Msg == "string")? initObj.Msg :"ÁøÇàÁßÀÔ´Ï´Ù.Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä";					//¸Þ½ÃÁö
	this.m_PressImageUrl = (initObj != null && typeof initObj.PressImageUrl == "string")? initObj.PressImageUrl :LocalPath+"/imgLoadingBar.gif";			//ÁøÇà¹Ù ÀÌ¹ÌÁö °æ·Î
	this.m_MsgBoxWidth = (initObj != null && typeof initObj.MsgBoxWidth == "string")? initObj.MsgBoxWidth :"500";			//¸Þ½ÃÁö ¹Ú½º width
	this.m_MsgBoxHeight = (initObj != null && typeof initObj.MsgBoxHeight == "string")? initObj.MsgBoxHeight :"400";			//¸Þ½ÃÁö ¹Ú½º height
	this.m_MsgBoxBackGroundColor = (initObj != null && typeof initObj.MsgBoxBackGroundColor == "string")? initObj.MsgBoxBackGroundColor :"747474";	//¸Þ½ÃÁö ¹Ú½º ¹è°æ»ö
	this.m_MsgBoxBackImageUrl = (initObj != null && typeof initObj.MsgBoxBackImageUrl == "string")? initObj.MsgBoxBackImageUrl :"";		//¸Þ½ÃÁö ¹Ú½º ¹è°æÀÌ¹ÌÁö°æ·Î  
	this.m_MsgBoxFont = (initObj != null && typeof initObj.MsgBoxFont == "string")? initObj.MsgBoxFont :"µ¸¿ò";		//¸Þ½ÃÁö ¹Ú½º ¹è°æÀÌ¹ÌÁö°æ·Î
	this.m_MsgBoxFontSize = (initObj != null && typeof initObj.MsgBoxFontSize == "string")? initObj.MsgBoxFontSize :"9pt";		//¸Þ½ÃÁö ¹Ú½º ¹è°æÀÌ¹ÌÁö°æ·Î
	this.m_MsgBoxFontColor = (initObj != null && typeof initObj.MsgBoxFontColor == "string")? initObj.MsgBoxFontColor :"FFFFFF";		//¸Þ½ÃÁö ¹Ú½º ¹è°æÀÌ¹ÌÁö°æ·Î
	this.m_MsgBoxBorderColor = (initObj != null && typeof initObj.MsgBoxBorderColor == "string")? initObj.MsgBoxBorderColor :"FFFFFF";		//¸Þ½ÃÁö ¹Ú½º ¹è°æÀÌ¹ÌÁö°æ·Î
	//Blind ¼³Á¤
	this.m_BlindColor = (initObj != null && typeof initObj.BlindColor == "string")? initObj.BlindColor :"000000";				//¹è°æ»ö
	this.m_BlindAlpha = (initObj != null && typeof initObj.BlindAlpha == "string")? initObj.BlindAlpha :"10";				//Blind Åõ¸íµµ
	this.m_count =  WaitingDialogLoadCount++; //·¹ÀÌ¾î Áõ°¡¼ö

	//»ç¿ëÀ¯¹« ¼³Á¤
	this.m_PressUseYN = (initObj != null && typeof initObj.PressUseYN == "boolean")? initObj.PressUseYN :false;				//ÁøÇà¹Ù »ç¿ë¿©ºÎ
	this.m_BlindUseYN = (initObj != null && typeof initObj.BlindUseYN == "boolean")? initObj.BlindUseYN :false;				//Blind »ç¿ë¿©ºÎ
	this.m_MsgUseYN = (initObj != null && typeof initObj.MsgUseYN == "boolean")? initObj.MsgUseYN :true;				//¸Þ½ÃÁö »ç¿ë¿©ºÎ
	this.m_CloseTimeUseYN = (initObj != null && typeof initObj.CloseTimeUseYN == "boolean")? initObj.CloseTimeUseYN :true;			//ÀÚµ¿ Á¾·á »ç¿ë¿©ºÎ
	this.m_CloseBtnUseYN = (initObj != null && typeof initObj.CloseBtnUseYN == "boolean")? initObj.CloseBtnUseYN :false;			
	this.m_CloseTime = (initObj != null && typeof initObj.CloseTime == "string")? initObj.CloseTime :"3000";				//Dialog ÀÚµ¿ Á¾·á ½Ã°£ 1000 = 1ÃÊ

	//method
	this.OnOpenWait = OnOpenWait;			//Dialog ¿­±â
	this.OnCloseWait = OnCloseWait;		//Dialog ´Ý±â
	this.WinBodyHTML = WinBodyHTML;	//¸Þ½ÃÁö ³»¿ë
	this.InitMsgLayer = InitMsgLayer;
	this.InitBlindLayer = InitBlindLayer; 
	this.WT_LayerCenter = WT_LayerCenter; //·¹ÀÌ¾î Áß¾Ó Á¤·Ä
	this.CreateLayer	= CreateLayer; //±âº» ·¹ÀÌ¾î »ý¼º
	this.OnOpenWindow	= OnOpenWindow; //·¹ÀÌ¾îÃ¢
	this.TimeID = null;
	//ÃÊ±â»ý¼º
	this.CreateLayer();

}

function CreateLayer()
{
	//¸Þ½ÃÁö 
	var IsWTLayer = document.all["_WT_FLHVIEWLayer_"+this.m_count+""];

	if(typeof IsWTLayer != "object")
	{
		//document.body.insertAdjacentHTML("BeforeEnd" ,this.InitMsgLayer()) ;
		document.write(this.InitMsgLayer());
	}

	//ºí¶óÀÎµå
	var IsWTBlindLayer = document.all["_WT_BlindVIEWLayer_"+this.m_count+""];
	if(typeof IsWTBlindLayer != "object")
		document.write(this.InitBlindLayer());
//		document.body.insertAdjacentHTML("BeforeEnd" ,this.InitBlindLayer()) ;

}
function OnCloseWait()
{
		clearInterval(this.TimeID);
	try{

		if (this.m_OpenType == "2")//·¹ÀÌ¾î
		{
			var IsWTLayer = document.all["_WT_FLHVIEWLayer_"+this.m_count+""];
			IsWTLayer.style.display = "none";


			var EditorDoc	=	this.m_OpenObject.contentWindow.document;
			EditorDoc.open();
			EditorDoc.write(this.WinBodyHTML());
			EditorDoc.close();


			this.m_OpenObject.src="about:blank";
			this.m_OpenObject = null;

		}
		else	//»õÃ¢
		{
			this.m_OpenObject.close(); 
			this.m_OpenObject = null;
		}
		//ºí¶óÀÎµå
		var IsWTBlindLayer = document.all["_WT_BlindVIEWLayer_"+this.m_count+""];
		IsWTBlindLayer.style.display = "none";


	}catch(e){}

}

function OnOpenWait(inData)
{
	//ÀÌ¹Ì ½ÇÇàÁßÀÎ °æ¿ì Ã³¸® ¾ÈÇÔ
	if(this.m_OpenObject != null)
		return;
	if (typeof inData == "string" )
		this.m_Msg = inData;
	if (this.m_OpenType == "2")//·¹ÀÌ¾î
	{

		//Áß¾Ó À§Ä¡
		var rtnObj = new Object();
		var y = screen.availHeight;
		var x = screen.availWidth;
		rtnObj.x = Number((y - this.m_MsgBoxWidth)/2);
		rtnObj.y = Number((x - this.m_MsgBoxHeight)/2);
		var IsWTLayer = document.all["_WT_FLHVIEWLayer_"+this.m_count+""];
		this.WT_LayerCenter();

		this.m_OpenObject = document.all["_WT_MSGVIEWIfr_"+this.m_count+""];
		try{
		var EditorDoc	=	this.m_OpenObject.contentWindow.document;
		EditorDoc.open();
		EditorDoc.write(this.WinBodyHTML());
		EditorDoc.close();
		}catch(e){}
	}
	else	//»õÃ¢
	{
		this.m_OpenObject = window.showModelessDialog(LocalPath+"/loading.htm",this,"dialogHeight:"+ this.m_MsgBoxHeight +"px;dialogWidth:"+ this.m_MsgBoxWidth +"px;scroll:0;center:1;status:0;help:no;");
		try{
		var EditorDoc	=	this.m_OpenObject.document;
		EditorDoc.open();
		EditorDoc.write(this.WinBodyHTML());
		EditorDoc.close();
		}catch(e){}
	}


	if(this.m_BlindUseYN )//Blind
	{
		var IsWTBlindLayer = document.all["_WT_BlindVIEWLayer_"+this.m_count+""];
		if (typeof IsWTBlindLayer == "object")
		{
			IsWTBlindLayer.style.setExpression("width", "(document.body.offsetWidth < document.body.scrollWidth)?document.body.scrollWidth :document.body.offsetWidth  "); 
			IsWTBlindLayer.style.setExpression("height", "(document.body.offsetHeight < document.body.scrollHeight)?document.body.scrollHeight :document.body.offsetHeight  ");
			IsWTBlindLayer.style.display =  "block";
		}
	}

	if((this.m_CloseTimeUseYN && this.m_CloseTime != "" && this.m_CreateObjectStr != "") || (typeof inData == "number" )) //ÀÚµ¿ ´ÝÈû
	{	
		if ( typeof inData == "number")
			this.TimeID = setInterval(this.m_CreateObjectStr + ".OnCloseWait()",inData);
		else
			this.TimeID = setInterval(this.m_CreateObjectStr + ".OnCloseWait()",this.m_CloseTime);
	}

}

function OnOpenWindow(inURL)
{
	//ÀÌ¹Ì ½ÇÇàÁßÀÎ °æ¿ì Ã³¸® ¾ÈÇÔ
	if(this.m_OpenObject != null)
		return;


	if (this.m_OpenType == "2")//·¹ÀÌ¾î
	{
		//Áß¾Ó À§Ä¡
		var rtnObj = new Object();
		var y = screen.availHeight;
		var x = screen.availWidth;
		rtnObj.x = Number((y - this.m_MsgBoxWidth)/2);
		rtnObj.y = Number((x - this.m_MsgBoxHeight)/2);
		var IsWTLayer = document.all["_WT_FLHVIEWLayer_"+this.m_count+""];
		this.WT_LayerCenter();

		this.m_OpenObject = document.all["_WT_MSGVIEWIfr_"+this.m_count+""];
		if(inURL != "")
		{
			try{
			this.m_OpenObject.src=inURL;
			}catch(e){}
		}
	}
	else	//»õÃ¢
	{
		this.m_OpenObject = window.showModelessDialog(inURL,this,"dialogHeight:"+ this.m_MsgBoxHeight +"px;dialogWidth:"+ this.m_MsgBoxWidth +"px;scroll:0;center:1;status:0;help:no;");
	}

	if(this.m_BlindUseYN )//Blind
	{
		var IsWTBlindLayer = document.all["_WT_BlindVIEWLayer_"+this.m_count+""];
		if (typeof IsWTBlindLayer == "object")
		{
			IsWTBlindLayer.style.setExpression("width", "(document.body.offsetWidth < document.body.scrollWidth)?document.body.scrollWidth :document.body.offsetWidth  "); 
			IsWTBlindLayer.style.setExpression("height", "(document.body.offsetHeight < document.body.scrollHeight)?document.body.scrollHeight :document.body.offsetHeight  ");
			IsWTBlindLayer.style.display =  "block";
		}
	}
	if((this.m_CloseTimeUseYN && this.m_CloseTime != "" && this.m_CreateObjectStr != "") ) //ÀÚµ¿ ´ÝÈû
	{	
		if ( typeof inData == "number")
			this.TimeID = setInterval(this.m_CreateObjectStr + ".OnCloseWait()",inData);
		else
			this.TimeID = setInterval(this.m_CreateObjectStr + ".OnCloseWait()",this.m_CloseTime);
	}

}
function InitMsgLayer()
{
	var topVal = "5";
	var rtnDivStr	= "";

	if (this.m_CloseBtnUseYN)
	{
		rtnDivStr	+= "<DIV ID='_WT_FLHVIEWLayer_"+this.m_count+"' style='width:"+ this.m_MsgBoxWidth +";height:"+ this.m_MsgBoxHeight +";position:absolute;z-index:1001;overflow:hidden;border:3px solid #cccccc;'  ondragstart='return false' onselectstart='return false' style='display:none;text-align:center' !style='FILTER:progid:DXImageTransform.Microsoft.Glow(color="+this.m_MsgBoxBorderColor+",strength=1); '>";
		topVal = "25";
		rtnDivStr	+= "<table width=100% height=18 cellpadding=0 cellspacing=0 border=0 ><tr>";
		rtnDivStr	+= "<td  style='filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#929292, EndColorStr=#D8D8D8);' style='padding: 0 3 0 3 ' align=right  width=100% >";
		rtnDivStr	+= "<table width='100%' border='0' cellspacing='1' cellpadding='0' height='15'>";
		rtnDivStr	+= "<tr>";
		rtnDivStr	+= "<td align='right'><img src='" + LocalPath+"btn_close.gif' width=15 align=absmiddle style='cursor:hand' onclick='"+this.m_CreateObjectStr + ".OnCloseWait();"+"' ></td>";
		rtnDivStr	+= "</tr>";
		rtnDivStr	+= "</table>";
		rtnDivStr	+= "</td>";
		rtnDivStr	+= "</tr>";
		rtnDivStr	+= "</table>";
	}
	else
	{

		rtnDivStr	+= "<DIV ID='_WT_FLHVIEWLayer_"+this.m_count+"' style='width:"+ this.m_MsgBoxWidth +";height:"+ this.m_MsgBoxHeight +";position:absolute;z-index:1001;overflow:hidden;border:0px solid #cccccc;'  ondragstart='return false' onselectstart='return false' style='display:none;text-align:center' !style='FILTER:progid:DXImageTransform.Microsoft.Glow(color="+this.m_MsgBoxBorderColor+",strength=1); '>";
	}

	rtnDivStr	+= "<table width=100% height=100% cellpadding=0 cellspacing=0 border=0 >";
	rtnDivStr	+= "<DIV ID='_WT_MSGVIEWLayer' style='width:"+ Number(this.m_MsgBoxWidth - 10) +";height:"+ Number(this.m_MsgBoxHeight -10) + ";position:absolute;z-index:1001;top:"+topVal+";text-align:center'>";
	rtnDivStr	+= "<iframe src='"+LocalPath+"/loading.htm' id='_WT_MSGVIEWIfr_"+this.m_count+"' name='_WT_MSGVIEWIfr_"+this.m_count+"' ALLOWTRANSPARENCY='true' width='"+ Number(this.m_MsgBoxWidth - 15) +"' height='"+  Number(this.m_MsgBoxHeight -15) + "' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></iframe>";
	rtnDivStr	+= "</DIV>";	
	rtnDivStr	+= "<tr>";
	if (this.m_MsgBoxBackGroundColor != "")
		rtnDivStr	+= "<td align=center bgcolor="+this.m_MsgBoxBackGroundColor+">";
	else
		rtnDivStr	+= "<td align=center >";
//	rtnDivStr	+= "<EMBED src='"+LocalPath+"/WaitingBox.swf?color="+this.m_MsgBoxBackGroundColor+"&op=100&obj=msgbox' width=100% height=100% type=application/x-shockwave-flash wmode='transparent'  id='_LT_FLHVIEW'></EMBED>";
	rtnDivStr	+= "</td>";
	rtnDivStr	+= "</tr>";
	rtnDivStr	+= "</table>";
	rtnDivStr	+= "</DIV>";
	return rtnDivStr;
}
function InitBlindLayer()
{
	var rtnDivStr	= "";
	rtnDivStr	+= "<DIV ID='_WT_BlindVIEWLayer_"+this.m_count+"' style='width:"+ document.body.clientWidth +";height:"+ document.body.clientHeight +";position:absolute;z-index:1000;overflow:hidden;top:0;left:0'  ondragstart='return false' onselectstart='return false' style='display:none' style='filter: alpha(opacity="+this.m_BlindAlpha+");background-color:"+this.m_BlindColor+"'>";
	rtnDivStr	+= "<table width=100% height=100% cellpadding=0 cellspacing=0 border=0 >";
	rtnDivStr	+= "<tr>";
	rtnDivStr	+= "<td align=center >";
	rtnDivStr	+= "<iframe src='"+LocalPath+"/loading.htm' width=100% height=100%  topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' frameborder='0' scrolling='no' id='_WT_BlindVIEWIfr_"+this.m_count+"' style='filter: alpha(opacity=0);'></iframe>";
	rtnDivStr	+= "</td>";
	rtnDivStr	+= "</tr>";
	rtnDivStr	+= "</table>";
	rtnDivStr	+= "</DIV>";
	return rtnDivStr;
}

function WinBodyHTML()
{
	var winmsg = "";
	winmsg +='<title>Waiting¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡</title>';
	winmsg +='<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" style="background-color:transparent" oncontextmenu="javascript:return false" ondragstart="javascript:return false" onselectstart="javascript:return false">';
	winmsg +='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="'+this.m_MsgBoxBackGroundColor+'" style="background-image:url('+this.m_MsgBoxBackImageUrl+');font-size:'+this.m_MsgBoxFontSize+';font-family:'+this.m_MsgBoxFont+';color:'+this.m_MsgBoxFontColor+';">';
	if(this.m_MsgUseYN)//¸Þ½ÃÁö »ç¿ë
	{
		winmsg +='<tr height="80%">';
		winmsg +='<td align="center">';
		winmsg +=this.m_Msg;
		winmsg +='</td>';
		winmsg +='</tr>';
	}

	if(this.m_PressUseYN && this.m_PressImageUrl != "")//»óÅÂ¹Ù »ç¿ë
	{
		winmsg +='<tr>';
		winmsg +='<td align="center">';
		winmsg +='<img src="'+ this.m_PressImageUrl +'" >';
		winmsg +='</td>';
		winmsg +='</tr>';
	}
	winmsg +='</table>';
	winmsg +='</body>';
	return winmsg;
}
function WT_LayerCenter()
{

	var IsWTLayer = document.all["_WT_FLHVIEWLayer_"+this.m_count+""];
	//À§Ä¡ ¼³Á¤
	IsWTLayer.style.setExpression("left", "(document.body.clientWidth+document.body.scrollLeft)/2 - document.all['_WT_FLHVIEWLayer_"+this.m_count+"'].offsetWidth/2"); // ·¹ÀÌ¾îÀÇ x Ãà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	IsWTLayer.style.setExpression("top", "(document.body.clientHeight)/2 +document.body.scrollTop - document.all['_WT_FLHVIEWLayer_"+this.m_count+"'].offsetHeight/2"); // ·¹ÀÌ¾îÀÇ yÃà À§Ä¡¸¦ ¼³Á¤ ÇÕ´Ï´Ù
	IsWTLayer.style.display = "block";
}

//-->