<?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" />
	<link rel="stylesheet" type="text/css" href="../../../theme/css/censusmain.css"/>
	<link rel="stylesheet" type="text/css" href="../../../theme/css/mqwizard.css"/>
	<link rel="stylesheet" type="text/css" href="../../../js/JQUERY/jquery-ui-1.10.2.custom.css"/>
	
	<script type="text/javascript" src="../../../js/jquery/jquery-1.7.1.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.bgiframe-2.1.2.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.core.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.mouse.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.position.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.resizable.js"></script>
	<script type="text/javascript" src="../../../js/jquery/jquery.ui.dialog.js"></script>
	
	<script type="text/javascript" src="../../../js/mqsysutils.js"></script>
	<script type="text/javascript" src="../../../js/mqformelements.js"></script>
	<script type="text/javascript" src="../../../js/mqlist.js"></script>
    <script type="text/javascript" src="../../../js/mqviewfields.js"></script>
    <script type="text/javascript" src="../../../js/mqrecordset.js"></script>
    <script type="text/javascript" src="../../../js/mqloaddata.js"></script>
    <script type="text/javascript" src="../../../js/xml.js"></script>
	<script type="text/javascript" src="../../../js/popupwindow.js"></script>
	<script type="text/javascript" src="../../../js/date.js"></script>
	<script type="text/javascript" src="../../../js/anchorposition.js"></script>
	<script type="text/javascript" src="../../../js/calendarpopup.js"></script>
	<script type="text/javascript" src="../../../js/window.js"></script>
	<script type="text/javascript" src="../../../js/autosuggest.js"></script>
	<script type="text/javascript" src="../../../js/cmqlookupitemint.js"></script>
	<script type="text/javascript" src="../../../js/initlookupitemint.js"></script>

