<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#Layer1_close {
	position:absolute;
	left:238px;
	top:7px;
	width:18px;
	height:17px;
	z-index:4;
}
</style>
<script language="javascript" src="js/comm.js" type="text/javascript"></script>
<script language="javascript">
// import js document
	_import("product");_import("function");
	
	
	_import("webmenuevent");
	_import("control");
</script>
<body style="overflow:hidden;" onkeydown="try{return testCode(event.keyCode)}catch(e){}">
<div id="Layer1_close" style="display:none;">
<div style="cursor:hand;" onClick="window.external.OnOK();" onMouseOver="changeSubImgTo(this,'pic/close_red.gif')" onMouseOut="changeSubImgTo(this,'pic/close_blue.gif')"><img src="pic/close_blue.gif" ondragstart="changeSubImgTo(this.parentNode,'pic/close_blue.gif');return false;" width="16" height="16" /></div></div>
<table width="265" border="0" cellspacing="0" cellpadding="0" id="boxwidth">
  <tr>
    <td background="images/alert_msg_r1_c5.jpg" onMouseDown="moveWindow();"><table width="165" height="29" border="0" cellpadding="0" cellspacing="0">
      <tr>
	  <script language="javascript">
	  	document.write('<td width="165" background="images/'+FarstoneProductFlag+"/"+langType+'_alert_msg_r1_c1.jpg" style="background-repeat:no-repeat;">&nbsp;</td>')
	  </script>
	  </tr>
    </table></td>
    <td align="right" background="images/alert_msg_r1_c5.jpg" onMouseDown="moveWindow();"><table width="30%" height="29" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td style="background-image:url(images/alert_msg_top_right.jpg); background-repeat:no-repeat; background-position:right;">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><img src="images/alert_msg_r4_c1.jpg" width="9" height="6" /></td>
        <td><img src="" width="1" height="1" alt="" /></td>
        <td align="right" valign="top"><img src="images/alert_msg_r4_c11.jpg" width="9" height="6" /></td>
      </tr>
    </table>
        <table width="100%" height="100" border="0" cellpadding="0" cellspacing="0" id="boxheight">
          <tr>
            <td width="10" align="left" valign="bottom" background="images/alert_msg_r5_c1.jpg" style="background-position:left; background-repeat:repeat-y;">&nbsp;</td>
            <td style="background-repeat:repeat-x; background-position:bottom;">
			<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" id="msgTextTable">
                <tr>
                  <td width="50" align="center" valign="top" ><img id="iconShow" src="images/spacer.gif" width="34" height="34" /></td>
                  <td class="arial12pinkbold" style="padding-left:10px;" id="fontcolortd"><span id="rit_msg">&nbsp;</span></td>
                </tr>
                <tr> 
                  <td colspan="2" align="center" style="padding-top:10px;">
				  <div style="height:21px; display:none;" class="Arial12black" id="button_ok">
				  <button id="alert_button_ok_ok" cstyle="rit"  style="display:none;" onClick="window.external.OnOK();">OK</button>
				  </div>
				  
				  <div style="height:21px; display:none;" class="Arial12black"  id="button_yesorno">
				  	<button id="alert_button_yesno_yes" cstyle="rit"  style="display:none;" onClick="setSD('yes')">Yes</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_yesno_no" cstyle="rit"  style="display:none;" onClick="setSD('no')">No</button>
				  </div>
				  
				  <div style="height:21px; display:none;" class="Arial12black"  id="button_okcancel">
				  	<button id="alert_button_okcancel_ok" cstyle="rit"  style="display:none;" onClick="setSD('yes')">OK</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_okcancel_cancel" cstyle="rit"  style="display:none;" onClick="setSD('no')">Cancel</button>
				  </div>
				  
				  <div style="height:21px; display:none;" class="Arial12black"  id="button_tryagain">
				  	<button id="alert_button_tryagaincancel_tryagain" cstyle="rit"  style="display:none;" onClick="setSD('yes')">Try again</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_tryagaincancel_cancel" cstyle="rit"  style="display:none;" onClick="setSD('no')">Cancel</button>
				  </div>
				  
				  <div style="height:21px; display:none;" class="Arial12black"  id="button_continuecancel">
				  	<button id="alert_button_continuecancel_continue" cstyle="rit"  style="display:none;" onClick="setSD('yes')">Continue</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_continuecancel_cancel" cstyle="rit"  style="display:none;" onClick="setSD('no')">Cancel</button>
				  </div>
				  
				  	<div style="height:21px; display:none;" class="Arial12black" id="button_terminatecontinue">
				  	<button id="alert_button_terminatecontinue_terminate" cstyle="rit"  style="display:none;" onClick="setSD('yes')">Continue</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_terminatecontinue_continue" cstyle="rit"  style="display:none;" onClick="setSD('no')">Cancel</button>
				  </div>
				  
				  <div style="height:21px; display:none;" class="Arial12black" id="button_deletecancel">
				  	<button id="alert_button_deletecancel_delete" cstyle="rit"  style="display:none;" onClick="setSD('yes')">Continue</button>&nbsp;&nbsp;&nbsp;
					<button id="alert_button_deletecancel_cancel" cstyle="rit"  style="display:none;" onClick="setSD('no')">Cancel</button>
				  </div>	
				  			  </td>
                </tr>
            </table></td>
            <td width="10" align="right" valign="bottom" background="images/alert_msg_r5_c10.jpg" style="background-position:right; background-repeat:repeat-y;">&nbsp;</td>
          </tr>
        </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="5%" valign="top" background="images/alert_msg_bottom_center.jpg" style="background-position:top; background-repeat:repeat-x;"><img src="images/alert_msg_bottom_left.jpg" width="9" height="12" /></td>
            <td width="90%" background="images/alert_msg_bottom_center.jpg" style="background-position:top; background-repeat:repeat-x;">&nbsp;</td>
            <td width="5%" align="right" valign="top" background="images/alert_msg_bottom_center.jpg" style="background-position:top; background-repeat:repeat-x;"><img src="images/alert_msg_bottom_right.jpg" width="9" height="12" /></td>
          </tr>
      </table></td>
  </tr>
