anchor.diff:  									}
   
   	AutocompleterManager.addAutocompleter(multisiteStudySiteAutocompleterProps);
  -	
  +
  +	var win;
  +	function selectStudySites(studyId, parentAssociationId, parentIndex){
  +		win = new Window({title: "Select Study Sites", 
  +				scrollbar: false, zIndex:100, width:900, height:325 ,
  +				recenterAuto:true, className :"mac_os_x",
  +				url: "<c:url value='/pages/study/selectStudySites?decorator=noheaderDecorator&parentAssociationId='/>" + parentAssociationId  +"&parentIndex=" + parentIndex  +"&studyId=" + studyId , 
  +				showEffectOptions: {duration:1.5}
  +					}
  +				) 
  +		win.showCenter(true)
  +	}
  +
  +	function closePopup() {
  +		win.close();
  +	}
  +
  +	function reloadParentStudySites(studyId , studyAssociationId , nciCodes , parentIndex, irbApprovalSites){
  +		$('nciCodes').value=nciCodes;
  +		$('irbApprovalSites').value=irbApprovalSites;
  +		$('studyAssociationId').value=studyAssociationId;
  +		<tags:tabMethod method="associateParentStudySites" divElement="'parentStudySiteDiv-'+parentIndex" formName="'parentStudySiteForm'"  viewName="/study/parentStudySiteSection" javaScriptParam="'parentIndex='+parentIndex"/>
  +	}
  +
  +	function deleteCompanionStudySiteAssociation(studySiteId, parentIndex){
  +		$("_doNotSave").name="xyz";
  +		<tags:tabMethod method="removeCompanionStudyAssociation" divElement="'parentStudySiteDiv-'+parentIndex" formName="'parentStudySiteForm'"  viewName="/study/parentStudySiteSection" javaScriptParam="'studySiteId='+studySiteId+'&parentIndex='+parentIndex"/>
  +		$("_doNotSave").name="_doNotSave";
  +	}
  +		
   	</script>
   </head>
   <body>
  
