/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: ......
 * Generated at: 2020-06-22 09:40:07 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;

public final class selcolor_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
  }

  public void _jspDestroy() {
  }

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

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<HTML>\r\n");
      out.write("  <head><meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\r\n");
      out.write(" \r\n");
      out.write("    <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("    <TITLE>选择颜色&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TITLE>\r\n");
      out.write("    \r\n");
      out.write("    <META http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("    <META http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("    <META http-equiv=\"expires\" content=\"0\">\r\n");
      out.write("    \r\n");
      out.write("    \r\n");
      out.write("<STYLE type=text/css>\r\n");
      out.write("TD {FONT-SIZE: 12px}\r\n");
      out.write("BODY {FONT-SIZE: 12px}\r\n");
      out.write("BUTTON {WIDTH: 5em}\r\n");
      out.write("</STYLE>\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("<SCRIPT language=JavaScript>\r\n");
      out.write("\r\n");
      out.write("var sTitle = \"\";\r\n");
      out.write("var color =window.dialogArguments;\r\n");
      out.write("var oSelection;\r\n");
      out.write("var oControl;\r\n");
      out.write("var sRangeType;\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("// 默认显示值\r\n");
      out.write("if (!color) color = \"#000000\";\r\n");
      out.write("\r\n");
      out.write("// 返回有背景颜色属性的对象\r\n");
      out.write("function GetParent(obj){\r\n");
      out.write("\twhile(obj!=null && obj.tagName!=\"TD\" && obj.tagName!=\"TR\" && obj.tagName!=\"TH\" && obj.tagName!=\"TABLE\")\r\n");
      out.write("\t\tobj=obj.parentElement;\r\n");
      out.write("\treturn obj;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("// 返回标签名的选定控件\r\n");
      out.write("function GetControl(obj, sTag){\r\n");
      out.write("\tobj=obj.item(0);\r\n");
      out.write("\tif (obj.tagName==sTag){\r\n");
      out.write("\t\treturn obj;\r\n");
      out.write("\t}\r\n");
      out.write("\treturn null;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("// 数值转为RGB16进制颜色格式\r\n");
      out.write("function N2Color(s_Color){\r\n");
      out.write("\ts_Color = s_Color.toString(16);\r\n");
      out.write("\tswitch (s_Color.length) {\r\n");
      out.write("\tcase 1:\r\n");
      out.write("\t\ts_Color = \"0\" + s_Color + \"0000\"; \r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tcase 2:\r\n");
      out.write("\t\ts_Color = s_Color + \"0000\";\r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tcase 3:\r\n");
      out.write("\t\ts_Color = s_Color.substring(1,3) + \"0\" + s_Color.substring(0,1) + \"00\" ;\r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tcase 4:\r\n");
      out.write("\t\ts_Color = s_Color.substring(2,4) + s_Color.substring(0,2) + \"00\" ;\r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tcase 5:\r\n");
      out.write("\t\ts_Color = s_Color.substring(3,5) + s_Color.substring(1,3) + \"0\" + s_Color.substring(0,1) ;\r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tcase 6:\r\n");
      out.write("\t\ts_Color = s_Color.substring(4,6) + s_Color.substring(2,4) + s_Color.substring(0,2) ;\r\n");
      out.write("\t\tbreak;\r\n");
      out.write("\tdefault:\r\n");
      out.write("\t\ts_Color = \"\";\r\n");
      out.write("\t}\r\n");
      out.write("\treturn '#' + s_Color;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("// 初始值\r\n");
      out.write("function InitDocument(){\r\n");
      out.write("\tShowColor.bgColor = color;\r\n");
      out.write("\tRGB.innerHTML = color;\r\n");
      out.write("\tSelColor.value = color;\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("var clicked=false;\r\n");
      out.write("\r\n");
      out.write("var SelRGB = color;\r\n");
      out.write("var DrRGB = '';\r\n");
      out.write("var SelGRAY = '120';\r\n");
      out.write("\r\n");
      out.write("var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');\r\n");
      out.write("\r\n");
      out.write("function ToHex(n) {\t\r\n");
      out.write("\tvar h, l;\r\n");
      out.write("\r\n");
      out.write("\tn = Math.round(n);\r\n");
      out.write("\tl = n % 16;\r\n");
      out.write("\th = Math.floor((n / 16)) % 16;\r\n");
      out.write("\treturn (hexch[h] + hexch[l]);\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function DoColor(c, l){\r\n");
      out.write("\tvar r, g, b;\r\n");
      out.write("\r\n");
      out.write("\tr = '0x' + c.substring(1, 3);\r\n");
      out.write("\tg = '0x' + c.substring(3, 5);\r\n");
      out.write("\tb = '0x' + c.substring(5, 7);\r\n");
      out.write("\r\n");
      out.write("\tif(l > 120){\r\n");
      out.write("\t\tl = l - 120;\r\n");
      out.write("\r\n");
      out.write("\t\tr = (r * (120 - l) + 255 * l) / 120;\r\n");
      out.write("\t\tg = (g * (120 - l) + 255 * l) / 120;\r\n");
      out.write("\t\tb = (b * (120 - l) + 255 * l) / 120;\r\n");
      out.write("\t}else{\r\n");
      out.write("\t\tr = (r * l) / 120;\r\n");
      out.write("\t\tg = (g * l) / 120;\r\n");
      out.write("\t\tb = (b * l) / 120;\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\treturn '#' + ToHex(r) + ToHex(g) + ToHex(b);\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("function EndColor(){\r\n");
      out.write("\tvar i;\r\n");
      out.write("\r\n");
      out.write("\tif(DrRGB != SelRGB){\r\n");
      out.write("\t\tDrRGB = SelRGB;\r\n");
      out.write("\t\tfor(i = 0; i <= 30; i ++)\r\n");
      out.write("\t\tGrayTable.rows(i).bgColor = DoColor(SelRGB, 240 - i * 8);\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tSelColor.value = DoColor(RGB.innerText, GRAY.innerText);\r\n");
      out.write("\t \r\n");
      out.write("\t ShowColor.bgColor = SelColor.value;\r\n");
      out.write("\t\r\n");
      out.write("}\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onclick for=ColorTable language=JavaScript>\r\n");
      out.write("\tSelRGB = event.srcElement.bgColor;\r\n");
      out.write("\tclicked=true;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("\tclicked=false;\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onmouseover for=ColorTable language=JavaScript>\r\n");
      out.write("\tRGB.innerText = event.srcElement.bgColor;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onmouseout for=ColorTable language=JavaScript>\r\n");
      out.write("\tRGB.innerText = SelRGB;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onclick for=GrayTable language=JavaScript>\r\n");
      out.write("\tSelGRAY = event.srcElement.title;\r\n");
      out.write("\tclicked=true;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("\tclicked=false;\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onmouseover for=GrayTable language=JavaScript>\r\n");
      out.write("\tGRAY.innerText = event.srcElement.title;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onmouseout for=GrayTable language=JavaScript>\r\n");
      out.write("\tGRAY.innerText = SelGRAY;\r\n");
      out.write("\tEndColor();\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<SCRIPT event=onclick for=Ok language=JavaScript>\r\n");
      out.write("\tcolor = SelColor.value;\r\n");
      out.write("\t\r\n");
      out.write("    window.returnValue = color;\r\n");
      out.write("\t \r\n");
      out.write("\twindow.close();\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("</HEAD>\r\n");
      out.write("\r\n");
      out.write("<BODY bgColor=menu onLoad=\"InitDocument()\">\r\n");
      out.write("<DIV align=center>\r\n");
      out.write("<CENTER>\r\n");
      out.write("<TABLE border=0 cellPadding=0 cellSpacing=10>\r\n");
      out.write("<TBODY>\r\n");
      out.write("<TR>\r\n");
      out.write("<TD>\r\n");
      out.write("<TABLE border=0 cellPadding=0 cellSpacing=0 id=ColorTable style=\"CURSOR: hand\">\r\n");
      out.write("<SCRIPT language=JavaScript>\r\n");
      out.write("function wc(r, g, b, n){\r\n");
      out.write("\tr = ((r * 16 + r) * 3 * (15 - n) + 0x80 * n) / 15;\r\n");
      out.write("\tg = ((g * 16 + g) * 3 * (15 - n) + 0x80 * n) / 15;\r\n");
      out.write("\tb = ((b * 16 + b) * 3 * (15 - n) + 0x80 * n) / 15;\r\n");
      out.write("\r\n");
      out.write("\tdocument.write('<TD BGCOLOR=#' + ToHex(r) + ToHex(g) + ToHex(b) + ' height=8 width=8></TD>');\r\n");
      out.write("}\r\n");
      out.write("\r\n");
      out.write("var cnum = new Array(1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0);\r\n");
      out.write("\r\n");
      out.write("for(i = 0; i < 16; i ++){\r\n");
      out.write("\tdocument.write('<TR>');\r\n");
      out.write("\tfor(j = 0; j < 30; j ++){\r\n");
      out.write("\t\tn1 = j % 5;\r\n");
      out.write("\t\tn2 = Math.floor(j / 5) * 3;\r\n");
      out.write("\t\tn3 = n2 + 3;\r\n");
      out.write("\r\n");
      out.write("\t\twc((cnum[n3] * n1 + cnum[n2] * (5 - n1)),\r\n");
      out.write("\t\t(cnum[n3 + 1] * n1 + cnum[n2 + 1] * (5 - n1)),\r\n");
      out.write("\t\t(cnum[n3 + 2] * n1 + cnum[n2 + 2] * (5 - n1)), i);\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tdocument.writeln('</TR>');\r\n");
      out.write("}\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<TBODY></TBODY></TABLE></TD>\r\n");
      out.write("<TD>\r\n");
      out.write("<TABLE border=0 cellPadding=0 cellSpacing=0 id=GrayTable style=\"CURSOR: hand\">\r\n");
      out.write("<SCRIPT language=JavaScript>\r\n");
      out.write("for(i = 255; i >= 0; i -= 8.5)\r\n");
      out.write("document.write('<TR BGCOLOR=#' + ToHex(i) + ToHex(i) + ToHex(i) + '><TD TITLE=' + Math.floor(i * 16 / 17) + ' height=4 width=20></TD></TR>');\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<TBODY></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></DIV>\r\n");
      out.write(" \r\n");
      out.write("<TABLE border=0 align=\"right\" cellPadding=0 cellSpacing=10>\r\n");
      out.write("<TBODY>\r\n");
      out.write("<TR>\r\n");
      out.write("<TD width=\"55\" rowSpan=2 align=middle>\r\n");
      out.write("\r\n");
      out.write("<TABLE border=1 cellPadding=0 cellSpacing=0 height=19 id=ShowColor width=40 bgcolor=\"\">\r\n");
      out.write("<TBODY>\r\n");
      out.write("<TR>\r\n");
      out.write("<TD width=\"51\" height=\"17\" align=\"center\"></TD>\r\n");
      out.write("</TR></TBODY></TABLE>\r\n");
      out.write("\r\n");
      out.write("</TD>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<TD width=\"70\"   >  <span style=\"display:none\">基色: <SPAN id=RGB></SPAN><BR>亮度: <SPAN\r\n");
      out.write("id=GRAY>120</SPAN><BR>代码: </span><INPUT id=SelColor size=7 value=\"\"></TD>\r\n");
      out.write("<TD width=\"91\" align=\"right\" nowrap>\r\n");
      out.write("  <input type='button' onclick=\"window.close()\" value='取消'>\r\n");
      out.write("<input name=\"button\" type=\"button\" id=Ok value=\"确定\"></TD></TR>\r\n");
      out.write("</TBODY></TABLE> \r\n");
      out.write("\r\n");
      out.write("</BODY></HTML>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
