package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
import java.util.*;
import java.sql.*;
import java.io.File;
import org.apache.log4j.Category;
import jp.co.sint.database.*;
import jp.co.sint.tools.*;
import jp.co.sint.basic.*;
import jp.co.sint.config.*;
import jp.co.sint.beans.front.*;
import jp.co.sint.beans.mallmgr.*;
import jp.co.sint.servlet.front.SICustAccessLog;

public class cmdty_info_popup_jsp extends HttpJspBase {


  private static java.util.Vector _jspx_includes;

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_response_sendRedirect;

  public cmdty_info_popup_jsp() {
    _jspx_tagPool_response_sendRedirect = new org.apache.jasper.runtime.TagHandlerPool();
  }

  public java.util.List getIncludes() {
    return _jspx_includes;
  }

  public void _jspDestroy() {
    _jspx_tagPool_response_sendRedirect.release();
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    javax.servlet.jsp.PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=MS932");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"../../util/error.jsp", true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");

/**
 * Copyright (c) 2003-2009 System Integrator Corporation. & Beautygarage Inc.
 *                 All Rights Reserved.
 * @version $Id : include/cmdty_info_popup.jsp,v 2.0 2009/04/19 Exp $
 * @author      : Naotaka Ohsugi
 * @Description : 商品詳細用ポップアップ
 * @History
 * Author         Date        Reason
 * ============   ==========  ===========================
 * Naotaka        2009/04/19  Original
 */

