<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
							  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
							  xmlns:user="mynamespace">
	<xsl:output method="html" media-type="text/html; charset=UTF-8"/>						
	<xsl:include href="top_nav.xsl"/>
	<xsl:template match="/">
		<html>
		<head>
			<base>
				<xsl:attribute name="href"><xsl:value-of select="/root/file_path"/></xsl:attribute>
			</base>			
			<title><xsl:value-of select="/root/product/seo_title"/></title>
			<meta name="keywords">
				<xsl:attribute name="content"><xsl:value-of select="/root/product/seo_keyword"/></xsl:attribute>
			</meta>
			<meta name="description">
				<xsl:attribute name="content"><xsl:value-of select="/root/product/seo_description"/></xsl:attribute>
			</meta>				
		</head>
		<xsl:call-template name="top_nav"/>
			<xsl:choose>
			<xsl:when test="/root/product_id = 0">
				<xsl:value-of select="/root/root/invalid_product"/>
			</xsl:when>
			<xsl:otherwise>

			<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
				<tr>
					<td valign="top">
							<xsl:for-each select="root/category_path">
								<xsl:sort select="category_id" data-type="number"/>
								
								<a>
									<xsl:attribute name="href">catalog/<xsl:value-of select="category_id"/></xsl:attribute>
									<xsl:value-of select="name"/>
								</a>

								<xsl:if test="position() != last()">
									&gt; 
								</xsl:if>
							</xsl:for-each>
						<p>
						<xsl:if test="root/success = 1">
							<font class="myfontmsg"><xsl:value-of select="/root/root/update_message"/></font><br/>
						</xsl:if>
						</p>
						
						<xsl:value-of select="/root/root/text" disable-output-escaping="yes"/>

						<xsl:if test="/root/search_type = 'browse'">
							<xsl:if test="/root/previous_product &gt; 0">
								<a>
									<xsl:attribute name="href"><xsl:value-of select="/root/config/cgipath"/>isapi.dll?product_detail&amp;product_id=<xsl:value-of select="/root/previous_product"/>&amp;search_type=<xsl:value-of select="/root/search_type"/>&amp;registry_id=<xsl:value-of select="/root/registry_id"/>&amp;cat_id=<xsl:value-of select="/root/category_id"/></xsl:attribute>
									<xsl:choose>
										<xsl:when test="/root/language/id = 1">
											Previous
										</xsl:when>
										<xsl:otherwise>
											Anterior
										</xsl:otherwise>
									</xsl:choose>
								</a>
							</xsl:if>
							
							<xsl:if test="/root/next_product &gt; 0">
								<a>
									<xsl:attribute name="href"><xsl:value-of select="/root/config/cgipath"/>isapi.dll?product_detail&amp;product_id=<xsl:value-of select="/root/next_product"/>&amp;search_type=<xsl:value-of select="/root/search_type"/>&amp;registry_id=<xsl:value-of select="/root/registry_id"/>&amp;cat_id=<xsl:value-of select="/root/category_id"/></xsl:attribute>
									<xsl:choose>
										<xsl:when test="/root/language/id = 1">
											Next
										</xsl:when>
										<xsl:otherwise>
											Urmator
										</xsl:otherwise>
									</xsl:choose>
								</a>
							</xsl:if>
						</xsl:if>

						<form method="post" name="search_form" enctype="multipart/form-data">
							<xsl:attribute name="action"><xsl:value-of select="/root/config/cgipath"/>isapi.dll?product_detail&amp;product_id=<xsl:value-of select="/root/product_id"/>&amp;search_type=<xsl:value-of select="/root/search_type"/>&amp;registry_id=<xsl:value-of select="/root/registry_id"/>&amp;cat_id=<xsl:value-of select="/root/category_id"/></xsl:attribute>

						<table cellpadding="2" cellspacing="0"  border="0">
							<tr class="myfont">
								<td colspan="2" class="mybgcolor2a"><h1 class="product_title"><xsl:value-of select="root/product/name"/></h1></td>
							</tr>
							<tr valign="top">
								<td width="100%" class="mybgcolor4" colspan="2">
								<!-- new table header-->
								
								<table cellpadding="0" cellspacing="0" width="625" border="0">
								<tr>
								<td valign="top">

									<table cellpadding="2" cellspacing="1" width="100%" border="0">
									<xsl:value-of select="user:initial_counter()"/>
									<xsl:choose>
									<xsl:when test="count(/root/product/product_style) &gt; 0">										
										<tr>
											<td width="100%">
												<table width="100%">
													<xsl:call-template name="price">
														<xsl:with-param name="retail_price" select="/root/product/retail"/>
														<xsl:with-param name="member_price" select="/root/product/member_price"/>
														<xsl:with-param name="sell_price" select="/root/product/sell"/>
														<xsl:with-param name="wholesale_price" select="/root/product/wholesale_price"/>
														<xsl:with-param name="customer_price" select="/root/product/customer_product/sell_price"/>
														<xsl:with-param name="sale_price" select="/root/product/sale_price"/>
													</xsl:call-template>

													<xsl:for-each select="/root/product/product_style/product_style_same">
														<tr class="myfont" valign="top">
															<td class="mybgcolor"><xsl:value-of select="style"/>:</td>
															<td class="mybgcolor2">
																<select>
																	<xsl:attribute name="name">style_type_same_id_<xsl:value-of select="position()-1"/></xsl:attribute>
																	<xsl:attribute name="onchange">change_picture(this.form,'<xsl:value-of select="/root/file_path"/>',this)</xsl:attribute>
																	<xsl:for-each select="style_type">
																		<option>
																			<xsl:attribute name="value"><xsl:value-of select="style_type_id"/></xsl:attribute>
																			<xsl:value-of select="style_type"/>
																		</option>
																	</xsl:for-each>
																</select>
																<xsl:for-each select="style_type">
																	<input type="hidden">
																		<xsl:attribute name="name">style_picture_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:choose>
																			<xsl:when test="picture != ''">
																				<xsl:attribute name="value"><xsl:value-of select="picture"/></xsl:attribute>
																			</xsl:when>
																			<xsl:otherwise>
																				<xsl:attribute name="value"></xsl:attribute>
																			</xsl:otherwise>
																		</xsl:choose>
																	</input>
																</xsl:for-each>
															</td>
														</tr>
													</xsl:for-each>

													<xsl:for-each select="/root/product/product_style/product_style_notsame">
														<tr class="myfont" valign="top">
															<td class="mybgcolor"><xsl:value-of select="style"/>:</td>
															<td class="mybgcolor2"><select>
																<xsl:attribute name="name">style_type_notsame_id_<xsl:value-of select="position()-1"/></xsl:attribute>
																<xsl:attribute name="onchange">change_style_notsame(this.form,'<xsl:value-of select="/root/file_path"/>',this)</xsl:attribute>
																<xsl:for-each select="style_type">
																	<option>
																		<xsl:attribute name="value"><xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:value-of select="style_type"/>
																		<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
																		<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
																		<xsl:call-template name="style_price">
																			<xsl:with-param name="member_price" select="member_price"/>
																			<xsl:with-param name="sell_price" select="sell"/>
																			<xsl:with-param name="wholesale_price" select="wholesale_price"/>
																		</xsl:call-template>
																	</option>
																</xsl:for-each>
																</select>
																<xsl:for-each select="style_type">
																	<input type="hidden">
																		<xsl:attribute name="name">style_picture_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:choose>
																			<xsl:when test="picture != ''">
																				<xsl:attribute name="value"><xsl:value-of select="picture"/></xsl:attribute>
																			</xsl:when>
																			<xsl:otherwise>
																				<xsl:attribute name="value"></xsl:attribute>
																			</xsl:otherwise>
																		</xsl:choose>
																	</input>
																	<input type="hidden">
																		<xsl:attribute name="name">style_price_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:attribute name="value"><xsl:call-template name="style_price2">
																			<xsl:with-param name="member_price" select="member_price"/>
																			<xsl:with-param name="sell_price" select="sell"/>
																			<xsl:with-param name="wholesale_price" select="wholesale_price"/>
																			</xsl:call-template></xsl:attribute>
																	</input>
																	<!--
																	<input type="hidden">
																		<xsl:attribute name="name">style_track_stock_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:attribute name="value"><xsl:value-of select="track_stock"/></xsl:attribute>
																	</input>
																	<input type="hidden">
																		<xsl:attribute name="name">style_stock_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:attribute name="value"><xsl:value-of select="stock"/></xsl:attribute>
																	</input>
																	<input type="hidden">
																		<xsl:attribute name="name">style_backorder_<xsl:value-of select="style_type_id"/></xsl:attribute>
																		<xsl:attribute name="value"><xsl:value-of select="reqty"/></xsl:attribute>
																	</input>
																	-->
																</xsl:for-each>
															</td>
														</tr>
													</xsl:for-each>

													<select style="display: none; visibility:hidden;" name="style_inventory">
														<option value=""/>
														<xsl:for-each select="/root/product/style_inventory">
															<option>
																<xsl:attribute name="value"><xsl:value-of select="inventory_id"/>,<xsl:value-of select="stock"/>,<xsl:value-of select="backorder"/>,<xsl:value-of select="sell"/></xsl:attribute>
																<xsl:for-each select="style_inventory_style">
																	<xsl:value-of select="style_type_id"/><xsl:if test="position() != last()">,</xsl:if>
																</xsl:for-each>
															</option>
														</xsl:for-each>
													</select>
													<xsl:if test="count(/root/product/style_inventory) &gt; 0">
														<tr class="myfont">
															<td class="mybgcolor"><xsl:value-of select="/root/root/inventory"/>:</td>
															<td class="mybgcolor2"><input type="text" name="inventory" readonly=""/></td>
														</tr>
													</xsl:if>

													<xsl:if test="count(/root/product/product_style/product_style_notsame) &gt; 0">
														<tr class="myfont" valign="top">
															<td class="mybgcolor"><xsl:value-of select="/root/root/total_price"/></td>
															<td class="mybgcolor2"><input type="text" name="total_price" readonly=""/></td>
														</tr>
													</xsl:if>

													<xsl:if test="/root/product/track_stock = 1">
														<xsl:call-template name="inventory"/>
													</xsl:if>