<title></title>
		
	<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 MSG_AGREEMENT_REQUIRES_NAME=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_NAME"];
		var MSG_AGREEMENT_REQUIRES_CONTACT_TYPE=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_CONTACT_TYPE"];
		var MSG_AGREEMENT_REQUIRES_CUSTOMER=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_CUSTOMER"];
		var MSG_AGREEMENT_REQUIRES_SRVC_TYPE=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_SRVC_TYPE"];
		var MSG_AGREEMENT_REQUIRES_SRVC_LVL=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_SRVC_LVL"];
		var MSG_AGREEMENT_REQUIRES_START_DATE=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_START_DATE"];
		var MSG_AGREEMENT_REQUIRES_END_DATE=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_END_DATE"];
		var MSG_AGREEMENT_REQUIRES_REPORTING_PERIOD=g_MqRef.RESX["SLA_ADMIN.MSG_AGREEMENT_REQUIRES_REPORTING_PERIOD"];
		var MSG_NAVIGATE_AWAY = g_MqRef.RESX["SLA_ADMIN.MSG_NAVIGATE_AWAY"];
		var MSG_REMINDER_REQUIRES_POC_AND_DAYS=g_MqRef.RESX["SLA_ADMIN.MSG_REMINDER_REQUIRES_POC_AND_DAYS"];
		var MSG_END_DATE_BEFORE_START_DATE=g_MqRef.RESX["SLA_ADMIN.MSG_END_DATE_BEFORE_START_DATE"];
		var MSG_REVIEW_DATE_BEFORE_START_DATE=g_MqRef.RESX["SLA_ADMIN.MSG_REVIEW_DATE_BEFORE_START_DATE"];
		var CUSTOMER_TYPE_SELECTED = 0;
		var CUSTOMER_TYPE_CONTACT = 1;
		var CUSTOMER_TYPE_COMPANY = 2;
		var CUSTOMER_TYPE_DEPARTMENT = 3;
		var TBL_USER = "tblUser";
		var TBL_DEPARTMENT = "tblDepartment";
		var FLD_NAME_ORIGINATOR = "nOriginatorID";
		var FLD_NAME_COMPANY_NAME = "nCompanyName";
		var FLD_NAME_DEPARTMENT = "Department";
		var FLD_NAME_USER = "nUserID";
		var FLD_CAPTION_CONTACT = "Contact";
		var FLD_CAPTION_COMPANY = "Company";
		var FLD_CAPTION_DEPARTMENT = "Department";
		var FLD_CAPTION_PROVIDER = g_MqRef.RESX["SLA_ADMIN.FLD_CAPTION_PROVIDER"];
		var FLD_CAPTION_CUSTOMER = g_MqRef.RESX["SLA_ADMIN.FLD_CAPTION_CUSTOMER"];
		var DS_TYPE_USERS = 16;
		var FLD_AGREEMENT_CUSTOMER_ID = "13";
		var FLD_POC_PROVIDER_ID = "16";
		var FLD_POC_CUSTOMER_ID = "17";
	
		//Configuration constants
		var CONFIG_TABLE_DS_TYPE = 3;
		var CONFIG_FIELD_CAPTION = 0;
		var CONFIG_TABLE_NAME = 1;
		var CONFIG_FIELD_NAME = 2;
		var m_blnAddAgreement=<WC@ADD_AGREEMENT></WC@ADD_AGREEMENT>;
		var m_lngAgreementID="<WC@AGREEMENT_ID></WC@AGREEMENT_ID>";
		var m_strAgreementFields="<WC@AGREEMENT_FIELDS></WC@AGREEMENT_FIELDS>";
		var m_blnSaving = false;
		var m_blnDataChanged = false;
		
		var m_objAutoSuggestSwitcher = new CMqAutoSuggestSwitcher();
		var m_arrAutoSuggestSettingsCustomer;
		var m_objAutoSuggestSettingsPOCProvider = new CMqAutoSuggestSettings(FLD_CAPTION_PROVIDER,TBL_USER,FLD_NAME_USER, DS_TYPE_USERS);
		var m_objAutoSuggestSettingsPOCCustomer = new CMqAutoSuggestSettings(FLD_CAPTION_CUSTOMER,TBL_USER,FLD_NAME_ORIGINATOR, DS_TYPE_USERS);
		
		m_objAutoSuggestSwitcher.Add(new CMqAutoSuggestSettings(FLD_CAPTION_CONTACT,TBL_USER,FLD_NAME_ORIGINATOR, DS_TYPE_USERS), CUSTOMER_TYPE_CONTACT);
		m_objAutoSuggestSwitcher.Add(new CMqAutoSuggestSettings(FLD_CAPTION_COMPANY,TBL_USER,FLD_NAME_COMPANY_NAME, DS_TYPE_USERS), CUSTOMER_TYPE_COMPANY);
		m_objAutoSuggestSwitcher.Add(new CMqAutoSuggestSettings(FLD_CAPTION_DEPARTMENT,TBL_DEPARTMENT,FLD_NAME_DEPARTMENT, DS_TYPE_USERS), CUSTOMER_TYPE_DEPARTMENT);
		
		m_arrAutoSuggestSettingsCustomer = m_objAutoSuggestSwitcher.MakeActive(CUSTOMER_TYPE_CONTACT);

		if(m_blnAddAgreement){
			document.title=g_MqRef.RESX["SLA_ADMIN.ADD_SLA"];
		}else{
			document.title=g_MqRef.RESX["SLA_ADMIN.UPDATE_SLA"];
		}
		var m_MqList=new MqList();
		var m_objMqButton=new MqButton();
		
		var m_objRef;
		if(opener){
			m_objRef=opener;
		}
		
		var m_objViewFields= new CMqFieldCol();
		var m_objLoadDataMgr;
    
		var m_strAgreementDataXML="<WC@AGREEMENT_XML_DATA>1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;28</WC@AGREEMENT_XML_DATA>";
		var m_oFieldValuesRs;
		var strDateFormat = "<WC@SYS_DATE_FORMAT></WC@SYS_DATE_FORMAT>";
		
		var DEFAULT_REMINDER_DAYS="7";
		
		var Ver6;
		var Nav6;
		var Nav7;
		Ver6 = parseInt(navigator.appVersion) >= 5;
		Nav6 = ((navigator.appName == "Netscape") && Ver6);
		
		// Create CalendarPopup objects
		var objCal = new CalendarPopup("ifraCal",null,null,"IFRAME");
		objCal.setMonthNames("January","February","March","April","May","June","July","August","September","October","November","December");
		objCal.setDayHeaders("S","M","T","W","T","F","S");
		objCal.setWeekStartDay(0); //Sunday
		objCal.setDisabledWeekDays(); //allow to select any day of the week
		objCal.setTodayText("Today");
		objCal.setCloseText("Close");
		objCal.showYearNavigation();


		var m_strWinID=parseInt( Math.random() * 1000);
		var m_objLookupItemInfoColl=new Array();
		var DEFAULT_VALUE_DELIM=";";
		var m_objViewFieldRef = document; //Was parent before. Must handle this when sharing.
		var m_strPathToAdminHTML = "../../../HTML/";
		
		var m_objAutoSuggest = new CMqAutoSuggest();
		
		m_objAutoSuggest.Initialize("", document);
		
			function MqOpenURL(strURL,strName, strFeatures,blnGetIDText,blnAsChildWin, blnAsModalWin, lngWidth, lngHeight)
			{               
				var MAX_URL_LEN=2020;
				if (!strName){
					strName="_blank";
				}
				
				if (!strFeatures){
					strFeatures="toolbar=no,directories=no,resizable=yes,scrollbars=yes";
				}
				
				if (parent){
					var objMacros=new parent.CMqMacros();
					if(objMacros){
						strURL=objMacros.ResolveFieldMacros(strURL,parent.m_objLoadDataMgr,true,blnGetIDText);
					}
							
					var objURIUtils=new parent.CMqURIUtils();
					if(objURIUtils){
						strURL=objURIUtils.AddURIProtocol(strURL);
					}
				}
				if (strURL.length>MAX_URL_LEN){
					strURL=strURL.substr(0,MAX_URL_LEN);
				}
				if(blnAsChildWin){
					if(blnAsModalWin){
						parent.OpenModalWindow(strURL, lngWidth, lngHeight, false);
					}else{
						OpenChildWindow(strURL,strName,strFeatures);
					}
				}else{
					window.open(strURL,strName,strFeatures);
				}
			}
		
		function AddURLButton(strURL,strCSSClassName,strFieldID, strFieldName, objDocumentRef)
        {
			var strTooltipButton="";
			var URL_BUTTON_NAME="RC";
			var RC_CSS_CLASS_NAME="RemoteControl";
			var strURLButtonName;
			var objString=new MqString();
			var USER_DETAILS_CLASS_NAME ="UserDetails";
			var BROWSE_ALT_CHOICE_LIST_CLASS_NAME ="BrowseAlternateChoiceList";
			var strButtonAction="MqOpenURL('"+strURL+"')";
			var strButtonNamePostfix;
			
			if (RC_CSS_CLASS_NAME==objString.Left(strCSSClassName,RC_CSS_CLASS_NAME.length)){
				strTooltipButton="Start a remote control session";
			}else{			
				if(USER_DETAILS_CLASS_NAME.toLowerCase()==objString.Left(strCSSClassName,USER_DETAILS_CLASS_NAME.length).toLowerCase()){
					strTooltipButton="Details";
					strButtonAction=strURL;
				}else{	
					if(BROWSE_ALT_CHOICE_LIST_CLASS_NAME.toLowerCase()==objString.Left(strCSSClassName,BROWSE_ALT_CHOICE_LIST_CLASS_NAME.length).toLowerCase()){
						strTooltipButton= g_MqRef.RESX["TOOLTIP_SELECT_VALUE"];
						strButtonAction=strURL;
						strButtonNamePostfix="_SelVal";
					}else{
						strTooltipButton="Connect to Internet address";
					}
				}
			}
					
			if(m_objMqButton){	
				if(strFieldName){
					if(strButtonNamePostfix){
						strURLButtonName=strFieldName+strButtonNamePostfix;
					}else{
						strURLButtonName=URL_BUTTON_NAME+strFieldName;
					}
				}else{
					strURLButtonName=URL_BUTTON_NAME+strFieldID;		
				}
				
				m_objMqButton.WriteButtonHTML(strURLButtonName,strButtonAction,strCSSClassName,false,m_objMqButton.STATE_1,strTooltipButton, null, objDocumentRef);
			}
        }		
		
		function GetBoundControl(lngFieldID)
		{
			var objElement;
			
			if(lngFieldID){
				var objField=m_objViewFields.Field(lngFieldID);//m_objViewFieldRef
				if(objField.GetBoundControl){
					var objElement = document.getElementById(objField.GetBoundControl());
				}
			}
			
			return objElement;
		}
		
		function LoadLargeListOrCombo(lngFieldID, strFieldCaption, strSearchResultsURL, strTableName, blnAutoComplete, lngRecordsPerPage, strFieldName, blnHideAddNewButton, lngWidth, lngHeight)
		{ 
	
			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=m_objViewFields.Field(lngFieldID);//m_objViewFieldRef
				if (objField){

					var arrSelectedIDs;
					var arrSelectedValues;
					var blnMultiSelect;
					var 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");
					}

					InitLookupItemVals(lngFieldID, arrSelectedIDs, arrSelectedValues, fnSetValue, blnMultiSelect, strFieldCaption, strWorkflowValues, strSearchResultsURL, blnAutoComplete, lngRecordsPerPage, strFieldName, blnHideAddNewButton);
					
					if(!lngWidth){
					if(blnMultiSelect){
						lngWidth=800;
					}else{
						lngWidth=650;
					}
					}
					if(!lngHeight){
						if(blnMultiSelect){
							lngHeight=570;
						}else{
							lngHeight=500;
						}
					}
					
					var strWinFeatures=GetWinFeaturesToCenter(lngWidth, lngHeight); 
					
					if(!blnAutoComplete){
						if(blnMultiSelect){
							MqOpenURL(m_strPathToAdminHTML + "TmplLookupItemMultiSelect.htm?TBL=" + g_MqRef.MqStr.MqEncodeURIComponent(strTableName) + "&FID=" + lngFieldID,"ChoicesList"+lngFieldID+m_strWinID,"scrollbars=no,resizable=yes,toolbar=no,directories=no" + strWinFeatures, false, true, true, lngWidth, lngHeight);
						}else{
							MqOpenURL(m_strPathToAdminHTML + "TmplLookupItem.htm?TBL=" + g_MqRef.MqStr.MqEncodeURIComponent(strTableName) + "&FID=" + lngFieldID,"ChoicesList"+lngFieldID+m_strWinID,"scrollbars=no,resizable=yes,toolbar=no,directories=no" + strWinFeatures, false, true, true, lngWidth, lngHeight);
						}
					}else{
						return m_strPathToAdminHTML + "TmplLookupItemCompact.htm?TBL=" + g_MqRef.MqStr.MqEncodeURIComponent(strTableName) + "&FID=" + lngFieldID;
					}
				} 
			}
		}
	
	function SetComboOrListValue(lngFieldID, arrSelectedIDs, arrSelectedValues)
	{
		var strSelectedIDs;
		var strSelectedValues;
		
		if (lngFieldID)
		{
			var objField=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);
			}
			
			var objHTMLElement = objFormElement.GetElement();
			if (objHTMLElement && objHTMLElement.onchange)
			{
				objHTMLElement.onchange();
			}
			else
			{
				parent.OnRecordChanged(lngFieldID);
			}
		}
	}
	
		/** AUTOSUGGEST ADDITIONS STOP **/
		function CreateWindowWithApplet2(ctrl ,ctrlAnchor,strFieldID)
		{	
			objCal.select(ctrl, ctrlAnchor,strDateFormat,strFieldID);
		}
		
		function CreateAttachmentsWindow(ctrl, strFieldName)
		{
			var strCtrlVal="-1";
			var strCtrlName="";
			var strValue;
			
			if(ctrl){
				strCtrlName=ctrl.id;
				strValue=ctrl.value;
			}
			
			if (strValue !== "") {
				strCtrlVal=g_MqRef.MqStr.MqEncodeURIComponent(strValue, ";");
			}
				
			var strArgs="AttachID=" + g_MqRef.MqStr.MqEncodeURIComponent(GetHiddenAttachFields("txtUploadDir")) + 
							"&Proj=" + m_objRef.GetProjectID() + 
							"&FldName=" + g_MqRef.MqStr.MqEncodeURIComponent("SLA_" + strFieldName) +
							"&CtrlName=" + g_MqRef.MqStr.MqEncodeURIComponent(strCtrlName) +
							"&ctrlValue=" + strCtrlVal;
			OpenChildWindow("Attachment.asp?" + strArgs, "UploadFiles" + strCtrlName,"scrollbars=auto,resizable=yes", true, 500, 550);
			
		}
		
		function HandleIDToNameConversions()
		{
			var DELIM_COMPLEX = "*|*";
			
			var objCustomerFld = document.getElementById(FLD_AGREEMENT_CUSTOMER_ID);
			var objPOCProviderFld = document.getElementById(FLD_POC_PROVIDER_ID);
			var objPOCCustomerFld = document.getElementById(FLD_POC_CUSTOMER_ID);
			var lngCustomerID;
			var lngPOCProviderID;
			var lngPOCCustomerID;
			var INDEX_CUSTOMER = 0;
			var INDEX_POC_PROVIDER = 1;
			var INDEX_POC_CUSTOMER = 2;
			var strIDs;
			
			if(objCustomerFld){ lngCustomerID = objCustomerFld.getAttribute("mqvalue");}
			if(objPOCProviderFld){ lngPOCProviderID = objPOCProviderFld.getAttribute("mqvalue");}	
			if(objPOCCustomerFld){lngPOCCustomerID = objPOCCustomerFld.getAttribute("mqvalue");}
			
			if(!lngCustomerID){ lngCustomerID = 0; }
			if(!lngPOCProviderID){ lngPOCProviderID = 0; }
			if(!lngPOCCustomerID){ lngPOCCustomerID = 0; }
			
			strIDs= lngCustomerID + DEFAULT_VALUE_DELIM + m_arrAutoSuggestSettingsCustomer.GetTableName() + DEFAULT_VALUE_DELIM + DS_TYPE_USERS + DELIM_COMPLEX +
					lngPOCProviderID + DEFAULT_VALUE_DELIM + TBL_USER + DEFAULT_VALUE_DELIM + DS_TYPE_USERS + DELIM_COMPLEX +
					lngPOCCustomerID + DEFAULT_VALUE_DELIM + TBL_USER + DEFAULT_VALUE_DELIM + DS_TYPE_USERS;

			var co=m_objRef.mobjHTTPrequest.Get(m_objRef.mstrCurrentLocation + 
				"WCSLA.ASP?WCI=wciGetCustomerName&Proj=" + m_objRef.GetProjectID() + 
				"&IDS=" + g_MqRef.MqStr.MqEncodeURIComponent(strIDs));

			if(co.length > 0){
				var arrNames = co.split(DELIM_COMPLEX);
				
				if(arrNames){
					if(objCustomerFld){
						if(arrNames[INDEX_CUSTOMER]){
							if(arrNames[INDEX_CUSTOMER].length > 0){
								objCustomerFld.value = arrNames[INDEX_CUSTOMER];
							}
						}
					}
	
					if(objPOCProviderFld){
						if(arrNames[INDEX_POC_PROVIDER]){
							if(arrNames[INDEX_POC_PROVIDER].length > 0){
								objPOCProviderFld.value = arrNames[INDEX_POC_PROVIDER];
							}
						}
					}

					if(objPOCCustomerFld){
						if(arrNames[INDEX_POC_CUSTOMER]){
							if(arrNames[INDEX_POC_CUSTOMER].length > 0){
								objPOCCustomerFld.value = arrNames[INDEX_POC_CUSTOMER];
							}
						}
					}
				}
					
			}
		}

		function OnLoadBody()
		{
			var objHeaderText=document.getElementById("HeaderText");
		
			if(objHeaderText){
				if(m_blnAddAgreement){
					objHeaderText.innerHTML=g_MqRef.RESX["SLA_ADMIN.ADD_SLA"];
				}else{
					objHeaderText.innerHTML=g_MqRef.RESX["SLA_ADMIN.UPDATE_SLA"];
				}
			}
			
			LoadData();		
			
			HandleAgreementCustomerOptions(true);
			
			HandleIDToNameConversions();
			
			var objRSHelper = new CMqRSHelper();
			m_objLoadDataMgr.SetSingleValueToFields(objRSHelper.GetFieldValue(13,m_oFieldValuesRs), Array("13"),false,false);
			        
			        
			if(m_blnAddAgreement){
				var objEnabled=document.getElementById("9");
				if(objEnabled){
					objEnabled.checked=true;
				}
				
				var objReminderDays=document.getElementById("28");
				
				if(objReminderDays){
					objReminderDays.value=DEFAULT_REMINDER_DAYS;
				}
				
				SetHiddenAttachFields("txtUploadDir", "INIT");				
			}else{
				SetHiddenAttachFields("txtUploadDir", m_lngAgreementID);
			}	
		
			var objTxtName=document.getElementById("2");
			
			if(objTxtName){
				objTxtName.focus();
			}
			
			if(m_objRef){
				if(!m_objRef.CanManageEscalation()){
					disableImage("Ok");
					
					var objCtrl=document.getElementById("18");
					if(objCtrl){
						objCtrl.setAttribute("AttachMode", "7");
					}
				}
			}
		}
		
		
		function LoadData()
		{
			var objRecordset=new CMqRecordset(m_strAgreementFields,m_objViewFields.GetFieldIDName()); 
			m_objViewFields.Load(objRecordset);

			
			if(m_strAgreementDataXML.length>0){
				m_oFieldValuesRs=new CMqRecordset(m_strAgreementDataXML,m_objViewFields.GetFieldIDName());	
			}
			m_objLoadDataMgr= new CMqLoadDataMgr(m_objViewFields,"document");
				
			m_objLoadDataMgr.Load(m_oFieldValuesRs);
		}
		
		function SetAgreement()
		{
			var strWCI;
			var strRecordInfo;
			
			if(m_objRef){
				if(m_objRef.CanManageEscalation()){
					if(RequiredFieldsAreFilledIn()){
						if(DateValsAreValid()){
							strRecordInfo=m_objLoadDataMgr.GetDataForSave();
							
							m_blnSaving = true;
							
							if(m_blnAddAgreement){
								strWCI="wciAddAgreement";
							}else{
								strWCI="wciUpdateAgreement";
							}
							var co=m_objRef.mobjHTTPrequest.Get(m_objRef.mstrCurrentLocation + 
								"WCSLA.ASP?WCI=" + strWCI + "&Proj=" + m_objRef.GetProjectID() + 
								"&AID=" + m_lngAgreementID + "&RI=" + 
								g_MqRef.MqStr.MqEncodeURIComponent(strRecordInfo) +
								"&txtUploadDir="+ g_MqRef.MqStr.MqEncodeURIComponent(GetHiddenAttachFields("txtUploadDir")));
			
							if (co!=m_objRef.mobjHTTPrequest.CANCEL_PROCESS){
															
								var objResponse=m_objRef.mobjHTTPrequest.Response(co);
								if (objResponse){
									if (objResponse.HasErrors()){
										objResponse.ProcessErrors("",true);
									}else{
										m_objRef.LoadAgreementsListByProject();
										window.close();
									}
								}
							}	
						}
					}
				}
			}
		}
	

		function RequiredFieldsAreFilledIn()
		{
			var blnReturn=false;
			if(FieldIsFilled("2", MSG_AGREEMENT_REQUIRES_NAME)){
				if(FieldIsFilled("12", MSG_AGREEMENT_REQUIRES_CONTACT_TYPE)){
					if(FieldIsFilled("7", MSG_AGREEMENT_REQUIRES_SRVC_TYPE)){
						if(FieldIsFilled("10", MSG_AGREEMENT_REQUIRES_SRVC_LVL)){
							if(FieldIsFilled("4", MSG_AGREEMENT_REQUIRES_START_DATE)){
								if(FieldIsFilled("5", MSG_AGREEMENT_REQUIRES_END_DATE)){
									if(FieldIsFilled("21", MSG_AGREEMENT_REQUIRES_REPORTING_PERIOD)){
										var blnContinue = true;
										var cboCustType=document.getElementById("12");
										if(cboCustType){
											var lngCustType;
											lngCustType=cboCustType.options[cboCustType.selectedIndex].value;

											// SLAs that are not Global and Not Assigned by Engine need a 'customer'
											if(lngCustType != 4 && lngCustType != 5)
											{
												blnContinue = FieldIsFilled("13", MSG_AGREEMENT_REQUIRES_CUSTOMER);
											}
										}
										if (blnContinue){
											var objReminderChk=document.getElementById("8");
											if(objReminderChk){
												if(objReminderChk.checked){
													if((FieldIsFilled("28", "")==false) || 
															(FieldIsFilled("16", "")==false) ||
																(FieldIsFilled("11", "")==false)){
														alert(MSG_REMINDER_REQUIRES_POC_AND_DAYS);
													}else{
														blnReturn = true;
													}
												}else{
													blnReturn = true;
												}
											}else{
												blnReturn = true;
											}
										}
									}
								}
							}
						}
					}
				}
			}
			
			return blnReturn;
		}
		
		function DateValsAreValid()
		{
			var objStartDate=document.getElementById("4");
			var objEndDate=document.getElementById("5");
			var objReviewDate=document.getElementById("11");
			var strStartDate="";
			var strEndDate="";
			var strReviewDate="";
			
			if(objStartDate){	
				if(objEndDate){
					strStartDate=objStartDate.value;
					strEndDate=objEndDate.value;
					strReviewDate=objReviewDate.value;
					if(DateIsBefore(strStartDate, objEndDate.value)){
						alert(MSG_END_DATE_BEFORE_START_DATE);
						return false;
					}else{
						if(strReviewDate.length>0){
							if(DateIsBefore(strStartDate, strReviewDate)){
								alert(MSG_REVIEW_DATE_BEFORE_START_DATE);
								return false;
							}else{
								return true;
							}
						}else{
							return true;
						}
					}
				}
			}
		}
		
		function DateIsBefore(strBaseDate, strCheckDate)
		{
			var datDate1=Date.parse(strBaseDate);
			var datDate2=Date.parse(strCheckDate);
			var lngDiff=((datDate2-datDate1)/(24*60*60*1000));
			
			if(lngDiff<0){
				return true;
			}else{
				return false;
			}
		}

		function FieldIsFilled(strElementName, strRequiredMsg)
		{
			var objTxtCtrl;
			objTxtCtrl=document.getElementById(strElementName);
			
			if(objTxtCtrl){
				if(objTxtCtrl.value.length>0){
					return true;
				}else{
					if(strRequiredMsg.length>0){
						alert(strRequiredMsg);
						objTxtCtrl.focus();
					}
					return false;
				}	
			}
		}
		
		function KeyPressed(e)
		{			
			if(e){	
				if(e.keyCode == 13){
					if(!EvtSrcCtrlIsMemo(e)){
						SetAgreement();
					}
				}else{
					if(e.keyCode == 27){
						window.close()
					}
				}
			}
		}
		
		function EvtSrcCtrlIsMemo(e)
		{
			var MEMO_TYPE="textarea";
			
			var objElement;
			var blnReturn=false;
					
			if(e.srcElement){
				objElement=e.srcElement;
			}else{
				if(e.target){
					objElement=e.target;
				}
			}
					
			if(objElement){
				blnReturn = (objElement.type==MEMO_TYPE);
			}
			
			return blnReturn;
		}
		
		function VerifyValue(ctrlName,strNewValue)
		{
			//This function is here for the calendar so we can 
			//share the code. Same as function in CensusMain.js
											
			var ctrl=document.getElementById(ctrlName);
							
			if(ctrl){
				ctrlvalue = ctrl.value;
				if (ctrlvalue !=  strNewValue){
					ctrl.value = strNewValue;
				}
			}
		}
				
		function HandleAgreementCustomerOptions(blnOnLoad)
		{
			var cboCustType=document.getElementById("12");
			
			if(cboCustType){
				var lngCustType;
				if(blnOnLoad){
					if(m_blnAddAgreement){
						lngCustType=1;
					}else{
						if(cboCustType.selectedIndex==-1){
							lngCustType=1;
						}else{
							lngCustType=cboCustType.options[cboCustType.selectedIndex].value;
						}
					}
				}else{
					lngCustType=cboCustType.options[cboCustType.selectedIndex].value;
				}
				m_objAutoSuggest.Hide(false);
		
				if(lngCustType){
					if(lngCustType < 4){
						m_arrAutoSuggestSettingsCustomer = m_objAutoSuggestSwitcher.MakeActive(lngCustType);
						
						DisableCustomerField(false);
					}else{
						DisableCustomerField(true);
					}
				}else{
					//Happens when the user selects the blank choice list value.
					DisableCustomerField(true);
				}
				
				if(!blnOnLoad){
					var objCustomerField = document.getElementById("13");
					if(objCustomerField){
						objCustomerField.setAttribute('value','');
						objCustomerField.setAttribute('mqvalue', '');
					}
					

					
				}
				 
			}
		}
		
		function DisableCustomerField(blnDisable){

			var objFormElement=new CMqFormElement();
			var objCustomerField = document.getElementById("13");
			if(objCustomerField){
				objFormElement.Initialize("13",objFormElement.GetControlType(objCustomerField),document);
				objFormElement.Disable(blnDisable, objCustomerField, document);
			}
			
			var objCustomerFieldBtn = document.getElementById("a_13_SelVal");
			if(objCustomerFieldBtn){
				if(blnDisable){
					m_objMqButton.Disable(objCustomerFieldBtn);
				}else{
					m_objMqButton.Enable(objCustomerFieldBtn);
				}
			}
		}

		//this function will get the hidden fields if there are 
		//attachments in a new agreement
		function GetHiddenAttachFields(ctrlName)
		{
			return document.getElementById(ctrlName).value;
		}

		//this function will set the hidden fields if there are 
		//attachments in a new agreement
		function SetHiddenAttachFields(ctrlName,strNewValue)
		{
			var ctrl = document.getElementById(ctrlName);
			var ctrlvalue = ctrl.value;

			if (ctrlvalue !=  strNewValue){
				ctrl.value = strNewValue;
			}
		}

		 function WindowClosing()
		 {
			if(m_blnDataChanged && !m_blnSaving){
				return MSG_NAVIGATE_AWAY;
			}
		 }
		 
		 function DataChanged()
		 {
			m_blnDataChanged = true;
		 }		
	</script>
