<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ page import='gov.va.med.esr.ui.report.action.ReportConstants' %>

    <c:set var="availableText"><bean-el:message key="label.available" /></c:set>
    <c:set var="selectedText"><bean-el:message key="label.selected" /></c:set>
    <c:set var="ALL_SITES_AND_VBA"><%=ReportConstants.ALL_SITES_AND_VBA%></c:set>
    <c:set var="ALL_SITES"><%=ReportConstants.ALL_SITES%></c:set>
    <c:set var="VBA"><%=ReportConstants.VBA%></c:set>

    <c:set var="selectedQueryTo" value="${reportInfoForm.queryTo}" />
    <esrcore:setLookup var="queryToSource" className="gov.va.med.esr.ui.common.beans.VAFacilityExceptVBA" removeCollection="selectedQueryTo" />
    <esrcore:setLookup var="queryToTarget" className="gov.va.med.esr.ui.common.beans.VAFacilityExceptVBA" removeCollection="queryToSource" />
    <tr>
    	<td class="moduleLabel" style="vertical-align: top"><br><fw:label required="true" property="queryTo" forId="queryToSource"><bean-el:message key="label.report.queryTo" />:</fw:label></td>
    	<td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3" align="center">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="moduleValue"><bean-el:message key="label.available" /></td>
            <td class="moduleValue">&nbsp;</td>
            <td class="moduleValue"><bean-el:message key="label.selected" /></td>
          </tr>
          <tr>
          	<td class="moduleLabel">
      	    <html-el:select title="${availableText}" styleId="queryToSource" styleClass="moduleEdit" style="width:400px;" property="dummySelect" multiple="true" size="8">
      	      	<c:if test="${reportInfoForm.allSitesAndVBASelected == false}">
      	            <html-el:option styleClass="moduleEdit" value="${ALL_SITES_AND_VBA}"><bean-el:message key="label.report.allSitesVBA" /></html-el:option>
      	      	</c:if>
      	      	<c:if test="${reportInfoForm.allSitesSelected == false}">
      		    <html-el:option styleClass="moduleEdit" value="${ALL_SITES}"><bean-el:message key="label.report.allSites" /></html-el:option>
      	      	</c:if>
      	      	<c:if test="${reportInfoForm.vbaSelected == false}">
      		    <html-el:option styleClass="moduleEdit" value="${VBA}"><bean-el:message key="label.report.vba" /></html-el:option>
      	      	</c:if>
      		<esrcore:options styleClass="moduleEdit" collection="queryToSource" property="code" labelProperty="facilityName"/>
      	    </html-el:select>
          	</td>
          	<td class="moduleValue">
          	    <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('queryToSource','queryToTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
          	    <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('queryToTarget','queryToSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
          	</td>
           	<td class="moduleValue">
           	    <html-el:select title="${selectedText}" styleId="queryToTarget" styleClass="moduleEdit" style="width:400px;" property="queryTo" multiple="true" size="8">
        		<c:if test="${reportInfoForm.allSitesAndVBASelected == true}">
        		    <html-el:option styleClass="moduleEdit" value="${ALL_SITES_AND_VBA}"><bean-el:message key="label.report.allSitesVBA" /></html-el:option>
        		</c:if>
        		<c:if test="${reportInfoForm.allSitesSelected == true}">
        		    <html-el:option styleClass="moduleEdit" value="${ALL_SITES}"><bean-el:message key="label.report.allSites" /></html-el:option>
        		</c:if>
        		<c:if test="${reportInfoForm.vbaSelected == true}">
        		    <html-el:option styleClass="moduleEdit" value="${VBA}"><bean-el:message key="label.report.vba" /></html-el:option>
        		</c:if>
        		<esrcore:options styleClass="moduleEdit" collection="queryToTarget" property="code" labelProperty="facilityName"/>
           	    </html-el:select>
           	</td>
          </tr>
        </table>
      </td>
    </tr>
