<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	
	<title></title>
	
	<!--MqRelPath--><link rel="stylesheet" title="silver" type="text/css" href="../../theme/css/censusmain.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" title="silver" type="text/css" href="<BASE_VD>/theme/css/censusmain.css"/></MqAbsPath-->
	<!--MqRelPath--><link rel="stylesheet" title="silver" type="text/css" href="../../theme/css/mqwizard.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" title="silver" type="text/css" href="<BASE_VD>/theme/css/mqwizard.css"/></MqAbsPath-->

	<!--MqRelPath--><link rel="stylesheet" href="../../js/jquery/jquery.ui.all.css"><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" href="<BASE_VD>/js/jquery/jquery.ui.all.css"></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery-1.7.1.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery-1.7.1.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.bgiframe-2.1.2.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.bgiframe-2.1.2.js"></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.core.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.core.js"></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.widget.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.widget.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.mouse.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.mouse.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.draggable.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.draggable.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.position.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.position.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.resizable.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.resizable.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/jquery/jquery.ui.dialog.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/jquery/jquery.ui.dialog.js"></script></MqAbsPath-->

	<!--MqRelPath--><script type="text/javascript" src="../../js/mqsysutils.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqsysutils.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/cmqsysmsg.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/cmqsysmsg.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/window.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/window.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqlookupitemutils.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqlookupitemutils.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqformelements.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqformelements.js"></script></MqAbsPath-->
	<script type="text/javascript" src="../../js/cmqlookupitemint.js"></script>
	<script type="text/javascript" src="../../js/initlookupitemint.js"></script>
		

	<script type="text/javascript">
		// always define this object for the system messages
		var objSysMsg = new CMqSysMsg();
		var m_objMqButton = new MqButton();
		
		var m_strLookupItemPathPrefix="../";
		var m_strWinID=parseInt( Math.random() * 1000);
		var m_objLookupItemInfoColl=new Array();
		
		var DEFAULT_VALUE_DELIM=";";
		
		var FLD_ID_RESERVE_NUM=772;
		var FLD_ID_RES_FOR_DEPT=768;
		var FLD_ID_RES_FOR_LOC=769;
		var FLD_ID_RES_FOR_PROJ=770;
		var FLD_ID_SOFTWARE_ASSET_TYPE=430;	
		
		var m_objRef=parent;
		
		function OnLoad()
		{
			g_MqRef.ResMgr.ProcessAll(document);
			
			return true;
		}

		
		function cmdOK_OnClick()
		{
			if(ShowLoadingUI(true)){
				window.setTimeout("ReserveAssets()", 100);
			}
		}
		
		function ReserveAssets()
		{
			var lngCount=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RESERVE_NUM),document).GetValue();
			var strDept=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RES_FOR_DEPT),document).GetValue();
			var strLoc=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RES_FOR_LOC),document).GetValue();
			var strProj=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RES_FOR_PROJ),document).GetValue();
			var lngAssetType=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_SOFTWARE_ASSET_TYPE),m_objRef.objFrames.GetFrameWindow(m_objRef.RECORD_FRAME_ID).document).GetValue();

			var co = m_objRef.objRequest.Get(m_objRef.mstrCurrentLocation + "HRIT.asp" + 
												"?WCI=wciReserveAssets&AT=" + lngAssetType + 
												"&ResNum=" + lngCount +
												"&Dept=" + g_MqRef.MqStr.MqEncodeURIComponent(strDept) + 
												"&Loc=" + g_MqRef.MqStr.MqEncodeURIComponent(strLoc) +
												"&Proj=" + g_MqRef.MqStr.MqEncodeURIComponent(strProj));

			if (co!=m_objRef.objRequest.CANCEL_PROCESS){
								
				var objResponse=m_objRef.objRequest.Response(co);
									
				if (objResponse){
					if (objResponse.HasErrors()){
						objResponse.ProcessErrors("",true,window);
					}else{
						//stop, need a better way to reference this
						if(m_objRef){
							if(m_objRef.Record){
								if(m_objRef.Record.m_objAllocationReports8){
									m_objRef.Record.m_objAllocationReports8.Refresh();
								}
							}
						}
						
						ShowLoadingUI(false);
						if(co!=""){
							g_MqRef.AlertBox.show(g_MqRef.RESX["MSG_TITLE_RESERVE_ASSETS"], 
													g_MqRef.MqStr.FormatString(g_MqRef.RESX["MSG_FAILED_TO_RESERVE"], co, ";"));
						}else{
							CloseWindow();
						}
					}
				}
			}
		}
		
		function ShowLoadingUI(blnVisible)
		{
			var objLoadingOverlay=document.getElementById("loadingOverlay");
			if(objLoadingOverlay){
				if(blnVisible){
					objLoadingOverlay.style.display="";
				}else{
					objLoadingOverlay.style.display="none";
				}
			}
			return true;
		}
		
	</script>
	<style type="text/css">
	<!--
	input,textarea,select{
		font-family: tahoma, sans-serif;
		font-size:12px;
	}
	// -->
	</style>