</head>
<iframe id="ifraCal" style="position:absolute;visibility:hidden;width:150px;height:170px;padding:0px;z-index:10;" frameborder="1"></iframe>
<iframe id="ifrAutoSuggest" src="blank.htm" style="position: absolute;width: 400px; height: 181px;z-index: 16;display: none; border: 1px solid gray;overflow: none" frameborder="0" ></iframe>
<body class="ToolbarBody" style="margin:0px" onload="OnLoadBody()" onclick="m_objAutoSuggest.Hide()" onunload="OnBeforeNavigate();" onbeforeunload="return WindowClosing()" onkeypress="KeyPressed(event)" onresize="m_objAutoSuggest.Reposition()">

	<table width="100%" height="30" class="HeaderTop" marginwidth="0" cellpadding="0" cellspacing="0" border="0">	
		<tr>
			<td width="100%" align="left">
				<div id="HeaderText" class="SmallHeaderText">Add Service Agreement</div>
			</td>
		</tr>
	</table>
				
<table width="98%" style="margin-top:15px; margin-left:10px; margin-right:10px;table-layout: fixed">
<tr>
	<td width="20%" class="DialogLabelRequired">Agreement Name:</td>
	<td width="30%">
		<input type="text" name="2" id="2" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="255" onchange="DataChanged()">
	</td>	
