<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#Layer1_close {
	position:absolute;
	left:376px;
	top:7px;
	width:18px;
	height:17px;
	z-index:4;
}
</style>
<script language="javascript" src="js/comm.js" type="text/javascript"></script>
<script language="javascript" src="aol.js" type="text/javascript"></script>
<script language="javascript">
// import js document
	_import("product");_import("function");
	
	
	//_import("webmenuevent");
	_import("control");
</script>

<script language="javascript">
var XRA=new xmlResourceAgent("mainctl.xml",langType);

</script>

<body style="overflow:hidden;" onkeydown="return testCode(event.keyCode)">
<div id="Layer1_close" style="display:block;">
<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="405" 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 background="images/alert_msg_r1_c5.jpg" onMouseDown="moveWindow();">&nbsp;</td>
    <td valign="top" background="images/alert_msg_r1_c5.jpg" onMouseDown="moveWindow();"><table width="50" border="0" align="right" cellpadding="0" cellspacing="0" style="background-image:url(images/alert_msg_top_right.jpg); background-repeat:no-repeat; background-position:right;">
      <tr>
        <td height="7" colspan="3"><img name="" src="" width="1" height="1" alt="" /></td>
      </tr>
      <tr>
        <td width="35" align="right"><table width="17" height="16" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="arial11black"  >&nbsp;</td>
          </tr>
        </table></td>
        <td width="17" align="right"><table width="17" height="16" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td style="cursor:hand;" class="arial11black" onClick="window.external.OnOK();" onMouseOver="isMove=false;" onMouseOut="isMove=true;">&nbsp;</td>
          </tr>
        </table></td>
        <td width="10" align="right"><table width="10" height="16" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="arial11black" style="background-repeat:repeat-y; background-position:right;"><img name="" src="" width="1" height="1" alt="" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="3"><table width="62" height="6" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><img name="" src="" width="1" height="1" alt="" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="3"><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="200" 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 align="left" class="arial11black" style="background-repeat:repeat-x; background-position:bottom; text-align:center;">
			<div id="nameandcomp" style="display:none;">
			<script language="javascript">
	  document.write(XRA.getString("EnterSN_User"));
	  </script><br />
			<input type="text" id="userName" style="width:200px; height:18px; border:1px solid #92A2B1; font-size:11px; font-family:Tahoma, Arial;" maxlength="50" value="0" /><span style="padding-left:2px;">*</span>

			<br />
			<br />
			<script language="javascript">
	  document.write(XRA.getString("EnterSN_Company"));
	  </script><br />
			<label>
			<input name="textfield" type="text" id="companyName" style="width:200px; height:18px; border:1px solid #92A2B1;font-size:11px; font-family:Tahoma, Arial;" maxlength="80" value="0" />
			</label>
			</div>
			<div style="font-weight:bold; text-align:left; padding-left:20px; padding-bottom:4px;">
			<script language="javascript">
	  document.write(XRA.getString("str_enter_sn"));
	  </script>
			</div>
			<div style="text-align:left; padding-left:20px; padding-right:20px;">
			<script language="javascript">
	  document.write(XRA.getString("str_vp_distroy_enter_sn"));
	  </script>
			</div>

<br />
			<br />
			
			<label>
			<input id="SNLicense" type="text" name="textfield2" style="width:200px; height:18px; border:1px solid #92A2B1;font-size:11px; font-family:Tahoma, Arial;" />
			</label>
			<br />
			<br />

			<div style="width:200px; text-align:center;"><button cstyle="rit" onClick="saveSN();" id="save_password_button">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;<button cstyle="rit" onClick="window.external.OnClose();" id="cancel_password_button">Cancel</button></div>
			<br />
			
			</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="javascript">
var isMove=true;
var leftButtonId="";
var rightButtonId="";
var oldPassword="";
function moveWindow() {
	if (isMove) {
		window.external.OnMoveWindow();
	}
}
function testCode(id) {
	
	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();
		}
	}
}

document.body.onload=function()
{
	applyButton();
	document.getElementById("Layer1_close").style.display="";

	var xmlDoc = new ActiveXObject("Microsoft.xmldom");
	$("save_password_button").setValue(XRA.getString("Button_OK")+"&nbsp;");
	$("cancel_password_button").setValue(XRA.getString("CreateScureDisc_Cancel")+"&nbsp;");
	
	
	oldSn=RitForAsp.GetSerialnum();
	if(oldSn == "fs++")
	{
		oldSn = "";
	}

	document.getElementById("SNLicense").value=oldSn;
	userInfoXml=RitForAsp.GetUserInfo();
	if (userInfoXml!="fs++")
	{
		var userInfoObj=analyseXml(userInfoXml);
		if(typeof(userInfoObj.UserName)=="undefined")
			userInfoObj.UserName="";
		if(typeof(userInfoObj.CompanyName)=="undefined")
			userInfoObj.CompanyName="";
		
		document.getElementById("userName").value=userInfoObj.UserName;
		document.getElementById("companyName").value=userInfoObj.CompanyName;
	}
}

function saveSN()
{
	var inputUser = document.getElementById("userName").value;
	var inputCompany = document.getElementById("companyName").value;
	var inputSN=document.getElementById("SNLicense").value;
	
	var errMsg="";
	if (inputUser.replace(/\s/g,"")=="" || inputUser=="undefined")
	{
		errMsg+=XRA.getString("EnterSN_user_required");
		$("userName").focus();
	}
	
/*	if (inputCompany.replace(/\s/g,"")=="" || inputCompany=="undefined")
	{
		errMsg+=XRA.getString("EnterSN_company_required")
	}*/
	
	if (inputSN.replace(/\s/g,"")=="")
	{
		errMsg+=XRA.getString("EnterSN_SN_required");
		$("SNLicense").focus();
	}
	
	if (errMsg!="")
	{
		RIT_popMsg('',290,165,'ok',errMsg,'alert');
	}
	else
	{
		var saveSNRst=window.external.RitEnterSerialnum(inputSN,inputUser,inputCompany);
		if(saveSNRst==0)
		{
			//RIT_popMsg('',264,135,'ok',XRA.getString("EnterSN_SN_check_success"),'info');
			window.external.SetStaticData("REGSUCC");
			window.external.OnClose();
			
		}
		else
		{
			RIT_popMsg('',264,135,'ok',XRA.getString("EnterSN_SN_check_failed"),'alert');
			$("SNLicense").focus();
		}
	}
}

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

<object id="RitForAsp"
 classid="CLSID:8E2E6427-24FC-43EB-9179-5761CE833C15" width="0" height="0">                
</object>
</body>