</head>

<body id="frmMain" name="frmMain" class="MainBackgroundPopup" 
style="margin:0;" leftmargin="0" rightmargin="0" 
onload="OnLoad();" bottommargin="0" scroll="no">

	<div class="TopToolBarPopup">
		<table width="98%" class="TopToolBarWizard">
			<tr>
				<td valign="top" style="padding-top:15px; padding-left:10px" width="100%">
		            <div class="WizardTitle"><script type="text/javascript">document.write(g_MqRef.RESX["RESERVE_ASSETS_HDR"]);</script></div>
		            <div class="WizardDescription" id="wizardDesc"><script type="text/javascript">document.write(g_MqRef.RESX["RESERVE_ASSETS_DESC"]);</script></div>
		        </td>
		    </tr>
		</table>
	</div>
	<table id="tblMain" marginwidth="0" cellspacing="0" cellpadding="0" border="0" style="padding-left:10px;width: 98%;" >
				
		<tr>
			<td width="35%" valign="bottom" class="bgHeader"><a name="30">&#160;</a></td>
			<td width="65%" >&#160;</td>
		</tr>
		
		
		
		<!--tr>
<!-- Begin of multi-choice select from dialog field-->
<!--td  id='MqFC_766' width=20%  align=left  valign=top  cla-ss="fieldVisibility"><font  class="normalfield">Allocate to Users:</font></td>
<td id='MqF_766'  align=left  valign=top  colspan=3   cla-ss="fieldVisibility"><div  class='LargeListWithButton' style="height:200px;"><textarea  class='LargeList MemoFieldWidth' mqcontroltype='LargeList' multiline mqreadonly='1' style='position:absolute;width:97.5%'  size='3'  name='lst_766_lst_766_Allocate_to_User' id='lst_766_lst_766_Allocate_to_User' onchange="parent.OnRecordChanged('766')" onclick="LoadLargeListOrCombo(766, 'Allocate to User','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=tblUser&DS=16&CO=0','tblUser');" width='30' ></textarea><script type='text/javascript'>AddURLButton('LoadLargeListOrCombo(766, \'Allocate to User\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=tblUser&DS=16&CO=0\',\'tblUser\')','BrowseAlternateChoiceListSpanTwo','766','lst_766_lst_766_Allocate_to_User');</script></div></td>
<!-- End of multi-choice select from dialog field-->

<!--/tr>
<tr>
<!-- Begin of multi-choice select from dialog field-->
<!--td  id='MqFC_767' width=20%  align=left  valign=top  c-lass="fieldVisibility"><font  class="normalfield">Allocate to Devices / Computers:</font></td>
<td id='MqF_767'  align=left  valign=top  colspan=3   cla-ss="fieldVisibility"><div  class='LargeListWithButton' style="height:200px;"><textarea  class='LargeList MemoFieldWidth' mqcontroltype='LargeList' multiline mqreadonly='1' style='position:absolute;width:97.5%'  size='3'  name='lst_767_lst_767_Allocate_to_Device___Computer' id='lst_767_lst_767_Allocate_to_Device___Computer' onchange="parent.OnRecordChanged('767')" onclick="LoadLargeListOrCombo(767, 'Allocate to Device / Computer','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Computer&DS=16&CO=0','Computer');" width='30' ></textarea><script type='text/javascript'>AddURLButton('LoadLargeListOrCombo(767, \'Allocate to Device / Computer\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Computer&DS=16&CO=0\',\'Computer\')','BrowseAlternateChoiceListSpanTwo','767','lst_767_lst_767_Allocate_to_Device___Computer');</script></div></td>
<!-- End of multi-choice select from dialog field-->



<tr>
<td  id='MqFC_772'  align=left  valign=top width=20%   clas-s="fieldVisibility" style="padding-top:2px;padding-bottom:2px;"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_NUM_TO_RESERVE"></font></td>
<td id='MqF_772'  align=left  valign=top  colspan=3 width=80%  clas-s="fieldVisibility" style="padding-top:2px;padding-bottom:2px;"><input size=30  class='SpanTwoWidthOne'  name='nbr_772_nbr_772_Reserve__' id='nbr_772_nbr_772_Reserve__' onchange="parent.OnRecordChanged('772')" onkeypress="parent.OnRecordChanged('772')" maxlength=50 ></td>
</tr>