</tr>
<tr>
	<td valign="top" class="DialogLabel" style="padding-top:10px">Agreement Description:</td>
	<td style="padding-top:10px" colspan="3">
		<textarea name="3" id="3" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			rows="5" cols="22" onchange="DataChanged()"></textarea>
	</td>
</tr>
<tr>
	<td colspan="4">
		<hr style="color:#336699; height:1px;">
	</tr>
</tr>
<tr>
	<td class="DialogLabelRequired" style="padding-top:10px">Agreement is auto-assigned based on:</td>
	<td style="padding-top:10px">
		<select id="12" class="ComboBoxWidth" onchange="HandleAgreementCustomerOptions(false);DataChanged()">
			<option value="1">Contact</option>
			<option value="2">Company</option>
			<option value="3">Department</option>
			<option value="4">Global</option>
			<option value="5">Not Assigned By SLA Engine</option>
        </select>
	</td>

	<td class="DialogLabelRequired" style="padding-top:10px">Agreement Customer:</td>
	<td style="padding-top:10px">
		<div class='FieldWithButton'>
					<input class='LargeCombo ' mqvalue='' mqcontroltype='LargeCombo' style='position:relative;width: 75%' size=1  name='13' id='13' onchange="DataChanged()" width="30" onclick="" title="" onmouseover="this.className='LargeCombo  '" onkeyup="m_objAutoSuggest.OnKeyUp(this, '13', m_arrAutoSuggestSettingsCustomer.GetCaption(), event, m_arrAutoSuggestSettingsCustomer.GetTableName(), m_arrAutoSuggestSettingsCustomer.GetDSType(), m_arrAutoSuggestSettingsCustomer.GetFieldName());" onkeydown="m_objAutoSuggest.OnKeyDown(this, event)" size="1" onfocus="m_objAutoSuggest.OnFocus(this, '13', m_arrAutoSuggestSettingsCustomer.GetCaption(), event, m_arrAutoSuggestSettingsCustomer.GetTableName(), m_arrAutoSuggestSettingsCustomer.GetDSType(), m_arrAutoSuggestSettingsCustomer.GetFieldName())" onblur="m_objAutoSuggest.OnBlur(this)" onclick="m_objAutoSuggest.OnClick(this, event)" onmouseout="this.className='LargeCombo '" hasuserextension='false' ></input>
					<a mqbaseclass="BrowseAlternateChoiceList" title="Select value" accesskey="null" onclick="if(!m_objMqButton.IsDisabled(this)){LoadLargeListOrCombo(13, m_arrAutoSuggestSettingsCustomer.GetCaption(),'WCDisplayChoices.asp?WCI=DisplayChoices&amp;TBL=' + m_arrAutoSuggestSettingsCustomer.GetTableName() + '&amp;DS=' + m_arrAutoSuggestSettingsCustomer.GetDSType() +  '&amp;CO=0',m_arrAutoSuggestSettingsCustomer.GetTableName(),0,null,m_arrAutoSuggestSettingsCustomer.GetFieldName(), true);}return false;" id="a_13_SelVal" href="#" class="BrowseAlternateChoiceListState1"></a>
		</div>
	</td>