<!--
													<tr class="myfont" valign="top">
														<td>Logo</td>
														<td><input type="file" name="logo"/></td>
													</tr>
													<tr class="myfont" valign="top">
														<td>Logo2</td>
														<td><input type="file" name="logo2"/></td>
													</tr>
-->
													<tr class="myfont" valign="top">
														<td class="mybgcolor"><xsl:value-of select="/root/root/quantity"/>:</td>
														<td class="mybgcolor2">
														<xsl:if test="/root/config/ecommerce = 1 and /root/product/active = 1">									
														<input type="text" size="10" name="style_qty" maxlength="4"/> <xsl:value-of select="/root/root/each"/>
														</xsl:if>
															<input type="hidden" name="total_style_type_same">
																<xsl:attribute name="value"><xsl:value-of select="count(/root/product/product_style/product_style_same)"/></xsl:attribute>
															</input>
															<input type="hidden" name="total_style_type_notsame">
																<xsl:attribute name="value"><xsl:value-of select="count(/root/product/product_style/product_style_notsame)"/></xsl:attribute>
															</input>
														</td>
													</tr>

													<xsl:call-template name="writein">
														<xsl:with-param name="allow_writein" select="/root/product/writein"/>
														<xsl:with-param name="writein_field">style_writein</xsl:with-param>
														<xsl:with-param name="writein_value" select="/root/product/writeintext"/>
													</xsl:call-template>
												</table>
											</td>
											<td>
												<img name="style_picture">
													<xsl:attribute name="src"><xsl:value-of select="/root/config/sitepath"/>images/prod/style/no_pic.gif</xsl:attribute>
												</img>
											</td>
										</tr>

										<xsl:if test="/root/config/ecommerce = 1 and /root/product/active = 1">
										<tr class="myfont" valign="top">
											<td class="mybgcolor3" colspan="2" align="center">
												<input type="button" onclick="add_style1(this.form)" name="submit_button">
													<xsl:attribute name="value"><xsl:value-of select="/root/root/add"/></xsl:attribute>
												</input>
											</td>
										</tr>
										</xsl:if>
									</xsl:when>	
									<xsl:otherwise>
										<xsl:call-template name="price">
											<xsl:with-param name="retail_price" select="/root/product/retail"/>
											<xsl:with-param name="member_price" select="/root/product/member_price"/>
											<xsl:with-param name="sell_price" select="/root/product/sell"/>
											<xsl:with-param name="wholesale_price" select="/root/product/wholesale_price"/>
											<xsl:with-param name="customer_price" select="/root/product/customer_product/sell_price"/>
											<xsl:with-param name="sale_price" select="/root/product/sale_price"/>
										</xsl:call-template>

										<xsl:if test="/root/product/track_stock = 1">
											<xsl:call-template name="inventory"/>
										</xsl:if>													

										<xsl:if test="/root/config/ecommerce = 1 and /root/product/active = 1">
										<tr class="myfont" valign="top">
											<td class="mybgcolor"><xsl:value-of select="/root/root/quantity"/>:</td>
											<td class="mybgcolor2"><input type="text" size="10" name="prod_qty" maxlength="4"/> <xsl:value-of select="/root/root/each"/></td>
										</tr>
										</xsl:if>

										<xsl:call-template name="writein">
											<xsl:with-param name="allow_writein" select="/root/product/writein"/>
											<xsl:with-param name="writein_field">product_writein</xsl:with-param>
											<xsl:with-param name="writein_value" select="/root/product/writeintext"/>
										</xsl:call-template>

										<xsl:if test="/root/config/ecommerce = 1 and /root/product/active = 1">
										<tr class="myfont" valign="top">
											<td class="mybgcolor3" colspan="2" align="center">
												<input type="button" onclick="add_product2(this.form)" name="submit_button">
													<xsl:attribute name="value"><xsl:value-of select="/root/root/add"/></xsl:attribute>
												</input>
											</td>
										</tr>
										</xsl:if>
									</xsl:otherwise>
									</xsl:choose>
									</table>
									<xsl:if test="count(/root/product/volprice) &gt; 0">
										<table cellpadding="2" cellspacing="1" width="100%" border="0">
											<tr class="myfont">
												<xsl:for-each select="/root/root/column_heading">
													<td class="mybgcolor2"><xsl:value-of select="@name"/></td>
												</xsl:for-each>	
											</tr>
											<xsl:for-each select="root/product/volprice">
												<tr class="myfont" valign="top">
													<td class="mybgcolor"><xsl:value-of select="volqty"/></td>
													<td class="mybgcolor"><xsl:value-of select="volprice"/></td>
													<td class="mybgcolor"><xsl:value-of select="volpercent"/></td>
												</tr>
											</xsl:for-each>
										</table>
									</xsl:if>
								</td>
								<td valign="top" class="mybgcolor" width="150"><xsl:if test="root/product/thumbnail != ''">
									<img>
										<xsl:attribute name="src"><xsl:value-of select="/root/config/sitepath"/>images/thumbnail/<xsl:value-of select="root/product/thumbnail"/></xsl:attribute>
									</img><BR/>
									<a href="javascript:void(0)" onmouseout="big_hide()">
										<xsl:attribute name="onmouseover">big('<xsl:value-of select="/root/config/sitepath"/>images/prod/<xsl:value-of select="root/product/picture"/>')</xsl:attribute>
									<img border="0" name="i1" src="images/en/zoom.jpg" width="150" height="22"/></a>
									</xsl:if>
									<xsl:if test="count(/root/product/product_supplier) &gt; 0">
										<br/><a target="_blank">
											<xsl:attribute name="href"><xsl:value-of select="/root/product/product_supplier/url"/></xsl:attribute>
											<xsl:choose>
											<xsl:when test="/root/product/product_supplier/logo != ''">
												<img border="0">
													<xsl:attribute name="src"><xsl:value-of select="/root/config/sitepath"/>images/supplier/<xsl:value-of select="/root/product/product_supplier/logo"/></xsl:attribute>
												</img>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="/root/product/product_supplier/company"/>
											</xsl:otherwise>
											</xsl:choose>
										</a>
									</xsl:if>
									<br/>
								</td>
							</tr>
							</table>
								</td>
							</tr>
							<!-- the end --> 
							<xsl:for-each select="/root/product_extra_field">
								<tr class="myfont" valign="top">
									<td class="mybgcolor"  width="113"><xsl:value-of select="field_name"/></td>
									<td class="mybgcolor2"><xsl:value-of select="field_value"/></td>
								</tr>
							</xsl:for-each>
							<tr class="myfont" valign="top">
								<td colspan="2">
									<!-- CONTENT STARTS HERE -->
									<xsl:value-of select="root/product/description" disable-output-escaping="yes"/>
									<!-- CONTENT ENDS HERE -->
								</td>
							</tr>
							<tr class="myfont" valign="top">
								<td colspan="2" class="mybgcolor3" align="center">
									<input type="button">
										<xsl:attribute name="onclick">self.location='<xsl:value-of select="/root/config/secure_path"/><xsl:value-of select="/root/config/cgipath"/>isapi.dll?account&amp;favorite&amp;action=new&amp;product_id=<xsl:value-of select="root/product/product_id"/>'</xsl:attribute>
										<xsl:attribute name="value"><xsl:value-of select="/root/root/add_favorite"/></xsl:attribute>
									</input>
									<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
									<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
									<input type="button">
										<xsl:attribute name="onclick">self.location='<xsl:value-of select="/root/config/secure_path"/><xsl:value-of select="/root/config/cgipath"/>isapi.dll?account&amp;wishlist&amp;action=new&amp;product_id=<xsl:value-of select="root/product/product_id"/>'</xsl:attribute>
										<xsl:attribute name="value"><xsl:value-of select="/root/root/add_wishlist"/></xsl:attribute>
									</input>
