<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:decimal-format NaN="0"/>

<xsl:template match="/">

<html>
<script language="JavaScript" type="text/javascript">
<![CDATA[

var maxId = 0;
function gotBlur(obj) 
 {
	if((oldVal != obj.value) || (obj.ISCHANGED == "true"))
	{
		obj.ISCHANGED = "true"; 
	}
 }

function gotFocus( column )
{
	objCur=column.name; 
	oldVal=column.value; 
}

function setActivityToSalesPers()
{


	var teamCode = "";
	var teamDescr = "";
	var seldbID ="";
	var domId="";




	for( dbID = 1; dbID <= maxId; dbID++)
	{
	
		if( document.getElementById("DetailActCode."+dbID+".selectbox").value == 'true' )
		{
		
			seldbID = dbID;
            domId=document.getElementById("DetailActCode."+dbID+".db_id").value;
			actCode = document.getElementById("DetailActCode."+dbID+".purc_order").value;

			actDescr = document.getElementById("DetailActCode."+dbID+".purc_order").value;

		}
		
	}
	if( actDescr == "" )
	{
		alert("No Selection Made ! \nPlease Select Activity !");
	}
	else
	{
	
	   
		window.opener.displayActCode1( actCode, actDescr, seldbID ,domId);
		window.close();
	}
}



function setChecked( obj )
{
	for( dbID = 1; dbID <= maxId; dbID++)
	{
		objCurr = document.getElementById("DetailActCode."+dbID+".selectbox");
		if( objCurr.value == 'true' )
		{
			objCurr.value ='false';
			objCurr.checked = false;
		}
	}
	if( obj.value == 'false' )
	{
		
		obj.value ='true';
		obj.checked = true;
	}
	else
	{
		obj.value = 'false';
		obj.checked = false;
	}
}

]]>
</script>
<body>
<style type="text/css">

.tableClass
{margin-left:0px;margin-top:0px}

.header_td
{border:inset 0;background:#FFCCCC;font-family:verdana;font-size:9pt}

.input_editable
{border:inset 2;color:#102132;background:#D7E5F9;text-align:left;font-family:verdana;font-size:9pt}

.input_num_editable
{border:inset 2;color:#102132;background:#D7E5F9;text-align:right;font-family:verdana;font-size:9pt}

.td_leftAlign
{background:#D7E5F9;text-align:left;font-family:verdana;font-size:9pt}

.td_rightAlign
{background:#D7E5F9;text-align:right;font-family:verdana;font-size:9pt}

</style>

	<form name="Wizard_Activity">

	<table class="tableClass" border="0" cellspacing="1" cellpadding="1">
		<tr>
			<td class="header_td" nowrap="true" valign="bottom" width="5%">
			</td>
			<td class="header_td" nowrap="true" valign="bottom" width="75%">
				<strong>Purchase Order </strong>
			</td>
			<!-- <td class="header_td" nowrap="true" valign="bottom" width="75%">
				<strong>Line No</strong>
			</td>
			 <td class="header_td" nowrap="true" valign="bottom" width="20%">
				<strong>Release Aganst</strong>
			</td> 
			
			<td class="header_td" nowrap="true" valign="bottom" width="20%">
				<strong>Release amount</strong>
			</td>	

                         <td class="header_td" nowrap="true" valign="bottom" width="20%">
				<strong>Voucher Created</strong>
			</td> -->	
		</tr>

		<xsl:for-each select="//ACTIVITY">
			<xsl:variable name="purc_order"><xsl:value-of select="purc_order"/></xsl:variable>
			<xsl:variable name="db_id"><xsl:value-of select="db_id"/></xsl:variable>
		<!-- 	<xsl:variable name="line_no"><xsl:value-of select="line_no"/></xsl:variable>
<xsl:variable name="rel_agnst"><xsl:value-of select="rel_agnst"/></xsl:variable>
<xsl:variable name="rel_amt"><xsl:value-of select="rel_amt"/></xsl:variable>
<xsl:variable name="vouch_created"><xsl:value-of select="vouch_created"/></xsl:variable> -->
<xsl:value-of select="db_id"/>
			<xsl:variable name="dbID"><xsl:value-of select="@domID"/></xsl:variable>
			<SCRIPT>
				<![CDATA[ var qtyR ; qtyR ="]]>	<xsl:value-of select="$dbID"/>
				<![CDATA[";maxId= qtyR; ]]>
			</SCRIPT>
			<xsl:variable name="chkbox"><xsl:value-of select="@selected"/></xsl:variable>
			<tr>
				<td class="td_leftAlign">
					<xsl:choose>
						<xsl:when test="$chkbox ='Y'">
							<input  type="checkbox"  name="selectbox" id="DetailActCode.{normalize-space($dbID)}.selectbox" checked='true' value="true" onClick="setChecked(this)"/>
						</xsl:when>	
						<xsl:otherwise>
							<input  type="checkbox"  name="selectbox" id="DetailActCode.{normalize-space($dbID)}.selectbox" value="false" onClick="setChecked(this)"/>
						</xsl:otherwise>
					</xsl:choose>		
				</td>
				<td class="td_leftAlign">
					<xsl:value-of select="purc_order"/>
					<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.purc_order" id = "DetailActCode.{normalize-space($dbID)}.purc_order" value="{normalize-space($purc_order)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td>
				
				<td class="td_leftAlign">
						<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.db_id" id = "DetailActCode.{normalize-space($dbID)}.db_id" value="{normalize-space($db_id)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td>
				<!-- <td class="td_leftAlign">
					<xsl:value-of select="line_no"/>
					<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.line_no" id = "DetailActCode.{normalize-space($dbID)}.line_no" value="{normalize-space($line_no)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td>
				 <td class="td_leftAlign">
					<xsl:value-of select="rel_agnst"/>
					<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.line_no" id = "DetailActCode.{normalize-space($dbID)}.line_no" value="{normalize-space($line_no)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td>	
				
				<td class="td_leftAlign">
					<xsl:value-of select="rel_amt"/>
					<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.line_no" id = "DetailActCode.{normalize-space($dbID)}.line_no" value="{normalize-space($line_no)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td>

		<td class="td_leftAlign">
					<xsl:value-of select="vouch_created"/>
					<input  type="hidden"  name="Detail4.{normalize-space($dbID)}.line_no" id = "DetailActCode.{normalize-space($dbID)}.line_no" value="{normalize-space($line_no)}" size="20" class="fieldcell_items" ISCHANGED="false"/>
				</td> -->
			</tr>
		</xsl:for-each>
</table>
<table cellSpacing="1" cellPadding="1" width="50%" border="0">
	<tr>
	      <td>
			<input  type="hidden"  value="4" name="FORM_NO" />
			<input  type="hidden"  value="strg_meet_itm_wiz" name="OBJ_NAME" />
			<input  type="hidden"  value="" name="action" id="action" />

			<input type ="button" value=" Add " title='' onclick="javascript:setActivityToSalesPers()"/>
			<input type ="button" value="Cancel" title='' onclick="window.close()"/>
	      </td>
	</tr>
</table>
</form>
</body>

</html>
</xsl:template>
</xsl:stylesheet>