</tr>
<tr>
	<td colspan="4">
		<hr style="color:#336699; height:1px;">
	</td>
</tr>
<tr>
	<td class="DialogLabelRequired" style="padding-top:5px"><WC@SERVICE_TYPE_CAPTION></WC@SERVICE_TYPE_CAPTION>:</td>
	<td style="padding-top:5px">
		<select id="7" class="ComboBoxWidth" onchange="DataChanged()">
                <WC@CLV2>QS:STFN</WC@CLV2>
        </select>
	</td>
	<td class="DialogLabelRequired" style="padding-top:10px">Agreement Start Date:</td>
	<td style="padding-top:10px">
		<a  name='a_4' id='a_4'> </a>
		<div  class='FieldCalendar' name='div_4' id='div_4'>
		<input type="text" name="4" id="4" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="50" onchange="DataChanged()">
		<script type='text/javascript'>m_objMqButton.WriteButtonHTML('4_cal',"CreateWindowWithApplet2(document.getElementById('4'),'a_4','4')",'Calendar',false,m_objMqButton.STATE_1,'Calendar');</script>
		</div>
	</td>
</tr>
<tr>
	<td class="DialogLabelRequired" style="padding-top:10px">Service Level:</td>
	<td style="padding-top:10px">
		<select id="10" class="ComboBoxWidth" onchange="DataChanged()">
                <WC@SERVICE_LEVEL_LST></WC@SERVICE_LEVEL_LST>
        </select>
	</td>
	<td class="DialogLabelRequired" style="padding-top:10px">Agreement End Date:</td>
	<td style="padding-top:10px">
		<a  name='a_5' id='a_5'> </a>
		<div  class='FieldCalendar' name='div_5' id='div_5'>
		<input type="text" name="5" id="5" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="50" onchange="DataChanged()">
		<script type='text/javascript'>m_objMqButton.WriteButtonHTML('5_cal',"CreateWindowWithApplet2(document.getElementById('5'),'a_5','5')",'Calendar',false,m_objMqButton.STATE_1,'Calendar');</script>
		</div>
	</td>
