anchor.diff:  		View Clinical Reports<br />
   	
   		
  -		<bean:define id="selectedItemsId" name="kmDataSetForm" property="selectedItems" />
  +		<!-- bean:define id="selectedItemsId" name="kmDataSetForm" property="selectedItems" />  -->
  +		<s:set var="selectedItemsId" value="kmForm.selectedItems" />
  +		
   		<% 
  -		String[] selectedGroups = (String[])selectedItemsId; 
  -		List selectedGrpList = Arrays.asList(selectedGroups);
  +		//Shan: why do we need this
  +		//String[] selectedGroups = (String[])selectedItemsId; 
  +		//List selectedGrpList = Arrays.asList(selectedGroups);
   		%>
   
   		<!--check what type of plot it is as to display the correct link text-->
  -		<logic:equal name="kmDataSetForm" property="plotType" value="GE_KM_PLOT">		
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Up-Regulated") ) {
  -			%>
  -				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Upregulating Samples</a>
  -			<%
  -			}
  -			if ( selectedGrpList != null && selectedGrpList.contains("Down-Regulated") ) {
  -			%>
  +		<!--  logic:equal name="kmDataSetForm" property="plotType" value="GE_KM_PLOT">	-->
  +		<s:if test="kmForm.plotType.equals('GE_KM_PLOT')">	
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Up-Regulated')">
  +				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>
  +				Upregulating Samples</a>
  +			</s:if>
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Down-Regulated')">
   		 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Downregulating samples</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Upregulating Samples</a>
  -		 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Downregulating samples</a>
  -			-->
  -		</logic:equal>
  -		<logic:equal name="kmDataSetForm" property="plotType" value="COPY_NUM_KM_PLOT">		
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Up-Regulated") ) {
  -			%>
  +			</s:if>
  +			
  +		</s:if>
  +		<s:if test="kmForm.plotType.equals('COPY_NUM_KM_PLOT')">	
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Up-Regulated')">
   				<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Samples with Amplification</a>
  -			<%
  -			}
  -			if ( selectedGrpList != null && selectedGrpList.contains("Down-Regulated") ) {
  -			%>
  +			</s:if>
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Down-Regulated')">
   		 		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Samples with Deletion</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=up',700,500,'clinicalPlots');"/>Samples with Amplification</a>
  -		 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=down',700,500,'clinicalPlots');"/>Samples with Deletion</a>
  -			-->
  -		</logic:equal>
  -		<logic:notEqual name="kmDataSetForm" property="plotType" value="SAMPLE_KM_PLOT">
  -			<%
  -			if ( selectedGrpList != null && selectedGrpList.contains("Intermediate") ) {
  -			%>
  +			</s:if>
  +			
  +		</s:if>
  +		
  +		<s:if test="!kmForm.plotType.equals('SAMPLE_KM_PLOT')">
  +			
  +			<s:if test="kmForm.selectedItems != null && kmForm.selectedItems.contains('Intermediate')">
   				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=inter',700,500,'clinicalPlots');"/>Intermediate Samples</a>
  -			<%
  -			}
  -			%>
  -			<!--  
  -			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=inter',700,500,'clinicalPlots');"/>Intermediate Samples</a>
  -			-->		
  -		</logic:notEqual>
  -		<logic:equal name="kmDataSetForm" property="plotType" value="SAMPLE_KM_PLOT">
  +			</s:if>
  +				
  +		</s:if>
  +		
  +		<s:if test="kmForm.plotType.equals('SAMPLE_KM_PLOT')">
   			<a href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list1',700,500,'clinicalPlots');return false;"/><bean:write name="kmDataSetForm" property="storedData.samplePlot1Label" /></a>
  -			<logic:notEqual name="kmDataSetForm" property="storedData.samplePlot2Label" value="none">
  -				<a style="margin-left:20px" href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list2',700,500,'clinicalPlots');return false;"/><bean:write name="kmDataSetForm" property="storedData.samplePlot2Label" /></a>
  -			</logic:notEqual>
  -		</logic:equal>
  +			
  +			<s:if test="!kmForm.storedData.samplePlot2Label.equals('none')">
  +				<a style="margin-left:20px" href="#" onclick="javascript:spawnx('clinicalViaKMReport.do?dataName=KAPLAN&sampleGroup=list2',700,500,'clinicalPlots');return false;"/>
  +				<!-- bean:write name="kmDataSetForm" property="storedData.samplePlot2Label" />  -->
  +				<s:property value="kmForm.storedData.samplePlot2Label" />
  +				</a>
  +			</s:if>
  +		</s:if>
   		
   		<!-- Statistical Data  STARTS HERE --></p>
   		<fieldset class="gray" style="text-align:left">
   		<legend class="red">Statistical	Report:</legend>
   		<table class="graphTable" border="0" cellpadding="2" cellspacing="0">
  -			<logic:present name="kmDataSetForm" property="geneOrCytoband">
  +			<s:if test="kmForm.geneOrCytoband != null && kmForm.geneOrCytoband.length() > 0">
   				<tr>
   					<td colspan="2" id="reportBold">
  -					<bean:write name="kmDataSetForm" property="geneOrCytoband" /></td>
  -				</tr>
  -			</logic:present>
  -			<logic:present name="kmDataSetForm" property="selectedReporter">
  +						<s:property value="kmForm.geneOrCytoband" />
  +					</td>
  +				</tr>
  +			</s:if>
  +			<s:if test="kmForm.selectedReporter != null && kmForm.selectedReporter.length() > 0">
   				<!--Show the selected Reporter -->
   				<tr>
  -					<td colspan="2" id="reportBold">Reporter: <bean:write
  -						name="kmDataSetForm" property="selectedReporter" /></td>
  -				</tr>
  -			</logic:present>
  +					<td colspan="2" id="reportBold">Reporter: <s:property value="kmForm.selectedReporter" />
  +						</td>
  +				</tr>
  +			</s:if>
   			<tr>
   				<td colspan="2">&nbsp;</td>
   			</tr>
  
positive.code: 			<tr>
  				<td colspan="2" id="reportBold">Number of samples in group:</td>
  			</tr>
      		<logic:greaterThan name="kmDataSetForm" property="storedData.upSampleCount"
  				value="0">
  				<tr>
  					<td><bean:write name="kmDataSetForm" property="upOrAmplified" />:</td>
  					<td><bean:write name="kmDataSetForm" property="storedData.upSampleCount" /></td>
  				</tr>
  			</logic:greaterThan>
  			<logic:greaterThan name="kmDataSetForm" property="storedData.downSampleCount"
  				value="0">
  				<tr>
  					<td><bean:write name="kmDataSetForm" property="downOrDeleted" />:</td>
  					<td><bean:write name="kmDataSetForm" property="storedData.downSampleCount" /></td>
  				</tr>
  			</logic:greaterThan>
  			<logic:greaterThan name="kmDataSetForm" property="storedData.intSampleCount"
  				value="0">
  				<tr>
  					<td>Intermediate:</td>
  					<td><bean:write name="kmDataSetForm" property="storedData.intSampleCount" /></td>
  				</tr>
  			</logic:greaterThan>
  			<logic:greaterThan name="kmDataSetForm" property="storedData.sampleList1Count"
  				value="0">
  				<tr>
  					<td><bean:write name="kmDataSetForm" property="storedData.samplePlot1Label" /></td>
  					<td><bean:write name="kmDataSetForm" property="storedData.sampleList1Count" /></td>
  				</tr>
  			</logic:greaterThan>
  			<logic:greaterThan name="kmDataSetForm" property="storedData.sampleList2Count"
  				value="0">
  				<tr>
  					<td><bean:write name="kmDataSetForm" property="storedData.samplePlot2Label" /></td>
  					<td><bean:write name="kmDataSetForm" property="storedData.sampleList2Count" /></td>
  				</tr>
  			</logic:greaterThan>
  			<tr>
  				<td colspan="2">
  				<hr width="100%" size="1" color="black" />
  
negative.code: 			<tr>
  				<td>
  				<!-- Downregulated/Deleted -->
  				<span style="font-size:.9em"><label for="downFold">
  				<s:property value="kmForm.downOrDeleted" />
  				</label></span>			
  				
  				<!--check to see if it is copy number km plot or GE km plot. if it is, change the deleted fold change values-->
  				<s:if test="kmForm.plotType.equals('GE_KM_PLOT')">					
  					&nbsp;&ge;&nbsp; 
  					<s:select id="downFold" name="kmForm.downFold" list="kmForm.folds" theme="simple">
  	
  					</s:select>
  				</s:if>
  				<s:if test="kmForm.plotType.equals('COPY_NUM_KM_PLOT')">					
  					&nbsp;&le;&nbsp; 
  					<s:select id="downFold" name="kmForm.downFold" list="kmForm.copyNumberDownFolds" theme="simple">
  						
  					</s:select>
  				</s:if>
  				<!--end after deleted fold change values have been determined-->
  				 			
  				<span style="font-size:.9em">
  				<s:property value="kmForm.changeType" />
  				</span> 
  				</td>
  				
  				<!--Reporters-->
  				<td>
  					<!--make sure plot is GE and not Copy # before giving option of algorithm to use-->
  					<s:if test="kmForm.plotType.equals('GE_KM_PLOT')">
  						<span style="font-size:.9em;margin-left:10px"><label for="selectedReporter">Reporters</label></span>
  						
  						<s:select id="selectedReporter" name="kmForm.selectedReporter" list="kmForm.reporters" theme="simple">
  						</s:select>
  					</s:if>	
  				</td>
  			</tr>
  			
  			<tr>
  				<td align="center" colspan="2" style="font-size:.9em;margin-left:10px">
  					<p align="left">Select which plots should be visible in the redrawn graph:<label for="item">&#160;</label><br/></p>
  					<s:iterator value="kmForm.items" var="item"> 
  						<s:checkbox name="kmForm.selectedItems" theme = "simple">
  							<s:property value="#item" />
  						</s:checkbox>
  					</s:iterator>
  				</td>
  			</tr>
  			
  		</table>
  	</div>
  	<br/>
  	<!--  s:submit value="Redraw Graph" id="redrawGraphButton" /> -->
  	<s:submit type="button" id="redrawGraphButton" theme="simple">Redraw Graph</s:submit>
  	</s:if>
  		
  	<div>
  	<s:if test="kmForm.plotVisible == true">
  	
  		<hr/>
  		<b> 
  			<font size="+1"> 
  				<s:property value="kmForm.chartTitle" />
  			</font>
  		</b>
  		<br/>
  		
  		<!-- INSERT CHART HERE --> 
  		<p>
  			<graphing:KaplanMeierPlot bean="kmForm" dataset="selectedDataset" />
  		</p>
  		<p>
  		<br/>
  