      out.write("\r\n");
/**タグのセクション*/
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
/**エラー遷移先の定義のセクション*/
      out.write("\r\n");
      out.write("\r\n");
/**クラスのインポートのセクション*/
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

//beansの取得
UICmdtyInfo cmdtyInfoID=(UICmdtyInfo)session.getAttribute(SIConfig.SISESSION_CMDTY_POPUP_NAME);
if (cmdtyInfoID==null){
      out.write("\r\ncmdtyInfoID=new UICmdtyInfo();\r\n");
      /* ----  response:sendRedirect ---- */
      org.apache.taglibs.response.SendRedirectTag _jspx_th_response_sendRedirect_0 = (org.apache.taglibs.response.SendRedirectTag) _jspx_tagPool_response_sendRedirect.get(org.apache.taglibs.response.SendRedirectTag.class);
      _jspx_th_response_sendRedirect_0.setPageContext(pageContext);
      _jspx_th_response_sendRedirect_0.setParent(null);
      int _jspx_eval_response_sendRedirect_0 = _jspx_th_response_sendRedirect_0.doStartTag();
      if (_jspx_eval_response_sendRedirect_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        if (_jspx_eval_response_sendRedirect_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
          javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
          out = _bc;
          _jspx_th_response_sendRedirect_0.setBodyContent(_bc);
          _jspx_th_response_sendRedirect_0.doInitBody();
        }
        do {
          out.print(SIURLMap.getUrl(request,"webshop.servlet.front.main"));
          int evalDoAfterBody = _jspx_th_response_sendRedirect_0.doAfterBody();
          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
            break;
        } while (true);
        if (_jspx_eval_response_sendRedirect_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
          out = pageContext.popBody();
      }
      if (_jspx_th_response_sendRedirect_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
        return;
      _jspx_tagPool_response_sendRedirect.reuse(_jspx_th_response_sendRedirect_0);
      out.write("\r\n");

}

//各フロント画面に共通(common)
SISrchKey srchKeyList=cmdtyInfoID.getSrchKey();
String currCtgryCode=cmdtyInfoID.getCtgryCodeTxt();
//データベースへのコネンクション(common)
SIDatabaseConnection databaseConnection=new SIDatabaseConnection();try{
Connection connection=databaseConnection.getConnection();
//商品詳細のデータの取得
SICmdty cmdty=new SICmdty(cmdtyInfoID.getShopCodeTxt(),cmdtyInfoID.getCmdtyCodeTxt(),cmdtyInfoID.getIndividualCodeTxt());
boolean dispEnable=cmdty.reset(connection,true,true);

//値の設定
String referIndex  = cmdtyInfoID.getReferImageInx();
String maxImage    = cmdtyInfoID.getMaxImageCount();
String[] ImageName = cmdtyInfoID.getImageName();
//サイトの設定
String webshopSite=SIHTMLUtil.getRootPath(request);

      out.write("\r\n");
      out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ja\" lang=\"ja\">\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=Shift_JIS\" />\r\n");
      out.write("<title>MORE DETAIL：");
      out.print(cmdty.getCmdtyName());
      out.write(" [");
      out.print(cmdty.getMakerName());
      out.write("] - BEAUTY GARAGE");
      out.write("</title>\r\n");
      out.write("<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\r\n");
      out.write("<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\r\n");
      out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
      out.print(webshopSite);
      out.write("/css/pop.css\" media=\"screen,print\" />\r\n");
      out.write("<script src=\"");
      out.print(webshopSite);
      out.write("/script/common.js\" type=\"text/javascript\">");
      out.write("</script>\r\n");
      out.write("<script type=\"text/javascript\">\r\n$(document).ready( function() {\r\n  $(\".thumbnail a\").hover( function() {\r\n    var changeSrc = $(this).attr(\"href\");\r\n    $(\"#target\").attr(\"src\", changeSrc);\r\n\t//change(str);\r\n    return false;\r\n  });\r\n  \r\n});\r\nfunction change(str){\r\n  var elem = document.getElementById('text');\r\n  elem.innerHTML = str;\r\n}\r\n");
      out.write("</script>\r\n");
      out.write("</head>\r\n");
      out.write("<body id=\"index\">\r\n");
      out.write("<div id=\"wrapper\">\r\n");
      out.write("<!-- headerArea -->\r\n");
      out.write("<div id=\"headerArea\" class=\"clearFix\">\r\n");
      out.write("<img src=\"");
      out.print(webshopSite);
      out.write("/img/logo_pop.gif\" alt=\"BEAUTY GARAGE\" width=\"133\" height=\"23\" class=\"bglogo\" />\r\n");
      out.write("<p class=\"close\">");
      out.write("<a href=\"javascript:close();\" title=\"ウィンドウを閉じる\">");
      out.write("<img src=\"");
      out.print(webshopSite);
      out.write("/img/btn_close.gif\" alt=\"ウィンドウを閉じる\" width=\"99\" height=\"23\" />");
      out.write("</a>");
      out.write("</p>\r\n");
      out.write("</div>\r\n");
      out.write("<!-- /headerArea -->\r\n\r\n");
      out.write("<!-- contentsArea -->\r\n");
      out.write("<div id=\"contentsArea\">\r\n");
      out.write("<div class=\"wrap\">\r\n");
      out.write("<p class=\"pic\">");
      out.write("<img id=\"target\" src=\"");
      out.print(webshopSite);
      out.write("/image/cmdty/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("_");
      out.print(cmdtyInfoID.getIndividualCodeTxt());
      out.write("_");
      out.print(referIndex);
      out.write(".jpg\" />");
      out.write("</p>\r\n");
      out.write("<p class=\"pic thumbBox\">\r\n");
if(1<Integer.parseInt(maxImage)){for (int j=1;j<Integer.parseInt(maxImage)+1;j++){
      out.write("\r\n");
      out.write("<span class=\"thumbnail\">");
      out.write("<a onClick=\"return false\" href=\"");
      out.print(webshopSite);
      out.write("/image/cmdty/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("_");
      out.print(cmdtyInfoID.getIndividualCodeTxt());
      out.write("_");
      out.print(j);
      out.write(".jpg\">");
      out.write("<img src=\"");
      out.print(webshopSite);
      out.write("/image/cmdty/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("/");
      out.print(cmdtyInfoID.getCmdtyCodeTxt());
      out.write("_");
      out.print(cmdtyInfoID.getIndividualCodeTxt());
      out.write("_");
      out.print(j);
      out.write(".jpg\"  width=\"56\" height=\"42\" onMouseover=\"change('");
      out.print(ImageName[j-1]);
      out.write("')\"/>");
      out.write("</a>");
      out.write("</span>\r\n");
}}
      out.write("\r\n");
      out.write("</p>\r\n");
      out.write("<p id=\"text\" class=\"pic\">");
      out.print(ImageName[Integer.parseInt(referIndex)-1]);
      out.write("</p>\r\n");
      out.write("</div>\r\n");
      out.write("</div>\r\n");
      out.write("<!-- /contentsArea -->\r\n\r\n");
      out.write("<!-- footerArea -->\r\n");
      out.write("<div id=\"footerArea\">\r\n");
      out.write("<p id=\"copyright\">Copyright by BEAUTY GARAGE INC. All rights reserved.");
      out.write("</p>\r\n");
      out.write("</div>\r\n");
      out.write("<!-- /footerArea -->\r\n\r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");

}catch(Exception e){
  e.printStackTrace();
  throw new ServletException();
}finally{
  databaseConnection.close();
}

    } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
        out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}