</tr>
<tr>
	<td class="DialogLabel" style="padding-top:10px"><script type="text/javascript">document.write(FLD_CAPTION_PROVIDER);</script>:</td>
	<td style="padding-top:10px">
		<div class='FieldWithButton'>
			<input class='LargeCombo ' mqvalue='' mqcontroltype='LargeCombo' style='position:relative;width: 75%' size=1  name='16' id='16' onchange="DataChanged()" width="30" onclick="" title="" onmouseover="this.className='LargeCombo  '" onkeyup="m_objAutoSuggest.OnKeyUp(this, '16', m_objAutoSuggestSettingsPOCProvider.GetCaption(), event, m_objAutoSuggestSettingsPOCProvider.GetTableName(), m_objAutoSuggestSettingsPOCProvider.GetDSType(), m_objAutoSuggestSettingsPOCProvider.GetFieldName());" onkeydown="m_objAutoSuggest.OnKeyDown(this, event)" size="1" onfocus="m_objAutoSuggest.OnFocus(this, '16', m_objAutoSuggestSettingsPOCProvider.GetCaption(), event, m_objAutoSuggestSettingsPOCProvider.GetTableName(), m_objAutoSuggestSettingsPOCProvider.GetDSType(), m_objAutoSuggestSettingsPOCProvider.GetFieldName())" onblur="m_objAutoSuggest.OnBlur(this)" onclick="m_objAutoSuggest.OnClick(this, event)" onmouseout="this.className='LargeCombo '" hasuserextension='false' ></input>
					<a mqbaseclass="BrowseAlternateChoiceList" title="Select value" accesskey="null" onclick="if(!m_objMqButton.IsDisabled(this)){LoadLargeListOrCombo(16, m_objAutoSuggestSettingsPOCProvider.GetCaption(),'WCDisplayChoices.asp?WCI=DisplayChoices&amp;TBL=' + m_objAutoSuggestSettingsPOCProvider.GetTableName() + '&amp;DS=' + m_objAutoSuggestSettingsPOCProvider.GetDSType() +  '&amp;CO=0',m_objAutoSuggestSettingsPOCProvider.GetTableName(),0,null,m_objAutoSuggestSettingsPOCProvider.GetFieldName(), true);}return false;" id="a_16_SelVal" href="#" class="BrowseAlternateChoiceListState1"></a>
		</div>
	</td>
	<td class="DialogLabel" style="padding-top:10px">Agreement Purchase Price:</td>
	<td style="padding-top:10px">
		<input type="text" name="6" id="6" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="50" onchange="DataChanged()">
	</td>
