<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>

<% String pgid="products"; %> 
<%@ include file="commonjsps/i.top.jsp" %> 

<%
  String path_xml= Message.getMessageBundle("path.xml.products",bundle,request); 
  String products_type = request.getParameter("type");
  if (products_type == null){
  	products_type = "active";
  }
  
  String xpath_cat = "root/categorii[@produse='" + products_type + "']/categorie";
  String products_cat = request.getParameter("cat");
  if (products_cat != null){
  	xpath_cat = xpath_cat + "[@id='" + products_cat + "']";
  }
 
  String xpath_subcat="subcategorie";
  String products_subcat = request.getParameter("sub");
  if (products_subcat != null){
  	xpath_subcat = xpath_subcat + "[@id='" + products_subcat + "']";
  }
%>

	<link rel="stylesheet" type="text/css" href="<%=cpath%>/theme/interior.css"/>
	<link rel="stylesheet" type="text/css" href="<%=cpath%>/theme/product.css"/>

	<SCRIPT src="<%=cpath%>/javascript/dw_event.js" type=text/javascript></SCRIPT>
	<SCRIPT src="<%=cpath%>/javascript/dw_viewport.js" type=text/javascript></SCRIPT>
	<SCRIPT src="<%=cpath%>/javascript/dw_drag.js" type=text/javascript></SCRIPT>
	<SCRIPT src="<%=cpath%>/javascript/dw_writedrag.js" type=text/javascript></SCRIPT>
	<SCRIPT src="<%=cpath%>/javascript/dw_suplim.js" type=text/javascript></SCRIPT>
	
				<div id="breadcrumbs"><bean:message key="breadcrumbs.products"/></div>
			</div>
		</div>
  		<div id="bodyArea">
  			  <div id="col_2"> 
					 
			  </div>
			  <div id="col_1">
			  		<h1><bean:message key="title.products"/></h1>
				    <xtags:parse uri="<%=path_xml%>"/>
				    <table style="margin-top:-15px" cellspacing="0" cellspacing="5">
					    <xtags:forEach select="<%=xpath_cat%>">
					    	<a name="<xtags:valueOf select="@id"/>"/>
					    	<xtags:variable id="cat_name" select="name"/>
					    	<xtags:forEach select="<%=xpath_subcat%>">
					    		<xtags:variable id="subcat_name" select="name"/>
					    		<tr>
									<td colspan="2">
										<h2><%=cat_name%> <%if (!subcat_name.equals("")){%>&gt;<%}%> <%=subcat_name%></h2>
									</td>
								</tr>
								<%int i=0;%>
								<xtags:forEach select="produse/produs">
							    	<xtags:variable id="foto" select="foto/filename"/>
								    	<% i++; %>
								    	<tr <%if (i%2 == 0){%>class="alternate"<%}%>>
									    	<td valign="top">
									    		<%if (foto.length() > 0){%>
									    			<a onclick="return wrapContent(event, this.href, <xtags:valueOf select="foto/width"/>, <xtags:valueOf select="foto/height"/>)" href="library/images/products/m_<%=foto%>"><img border="0" class="icon_poze" src="library/images/products/<xtags:valueOf select="@id"/>_icon.jpg"></a>
										   		<%}%>
											</td>
											<td valign="top">
									    		<div class="title">
									    			<xtags:valueOf select="denumire"/>
									    		</div>
									    		<xtags:variable id="descriere_scurta" select="descriere_scurta"/>
									    		<div class="descriere">
									    			<xtags:variable id="produs_id" select="@id"/>
									    			<a href="<%=cpath%>/product.jsp?id=<%=produs_id%>"><%=descriere_scurta%></a>
									    		</div>
										    </td>
									    </tr>
								     </xtags:forEach>
							   </xtags:forEach>
					    </xtags:forEach>
					</table>
				    <br>
				    
				  
			  </div>
			  <br><br>
		</div>
		<DIV id=dragDiv><DIV id=handle><A href="javascript:%20void%20writeDrag.hide()" style="margin-right:5px">X</A></DIV><DIV id=cntnt onClick="writeDrag.hide();" onMouseOver="this.style.cursor='hand'"></DIV></DIV>	
<%@ include file="commonjsps/i.bottom.jsp" %>   
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-59017125-1', 'auto');
  ga('send', 'pageview');

</script>		
