<%-- 
/**
  * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  * USA
  *
  * Component of: Red Hat Application Server
  * 
  * Initial Developers: Aizaz Ahmed
  *                     Vivek Lakshmanan
  *                     Andrew Overholt
  *                     Matthew Wringe
  * Developers: Greg Lapouchnian
  * 			Patrick Smith
  */
--%>
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:include page="common/header.jsp" />

  <!-- Content begins here -->
  <div id="form" >

  <jsp:include page="messages.jsp" />


  <div class="ItemView">
  <c:if test="${picture != null}">
	<img src="/olstore/${picture.location}" title="${picture.text}" alt="${picture.text}"/>
  </c:if>
  
  <div class="ImageAdj">
    <p class="label"><c:out value="${item.name}"/></p>
    <p class="price">Price: <span class="price"><fmt:formatNumber value="${item.price}" pattern="$#,##0.00" /></span></p><br />
    <p class="shortDesc"><c:out value="${item.shortDesc}"/></p>

	<a href="<c:url value="/store/addItemToCart.do"><c:param name="itemId" value="${item.itemId}"/></c:url>">[Purchase this Item]</a><br/>
    <a href="<c:url value="/store/viewItem.do"><c:param name="itemId" value="${item.itemId}"/><c:param name="interesting" value="true"/></c:url>">[Mark this Item as Interesting]</a><br />
    <a href="<c:url value="/admin/editItem.do"><c:param name="itemId" value="${item.itemId}"/></c:url>"> [Admin - Edit this Item]</a>

	<c:forEach var='friends' items='${friendsMap}'>	
    	<c:if test="${!empty friends.value}">
			<c:if test="${friends.key == item.itemId}">
			   	<br/>Your friends that already purchased this item are:
				<c:forEach var='name' items='${friends.value}'>
					<li><c:out value="${name}"/></li>
				</c:forEach>
			</c:if>
		</c:if>
	</c:forEach>

    <div class="spacer" ></div>
   </div>


   <div class="details" >
     <div class="formHeader"> Details </div>
	    <p class="longDesc"><c:out value="${item.longDesc}"/></p>
	
	    <div class="properties">
	        <div class="propertiesView">
	        <div class="spacer" ></div>
	            <c:forEach var="prop" items="${item.properties}">
	            <div class="propRow">
	                <span class="label"><c:out value="${prop.name}"/></span>
	                <span class="formw"><c:out value="${prop.value}"/></span>
	                <div class="spacer"></div>
	            </div>
			</c:forEach>
	        <div class="spacer"></div>
	        </div>
	        <div class="spacer"></div>
	    </div>
	    <div class="spacer"></div>
     </div>

    <div class="spacer" ></div>
    </div>

    <br style="clear:both" />
    </div>

<jsp:include page="common/footer.jsp" />