</table>
<script language="jscript">
var isMove=true;
var leftButtonId="";
var rightButtonId="";
function moveWindow() {
	if (isMove) {
		window.external.OnMoveWindow();
	}
}
document.body.onload=function() {
	applyButton();
	document.getElementById("Layer1_close").style.display="";
	document.getElementById("Layer1_close").style.left=(Request("width")-26)+"px";
	
	$("alert_button_ok_ok").setValue(GS_Back("Button_OK")+"&nbsp;");
	$("alert_button_yesno_yes").setValue(GS_Back("Button_Yes")+"&nbsp;");
	$("alert_button_yesno_no").setValue(GS_Back("Button_No")+"&nbsp;");
	$("alert_button_okcancel_ok").setValue(GS_Back("Button_OK")+"&nbsp;");
	$("alert_button_okcancel_cancel").setValue(GS_Back("Button_Cancel")+"&nbsp;");
	$("alert_button_tryagaincancel_tryagain").setValue(GS_Back("Button_try_again")+"&nbsp;");
	$("alert_button_tryagaincancel_cancel").setValue(GS_Back("Button_Cancel")+"&nbsp;");
	$("alert_button_continuecancel_continue").setValue(GS_Back("Button_Continue")+"&nbsp;");
	$("alert_button_continuecancel_cancel").setValue(GS_Back("Button_Cancel")+"&nbsp;");
	$("alert_button_terminatecontinue_terminate").setValue(GS_Back("Button_Terminate")+"&nbsp;");
	$("alert_button_terminatecontinue_continue").setValue(GS_Back("Button_Continue")+"&nbsp;");
	$("alert_button_deletecancel_delete").setValue(GS_Back("Button_Delete")+"&nbsp;");
	$("alert_button_deletecancel_cancel").setValue(GS_Back("Button_Cancel")+"&nbsp;");
	
	var msgStr1=window.external.GetStaticData();
	window.external.SetStaticData("");
	msgStr1=msgStr1.replace("[|L]","\/")
	msgStr1=msgStr1.replace("[|R]","\\")
	msgStr1=unescape(msgStr1);
	if(/[^(\s\(\))]{21}/.test(msgStr1))
	{
		//var tmpChangeStr;
		//tmpChangeStr=msgStr1.match(/[^(\s\(\))]{20}/g);
		//for (i=0;i<tmpChangeStr.length;i++)
		//{
			//msgStr1=msgStr1.replace(tmpChangeStr[i],tmpChangeStr[i]+" ");
		//}

	}
	
	if (Request("msgtype")=="info")
	{
		document.getElementById("iconShow").src="images/alert_icon_info.jpg"
		document.getElementById("fontcolortd").className="Arial12Lightbluebold";
		document.getElementById("button_ok").style.display="block";
		//document.getElementById("okButtonFocus").focus();
		leftButtonId="okButtonFocus";
		rightButtonId="okButtonFocus";
	}
	else if (Request("msgtype")=="custom")
	{
		var btval=Request("btval");
		var btvalArr = btval.split("||");
		if(btvalArr.length==1)
		{
			document.getElementById("alert_button_ok_ok").setValue(btval);
			document.getElementById("iconShow").src="images/alert_icon_info.jpg"
			document.getElementById("fontcolortd").className="arial12pinkbold";
			document.getElementById("button_ok").style.display="block";			
		}
		else
		{
			$("alert_button_yesno_yes").setValue(btvalArr[0]);
			$("alert_button_yesno_no").setValue(btvalArr[1]);
			document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
			document.getElementById("fontcolortd").className="Arial12blackbold";
			document.getElementById("button_yesorno").style.display="block";
		}
		//document.getElementById("okButtonFocus").focus();
		leftButtonId="okButtonFocus";
		rightButtonId="okButtonFocus";
	}
	else if (Request("msgtype")=="alert")
	{
		document.getElementById("iconShow").src="images/alert_icon_error.jpg"
		document.getElementById("fontcolortd").className="arial12pinkbold";
		document.getElementById("button_ok").style.display="block";
		//document.getElementById("okButtonFocus").focus();
		leftButtonId="okButtonFocus";
		rightButtonId="okButtonFocus";
	}
	else if (Request("msgtype")=="confirm")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_yesorno").style.display="block";
		//document.getElementById("yesNoButtonFocus").focus();
		leftButtonId="yesNoButtonFocus";
		rightButtonId="yesNoButtonFocus2";
		
		window.external.SetStaticData("no");
	}
	else if (Request("msgtype")=="okcancel")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_okcancel").style.display="block";
		//document.getElementById("okCancelButtonFocus").focus();
		leftButtonId="okCancelButtonFocus";
		rightButtonId="okCancelButtonFocus2";
		
		window.external.SetStaticData("no");
	}
	else if (Request("msgtype")=="tryagain")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_tryagain").style.display="block";
		//document.getElementById("tryagainButtonFocus").focus();
		leftButtonId="tryagainButtonFocus";
		rightButtonId="tryagainButtonFocus2";
		
		window.external.SetStaticData("no");
	}
	else if (Request("msgtype")=="continuecancel")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_continuecancel").style.display="block";
		//document.getElementById("continuecancelButtonFocus").focus();
		leftButtonId="continuecancelButtonFocus";
		rightButtonId="continuecancelButtonFocus2";
		
		window.external.SetStaticData("no");
	}
	
	else if (Request("msgtype")=="terminatecontinue")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_terminatecontinue").style.display="block";
		//document.getElementById("continuecancelButtonFocus").focus();
		leftButtonId="terminatecontinueButtonFocus";
		rightButtonId="terminatecontinueButtonFocus2";
		
		window.external.SetStaticData("no");
	}
	else if (Request("msgtype")=="deletecancel")
	{
		document.getElementById("iconShow").src="images/alert_icon_warm.JPG"
		document.getElementById("fontcolortd").className="Arial12blackbold";
		document.getElementById("button_deletecancel").style.display="block";
		//document.getElementById("continuecancelButtonFocus").focus();
		leftButtonId="deletecancelButtonFocus";
		rightButtonId="deletecancelButtonFocus2";
		
		window.external.SetStaticData("no");
	}	
	
	document.getElementById("boxwidth").width=Request("width");
	document.getElementById("boxheight").height=Request("height")-47;
	
	document.getElementById("rit_msg").innerHTML=msgStr1;
	
	
}
function testCode(id) {
	if(id==32) { return false; }
	if (id==37) {
		var leftbtobj=document.getElementById(leftButtonId);
		if (leftbtobj!=null) {
			leftbtobj.focus();
		}
	}
	else if(id==39) {
		var leftbtobj=document.getElementById(rightButtonId);
		if (leftbtobj!=null) {
			leftbtobj.focus();
		}
	}
}
function setSD(str) { 	window.external.SetStaticData(str);window.external.OnOK(); }

function changeSubImgTo(parentNodeObj,url)
{
	var childNodesArray=parentNodeObj.childNodes;
	if (childNodesArray[0].src!=url)
	{
		childNodesArray[0].src=url;
	}
}
</script>
</body>