<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC >
<html class="RecordBody" id="htmlRecord">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<!--MqRelPath--><link rel="stylesheet" type="text/css" href="../../theme/css/censusmain.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" type="text/css" href="<BASE_VD>/theme/css/censusmain.css"/></MqAbsPath-->
	<!--MqRelPath--><link rel="stylesheet" type="text/css" href="../../theme/css/balloon.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" type="text/css" href="<BASE_VD>/theme/css/balloon.css"/></MqAbsPath-->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
	
	<!--MqRelPath--><link rel="stylesheet" type="text/css" href="../../js/JQUERY/jquery-ui-1.10.2.custom.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" type="text/css" href="<BASE_VD>../../js/JQUERY/jquery.ui.theme.css"/></MqAbsPath-->
	<!--MqRelPath--><link rel="stylesheet" type="text/css" href="../../js/JQUERY/jquery.ui.timepicker.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" type="text/css" href="<BASE_VD>../../js/JQUERY/jquery.ui.timepicker.css"/></MqAbsPath-->
	<!--MqRelPath--><link rel="stylesheet" type="text/css" href="../../js/JQUERY/jquery.ui.timepicker.extras.css"/><!--/MqRelPath--><!--MqAbsPath><link rel="stylesheet" type="text/css" href="<BASE_VD>../../js/JQUERY/jquery.ui.timepicker.extras.css"/></MqAbsPath-->

	<link rel="stylesheet" href="../../materialize/css/materialize.custom.css">
	
	<!--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.ui.core.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/JQUERY/jquery.ui.core.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.timepicker.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/JQUERY/jquery.ui.timepicker.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/JQUERY/jquery.ui.timepicker.changes.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/JQUERY/jquery.ui.timepicker.changes.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/frameconstants.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/frameconstants.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/mqlist.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqlist.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/popupmenu/hm_var.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/popupmenu/hm_var.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/scc/cmqgetsccfiles.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/scc/cmqgetsccfiles.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-->

	<!--MqRelPath--><script type="text/javascript" src="../../js/popupwindow.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/popupwindow.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/date.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/date.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/anchorposition.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/anchorposition.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/calendarpopup.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/calendarpopup.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqwebpart.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqwebpart.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/autosuggest.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/autosuggest.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/cmqloadingmessage.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/cmqloadingmessage.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../Reports/tmplReportViewer.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/Reports/tmplReportViewer.js"></script></MqAbsPath-->	
	<!--MqRelPath--><script type="text/javascript" src="../../js/Constants.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/Constants.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../js/Reports.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/Reports.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqreportviewer.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqreportviewer.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/keylistener.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/keylistener.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/initrelissue.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/<VIEW_FOLDER>/js/initrelissue.js"></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/MqEmbeddedReport.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqembeddedreport.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/1ToM.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/1ToM.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/mqmacrohlpr.js"></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/mqmacrohlpr.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/fld110.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/fld110.js" ></script></MqAbsPath-->
	<!--MqRelPath--><script type="text/javascript" src="../../js/VNHTMLDocInit.js" ></script><!--/MqRelPath--><!--MqAbsPath><script type="text/javascript" src="<BASE_VD>/js/VNHTMLDocInit.js" ></script></MqAbsPath-->

	
	<script type="text/javascript">
	
		if(g_MqRef.MqBrowser){
			if(g_MqRef.MqBrowser.ie && g_MqRef.MqBrowser.major<=6){
				document.write('<link rel="stylesheet" type="text/css" href="../../theme/css/censusmainquirks.css"/>');
			}
		}

		var m_oVNForm;
		var Ver4;
		var Ver6;
		var Nav4;
		var Nav6;
		var Nav7;
		var IE4;
		var strHtml;


		var m_objTabsMgr=parent.objTabsMgr;
		var objRequest = parent.objRequest;
		var m_objWebPart=new CMqWebPart();
		var strDateFormat = "<WC@SYS_DATE_FORMAT></WC@SYS_DATE_FORMAT>";
		var strTimeFormat = "h:mm:ss a";
		var m_objMqButton=new MqButton();
		// Deprecated, use g_VWS instead
		var m_oVecWebSess=g_VWS;
		var m_DefaultCursor="default";
		var loaded=false;
		var initialized=false;

		var m_blnSysInfoObjWritten=false;
		var m_strWinID=parseInt( Math.random() * 1000);
		var m_objMe = this;
		var m_objRecordRef = m_objMe;
		var m_objCensusMainRef = parent;
		var m_objWorkFlow=m_objCensusMainRef.m_objWorkFlow;
		var ActionType=m_objCensusMainRef.ActionType;
		var m_strUserGroups="<WC@CURRENT_USER_GROUPS>,</WC@CURRENT_USER_GROUPS>";
		var mstrPathPrefix="../../";
		var m_objReportViewer = new CMqReportViewer();
		var m_objEmbeddedReport = new CMqEmbeddedReport();
		var ATTRIB_MQ_TIME_FLD="MqTimeFld";
		var ATTRIB_MQ_TIME_FLD_ID="MqTimeFldID";
		
		var FLD_AUTHENTICATE_WITH_ID=-1;
		var FLD_SEC_TYPE_ID=-1;
		var FLD_PASSWORD_ID=-1;
		var FLD_PWD_CONFIRM_ID=-1;
		var FLD_CAN_LOGON=-1;
		
		var MSG_NOT_ENOUGH_TIME = g_MqRef.MqStr.Format(g_MqRef.RESX['WARNING_MESSAGE_ONBOARD_NOT_ENOUGH_TIME'], parent.m_strHoursStartDateCheck);
		
		var m_objControlsUi;
		if(parent.objControlsUi){
			m_objControlsUi=parent.objControlsUi;
		}

		var DEFAULT_VALUE_DELIM=";";

		var m_objAutoSuggest = new CMqAutoSuggest();
		
		m_objAutoSuggest.Initialize("", document, GetAutoSuggestHideEventElements(m_objCensusMainRef));
		
		var m_objMacroHlpr=new MqMacroHlpr(parent.m_objViewFields, this);
		
		function GetAutoSuggestHideEventElements(objRef)
		{
			var arrFrameObjects;
			
			if(objRef){
				arrFrameObjects = new Array(objRef.document.getElementById(objRef.RECORD_FRAME_NAME),
											objRef.document.getElementById(objRef.TABS_FRAME_NAME),
											objRef.document.getElementById(objRef.SUMMARY_LIST_FRAME_NAME),
											objRef.document.getElementById(objRef.TOPTOOLBAR_FRAME_NAME),
											objRef.document.getElementById(objRef.SQE_FRAME_NAME),
											objRef.document.getElementById(objRef.TOOLBAR_FRAME_NAME),
											objRef.document.getElementById(objRef.TOOLBARB_FRAME_NAME),
											objRef.document.getElementById(objRef.COMMANDBAR_FRAME_NAME),
											objRef.document.getElementById(objRef.SUM_LIST_HEADER_FRAME_NAME)
											);
			}
			
			return arrFrameObjects;
		} 
		
		function OnloadRecord()
		{
			var blnEnableCustomWorkflow=false;
			document.body.className=parent.CSS_RECORD_BODY;
			g_MqRef.ResMgr.ProcessAll(document);
			var objDownloadApplet;
			Nav7 = Nav6 && (typeof(document.body.clientWidth) == 'number');			
			var blnDownloadApplet;
			parent.mfrmRecord = document.Record;
			InitializeLists();
			
			// VNLibs is set to the censusmain
			// but we must use the parent, not the main window
			var oVNRec=new parent.VNRecord(g_VWS);

			m_oVNForm = new parent.VNRecForm(oVNRec, parent.m_objLoadDataMgr, g_VWS);
	
			loaded=true;
			initialized=true;

		}


		function ExcludeFieldFromLoadData(strFieldID){
			if (parent.m_objLoadDataMgr){
				parent.m_objLoadDataMgr.ExcludeField(strFieldID);
			}
		}

		function SetFieldValueOnNewRecord(strFieldID, strValue)
		{
			var arrSetVals;
			if(parent){
				if(!parent.m_objCustomSetVals){
					parent.m_objCustomSetVals=new parent.CMqDefVals();
				}
				arrSetVals = parent.m_objCustomSetVals.GetDefVals();
				arrSetVals[strFieldID]=strValue;
				parent.m_objCustomSetVals.SetDefVals(arrSetVals);
			}
		}
		
		function WriteSysInfoObj()
		{
			if(!m_blnSysInfoObjWritten){
				var strHTML="<object id='MqSystemInfo' name='MqSystemInfo' classid='CLSID:F7A51823-B17F-4841-A989-3D6C3BB434E7' codebase='../../applets/MqWebClient.CAB#version=1,0,0,1' width='0' height='0'></object>";
				document.write(strHTML);
				m_blnSysInfoObjWritten=true;
			}
		}
		
	

    var m_objFormElement = new parent.CMqFormElement();

    
    function InitializeLists()
    {
        if (window.event){
            var arrLists=document.getElementsByTagName("select");
            var i;
            
            if (arrLists){
                for (i=0;i<arrLists.length;i++){
                    arrLists[i].onkeypress=m_MqAutoList.OnKeyPress;
                    arrLists[i].onblur=m_MqAutoList.OnBlur;
                }
            }
        }
    }
    
	

	function LoadLargeListOrCombo(lngFieldID, strFieldCaption, strSearchResultsURL, strTableName, blnAutoComplete, lngRecordsPerPage, fnSetValue, lngWidth, lngHeight,lngDSType)
	{ 
		var blnShowWin=false;
		if(parent){
			if(parent.objRecord){
				if(parent.objRecord.GetRecordId() > 0){
					blnShowWin=true;
				}else{
					blnShowWin=false;
					if(parent.objFeatures){
						if(parent.objFeatures.getFeature(parent.FEATURE_SUBMIT)){
							blnShowWin=true;
						}
					}
				}
			}else{
				blnShowWin=true;
			}
		}
		
		if(blnShowWin){

			var objField=parent.m_objViewFields.Field(lngFieldID);
			if (objField){

				var arrSelectedIDs;
				var arrSelectedValues;
				var blnMultiSelect;

				if(!fnSetValue){
					fnSetValue=SetComboOrListValue;
				}

				var strWorkflowValues="";
				var objHTMLElement;

				var objFormElement=new CMqFormElement();
				objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');
				var lngControlType=objFormElement.GetControlType();

				if(lngControlType==CTRL_TYPE_LARGE_COMBO){
					blnMultiSelect=false;
					arrSelectedIDs=Array(objFormElement.GetValue());
				}else{  
					if(lngControlType==CTRL_TYPE_TEXT){
						blnMultiSelect=false;
						arrSelectedValues=Array(objFormElement.GetValue());
					}else{  // CTRL_TYPE_LARGE_LIST
						blnMultiSelect=true;
						var strValue = objFormElement.GetValue();
						if (strValue && strValue.length > 0)
						{
							var varValues=strValue.split(DEFAULT_VALUE_DELIM);
							if (varValues.length > 0){
								arrSelectedValues = new Array();
							}
							for(var lngIndex=0;lngIndex<varValues.length;lngIndex++)
							{
								arrSelectedValues[lngIndex]=varValues[lngIndex];
							}
						}
					}
				}
				
				objHTMLElement=objFormElement.GetElement();
				
				if(objHTMLElement){
					strWorkflowValues=objHTMLElement.getAttribute("MqWrkFlwVals");
				}

				parent.InitLookupItemVals(lngFieldID, arrSelectedIDs, arrSelectedValues, fnSetValue, blnMultiSelect, strFieldCaption, strWorkflowValues, strSearchResultsURL, blnAutoComplete, lngRecordsPerPage, null, null, objHTMLElement);
    
				if(!lngWidth){
					if(blnMultiSelect){
						lngWidth=1000;
					}else{
						lngWidth=850;
					}
				}
				if(!lngHeight){
					if(blnMultiSelect){
						lngHeight=770;
					}else{
						lngHeight=700;
					}
				}
				
				var strWinFeatures=GetWinFeaturesToCenter(lngWidth, lngHeight); 
				var strURL="../HTML/WCDisplayChoices.asp?WCI=TmplLookupItem&TBL=" + g_MqRef.MqStr.MqEncodeURIComponent(strTableName) + "&MqFID=" + lngFieldID + "&FID=" + lngFieldID + "&DS=" + lngDSType;
				var strURLExtraQS="";
				
				if(!blnAutoComplete){
					if(blnMultiSelect){
						if(objField){
							var objFieldCtrl=document.getElementById(objField.GetBoundControl());
							if(objFieldCtrl){
								objFieldCtrl.focus();
							}
						}
						strURLExtraQS="&MC=1";
					}

					m_oVNForm.ResolveChoiceIDsToText = false;
					m_oVNForm.OpenURL(strURL + strURLExtraQS,"ChoicesList"+lngFieldID+m_strWinID,
									{
										Width:lngWidth, 
										Height:lngHeight, 
										Modal: true, 
										SizeMode: WIN_MODE_MAXIMIZED
									},
									true);


				}else{
					strURLExtraQS="&AC=1";
					return strURL + strURLExtraQS;
				}
			} 
		}
	}
 
	function GetDepValsForFld(strValues,arrTargetFlds,lngFieldID)
	{
		var arrTargetFieldInfo;
		var strFieldName;
		var strFieldValues="";
		var arrTargetFields;
		var i,j;
		var strCurrentValue="";
		var DELIMITER=";";
		var INDEX_RET_FIELD_NAME=0;
		var INDEX_RET_FIELD_VALUES=1;
		var INDEX_FIELD_ID=0;
		var INDEX_FIELD_NAME=1;
		var INDEX_ACTION_TYPE=2;
		var INDEX_FORM_ELEM_OBJ=3;
		var INDEX_INIT_VALUES=4;
		var ACTION_TYPE_POSS_VAL=0;
		
		if(strValues!==""){
			arrTargetFields=strValues.split(DELIMITER);
			for(i=0;i<arrTargetFields.length;i++){
				arrTargetFieldInfo=unescape(arrTargetFields[i]);
				arrTargetFieldInfo=arrTargetFieldInfo.split("=");
				strFieldName=arrTargetFieldInfo[INDEX_RET_FIELD_NAME];
				for(j=0;j<arrTargetFlds.length;j++){
					if(arrTargetFlds[j]){
						if(arrTargetFlds[j][INDEX_FIELD_NAME]==strFieldName && arrTargetFlds[j][INDEX_FIELD_ID]==lngFieldID){
							strFieldValues=unescape(arrTargetFieldInfo[INDEX_RET_FIELD_VALUES]);
							if(arrTargetFlds[j][INDEX_ACTION_TYPE]==ACTION_TYPE_POSS_VAL){
								if(arrTargetFlds[j][INDEX_FORM_ELEM_OBJ]){
									strCurrentValue=arrTargetFlds[j][INDEX_FORM_ELEM_OBJ].GetValue();
								}
								
								if(strCurrentValue){
									if(strCurrentValue.length>0){
										if(strFieldValues.length===0){
											strFieldValues=strCurrentValue;
										}else{
											strFieldValues+=DELIMITER+strCurrentValue;
										}
									}
								}
							}
						}
					}
				}
			}
		}
		return strFieldValues;
	}
	
	function SetComboOrListValue(lngFieldID, arrSelectedIDs, arrSelectedValues)
	{
		var strSelectedIDs;
		var strSelectedValues;
		
		if (lngFieldID)
		{
			var objField=parent.m_objViewFields.Field(lngFieldID);

			var objFormElement=new CMqFormElement();
			objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');
			var lngControlType=objFormElement.GetControlType();
			
			if (lngControlType == CTRL_TYPE_LARGE_COMBO)
			{
				strSelectedIDs = "";
				strSelectedValues = "";
				
				if(arrSelectedIDs && arrSelectedValues){
					strSelectedIDs = arrSelectedIDs[0];
					strSelectedValues = arrSelectedValues[0];
				}
					
				objFormElement.SetValueToLargeCombo(objFormElement.GetElement(), strSelectedIDs, strSelectedValues, lngFieldID);
			}
			else
			{
				var selectedValues="";
				if(arrSelectedValues){
					for (var i=0; i < arrSelectedValues.length; i++)
					{
						if (i > 0){
							selectedValues += DEFAULT_VALUE_DELIM;
						}
						
						selectedValues += g_MqRef.MqStr.MqDecodeURIComponent(arrSelectedValues[i]);
					}
				}
				objFormElement.SetValue(selectedValues);
			}
			
			var objHTMLElement = objFormElement.GetElement();
			if (objHTMLElement && objHTMLElement.onchange)
			{
				objHTMLElement.onchange();
			}
			else
			{
				parent.OnRecordChanged(lngFieldID);
			}
		}
	}
	
	function SetComboOrListValue_Inv(lngFieldID, arrSelectedIDs, arrSelectedValues, arrInternalValues)
	{
		var strSelectedIDs;
		var strSelectedValues;
		
		if (lngFieldID)
		{
			var objField=parent.m_objViewFields.Field(lngFieldID);

			var objFormElement=new CMqFormElement();
			objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');
			var lngControlType=objFormElement.GetControlType();
			
			if (lngControlType == CTRL_TYPE_LARGE_COMBO)
			{
				strSelectedIDs = "";
				strSelectedValues = "";
				
				if(arrSelectedIDs && arrSelectedValues){
					strSelectedIDs = arrSelectedIDs[0];
					strSelectedValues = arrSelectedValues[0];
				}
				
				objFormElement.SetValueToLargeCombo(objFormElement.GetElement(), strSelectedIDs, strSelectedValues, lngFieldID);
			}
			else
			{
				var selectedValues="";
				for (var i=0; i < arrSelectedValues.length; i++)
				{
					if (i > 0){
						selectedValues += DEFAULT_VALUE_DELIM;
					}
					
					selectedValues += arrSelectedValues[i];
				}
				objFormElement.SetValue(selectedValues);
			}
			
			if(arrInternalValues){
				var arrFields;
				if(lngFieldID=="-1"){
					arrFields=new Array("","","", "-1", "916", "-1");
				}
				if(arrFields){
					if(arrInternalValues.length==1){
						arrInternalValues=unescape(arrInternalValues[0]).split("*|*");
					}
					if(arrInternalValues.length>=arrFields.length){
						for(x=0; x<arrInternalValues.length; x++){
							if(arrFields[x]!=""){
								objField=parent.m_objViewFields.Field(arrFields[x]);
								if(objField){
									objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');
									lngControlType=objFormElement.GetControlType();
			
									if (lngControlType == CTRL_TYPE_LARGE_COMBO)
									{
										objFormElement.SetValueToLargeCombo(objFormElement.GetElement(), arrInternalValues[x], arrInternalValues[x], arrFields[x], parent.objRequest);
									}
									else
									{
										objFormElement.SetValue(arrInternalValues[x]);
									}
								}
							}
						}
					}
				}
				
				if(lngFieldID=="568"){
					LoadInvoiceList();
				}
			}
			
			var objHTMLElement = objFormElement.GetElement();
			if (objHTMLElement && objHTMLElement.onchange)
			{
				objHTMLElement.onchange();
			}
			else
			{
				parent.OnRecordChanged(lngFieldID);
			}
		}
	}

		
		var FIELD_ID_DELIM=",";

		function AttachEvent(obj,strEvent,objFunction)
		{	
			if(obj.attachEvent){
				obj.attachEvent("on" + strEvent, objFunction);
			}else{
				if(obj.addEventListener){
					obj.addEventListener(strEvent, objFunction, false);
				}
			}
		}

		function InitContProj()
		{
			var oCtl;
			var oFlds=parent.m_objViewFields;
			var arrFldIDs=parent.m_strFullNameFieldIDs.split(FIELD_ID_DELIM);
			
			var arrPwdTriggerFlds=new Array(FLD_AUTHENTICATE_WITH_ID, FLD_SEC_TYPE_ID, FLD_CAN_LOGON);
			if (parent.m_objLoadDataMgr){
				if (oFlds){
					for (i=0;i<arrFldIDs.length;i++){
		  				
		  				oCtl=parent.m_objLoadDataMgr.GetHTMLElement(oFlds.Field(arrFldIDs[i]),document);
		  				if (oCtl){
		  					AttachEvent(oCtl,"change",MqCont_BuildFullName);		  					
		  				}
		  			}
		  			
		  			for(i=0; i<arrPwdTriggerFlds.length; i++){
						oCtl=parent.m_objLoadDataMgr.GetHTMLElement(oFlds.Field(arrPwdTriggerFlds[i]),document);
		  				if (oCtl){
		  					AttachEvent(oCtl,"change",MqCont_HandlePasswordFields);
		  				}
		  			}
		  		
		  			oCtl=parent.m_objLoadDataMgr.GetHTMLElement(oFlds.Field(1105),document);
		  			if(oCtl){
		  				AddOnChangeEvent(oCtl, "CheckStartDate()");
	  				}
		  				  				
					parent.m_objLoadDataMgr.SetOnAfterLoad("Record.MqCont_HandlePasswordFields(true);", true);
				}
			}
		}
		

		function AddOnChangeEvent(oCtl, strFunctionName, arrParams){
			var strBody="";
			var objFunc;			
			var PARAM_NAMES_INDEX = 0;
			var PARAM_VALUES_INDEX = 1;
			
			if (oCtl){							
				if(oCtl.onchange){
					strBody="var objFunction=" + oCtl.onchange.valueOf() + ";" + "objFunction();" + strFunctionName;
				}else{
					strBody=strFunctionName;
				}
				
				if(typeof(arrParams) != 'undefined'){
					objParamsName = arrParams[PARAM_NAMES_INDEX];
					objParamsValue = arrParams[PARAM_VALUES_INDEX];
					
					var objFunc = new Function (objParamsName, strBody );					
					
					oCtl.onchange=function(){
							//AttachEventFormulaFieldsCompany;							
							objFunc.apply(this, objParamsValue);
							objFunc();
					};					
				}else{
					objFunc=new Function (strBody );
					oCtl.onchange=objFunc;
				}
			}	
		}
		
		
		//This wrapper is important. When workflow adds code to the "onchange" event of a particular TmplRecord.htm element, 
		// it does so in TmplCensusMain.htm, using the CMQWorkflowRules.js code. This has a side-effect - it 
		// causes the "onchange" to be running in the TmplCensusMain.htm context, rather than TmplRecord.htm. 
		//This changes the meaning of the code that is in onchange (hard-coded on the TmplRecord.htm side).
		//
		//For example, "parent.OnRecordChanged" is valid when running in the context of TmplRecord.htm, 
		//but not if we're running in the TmplCensusMain.htm context.
		//(OnRecordChanged is a method that is stored at the TmplCensusMain.htm level - in the TmplCensusMain.htm context, 
		//"parent" refers to TmplCensusMain's parent, which certainly will NOT have the "OnRecordChanged" method.)
		//
		//To ensure the "onchange" code specified in TmplRecord.htm works in both contexts, we call it simply as "OnRecordChanged".
		//TmplCensusMain.htm context: "OnRecordChanged" works perfectly because we're already where we know the method is defined.
		//TmplRecord.htm context: Previously, the method didn't exist at the TmplRecord.htm level. We therefore added a wrapper
		//that simply refers to the OnRecordChanged in TmplCensusMain.htm.
		//This way, whatever the context, we're covered. 
		//
		//For more information, see dev issue 4351.
		function OnRecordChanged(strFieldID)
		{
			if(parent){
				if(parent.OnRecordChanged){
					parent.OnRecordChanged(strFieldID);
				}
			}
		}
		
		
		function SetOnChange(oCtrl, strFunction)
		{
			if (oCtrl){
				var strBody="";
				if (oCtrl.onchange){
					strBody="var objFunction=" + oCtrl.onchange.valueOf() + ";"  + "objFunction();" + strFunction;
				}else{
					strBody=strFunction;
				}
				var objFunc=new Function ( strBody );
				oCtrl.onchange=objFunc;		
			}
		}

		

		var mlngBatchCount=1;
		

		function SetFieldValueAfterLoad(lngFieldID, strValue)
		{
			parent.m_objLoadDataMgr.SetOnAfterLoad("Record.DoSetFieldValueAfterLoad(" + lngFieldID + ", " + strValue + ");", true);
		}
		
		function DoSetFieldValueAfterLoad(lngFieldID, strValue)
		{
			var objField=parent.m_objViewFields.Field(lngFieldID);

			if(objField){
				var objFormElement=new CMqFormElement();
				objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');		
		
				objFormElement.SetValue(strValue);
			}
		}

		function AddTooltipToFieldCaption(lngFieldID)
		{
			var objCaption=document.getElementById("MqFC_" + lngFieldID);
			
			if(objCaption){
				objCaption.innerHTML=objCaption.innerHTML + ' <a href="#" onclick="parent.OpenModalWindow(\'tmplTooltips.htm?FID=' + lngFieldID + '\');return false;"><img src="../../Theme/images/buttons/info16_on.gif" border="0" alt="Help"></a>';
			}
		}

		var m_objLoadingMessage = new CMqLoadingMessage();
		m_objLoadingMessage.Initialize(document, "divLoading", "htmlRecord", "divBlocker")
		
		function MqFormulaFormatter(strPatternFieldIDs, strWci, strWciParameter, strTargetField){
			var m_BatchFieldNumber;
			
			this.ProcessFormula = ProcessFormula;						
			this.BatchFieldNumber = m_BatchFieldNumber;
			this.SetBatchFieldNumber = SetBatchFieldNumber;
			
			function SetBatchFieldNumber(pm_BatchFieldNumber){
				m_BatchFieldNumber = pm_BatchFieldNumber;
			}
			
			function GetBatchUserInformation(lngFieldID, blnSet, strValue){
				var strBatchFieldName;
				var strFieldName;
				var objField;
				var objCtrl;
				var objFormElement;
				var strFldValue;
				
				objField=parent.m_objViewFields.Field(lngFieldID);					
				strFieldName = objField.GetBoundControl();
				
				strBatchFieldName=strFieldName.replace(new RegExp(lngFieldID,"g"), lngFieldID + "_" + m_BatchFieldNumber);
			
				objCtrl = document.getElementById(strBatchFieldName);
				
				if(objCtrl){
					objFormElement=new CMqFormElement();
					
					if(!blnSet){
						strFldValue = objFormElement.GetValue(false, objCtrl);
					}else{
						objFormElement.SetValue(strValue, false, objCtrl);	
					}
				}
				
				return strFldValue;
			}
			
			function SetBatchUserInformation(lngFieldID, strValue){
				return GetBatchUserInformation(lngFieldID, true, strValue);
			}
			
			function ProcessFormula(blnBatchNumber){				
				var objDtMgr = parent.m_objLoadDataMgr;
				var strFormulaIDs = strPatternFieldIDs.split(FIELD_ID_DELIM);
				var strInfo = '';
				var sFName;
				var sLName;
				var FIRST_NAME_FIELD_ID = -1;
				var LAST_NAME_FIELD_ID = -1;
				
				if(typeof(blnBatchNumber) != 'undefined' && blnBatchNumber != ''){
					SetBatchFieldNumber(blnBatchNumber);					
				}

				if(m_BatchFieldNumber > 0){
					sFName = GetBatchUserInformation(FIRST_NAME_FIELD_ID);
					sLName = GetBatchUserInformation(LAST_NAME_FIELD_ID);					
				}else{
					sFName = objDtMgr.GetFieldValue(FIRST_NAME_FIELD_ID);
					sLName = objDtMgr.GetFieldValue(LAST_NAME_FIELD_ID);						
				}
				
				var sCompanyID = objDtMgr.GetFieldValue(-1);
							
				if(sFName != '' && sLName != ''){	
						
					for(c=0;c<strFormulaIDs.length;c++){
						if(m_BatchFieldNumber > 0){
							strInfo += GetBatchUserInformation(strFormulaIDs[c]) + ' ';	
						}else{
							strInfo += objDtMgr.GetFieldValue(strFormulaIDs[c]) + ' ';
						}
					}

					strInfo = strInfo.substring(0, strInfo.length - 1);
					strInfo = strInfo.replace(/\'/g,'');
					
					if(parent){			
						var strURL="HRIT.asp?WCI=" + strWci + "&" + strWciParameter + "="+g_MqRef.MqStr.MqEncodeURIComponent(strInfo)+"&companyid="+sCompanyID+"&Fld="+strTargetField;
						
						var objRequest = parent.objRequest;
						
						if(objRequest){
							var strReturn=objRequest.Get(strURL);
							
							if(strReturn != ''){
								if(m_BatchFieldNumber){
									SetBatchUserInformation(strTargetField, strReturn);
								}else{
									objDtMgr.SetSingleValueToFields(strReturn,[strTargetField],false,false);
									
									if(parent.m_objViewFields){
										var oField=parent.m_objViewFields.Field(strTargetField);
										if (oField){
											var oCtl=objDtMgr.GetHTMLElement(oField, document);
											if(oCtl){
												if(oCtl.onchange){
													oCtl.onchange();
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		
		function HandleDisableTabFields(strTabIDs)
		{
			if(parent){
				var lngCallerProject=g_MqRef.MqStr.GetQueryStringValue(parent.document.location.search, "CP");
				
				if(lngCallerProject=="14"){
					if (parent.m_objLoadDataMgr){
						parent.m_objLoadDataMgr.SetOnAfterLoad("Record.DoHandleDisableTabFields('" + strTabIDs + "');", true);
					}
				}
			}
		}
		
		function DoHandleDisableTabFields(strTabIDs)
		{
			var arrTabIDs=strTabIDs.split(";");
			
			if(parent){
				if(parent.m_objViewFields){
					
					var varFields=parent.m_objViewFields.GetFieldCol();
					var objFormElement=new CMqFormElement();
					
					for(lngFieldID in varFields){
								
					   try{
							var oField=parent.m_objViewFields.Field(lngFieldID);
					        if (oField){
								if(g_MqRef.MqArr.IsValueInArray(oField.GetTabID(), arrTabIDs)){
									objFormElement.Initialize(oField.GetBoundControl(),oField.GetControlType(),'document');
									objFormElement.Disable(true);
									var objCtrl=document.getElementById(oField.GetBoundControl());
									
									if(objCtrl){
										objCtrl.setAttribute("MqSkipForSave", "1");
									}
								}
							}
						}catch (e){
						//we do not log the error
						}
					}
				}
			}
		}
		
		function HandleResCondFields(lngChkFldID, lngCtrlFldID)
		{
			if (parent.m_objLoadDataMgr){
				parent.m_objLoadDataMgr.SetOnAfterLoad("Record.DoHandleResCondFields('" + lngChkFldID + "','" + lngCtrlFldID + "');", true);
			}
		}
		
		function DoHandleResCondFields(lngChkFldID, lngCtrlFldID)
		{
			if(parent){
				if(parent.m_objViewFields){
					var objField=parent.m_objViewFields.Field(lngChkFldID);
					if (objField){
						var objFormElement=new CMqFormElement();
						var lngCtrlType=objField.GetControlType();
						objFormElement.Initialize(objField.GetBoundControl(),lngCtrlType,'document');
						var blnChecked=objFormElement.GetValue();
						HideResCondFields(lngChkFldID, lngCtrlFldID, blnChecked);
					}
				}
			}
		}
		
		function HideResCondFields(lngChkFldID, lngCtrlFldID, blnChecked)
		{
			var USAGE_TYPE_FIELD_ID=806;
			
			var USAGE_TYPE_TEMPLATE=2;
			
			var lngUsageType=0;
			
			if(parent){
				if(parent.m_objViewFields){
					var objFormElement=new CMqFormElement();
					var objUsageTypeFld=parent.m_objViewFields.Field(USAGE_TYPE_FIELD_ID);
					if (objUsageTypeFld){
						var lngCtrlType=objUsageTypeFld.GetControlType();
						objFormElement.Initialize(objUsageTypeFld.GetBoundControl(),lngCtrlType,'document');
						lngUsageType=objFormElement.GetValue();
						if(lngUsageType!=USAGE_TYPE_TEMPLATE){
							HideFormElement("MqF_" + lngChkFldID, true);
							HideFormElement("MqFC_" + lngChkFldID, true);
							HideFormElement("sep" + lngChkFldID, true);
												
							if(blnChecked){
								HideFormElement("MqF_" + lngCtrlFldID, false);
								HideFormElement("MqFC_" + lngCtrlFldID, false);
								HideFormElement("sep" + lngChkFldID, false);
							}else{
								HideFormElement("MqF_" + lngCtrlFldID, true);
								HideFormElement("MqFC_" + lngCtrlFldID, true);
							}
						}else{
							HideFormElement("MqF_" + lngChkFldID, false);
							HideFormElement("MqFC_" + lngChkFldID, false);
							HideFormElement("sep" + lngChkFldID, false);
							
							HideFormElement("MqF_" + lngCtrlFldID, false);
							HideFormElement("MqFC_" + lngCtrlFldID, false);
							
							var objField=parent.m_objViewFields.Field(lngCtrlFldID);
							if (objField){
								objFormElement.Initialize(objField.GetBoundControl(),objField.GetControlType(),'document');
								objFormElement.Disable(true);
							}
						}
					}
				}
			}
		}
		
		function HideFormElement(strElementID, blnHidden)
		{
			var objElement=document.getElementById(strElementID);
			if(objElement){
				if(blnHidden){
					objElement.style.display="none";
					objElement.setAttribute("MqHidden", "1");
				}else{
					objElement.style.display="";
					objElement.style.visibility="visible";
				}
			}
		}
				
		function InitEndDateOnChange(strDateFieldName, lngTimeFieldID)
		{
			var oCtl=document.getElementById(strDateFieldName);
		  	
		  	if (oCtl){
		  		SetOnChange(oCtl,"OnEndDateChanged(this, " + lngTimeFieldID + ")");
		  	}
			return true;
		}
		
		function OnEndDateChanged(objEndDateField, lngTimeFieldID)
		{
			var DEFAULT_END_DATE="11:59 PM";
			
			if(objEndDateField){
			
				var strEndDate=objEndDateField.value;
				if(strEndDate!=""){
					var objEndTimeField=parent.m_objViewFields.Field(lngTimeFieldID);

					var objFormElement=new CMqFormElement();
					objFormElement.Initialize(objEndTimeField.GetBoundControl(),objEndTimeField.GetControlType(),'document');
			
					var strEndTime=objFormElement.GetValue();
					
					if(strEndTime==""){
						objFormElement.SetValue(DEFAULT_END_DATE);
					}
				}
			}
		}
		
		CloseWindowByEscKey();
		
		
	
</script>
</head>
<div id="ifraCal" style="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;width:150px;height:170px;padding:0px;z-index:10;"></div>
<iframe id="ifrAutoSuggest" src="blank.htm" style="position: absolute;width: 400px; height: 170px;z-index: 16;display: none; border: 1px solid gray;overflow: none" frameborder="0" ></iframe>
<body onload="OnloadRecord()" rightmargin=0 topmargin=0 onclick="m_objAutoSuggest.Hide()" onresize="m_objAutoSuggest.Reposition();m_objLoadingMessage.Reposition()">
<div id="divBlocker" class="LoadingClickBlocker" style="display: none"></div>
<div id="divLoading" class="LoadingMessage" style="display: none">
	<span class="LoadingMessageText"><script type="text/javascript">document.write(g_MqRef.RESX["LOADING_PLEASE_WAIT"]);</script></span>
</div>
<form name="Record" action="#">

<!-----------------------------------------Overview TAB ----------------------------------------->
	
	<script type='text/javascript'>
		if (m_objTabsMgr) document.write(m_objTabsMgr.GetTabPageHeaderHTML(1));
	</script>
	

	<table width="100%" class="RecordTab" cellspacing="0" style="table-layout: fixed;">
				
		<tr>
			<td width="15%" valign="bottom" class="bgHeader"><a name="1">&#160;</a></td>
			<td width="35%" >&#160;</td>
			<td width="15%">&#160;</td>
			<td width="35%">&#160;</td>
		</tr>
		
		
		

		
		

<!-----------------------------------------Allocation TAB ----------------------------------------->
	
	<script type='text/javascript'>
		if (m_objTabsMgr) document.write(m_objTabsMgr.GetTabPageHeaderHTML(30));
	</script>
	

	<table width="100%" class="RecordTab" cellspacing="0" style="table-layout: fixed;">
				
		<tr>
			<td width="15%" valign="bottom" class="bgHeader"><a name="30">&#160;</a></td>
			<td width="35%" >&#160;</td>
			<td width="15%">&#160;</td>
			<td width="35%">&#160;</td>
		</tr>
		
		
		
		<tr>
<!-- Begin of 103_7-->

<td  id='MqFC_11' width=20%  align=left  valign=top  class="fieldVisibility" MqHidden="0"><font  class="normalfield">Assign To:</font></td>
<td id='MqF_11'  align=left  valign=top   colspan=3   class="fieldVisibility" MqHidden="0"><div  class='FieldWithButton'>

			<input class='LargeCombo SpanTwoWidthOne' mqvalue='' mqcontroltype='LargeCombo' style='position:absolute;height:24px' size=1  name='cbo_11_cboOwner' id='cbo_11_cboOwner' 
			onchange="OnRecordChanged('11')" width="30" title="" onmouseover="this.className='LargeCombo SpanTwoWidthOne '" 
			onkeyup="m_objAutoSuggest.OnKeyUp(this, '11', 'Assign To', event, 'tblUser', '16', null, '0');" onkeydown="m_objAutoSuggest.OnKeyDown(this, event)" 
			size="1" onfocus="m_objAutoSuggest.OnFocus(this, '11', 'Assign To', event, 'tblUser', '16', null, '0')" onblur="m_objAutoSuggest.OnBlur(this)" 
			mqloaduserdetails='' onclick="parent.MqField_SingleChoice.OnClick('11', document, window, parent.m_objViewFields); m_objAutoSuggest.OnClick(this, event)" 
			onmouseout="this.className='LargeCombo SpanTwoWidthOne'"   >

<script type='text/javascript'>
	var oFrmFld11=new VNFormField(g_VWS.ViewFields().Field(11),document);
	var sFunc11='LoadLargeListOrCombo(11, \'Assign To\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=tblUser&DS=16&CO=0\',\'tblUser\',null,null,null,null,null,16)';
	oFrmFld11.AddURLButton(sFunc11,	'BrowseAlternateChoiceListSpanTwoWidthOne');
	
var bHidden=0; // 1 or 0

if (bHidden)
{
	//Move to new FormElement function
	var oFrmFld=new VNFormField(g_VWS.ViewFields().Field(11),document);
	oFrmFld.MakeHiddenType();
	
}
</script>
</div></td>
<!-- End of 103_7-->
			
</tr>
			
			
<tr>
<!-- Begin of 103_7-->

<td  id='MqFC_882' width=20%  align=left  valign=top  class="fieldVisibility" MqHidden="0"><font  class="normalfield">Relocate to:</font></td>
<td id='MqF_882'  align=left  valign=top   colspan=3   class="fieldVisibility" MqHidden="0"><div  class='FieldWithButton'>

			<input class='LargeCombo SpanTwoWidthOne' mqvalue='' mqcontroltype='LargeCombo' style='position:absolute;height:24px' size=1  name='cbo_882_cbo_882_Asset_Location' 
			id='cbo_882_cbo_882_Asset_Location' 
			onchange="OnRecordChanged('882')" width="30" title="" onmouseover="this.className='LargeCombo SpanTwoWidthOne '" 
			onkeyup="m_objAutoSuggest.OnKeyUp(this, '882', 'Relocate to', event, 'Location', '16', null, '0');" onkeydown="m_objAutoSuggest.OnKeyDown(this, event)" 
			size="1" onfocus="m_objAutoSuggest.OnFocus(this, '882', 'Relocate to', event, 'Location', '16', null, '0')" onblur="m_objAutoSuggest.OnBlur(this)" 
			mqloaduserdetails='' onclick="parent.MqField_SingleChoice.OnClick('882', document, window, parent.m_objViewFields); m_objAutoSuggest.OnClick(this, event)" 
			onmouseout="this.className='LargeCombo SpanTwoWidthOne'"   >

<script type='text/javascript'>
	var oFrmFld882=new VNFormField(g_VWS.ViewFields().Field(882),document);
	var sFunc882='LoadLargeListOrCombo(882, \'Relocate to\',\'WCDisplayChoices.asp?WCI=DisplayChoices&TBL=Location&DS=16&CO=0\',\'Location\',null,null,null,null,null,16)';
	oFrmFld882.AddURLButton(sFunc882,	'BrowseAlternateChoiceListSpanTwoWidthOne');

var bHidden=0; // 1 or 0

if (bHidden)
{
	//Move to new FormElement function
	var oFrmFld=new VNFormField(g_VWS.ViewFields().Field(882),document);
	oFrmFld.MakeHiddenType();
	
}
</script>
</div></td>
<!-- End of 103_7-->
			
</tr>



<input type="hidden" value="0" name="txtModified">
<input type="hidden" value="0" name="txtLoaded">
<input type="hidden" value="0" name="txtAttachmentValues">
<input type="hidden" value="" name="txtExtraSubmitArgs" id="txtExtraSubmitArgs">

</form>
</body>
</html>
