<?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-->
	<link rel="stylesheet" href="../../materialize/css/materialize.custom.css">
	
	<!--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_ALLOC_TO_USER=766;
		var FLD_ID_ALLOC_TO_COMP=767;
		var FLD_ID_SOFTWARE_ASSET_TYPE=430;	
		var FLD_ID_RES_FOR_PROJ=770;
		var FLD_ID_RES_FOR_LS=771;
		var FLD_ID_RESERVE_NUM=772;
		
		var ALLOC_TYPE_COMP="1";
		var ALLOC_TYPE_USERS="2";
		var ALLOC_TYPE_LIC_SERVERS="3";
		
		var m_objRef=parent;
		
		var m_lngAllocType=g_MqRef.MqStr.GetQueryStringValue(document.location.search, "AllocType");
		
		function OnLoad()
		{
			g_MqRef.ResMgr.ProcessAll(document);
			document.getElementById("lst_766_lst_766_Allocate_to_User").placeholder=g_MqRef.RESX["MC_FLD_PLACEHOLDER"];
			document.getElementById("lst_767_lst_767_Allocate_to_Device___Computer").placeholder=g_MqRef.RESX["MC_FLD_PLACEHOLDER"];
			
			var oWizardDesc=document.getElementById("wizardDesc");
			
			HideControl(FLD_ID_RES_FOR_PROJ);
								
			if(m_lngAllocType==ALLOC_TYPE_COMP){
				HideControl(FLD_ID_ALLOC_TO_USER);
				HideControl(FLD_ID_RES_FOR_LS);
				HideControl(FLD_ID_RESERVE_NUM);
				if(oWizardDesc){
					oWizardDesc.innerHTML=g_MqRef.RESX["ALLOCATE_ASSETS_DESC_COMPS"];
				}
			}else{
				if(m_lngAllocType==ALLOC_TYPE_USERS){
					HideControl(FLD_ID_ALLOC_TO_COMP);
					HideControl(FLD_ID_RES_FOR_LS);
					HideControl(FLD_ID_RESERVE_NUM);
					if(oWizardDesc){
						oWizardDesc.innerHTML=g_MqRef.RESX["ALLOCATE_ASSETS_DESC_USERS"];
					}
				}else{
					if(m_lngAllocType==ALLOC_TYPE_LIC_SERVERS){
						HideControl(FLD_ID_ALLOC_TO_COMP);
						HideControl(FLD_ID_ALLOC_TO_USER);
						if(oWizardDesc){
							oWizardDesc.innerHTML=g_MqRef.RESX["ALLOCATE_ASSETS_DESC_LIC_SRVRS"];
						}
					}else{
						HideControl(FLD_ID_ALLOC_TO_USER);
						HideControl(FLD_ID_ALLOC_TO_COMP);
						HideControl(FLD_ID_RES_FOR_PROJ);
						HideControl(FLD_ID_RES_FOR_LS);
						HideControl(FLD_ID_RESERVE_NUM);
					}
				}
			}
			return true;
		}

		function ToggleAdvanced()
		{
			if(document.getElementById("chk_ShowAdvanced").checked){
				ShowControl(FLD_ID_RES_FOR_PROJ);
			}else{
				HideControl(FLD_ID_RES_FOR_PROJ);
			}
		}
		
		function HideControl(lngFieldID)
		{
			var objFormElement=new CMqFormElement();
			objFormElement.HideElement(true, null, true, lngFieldID, document);
		}
		
		function ShowControl(lngFieldID)
		{
			var objFormElement=new CMqFormElement();                                                                     
			objFormElement.HideElement(false, null, true, lngFieldID, document);
		}
		
		function cmdOK_OnClick()
		{
			if(ShowLoadingUI(true)){
				window.setTimeout("SaveAllocation()", 100);
			}
		}
		
		function SaveAllocation()
		{
			var strUsers=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_ALLOC_TO_USER),document).GetValue();
			var strComputers=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_ALLOC_TO_COMP),document).GetValue();
			var strProj=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RES_FOR_PROJ),document).GetValue();
			var strLS=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RES_FOR_LS),document).GetValue();
			var lngCount=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_RESERVE_NUM),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();
			
			if(strUsers=="" && m_lngAllocType==ALLOC_TYPE_USERS){
				ShowLoadingUI(false);
				g_MqRef.AlertBox.show(g_MqRef.RESX["MSG_TITLE_ALLOCATE_ASSETS"], g_MqRef.RESX["MSG_SELECT_USER_ALLOCATION"]);
			}else{
				if(strComputers=="" && m_lngAllocType==ALLOC_TYPE_COMP){
					ShowLoadingUI(false);
					g_MqRef.AlertBox.show(g_MqRef.RESX["MSG_TITLE_ALLOCATE_ASSETS"], g_MqRef.RESX["MSG_SELECT_DEVICE_ALLOCATION"]);
				}else{
					if(strLS=="" && m_lngAllocType==ALLOC_TYPE_LIC_SERVERS){
						ShowLoadingUI(false);
						g_MqRef.AlertBox.show(g_MqRef.RESX["MSG_TITLE_ALLOCATE_ASSETS"], g_MqRef.RESX["MSG_SELECT_LIC_SRVR_ALLOCATION"]);
					}else{
						if(lngCount=="" && m_lngAllocType==ALLOC_TYPE_LIC_SERVERS){
							ShowLoadingUI(false);
							g_MqRef.AlertBox.show(g_MqRef.RESX["MSG_TITLE_ALLOCATE_ASSETS"], g_MqRef.RESX["MSG_ENTER_NUM_ALLOCATION"]);
						}else{
							var co = m_objRef.objRequest.Get(m_objRef.mstrCurrentLocation + "HRIT.asp" + 
																"?WCI=wciAllocateAssets&AT=" + lngAssetType + 
																"&Alloc1=" + g_MqRef.MqStr.MqEncodeURIComponent(strUsers) + 
																"&Alloc2=" + g_MqRef.MqStr.MqEncodeURIComponent(strComputers) +
																"&Alloc3=" + g_MqRef.MqStr.MqEncodeURIComponent(strLS) +
																"&Proj=" + g_MqRef.MqStr.MqEncodeURIComponent(strProj) + 
																"&ResNum=" + lngCount);

							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_ALLOCATE_ASSETS"], 
																	g_MqRef.MqStr.FormatString(g_MqRef.RESX["MSG_FAILED_TO_ALLOCATE"], 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["ALLOCATE_ASSETS_HDR"]);</script></div>
		            <div class="WizardDescription" id="wizardDesc"></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" style="padding-top:2px;padding-bottom:2px;"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_ALLOC_TO_USERS"></font></td>
<td id='MqF_766'  align=left  valign=top  colspan=3   cla-ss="fieldVisibility" style="padding-top:2px;padding-bottom:2px;"><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" style="padding-top:2px;padding-bottom:2px;"><font  class="normalfield" translate="yes" data-res="FLD_CAPTION_ALLOC_TO_DEVICES"></font></td>
<td id='MqF_767'  align=left  valign=top  colspan=3   cla-ss="fieldVisibility" style="padding-top:2px;padding-bottom:2px;"><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>

<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_ALLOC"></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_771' 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_LICENSE_SERVER"></font></td>
<td id='MqF_771'  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_771_cbo_771_Reserve_for_License_Server' id='cbo_771_cbo_771_Reserve_for_License_Server' 
			onchange="parent.OnRecordChanged('771')" onclick="LoadLargeListOrCombo(771, 'License Server','WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Computer&DS=16&CO=0','Computer',null,null,null,null,null,16)" width="30" title="" size="1" mqloaduserdetails='' >

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

<td  id='MqFC_ShowAdvanced' width=30%  align=left  valign=top style="padding-top:2px;padding-bottom:2px;">
	<font  class="normalfield">Show Advanced:</font>
</td>
<td id='MqF_ShowAdvanced' align=left valign=top style="padding-top:2px;padding-bottom:2px;">
	<div class=" switch" mqreadonly="" tabindex="0" name="chk_ShowAdvanced_readonly" id="chk_ShowAdvanced_readonly" style="font-size:13.33px; border:0px;padding-bottom:5px;">
		<label>
			<script>document.write(g_MqRef.RESX['NO']);</script>
			<input type="checkbox" name="chk_ShowAdvanced" id="chk_ShowAdvanced" onchange="ToggleAdvanced()"  style="display:none;"  MqToolTip="Show advanced options for allocating software assets" >
			<span class="lever"></span>
			<script>document.write(g_MqRef.RESX['YES']);</script>
		</label>
	</div>
	
</td>
</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">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>