<?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--><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>
	<!--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-->
		

	<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 m_objRef=parent;
		
		function OnLoad()
		{
			var ALLOC_TYPE_COMP="1";
			var ALLOC_TYPE_USERS="2";
			
			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");
			var lngAllocType=g_MqRef.MqStr.GetQueryStringValue(document.location.search, "AllocType");
			
			if(lngAllocType==ALLOC_TYPE_COMP){
				HideControl(FLD_ID_ALLOC_TO_USER);
				if(oWizardDesc){
					oWizardDesc.innerHTML=g_MqRef.RESX["ALLOCATE_ASSETS_DESC_COMPS"];
				}
			}else{
				if(lngAllocType==ALLOC_TYPE_USERS){
					HideControl(FLD_ID_ALLOC_TO_COMP);
					if(oWizardDesc){
						oWizardDesc.innerHTML=g_MqRef.RESX["ALLOCATE_ASSETS_DESC_USERS"];
					}
				}else{
					HideControl(FLD_ID_ALLOC_TO_USER);
					HideControl(FLD_ID_ALLOC_TO_COMP);
				}
			}
			return true;
		}

		function HideControl(lngFieldID)
		{
			var objFormElement=new CMqFormElement();
			objFormElement.HideElement(true, 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 lngAssetType=new VNFormField(m_objRef.g_VWS.ViewFields().Field(FLD_ID_SOFTWARE_ASSET_TYPE),m_objRef.document.Record.document).GetValue();
			
			var co = parent.objRequest.Get(parent.mstrCurrentLocation + "HRIT.asp" + 
												"?WCI=wciAllocateAssets&AT=" + lngAssetType + 
												"&Alloc1=" + g_MqRef.MqStr.MqEncodeURIComponent(strUsers) + 
												"&Alloc2=" + g_MqRef.MqStr.MqEncodeURIComponent(strComputers));

			if (co!=parent.objRequest.CANCEL_PROCESS){
								
				var objResponse=parent.objRequest.Response(co);
									
				if (objResponse){
					if (objResponse.HasErrors()){
						objResponse.ProcessErrors("",true,window);
					}else{
						//stop, need a better way to reference this
						if(parent){
							if(parent.Record){
								if(parent.Record.m_objAllocationReports8){
									parent.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"><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-->

	</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>