<!--
									<xsl:if test="/root/registry_id = 0">
										<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
										<xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/>
										<input type="button">
											<xsl:attribute name="value"><xsl:value-of select="/root/root/add_registry"/></xsl:attribute>
											<xsl:attribute name="onclick">self.location='<xsl:value-of select="/root/config/unsecure_path"/><xsl:value-of select="/root/config/cgipath"/>isapi.dll?gift_registry&amp;action=add_item&amp;product_id=<xsl:value-of select="/root/product/product_id"/>'</xsl:attribute>
										</input>
									</xsl:if>
-->
								</td>
							</tr>
						</table>
						<input type="hidden" name="cat_id">
							<xsl:attribute name="value"><xsl:value-of select="/root/category_id"/></xsl:attribute>
						</input>
						<input type="hidden" name="style_type_id"/>
						<input type="hidden" name="quantity"/>
						<input type="hidden" name="writeintext"/>
						<input type="hidden" name="style_type"/>
						<input type="hidden" name="allow_backorder">
							<xsl:attribute name="value"><xsl:value-of select="/root/config/allow_backorder"/></xsl:attribute>
						</input>

						<xsl:if test="count(/root/product/related_product) &gt; 0">
							<xsl:value-of select="/root/root/related_product"/>
							<table>
							<xsl:for-each select="/root/product/related_product">
								<tr>
									<td><a>
										<xsl:attribute name="href">products/<xsl:value-of select="product_id"/></xsl:attribute>
										<xsl:value-of select="name"/></a>
									</td>
								</tr>
							</xsl:for-each>
							</table>
						</xsl:if>

						<xsl:if test="/root/product/allow_review = 1">
						<table width="100%" cellpadding="2" cellspacing="1">
							<tr class="myfont" valign="top">
								<td class="mybgcolor">
									<p/><xsl:value-of select="/root/root/write_review"/> <a>
									<xsl:attribute name="href"><xsl:value-of select="/root/config/secure_path"/><xsl:value-of select="/root/config/cgipath"/>isapi.dll?product_review&amp;product_id=<xsl:value-of select="/root/product/product_id"/></xsl:attribute>
									<xsl:value-of select="/root/root/click_here"/></a>
								</td>
							</tr>
							<tr class="myfont"><td align="center" class="mybgcolor2a">
							<xsl:choose>
							<xsl:when test="/root/language/id = 1">
								Reviews:
							</xsl:when>
							<xsl:otherwise>
								Comentariu:
							</xsl:otherwise>
							</xsl:choose>
							</td></tr>

							<xsl:for-each select="/root/product_review">
								<tr class="myfont" valign="top">
									<td class="mybgcolor">
										<xsl:value-of select="/root/root/review_name"/>: <xsl:value-of select="name"/><br/>
										<xsl:value-of select="/root/root/review_date"/>: <xsl:value-of select="posted_date"/><br/>
										<xsl:value-of select="/root/root/review_title"/>: <xsl:value-of select="title"/><br/>
										<xsl:value-of select="/root/root/review"/>: <xsl:value-of select="review"/><br/>
										<br/>
									</td>
								</tr>
							</xsl:for-each> 
						</table>
						<center>
							<font class="myfont"><xsl:value-of select="user:display_page(.)" disable-output-escaping="yes"/></font>
						</center><br/>
						</xsl:if>
						<input type="hidden" name="current_page">
							<xsl:attribute name="value"><xsl:value-of select="root/pages/@current_page"/></xsl:attribute>
						</input>
						<input type="hidden" name="total_pages">
							<xsl:attribute name="value"><xsl:value-of select="root/pages/@total_pages"/></xsl:attribute>
						</input>
						<input type="hidden" name="page_size">
							<xsl:attribute name="value"><xsl:value-of select="root/pages/@page_size"/></xsl:attribute>
						</input>
						</form>
					</td>
				</tr>
			</table>
			</xsl:otherwise>
			</xsl:choose>
		<xsl:call-template name="bottom_nav"/>
		<script>
		<![CDATA[
			function compareNumbers(a, b) {   
				return a - b
			}

			function add_style1 (theform) {
				qty = parseFloat(theform.style_qty.value,10);
				if (isNaN(qty) || qty <= 0) {
					alert ("]]><xsl:value-of select="/root/root/invalid_quantity"/><![CDATA[");
					return;
				}

				total_style_notsame = parseInt (theform.total_style_type_notsame.value,10);
				var style_type_array = new Array();

				for (i=0; i<total_style_notsame; i++) {
					selected = theform.elements['style_type_notsame_id_'+i].selectedIndex;
					style_type_array[i] = theform.elements['style_type_notsame_id_'+i].options[selected].value;
				}

				style_type_array.sort(compareNumbers);

				len = theform.style_inventory.length;

				for (i=1; i<len; i++) {
					style_text = theform.style_inventory.options[i].text;
					arr = style_text.split (",")
					arr.sort (compareNumbers);

					len2 = arr.length;
					counter = 0;
					j = 0;
					match = true;
					while (j < len2) {
						if (counter < style_type_array.length) {
							if (arr[j] == style_type_array[counter]) {
								j++;
								counter++;
								continue;
							} else {
								if (style_type_array.length > arr.length)
									counter++;
								else {
									match = false;
									break;
								}
							}
						} else {
							match = false;
							break;
						}
					}

					if (match) {
						theform.style_inventory.selectedIndex = i;
						style_value = theform.style_inventory.options[i].value;

						arr = style_value.split(",")
						stock = parseInt(arr[1],10);
						backorder = parseInt(arr[2],10);
						price = parseFloat(arr[3]);

						if (theform.allow_backorder.value == 1) {
							if (stock - qty < backorder) {
								alert ("]]><xsl:value-of select="/root/root/backlog"/><![CDATA[");
								return;
							}
						} else {
							if (stock < qty) {
								alert ("]]><xsl:value-of select="/root/root/out_of_stock"/><![CDATA[");
								return;
							}
						}
						break;
					}
				}

				if (total_style_notsame == 0) {
					if (typeof(theform.product_stock) != "undefined") {
						min_stock = parseInt (theform.product_stock.value,10);
						max_backorder = parseInt (theform.backorder.value,10);

						if (theform.allow_backorder.value == 1) {
							if (min_stock - qty < max_backorder) {
								alert ("]]><xsl:value-of select="/root/root/backlog"/><![CDATA[");
								return;
							}
						} else {
							if (qty > min_stock) {
								alert ("]]><xsl:value-of select="/root/root/out_of_stock"/><![CDATA[");
								return;
							}
						}
					}
				}
								
				theform.quantity.value = qty;
				theform.writeintext.value = theform.style_writein.value;
				theform.submit_button.disabled = true;
				theform.submit();
			}

			function add_product2 (theform) {
				qty = parseFloat(theform.prod_qty.value,10)
				if (isNaN(qty) || qty <= 0) {
					alert ("]]><xsl:value-of select="/root/root/invalid_quantity"/><![CDATA[");
					return;
				}

				if (typeof(theform.product_stock) != "undefined") {
					min_stock = parseInt (theform.product_stock.value,10);
					max_backorder = parseInt (theform.backorder.value,10);
					if (theform.allow_backorder.value == 1) {
						if (min_stock - qty < max_backorder) {
							alert ("]]><xsl:value-of select="/root/root/backlog"/><![CDATA[");
							return;
						}
					} else {
						if (qty > min_stock) {
							alert ("]]><xsl:value-of select="/root/root/out_of_stock"/><![CDATA[");
							return;
						}
					}
				}

				theform.quantity.value = qty;
				theform.writeintext.value = theform.product_writein.value;
				theform.submit_button.disabled = true;
				theform.submit();
			}

			function change_picture (theform,base_url,obj) {
				selected = obj.selectedIndex;
				index = obj.options[selected].value;

				if (index != "") {
					if (theform.elements['style_picture_'+index].value != "")
						document.images['style_picture'].src = base_url + 'images/prod/style/' +theform.elements['style_picture_'+index].value;
				}
//					else 
//						document.images['style_picture'].src = base_url + 'images/prod/style/no_pic.gif';
			}

			function change_style_notsame (theform,base_url,obj) {
				change_picture (theform,base_url,obj);
				var total_style_type_notsame = parseInt (theform.total_style_type_notsame.value,10);

				total_price = parseFloat (theform.product_price.value);
				for (i=0; i<total_style_type_notsame; i++) {
					selected = theform.elements['style_type_notsame_id_'+i].selectedIndex;
					style_type_id = theform.elements['style_type_notsame_id_'+i].options[selected].value;				
					if (style_type_id != "") {
						style_price = parseFloat (theform.elements['style_price_'+style_type_id].value);
						total_price += style_price;
					}
				}

				theform.total_price.value = round_decimal(total_price,2);
				total_style_notsame = parseInt (theform.total_style_type_notsame.value,10);
				var style_type_array = new Array();

				for (i=0; i<total_style_notsame; i++) {
					selected = theform.elements['style_type_notsame_id_'+i].selectedIndex;
					style_type_array[i] = theform.elements['style_type_notsame_id_'+i].options[selected].value;
				}

				style_type_array.sort(compareNumbers);

				len = theform.style_inventory.length;

				for (i=1; i<len; i++) {
					style_text = theform.style_inventory.options[i].text;
					arr = style_text.split (",")
					arr.sort (compareNumbers);

					len2 = arr.length;
					counter = 0;
					j = 0;
					match = true;
					while (j < len2) {
						if (counter < style_type_array.length) {
							if (arr[j] == style_type_array[counter]) {
								j++;
								counter++;
								continue;
							} else {
								if (style_type_array.length > arr.length)
									counter++;
								else {
									match = false;
									break;
								}
							}
						} else {
							match = false;
							break;
						}
					}

					if (match) {
						style_value = theform.style_inventory.options[i].value;

						arr = style_value.split(",")
						stock = parseInt(arr[1],10);
						price = parseFloat (arr[3]);
						if (! isNaN(price))
							theform.total_price.value = round_decimal (price,2);

						if (stock > 0) {
							theform.inventory.value = "]]><xsl:value-of select="/root/root/in_stock"/><![CDATA[";
						} else {
							theform.inventory.value = "]]><xsl:value-of select="/root/root/out_stock"/><![CDATA[";
						}

						break;
					}
				}

			}

			function init () {
				if (typeof(document.search_form.total_style_type_notsame) != "undefined") {
					total_style_notsame = parseInt (document.search_form.total_style_type_notsame.value,10);
					if (total_style_notsame > 0)
						change_style_notsame(document.search_form,']]><xsl:value-of select="/root/file_path"/><![CDATA[',document.search_form.style_type_notsame_id_0);
				}
			}

			init ();

			imgPrArr=new Array()
			function imgPreload(imgP){imgPrArrT=(imgP+",").split(",");for (i in imgPrArrT){if (imgPrArrT[i]!=""){imgPrArr[imgPrArrT[i]]=new Image();imgPrArr[imgPrArrT[i]].src=imgPrArrT[i]}}}

			imgPreload("1.gif,2.gif")


			ns4=(navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? 1 : 0;
			ie4new=(document.all && !document.getElementById)? 1 : 0;
			ie5=(document.getElementById && document.all)? 1 : 0;
			ns6=(document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? 1: 0;
			w3c=(document.getElementById)? 1 : 0;
			wid=(ie4new||ie5)?window.document.body.clientWidth-60:window.innerWidth-36
			if(ns4){document.write ('<layer name="di1"></layer>')}else{document.write ('<div id="di1" style="position:absolute;y-index:500" ></div>')}
			outd=""

			if(w3c)div1=document.getElementById('di1')
			if(ie4)div1=document.all['di1']
			if(ns4)div1=document.layers['di1']

			function move_div(x,y){
				if (isNaN(x+y))return
				if(ns4){div1.moveTo(x,y)}else{div1.style.left=x+'px';div1.style.top=y+'px';}
			}

			function write_div(text){
				if(ns4){
					div1.document.open();
					div1.document.write(text);
					div1.document.close();
				}
				else {div1.innerHTML=text;}
			}
			 
			function big(n){
			ondiv=n
					write_div("<a href=javascript:void(0) onmouseout='big_hide()' onmouseover='ondiv=1'><img border=1 name=ib src="+n+"></a>");
					move_div(x,y)
			}

			function big_hide(){
				ondiv=0;
				t3=window.setTimeout('big_hide2()',100)
			}

			function big_hide2(){
			if (ondiv==0){
				write_div("");
				move_div(-100,-1000)}
			}

			y=120
			x=485

		]]>
		</script>

		</html>
	</xsl:template>

	<xsl:template name="currency">
		<xsl:param name="price"/>

		<xsl:if test="/root/currency_id = 0">
		<xsl:for-each select="/root/currency">
			<xsl:if test="exchange_rate != 1 and display=1">
				(<xsl:value-of select="symbol"/> <xsl:value-of select="format-number(exchange_rate * $price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/> <xsl:value-of select="user:nbsp()" disable-output-escaping="yes"/> <xsl:value-of select="currency"/>)<br/>
			</xsl:if>
		</xsl:for-each>
		</xsl:if>
	</xsl:template>

	<xsl:template name="price">
		<xsl:param name="retail_price"/>
		<xsl:param name="member_price"/>
		<xsl:param name="sell_price"/>
		<xsl:param name="wholesale_price"/>
		<xsl:param name="customer_price"/>
		<xsl:param name="sale_price"/>

		<xsl:if test="$retail_price != ''">
			<tr class="myfont" valign="top">
				<td class="mybgcolor"><xsl:value-of select="/root/root/retail_price"/>:</td>
				<td class="mybgcolor2">
					<xsl:choose>
						<xsl:when test="/root/currency_id &gt; 0">
							<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
							<xsl:value-of select="format-number($retail_price * /root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="/root/currency_symbol/symbol"/>
							<xsl:value-of select="format-number($retail_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:otherwise>
					</xsl:choose>
				</td>
			</tr>
		</xsl:if>
		<tr class="myfont" valign="top">
			<td class="mybgcolor"><xsl:value-of select="/root/root/our_price"/>:</td>
			<td class="mybgcolor2">
				<xsl:choose>
					<xsl:when test="$customer_price != ''">
						<b>
							<xsl:choose>
								<xsl:when test="/root/currency_id &gt; 0">
									<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
									<xsl:value-of select="format-number($customer_price * /root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
									<input type="hidden" name="product_price">
										<xsl:attribute name="value"><xsl:value-of select="$customer_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
									</input>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/>
									<xsl:value-of select="format-number($customer_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
									<input type="hidden" name="product_price">
										<xsl:attribute name="value"><xsl:value-of select="$customer_price"/></xsl:attribute>
									</input>
								</xsl:otherwise>
							</xsl:choose>
						</b>
						<br/>
						<xsl:if test="count(/root/currency) &gt; 1">
							<xsl:call-template name="currency">
								<xsl:with-param name="price" select="$customer_price"/>
							</xsl:call-template>
						</xsl:if>
					</xsl:when>
					<xsl:when test="/root/customer/iswholesale = 1">
						<b>
						<xsl:choose>
							<xsl:when test="/root/wholesale_customer/discount_rate != ''">
								<xsl:choose>
									<xsl:when test="count(/root/wholesale_customer/discount_category) &gt; 0">
										<xsl:value-of select="user:initial_counter()"/>
										<xsl:for-each select="/root/wholesale_customer/discount_category">
											<xsl:if test="count(/root/category_path[category_id=current()/category_id]) &gt; 0">
												<xsl:if test="user:get_counter() = 0">
													<xsl:choose>
														<xsl:when test="/root/currency_id &gt; 0">
															<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
															<xsl:value-of select="format-number($wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate*(100-discount_rate) div 100,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
															<input type="hidden" name="product_price">
																<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate*(100-discount_rate) div 100"/></xsl:attribute>
															</input>
														</xsl:when>
														<xsl:otherwise>
															<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
															<xsl:value-of select="format-number($wholesale_price*(100-discount_rate) div 100,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
															<input type="hidden" name="product_price">
																<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*(100-discount_rate) div 100"/></xsl:attribute>
															</input>
														</xsl:otherwise>
													</xsl:choose>
													<xsl:value-of select="user:increment_counter()"/>
												</xsl:if>
											</xsl:if>
										</xsl:for-each>

										<xsl:if test="user:get_counter() = 0">
											<xsl:choose>
												<xsl:when test="/root/currency_id &gt; 0">
													<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
													<xsl:value-of select="format-number($wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
													<input type="hidden" name="product_price">
														<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
													</input>
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
													<xsl:value-of select="format-number($wholesale_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
													<input type="hidden" name="product_price">
														<xsl:attribute name="value"><xsl:value-of select="$wholesale_price"/></xsl:attribute>
													</input>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:if>
									</xsl:when>
									<xsl:otherwise>
										<xsl:choose>
											<xsl:when test="/root/currency_id &gt; 0">
												<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
												<xsl:value-of select="format-number($wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate*(100-/root/wholesale_customer/discount_rate) div 100,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
												<input type="hidden" name="product_price">
													<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate*(100-/root/wholesale_customer/discount_rate) div 100"/></xsl:attribute>
												</input>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
												<xsl:value-of select="format-number($wholesale_price*(100-/root/wholesale_customer/discount_rate) div 100,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
												<input type="hidden" name="product_price">
													<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*(100-/root/wholesale_customer/discount_rate) div 100"/></xsl:attribute>
												</input>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:when>
							<xsl:otherwise>
								<xsl:choose>
									<xsl:when test="/root/currency_id &gt; 0">
										<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
										<xsl:value-of select="format-number($wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
										<input type="hidden" name="product_price">
											<xsl:attribute name="value"><xsl:value-of select="$wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
										</input>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
										<xsl:value-of select="format-number($wholesale_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
										<input type="hidden" name="product_price">
											<xsl:attribute name="value"><xsl:value-of select="$wholesale_price"/></xsl:attribute>
										</input>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
						</b>
						<br/>
						<xsl:if test="count(/root/currency) &gt; 1">
							<xsl:choose>
								<xsl:when test="/root/wholesale_customer/discount_rate != ''">
									<xsl:call-template name="currency">
										<xsl:with-param name="price" select="/root/product/wholesale_price * (100-/root/wholesale_customer/discount_rate) div 100"/>
									</xsl:call-template>
								</xsl:when>
								<xsl:otherwise>
									<xsl:call-template name="currency">
										<xsl:with-param name="price" select="/root/product/wholesale_price"/>
									</xsl:call-template>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:if>
					</xsl:when>
					<xsl:when test="/root/customer/ismember = 1">
						<b>
							<xsl:choose>
								<xsl:when test="/root/currency_id &gt; 0">
									<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
									<xsl:value-of select="format-number($member_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
									<input type="hidden" name="product_price">
										<xsl:attribute name="value"><xsl:value-of select="$member_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
									</input>
								</xsl:when>
								<xsl:otherwise>							
									<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
									<xsl:value-of select="format-number($member_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
									<input type="hidden" name="product_price">
										<xsl:attribute name="value"><xsl:value-of select="$member_price"/></xsl:attribute>
									</input>
								</xsl:otherwise>
							</xsl:choose>
						</b>
						<br/>
						<xsl:if test="count(/root/currency) &gt; 1">
							<xsl:call-template name="currency">
								<xsl:with-param name="price" select="/root/product/member_price"/>
							</xsl:call-template>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<b>
							<xsl:choose>
								<xsl:when test="/root/currency_id &gt; 0">
									<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
									<xsl:choose>
										<xsl:when test="/root/config/activate_sale_price = 1 and $sale_price != ''">
											<xsl:value-of select="format-number($sale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
											<input type="hidden" name="product_price">
												<xsl:attribute name="value"><xsl:value-of select="$sale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
											</input>
										</xsl:when>
										<xsl:otherwise>											
											<xsl:value-of select="format-number($sell_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
											<input type="hidden" name="product_price">
												<xsl:attribute name="value"><xsl:value-of select="$sell_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/></xsl:attribute>
											</input>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
									<xsl:choose>
										<xsl:when test="/root/config/activate_sale_price = 1 and $sale_price != ''">
											<xsl:value-of select="format-number($sale_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
											<input type="hidden" name="product_price">
												<xsl:attribute name="value"><xsl:value-of select="$sale_price"/></xsl:attribute>
											</input>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="format-number($sell_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
											<input type="hidden" name="product_price">
												<xsl:attribute name="value"><xsl:value-of select="$sell_price"/></xsl:attribute>
											</input>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose>
						</b>
						<br/>
						<xsl:if test="count(/root/currency) &gt; 1">
							<xsl:choose>
								<xsl:when test="/root/config/activate_sale_price = 1 and $sale_price != ''">
									<xsl:call-template name="currency">
										<xsl:with-param name="price" select="/root/product/sale_price"/>
									</xsl:call-template>
								</xsl:when>
								<xsl:otherwise>
									<xsl:call-template name="currency">
										<xsl:with-param name="price" select="/root/product/sell"/>
									</xsl:call-template>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="style_price">
		<xsl:param name="member_price"/>
		<xsl:param name="sell_price"/>
		<xsl:param name="wholesale_price"/>

		<xsl:choose>
			<xsl:when test="/root/customer/iswholesale = 1">
				<xsl:if test="$wholesale_price &gt; 0">+</xsl:if>
				<xsl:if test="$wholesale_price != 0">
					<xsl:choose>
						<xsl:when test="/root/currency_id &gt; 0">
							<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
							<xsl:value-of select="format-number($wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
							<xsl:value-of select="format-number($wholesale_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:when>
			<xsl:when test="/root/customer/ismember = 1">
				<xsl:if test="$member_price &gt; 0">+</xsl:if>
				<xsl:if test="$member_price != 0">
					<xsl:choose>
						<xsl:when test="/root/currency_id &gt; 0">
							<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
							<xsl:value-of select="format-number($member_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
							<xsl:value-of select="format-number($member_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="$sell_price &gt; 0">+</xsl:if>
				<xsl:if test="$sell_price != 0">
					<xsl:choose>
						<xsl:when test="/root/currency_id &gt; 0">
							<xsl:value-of select="/root/currency[currency_id = /root/currency_id]/symbol"/>
							<xsl:value-of select="format-number($sell_price*/root/currency[currency_id=/root/currency_id]/exchange_rate,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="/root/currency[exchange_rate = 1]/symbol"/> 
							<xsl:value-of select="format-number($sell_price,/root/config/number_format[@selected=1]/@format,/root/config/number_format[@selected=1]/@name)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="style_price2">
		<xsl:param name="member_price"/>
		<xsl:param name="sell_price"/>
		<xsl:param name="wholesale_price"/>

		<xsl:choose>
			<xsl:when test="/root/customer/iswholesale = 1">
				<xsl:choose>
					<xsl:when test="/root/currency_id &gt; 0">
						<xsl:value-of select="$wholesale_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$wholesale_price"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:when test="/root/customer/ismember = 1">
				<xsl:choose>
					<xsl:when test="/root/currency_id &gt; 0">
						<xsl:value-of select="$member_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$member_price"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="/root/currency_id &gt; 0">
						<xsl:value-of select="$sell_price*/root/currency[currency_id=/root/currency_id]/exchange_rate"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="$sell_price"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
			

	<xsl:template name="inventory">
		<tr class="myfont">
			<td class="mybgcolor"><xsl:value-of select="/root/root/inventory"/>:</td>
			<td class="mybgcolor2"><xsl:choose>
				<xsl:when test="/root/product/stock &gt; 0">
					<xsl:value-of select="/root/root/in_stock"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="/root/root/out_stock"/>
				</xsl:otherwise>
				</xsl:choose>
				<input type="hidden" name="product_stock">
					<xsl:attribute name="value"><xsl:value-of select="/root/product/stock"/></xsl:attribute>
				</input>
				<input type="hidden" name="backorder">
					<xsl:attribute name="value"><xsl:value-of select="/root/product/reqty"/></xsl:attribute>
				</input>
			</td>
		</tr>
	</xsl:template>

	<xsl:template name="writein">
		<xsl:param name="allow_writein"/>
		<xsl:param name="writein_field"/>
		<xsl:param name="writein_value"/>

		<xsl:choose>
		<xsl:when test="$allow_writein = 1">
			<tr class="myfont">
				<td class="mybgcolor"><xsl:value-of select="$writein_value"/>:</td>
				<td class="mybgcolor2"><input type="text" maxlength="100">
					<xsl:attribute name="name"><xsl:value-of select="$writein_field"/></xsl:attribute>
					</input>
				</td>
			</tr>
		</xsl:when>
		<xsl:otherwise>
			<input type="hidden">
				<xsl:attribute name="name"><xsl:value-of select="$writein_field"/></xsl:attribute>
			</input>
		</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

</xsl:stylesheet>