positive.code: 		<input type="hidden" name="_target${tab.number}" id="_target"/>
  		<input type="hidden" name="_page" value="${tab.number}" id="_page"/>
  	</form:form>
  		<div id="dummy-div" style="display: none;" ></div>
  		<tags:panelBox title="Manage Study Sites">
  			<div class="row">
  				<div class="label"><fmt:message key="c3pr.common.selectAnOrganization" /></div>
  				<div class="value">
  					<tags:autocompleter name="axxxxyyy" displayValue="" value="" basename="studysite" ></tags:autocompleter>
  					<tags:button color="blue" value="Add study site" icon="add" type="button" size="small" id="addStudySite" onclick="addStudySite();" disabled="true"></tags:button>
  				</div>
  			</div>
  			<br>
  			<form:form id="studySitesForm">
  			<div id="studySites">
  			<c:forEach items="${command.study.studySites}" varStatus="status" var="site">
  				<chrome:division title="${site.healthcareSite.name} (${site.healthcareSite.nciInstituteCode})" minimize="true" divIdToBeMinimized="site-${status.index}" >
  					<div id="site-${status.index}" style="display:none;">
  						<div class="row">
  							<div class="leftpanel">
  								<div class="row">
  									<div class="label"><fmt:message key="site.IRBApprovalDate" /></div>
  									<div class="value" id="siteIRB-${site.healthcareSite.nciInstituteCode }">
  										<tags:dateInput path="study.studySites[${status.index}].irbApprovalDate"/>
  									</div>
  								</div>
  								<div class="row">
  									<div class="label"><fmt:message key="c3pr.common.targetAccrual" /></div>
  									<div class="value">
  										<form:input path="study.studySites[${status.index}].targetAccrualNumber" maxlength="6" cssClass="validate-NUMERIC" size="6"/>
  									</div>
  								</div>
  								<div class="row" id="actions-${status.index}">
  									<div class="label"><fmt:message key="site.actions" /></div>
  									<div class="value" id="actions-${site.healthcareSite.nciInstituteCode }">
              							<c:set var="noAction" value="true"/>
              							<c:if test="${fn:length(site.possibleTransitions)>0 && (site.hostedMode || localNCICode==site.study.studyCoordinatingCenters[0].healthcareSite.nciInstituteCode || localNCICode==site.healthcareSite.nciInstituteCode)}">
              								<select id="siteAction-${site.healthcareSite.nciInstituteCode}">
              									<c:forEach items="${site.possibleTransitions}" var="possibleAction">
              										<c:choose>
     														<c:when test="${possibleAction=='ACTIVATE_STUDY_SITE'}">
     															<c:if test="${site.hostedMode || (localNCICode==site.healthcareSite.nciInstituteCode && (site.siteStudyStatus=='APPROVED_FOR_ACTIVTION' || localNCICode==site.study.studyCoordinatingCenters[0].healthcareSite.nciInstituteCode))}">
     																<option value="${possibleAction}">${possibleAction.displayName }</option>
     																<c:set var="noAction" value="false"/>
     															</c:if>
     														</c:when>
     														<c:when test="${possibleAction=='APPROVE_STUDY_SITE_FOR_ACTIVATION'}">
     															<c:if test="${localNCICode==site.study.studyCoordinatingCenters[0].healthcareSite.nciInstituteCode}">
     																<option value="${possibleAction}">${possibleAction.displayName }</option>
     																<c:set var="noAction" value="false"/>
     															</c:if>
     														</c:when>
  						   								<c:otherwise>
  								   							<option value="${possibleAction}">${possibleAction.displayName }</option>
  								   							<c:set var="noAction" value="false"/>
  								   						</c:otherwise>
  													</c:choose>
              									</c:forEach>
              								</select>
              								<tags:button type="button" color="blue" value="Go" id="go" onclick="takeAction('${site.healthcareSite.nciInstituteCode}');" size="small"/>
  										</c:if>
  										<div id="sendingMessage-${site.healthcareSite.nciInstituteCode }" class="working" style="display: none">
  											Working...<img src="<tags:imageUrl name='indicator.white.gif'/>" border="0" alt="sending.."/>
  										</div>
  									</div>
  									<c:if test="${noAction}">
  										<script>
  											Element.hide('actions-'+${status.index});
  										</script>
  									</c:if>
  								</div>
  								<div class="row" id="message-${status.index}">
  									<div class="label"><fmt:message key="site.messages" /></div>
  									<div class="value" id="Messages-${site.healthcareSite.nciInstituteCode }">
  										<c:choose>
  											<c:when test="${!site.hostedMode && !site.isCoordinatingCenter && fn:length(siteEndpoint.endpoints)>0}">
  												<c:choose>
  													<c:when test="${siteEndpoint.lastAttemptedEndpoint.status=='MESSAGE_SEND_FAILED'}">
  														<font color="red">${siteEndpoint.lastAttemptedEndpoint.status.code}</font><br>
  														Click <a href="javascript:showEndpointError('${siteEndpoint.healthcareSite.nciInstituteCode }','${site.healthcareSite.nciInstituteCode }');">here</a> to see the error messages
  													</c:when>
  													<c:otherwise>
  														<font color="green">${siteEndpoint.lastAttemptedEndpoint.status.code}</font><br>
  														Click <a href="javascript:showEndpointError('${siteEndpoint.healthcareSite.nciInstituteCode }','${site.healthcareSite.nciInstituteCode }');">here</a> to see the messages
  													</c:otherwise>
  												</c:choose>
  											</c:when>
  											<c:otherwise>
  												None
  											</c:otherwise>
  										</c:choose>
  									</div>
  								</div>
  							</div>
  							<div class="rightpanel">
  								<div class="row">
  									<div class="label"><fmt:message key="site.activationDate" /></div>
  									<div class="value">
  										<tags:dateInput path="study.studySites[${status.index}].startDate"/>
  									</div>
  								</div>
  								<div class="row">
  									<c:if test="${command.study.multiInstitutionIndicator && multisiteEnv}">
  										<div class="label"><fmt:message key="site.hostedMode" /></div>
  										<div class="value">
  					            			<form:checkbox path="study.studySites[${status.index}].hostedMode"/>
              								<input type="hidden" name="${command.study.studySites[status.index].healthcareSite.nciInstituteCode}-wasHosted" value="${command.study.studySites[status.index].hostedMode}"/>
  										</div>
      			        			</c:if>
  								</div>
  								<div class="row">
  									<div class="label"><fmt:message key="c3pr.common.status" /></div>
  									<div class="value" id="siteStatus-${site.healthcareSite.nciInstituteCode }">${site.siteStudyStatus.code}</div>
  								</div>
  							</div>
  						</div>
  					</div>
  				</chrome:division>
  				<div class="division"></div>	
  			</c:forEach>
  			</div>
  			</form:form>
  			<div id="newStudySite" style="display: none" ></div>
  
negative.code: 		Element.show('sendingMessage-'+nciCode);
  	}
  
  	function changeCompanionStudySiteStatus(nciCode){
  		action=$("companionSiteAction-"+nciCode).value;
  		<tags:tabMethod method="changeStatus" formName="'tabMethodForm'" onFailure='failedStatusChange' viewName="/study/asynchronous/companionSites_row" divElement="'dummy-div'" javaScriptParam="'action=' + action+ '&nciCode='+nciCode+ '&studySiteType=companionSite&DO_NOT_SAVE=true'" />
  		Element.show('companionSendingMessage-'+nciCode);
  	}
  
  	function showEndpointError(nciCode, localNciCode){
  		Dialog.alert({url: $('command').action,  
  					options: {method: 'post', parameters:"decorator=nullDecorator&_asynchronous=true&_asyncMethodName=showEndpointMessage&_asyncViewName=/study/asynchronous/manage_sites&_target${tab.number}=${tab.number}&_page=${tab.number}&nciCode="+nciCode+"&localNciCode="+localNciCode, 
  