<tr>
<!-- Begin of 103_7-->
<td  id='MqFC_768' width=20%  align=left  valign=top  cl-ass="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_DEPARTMENT"></font></td>
<td id='MqF_768'  align=left  valign=top   colspan=3   cla-ss="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><div  class='FieldWithButton'>

			<input class='LargeCombo MemoFieldWidth' mqvalue='' mqcontroltype='LargeCombo' style='position:absolute;width:97.5%' size=1  name='cbo_768_cbo_768_Reserve_for_Department' id='cbo_768_cbo_768_Reserve_for_Department' 
			onchange="parent.OnRecordChanged('768')" onclick="LoadLargeListOrCombo(768, 'Department','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Department&DS=16&CO=0','Department',null,null,null,null,null,16)" width="30" title="" size="1"	mqloaduserdetails='' >

<script type='text/javascript'>
AddURLButton('LoadLargeListOrCombo(768, \'Department\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Department&DS=16&CO=0\',\'Department\',null,null,null,null,null,16)',
	'BrowseAlternateChoiceListSpanTwo','768','cbo_768_cbo_768_Reserve_for_Department');
</script>
</div></td>
<!-- End of 103_7-->
</tr>

<tr>
<!-- Begin of 103_7-->
<td  id='MqFC_769' width=20%  align=left  valign=top  cla-ss="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_LOCATION"></font></td>
<td id='MqF_769'  align=left  valign=top   colspan=3   cl-ass="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><div  class='FieldWithButton'>

			<input class='LargeCombo MemoFieldWidth' mqvalue='' mqcontroltype='LargeCombo' style='position:absolute;width:97.5%' size=1  name='cbo_769_cbo_769_Reserve_for_Location' id='cbo_769_cbo_769_Reserve_for_Location' 
			onchange="parent.OnRecordChanged('769')" onclick="LoadLargeListOrCombo(769, 'Location','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Location&DS=16&CO=0','Location',null,null,null,null,null,16)" width="30" title="" size="1" mqloaduserdetails='' >

<script type='text/javascript'>
AddURLButton('LoadLargeListOrCombo(769, \'Location\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Location&DS=16&CO=0\',\'Location\',null,null,null,null,null,16)',
	'BrowseAlternateChoiceListSpanTwo','769','cbo_769_cbo_769_Reserve_for_Location');
</script>
</div></td>
<!-- End of 103_7-->
</tr>

<tr>
<!-- Begin of 103_7-->
<td  id='MqFC_770' width=20%  align=left  valign=top  cla-ss="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_PROJECT"></font></td>
<td id='MqF_770'  align=left  valign=top   colspan=3   cl-ass="fieldVisibility" style="padding-top:2px;padding-bottom:2px;" MqHidden="0"><div  class='FieldWithButton'>

			<input class='LargeCombo MemoFieldWidth' mqvalue='' mqcontroltype='LargeCombo' style='position:absolute;width:97.5%' size=1  name='cbo_770_cbo_770_Reserve_for_Project' id='cbo_770_cbo_770_Reserve_for_Project' 
			onchange="parent.OnRecordChanged('770')" onclick="LoadLargeListOrCombo(770, 'Project','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Project&DS=16&CO=0','Project',null,null,null,null,null,16)" width="30" title="" size="1" mqloaduserdetails='' >

<script type='text/javascript'>
AddURLButton('LoadLargeListOrCombo(770, \'Project\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Project&DS=16&CO=0\',\'Project\',null,null,null,null,null,16)',
	'BrowseAlternateChoiceListSpanTwo','770','cbo_770_cbo_770_Reserve_for_Project');
</script>
</div></td>
<!-- End of 103_7-->
</tr>

	</table>
	<table align="right" style="padding-right:10px; padding-top:20px">
		<tr>
			<td align=right>
				<script type="text/javascript">m_objMqButton.WriteTextButtonHTML("OK", g_MqRef.RESX["BUTTON_OK"], 'cmdOK_OnClick()', "", 32, "", g_MqRef.RESX["BUTTON_OK"], 90);</script>
			</td>
			<td align=right>
				<script type="text/javascript">m_objMqButton.WriteTextButtonHTML("Close", g_MqRef.RESX["BUTTON_CLOSE"], 'CloseWindow()', "", 32, "", g_MqRef.RESX["BUTTON_CLOSE"], 90);</script>
			</td>
		</tr>
		</tbody> 
	</table>
	<div id="loadingOverlay" class="ui-widget-overlay" style="width:100%;height:100%;z-index:1001;display:none"><img src="../../theme/images/images/icon_wait.gif" style="position:absolute; left:50%; top:50%;"/></div>

	<div style="visibility: hidden;display:none">
		<div id="dialog-modal" style="width:100%;height:100%;padding:0px;margin:0px;overflow:hidden">
			<iframe id="dialog-modal-url" width="100%" height="100%" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="auto"></iframe>
		</div>
		<div id="dialog-modal-orig-width" name="dialog-modal-orig-width" style="display:none"></div>
		<div id="dialog-modal-orig-height" name="dialog-modal-orig-height" style="display:none"></div>
	</div>
</body>
</html>