</tr>
<tr>
	<td class="DialogLabel" style="padding-top:10px"><script type="text/javascript">document.write(FLD_CAPTION_CUSTOMER);</script>:</td>
	<td style="padding-top:10px">
		<div class='FieldWithButton'>
			<input class='LargeCombo ' mqvalue='' mqcontroltype='LargeCombo' style='position:relative;width: 75%' size=1  name='17' id='17' onchange="DataChanged()" width="30" onclick="" title="" onmouseover="this.className='LargeCombo  '" onkeyup="m_objAutoSuggest.OnKeyUp(this, '17', m_objAutoSuggestSettingsPOCCustomer.GetCaption(), event, m_objAutoSuggestSettingsPOCCustomer.GetTableName(), m_objAutoSuggestSettingsPOCCustomer.GetDSType(), m_objAutoSuggestSettingsPOCCustomer.GetFieldName());" onkeydown="m_objAutoSuggest.OnKeyDown(this, event)" size="1" onfocus="m_objAutoSuggest.OnFocus(this, '17', m_objAutoSuggestSettingsPOCCustomer.GetCaption(), event, m_objAutoSuggestSettingsPOCCustomer.GetTableName(), m_objAutoSuggestSettingsPOCCustomer.GetDSType(), m_objAutoSuggestSettingsPOCCustomer.GetFieldName())" onblur="m_objAutoSuggest.OnBlur(this)" onclick="m_objAutoSuggest.OnClick(this, event)" onmouseout="this.className='LargeCombo '" hasuserextension='false' ></input>
					<a mqbaseclass="BrowseAlternateChoiceList" title="Select value" accesskey="null" onclick="if(!m_objMqButton.IsDisabled(this)){LoadLargeListOrCombo(17, m_objAutoSuggestSettingsPOCCustomer.GetCaption(),'WCDisplayChoices.asp?WCI=DisplayChoices&amp;TBL=' + m_objAutoSuggestSettingsPOCCustomer.GetTableName() + '&amp;DS=' + m_objAutoSuggestSettingsPOCCustomer.GetDSType() +  '&amp;CO=0',m_objAutoSuggestSettingsPOCCustomer.GetTableName(),0,null,m_objAutoSuggestSettingsPOCCustomer.GetFieldName(), true);}return false;" id="a_17_SelVal" href="#" class="BrowseAlternateChoiceListState1"></a>
		</div>
	</td>
	<td class="DialogLabel" style="padding-top:10px">Review Date:</td>
	<td style="padding-top:10px">
		<a  name='a_11' id='a_11'> </a>
		<div  class='FieldCalendar' name='div_11' id='div_11'>
			<input type="text" name="11" id="11" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="50" onchange="DataChanged()">
			<script type='text/javascript'>m_objMqButton.WriteButtonHTML('11_cal',"CreateWindowWithApplet2(document.getElementById('11'),'a_11','11')",'Calendar',false,m_objMqButton.STATE_1,'Calendar');</script>
		</div>	
	</td>

</tr>
<tr>
	<td class="DialogLabel" style="padding-top:10px">Attachments:</td>
	<td style="padding-top:10px">
		<div  class='FieldAttachment' name='a_18' id='a_18'>
			<input type="text" name="18" id="18" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onchange="DataChanged()" onmouseout="this.className='TextBoxWidth';" 
			maxlength="50" AttachMode='0' onfocus='blur()' disabled>
			<script type='text/javascript'>m_objMqButton.WriteButtonHTML('18_attach',"CreateAttachmentsWindow(document.getElementById('18'), 'Attachments');",'Attachments',false,m_objMqButton.STATE_1,'Attach File');</script>
		</div>
	</td>
	<td colspan="2" class="DialogLabel" style="padding-right:50px">
	<input type="checkbox" name="8" id="8">	Send the Point of Contact (Provider) a reminder <input type="text" name="28" id="28" class="TextBoxWidth" 
			onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
			maxlength="5" style="width:30px; padding-left:2px" onchange="DataChanged()"> days before the Review Date.</td>
</tr>
<tr>
	<td colspan="4">
		<hr style="color:#336699; height:1px;">
	</td>
</tr>
</tr>
	<td class="DialogLabelRequired">Reporting Period:</td>
	<td>
		<select id="21" class="ComboBoxWidth" onchange="DataChanged()">
			<option value="1">Weekly</option>
			<option value="2">Monthly</option>
			<option value="3">Quarterly</option>
			<option value="4">Semi-Annually</option>
			<option value="5">Annually</option>
        </select>
	</td>
</tr>
<tr>
	<td class="DialogLabel" colspan="4" style="padding-top:10px">


		<table>
			<tr>
				<td class="DialogLabel" style="padding-right:10px">
				Maximum Number of Non-Compliant Issues Per Reporting Period:
				</td>
				<td>
					<input type="text" name="19" id="19" class="TextBoxWidth"  style="width:50px;"
						onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
						maxlength="10" onchange="DataChanged()">
				</td>
			</tr>
			<tr>
				<td class="DialogLabel">
				Maximum % of Non-Compliant Issues Per Reporting Period:
				</td>
				<td class="DialogLabel">
					<input type="text" name="20" id="20" class="TextBoxWidth" style="width:50px"
						onmouseover="this.className='TextBoxWidthHover';" onmouseout="this.className='TextBoxWidth';" 
						maxlength="10" onchange="DataChanged()"> %
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td colspan="4">
		<hr style="color:#336699; height:1px;">
	</tr>
</tr>
<tr>
	<td class="DialogLabel" colspan="3">
	<input type="checkbox" name="9" id="9">	Service Agreement is enabled</td>
	<td>
		<table width="100%" style="margin-top:10px">
		<tr>
			<td align="right">
				<script type="text/javascript">document.write(writeImageAlt("Ok","../../../Theme/images/buttons/","js:SetAgreement();",78,27,false,"OK"));</script>&nbsp;&nbsp;&nbsp;&nbsp;<script type="text/javascript">document.write(writeImageAlt("Close","../../../Theme/images/buttons/","js:window.close();",78,27,false,"Close"));</script>
			</td>
		</tr>
		</table>
	</td>
</tr>

</table>
<input type="hidden" name="txtUploadDir" id="txtUploadDir" value=""> 

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