-
+ 5DDA52724E8EE7889BAF0A35AD0665F2DB6AF09CB7DAEDE70D7320AC1F24FD1AB6EEB4563D39DA229C6F43FD46695BE69D6067C211A8B886390CAA87D156B8F6
mp-wp/wp-includes/js/colorpicker.js
(0 . 0)(1 . 707)
99577 // ===================================================================
99578 // Author: Matt Kruse <matt@mattkruse.com>
99579 // WWW: http://www.mattkruse.com/
99580 //
99581 // NOTICE: You may use this code for any purpose, commercial or
99582 // private, without any further permission from the author. You may
99583 // remove this notice from your final code if you wish, however it is
99584 // appreciated by the author if at least my web site address is kept.
99585 //
99586 // You may *NOT* re-distribute this code in any way except through its
99587 // use. That means, you can include it in your product, or your web
99588 // site, or any other form where the code is actually being used. You
99589 // may not put the plain javascript up on your site for download or
99590 // include it in your javascript libraries for download.
99591 // If you wish to share this code with others, please just point them
99592 // to the URL instead.
99593 // Please DO NOT link directly to my .js files from your site. Copy
99594 // the files to your server and use them there. Thank you.
99595 // ===================================================================
99596
99597
99598 /* SOURCE FILE: AnchorPosition.js */
99599
99600 /*
99601 AnchorPosition.js
99602 Author: Matt Kruse
99603 Last modified: 10/11/02
99604
99605 DESCRIPTION: These functions find the position of an <A> tag in a document,
99606 so other elements can be positioned relative to it.
99607
99608 COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
99609 positioning errors - usually with Window positioning - occur on the
99610 Macintosh platform.
99611
99612 FUNCTIONS:
99613 getAnchorPosition(anchorname)
99614 Returns an Object() having .x and .y properties of the pixel coordinates
99615 of the upper-left corner of the anchor. Position is relative to the PAGE.
99616
99617 getAnchorWindowPosition(anchorname)
99618 Returns an Object() having .x and .y properties of the pixel coordinates
99619 of the upper-left corner of the anchor, relative to the WHOLE SCREEN.
99620
99621 NOTES:
99622
99623 1) For popping up separate browser windows, use getAnchorWindowPosition.
99624 Otherwise, use getAnchorPosition
99625
99626 2) Your anchor tag MUST contain both NAME and ID attributes which are the
99627 same. For example:
99628 <A NAME="test" ID="test"> </A>
99629
99630 3) There must be at least a space between <A> </A> for IE5.5 to see the
99631 anchor tag correctly. Do not do <A></A> with no space.
99632 */
99633
99634 // getAnchorPosition(anchorname)
99635 // This function returns an object having .x and .y properties which are the coordinates
99636 // of the named anchor, relative to the page.
99637 function getAnchorPosition(anchorname) {
99638 // This function will return an Object with x and y properties
99639 var useWindow=false;
99640 var coordinates=new Object();
99641 var x=0,y=0;
99642 // Browser capability sniffing
99643 var use_gebi=false, use_css=false, use_layers=false;
99644 if (document.getElementById) { use_gebi=true; }
99645 else if (document.all) { use_css=true; }
99646 else if (document.layers) { use_layers=true; }
99647 // Logic to find position
99648 if (use_gebi && document.all) {
99649 x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
99650 y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
99651 }
99652 else if (use_gebi) {
99653 var o=document.getElementById(anchorname);
99654 x=AnchorPosition_getPageOffsetLeft(o);
99655 y=AnchorPosition_getPageOffsetTop(o);
99656 }
99657 else if (use_css) {
99658 x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
99659 y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
99660 }
99661 else if (use_layers) {
99662 var found=0;
99663 for (var i=0; i<document.anchors.length; i++) {
99664 if (document.anchors[i].name==anchorname) { found=1; break; }
99665 }
99666 if (found==0) {
99667 coordinates.x=0; coordinates.y=0; return coordinates;
99668 }
99669 x=document.anchors[i].x;
99670 y=document.anchors[i].y;
99671 }
99672 else {
99673 coordinates.x=0; coordinates.y=0; return coordinates;
99674 }
99675 coordinates.x=x;
99676 coordinates.y=y;
99677 return coordinates;
99678 }
99679
99680 // getAnchorWindowPosition(anchorname)
99681 // This function returns an object having .x and .y properties which are the coordinates
99682 // of the named anchor, relative to the window
99683 function getAnchorWindowPosition(anchorname) {
99684 var coordinates=getAnchorPosition(anchorname);
99685 var x=0;
99686 var y=0;
99687 if (document.getElementById) {
99688 if (isNaN(window.screenX)) {
99689 x=coordinates.x-document.body.scrollLeft+window.screenLeft;
99690 y=coordinates.y-document.body.scrollTop+window.screenTop;
99691 }
99692 else {
99693 x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
99694 y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
99695 }
99696 }
99697 else if (document.all) {
99698 x=coordinates.x-document.body.scrollLeft+window.screenLeft;
99699 y=coordinates.y-document.body.scrollTop+window.screenTop;
99700 }
99701 else if (document.layers) {
99702 x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
99703 y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
99704 }
99705 coordinates.x=x;
99706 coordinates.y=y;
99707 return coordinates;
99708 }
99709
99710 // Functions for IE to get position of an object
99711 function AnchorPosition_getPageOffsetLeft (el) {
99712 var ol=el.offsetLeft;
99713 while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
99714 return ol;
99715 }
99716 function AnchorPosition_getWindowOffsetLeft (el) {
99717 return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
99718 }
99719 function AnchorPosition_getPageOffsetTop (el) {
99720 var ot=el.offsetTop;
99721 while((el=el.offsetParent) != null) { ot += el.offsetTop; }
99722 return ot;
99723 }
99724 function AnchorPosition_getWindowOffsetTop (el) {
99725 return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
99726 }
99727
99728 /* SOURCE FILE: PopupWindow.js */
99729
99730 /*
99731 PopupWindow.js
99732 Author: Matt Kruse
99733 Last modified: 02/16/04
99734
99735 DESCRIPTION: This object allows you to easily and quickly popup a window
99736 in a certain place. The window can either be a DIV or a separate browser
99737 window.
99738
99739 COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
99740 positioning errors - usually with Window positioning - occur on the
99741 Macintosh platform. Due to bugs in Netscape 4.x, populating the popup
99742 window with <STYLE> tags may cause errors.
99743
99744 USAGE:
99745 // Create an object for a WINDOW popup
99746 var win = new PopupWindow();
99747
99748 // Create an object for a DIV window using the DIV named 'mydiv'
99749 var win = new PopupWindow('mydiv');
99750
99751 // Set the window to automatically hide itself when the user clicks
99752 // anywhere else on the page except the popup
99753 win.autoHide();
99754
99755 // Show the window relative to the anchor name passed in
99756 win.showPopup(anchorname);
99757
99758 // Hide the popup
99759 win.hidePopup();
99760
99761 // Set the size of the popup window (only applies to WINDOW popups
99762 win.setSize(width,height);
99763
99764 // Populate the contents of the popup window that will be shown. If you
99765 // change the contents while it is displayed, you will need to refresh()
99766 win.populate(string);
99767
99768 // set the URL of the window, rather than populating its contents
99769 // manually
99770 win.setUrl("http://www.site.com/");
99771
99772 // Refresh the contents of the popup
99773 win.refresh();
99774
99775 // Specify how many pixels to the right of the anchor the popup will appear
99776 win.offsetX = 50;
99777
99778 // Specify how many pixels below the anchor the popup will appear
99779 win.offsetY = 100;
99780
99781 NOTES:
99782 1) Requires the functions in AnchorPosition.js
99783
99784 2) Your anchor tag MUST contain both NAME and ID attributes which are the
99785 same. For example:
99786 <A NAME="test" ID="test"> </A>
99787
99788 3) There must be at least a space between <A> </A> for IE5.5 to see the
99789 anchor tag correctly. Do not do <A></A> with no space.
99790
99791 4) When a PopupWindow object is created, a handler for 'onmouseup' is
99792 attached to any event handler you may have already defined. Do NOT define
99793 an event handler for 'onmouseup' after you define a PopupWindow object or
99794 the autoHide() will not work correctly.
99795 */
99796
99797 // Set the position of the popup window based on the anchor
99798 function PopupWindow_getXYPosition(anchorname) {
99799 var coordinates;
99800 if (this.type == "WINDOW") {
99801 coordinates = getAnchorWindowPosition(anchorname);
99802 }
99803 else {
99804 coordinates = getAnchorPosition(anchorname);
99805 }
99806 this.x = coordinates.x;
99807 this.y = coordinates.y;
99808 }
99809 // Set width/height of DIV/popup window
99810 function PopupWindow_setSize(width,height) {
99811 this.width = width;
99812 this.height = height;
99813 }
99814 // Fill the window with contents
99815 function PopupWindow_populate(contents) {
99816 this.contents = contents;
99817 this.populated = false;
99818 }
99819 // Set the URL to go to
99820 function PopupWindow_setUrl(url) {
99821 this.url = url;
99822 }
99823 // Set the window popup properties
99824 function PopupWindow_setWindowProperties(props) {
99825 this.windowProperties = props;
99826 }
99827 // Refresh the displayed contents of the popup
99828 function PopupWindow_refresh() {
99829 if (this.divName != null) {
99830 // refresh the DIV object
99831 if (this.use_gebi) {
99832 document.getElementById(this.divName).innerHTML = this.contents;
99833 }
99834 else if (this.use_css) {
99835 document.all[this.divName].innerHTML = this.contents;
99836 }
99837 else if (this.use_layers) {
99838 var d = document.layers[this.divName];
99839 d.document.open();
99840 d.document.writeln(this.contents);
99841 d.document.close();
99842 }
99843 }
99844 else {
99845 if (this.popupWindow != null && !this.popupWindow.closed) {
99846 if (this.url!="") {
99847 this.popupWindow.location.href=this.url;
99848 }
99849 else {
99850 this.popupWindow.document.open();
99851 this.popupWindow.document.writeln(this.contents);
99852 this.popupWindow.document.close();
99853 }
99854 this.popupWindow.focus();
99855 }
99856 }
99857 }
99858 // Position and show the popup, relative to an anchor object
99859 function PopupWindow_showPopup(anchorname) {
99860 this.getXYPosition(anchorname);
99861 this.x += this.offsetX;
99862 this.y += this.offsetY;
99863 if (!this.populated && (this.contents != "")) {
99864 this.populated = true;
99865 this.refresh();
99866 }
99867 if (this.divName != null) {
99868 // Show the DIV object
99869 if (this.use_gebi) {
99870 document.getElementById(this.divName).style.left = this.x + "px";
99871 document.getElementById(this.divName).style.top = this.y;
99872 document.getElementById(this.divName).style.visibility = "visible";
99873 }
99874 else if (this.use_css) {
99875 document.all[this.divName].style.left = this.x;
99876 document.all[this.divName].style.top = this.y;
99877 document.all[this.divName].style.visibility = "visible";
99878 }
99879 else if (this.use_layers) {
99880 document.layers[this.divName].left = this.x;
99881 document.layers[this.divName].top = this.y;
99882 document.layers[this.divName].visibility = "visible";
99883 }
99884 }
99885 else {
99886 if (this.popupWindow == null || this.popupWindow.closed) {
99887 // If the popup window will go off-screen, move it so it doesn't
99888 if (this.x<0) { this.x=0; }
99889 if (this.y<0) { this.y=0; }
99890 if (screen && screen.availHeight) {
99891 if ((this.y + this.height) > screen.availHeight) {
99892 this.y = screen.availHeight - this.height;
99893 }
99894 }
99895 if (screen && screen.availWidth) {
99896 if ((this.x + this.width) > screen.availWidth) {
99897 this.x = screen.availWidth - this.width;
99898 }
99899 }
99900 var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
99901 this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
99902 }
99903 this.refresh();
99904 }
99905 }
99906 // Hide the popup
99907 function PopupWindow_hidePopup() {
99908 if (this.divName != null) {
99909 if (this.use_gebi) {
99910 document.getElementById(this.divName).style.visibility = "hidden";
99911 }
99912 else if (this.use_css) {
99913 document.all[this.divName].style.visibility = "hidden";
99914 }
99915 else if (this.use_layers) {
99916 document.layers[this.divName].visibility = "hidden";
99917 }
99918 }
99919 else {
99920 if (this.popupWindow && !this.popupWindow.closed) {
99921 this.popupWindow.close();
99922 this.popupWindow = null;
99923 }
99924 }
99925 }
99926 // Pass an event and return whether or not it was the popup DIV that was clicked
99927 function PopupWindow_isClicked(e) {
99928 if (this.divName != null) {
99929 if (this.use_layers) {
99930 var clickX = e.pageX;
99931 var clickY = e.pageY;
99932 var t = document.layers[this.divName];
99933 if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
99934 return true;
99935 }
99936 else { return false; }
99937 }
99938 else if (document.all) { // Need to hard-code this to trap IE for error-handling
99939 var t = window.event.srcElement;
99940 while (t.parentElement != null) {
99941 if (t.id==this.divName) {
99942 return true;
99943 }
99944 t = t.parentElement;
99945 }
99946 return false;
99947 }
99948 else if (this.use_gebi && e) {
99949 var t = e.originalTarget;
99950 while (t.parentNode != null) {
99951 if (t.id==this.divName) {
99952 return true;
99953 }
99954 t = t.parentNode;
99955 }
99956 return false;
99957 }
99958 return false;
99959 }
99960 return false;
99961 }
99962
99963 // Check an onMouseDown event to see if we should hide
99964 function PopupWindow_hideIfNotClicked(e) {
99965 if (this.autoHideEnabled && !this.isClicked(e)) {
99966 this.hidePopup();
99967 }
99968 }
99969 // Call this to make the DIV disable automatically when mouse is clicked outside it
99970 function PopupWindow_autoHide() {
99971 this.autoHideEnabled = true;
99972 }
99973 // This global function checks all PopupWindow objects onmouseup to see if they should be hidden
99974 function PopupWindow_hidePopupWindows(e) {
99975 for (var i=0; i<popupWindowObjects.length; i++) {
99976 if (popupWindowObjects[i] != null) {
99977 var p = popupWindowObjects[i];
99978 p.hideIfNotClicked(e);
99979 }
99980 }
99981 }
99982 // Run this immediately to attach the event listener
99983 function PopupWindow_attachListener() {
99984 if (document.layers) {
99985 document.captureEvents(Event.MOUSEUP);
99986 }
99987 window.popupWindowOldEventListener = document.onmouseup;
99988 if (window.popupWindowOldEventListener != null) {
99989 document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
99990 }
99991 else {
99992 document.onmouseup = PopupWindow_hidePopupWindows;
99993 }
99994 }
99995 // CONSTRUCTOR for the PopupWindow object
99996 // Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
99997 function PopupWindow() {
99998 if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
99999 if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
100000 if (!window.listenerAttached) {
100001 window.listenerAttached = true;
100002 PopupWindow_attachListener();
100003 }
100004 this.index = popupWindowIndex++;
100005 popupWindowObjects[this.index] = this;
100006 this.divName = null;
100007 this.popupWindow = null;
100008 this.width=0;
100009 this.height=0;
100010 this.populated = false;
100011 this.visible = false;
100012 this.autoHideEnabled = false;
100013
100014 this.contents = "";
100015 this.url="";
100016 this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
100017 if (arguments.length>0) {
100018 this.type="DIV";
100019 this.divName = arguments[0];
100020 }
100021 else {
100022 this.type="WINDOW";
100023 }
100024 this.use_gebi = false;
100025 this.use_css = false;
100026 this.use_layers = false;
100027 if (document.getElementById) { this.use_gebi = true; }
100028 else if (document.all) { this.use_css = true; }
100029 else if (document.layers) { this.use_layers = true; }
100030 else { this.type = "WINDOW"; }
100031 this.offsetX = 0;
100032 this.offsetY = 0;
100033 // Method mappings
100034 this.getXYPosition = PopupWindow_getXYPosition;
100035 this.populate = PopupWindow_populate;
100036 this.setUrl = PopupWindow_setUrl;
100037 this.setWindowProperties = PopupWindow_setWindowProperties;
100038 this.refresh = PopupWindow_refresh;
100039 this.showPopup = PopupWindow_showPopup;
100040 this.hidePopup = PopupWindow_hidePopup;
100041 this.setSize = PopupWindow_setSize;
100042 this.isClicked = PopupWindow_isClicked;
100043 this.autoHide = PopupWindow_autoHide;
100044 this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
100045 }
100046
100047 /* SOURCE FILE: ColorPicker2.js */
100048
100049 /*
100050 Last modified: 02/24/2003
100051
100052 DESCRIPTION: This widget is used to select a color, in hexadecimal #RRGGBB
100053 form. It uses a color "swatch" to display the standard 216-color web-safe
100054 palette. The user can then click on a color to select it.
100055
100056 COMPATABILITY: See notes in AnchorPosition.js and PopupWindow.js.
100057 Only the latest DHTML-capable browsers will show the color and hex values
100058 at the bottom as your mouse goes over them.
100059
100060 USAGE:
100061 // Create a new ColorPicker object using DHTML popup
100062 var cp = new ColorPicker();
100063
100064 // Create a new ColorPicker object using Window Popup
100065 var cp = new ColorPicker('window');
100066
100067 // Add a link in your page to trigger the popup. For example:
100068 <A HREF="#" onClick="cp.show('pick');return false;" NAME="pick" ID="pick">Pick</A>
100069
100070 // Or use the built-in "select" function to do the dirty work for you:
100071 <A HREF="#" onClick="cp.select(document.forms[0].color,'pick');return false;" NAME="pick" ID="pick">Pick</A>
100072
100073 // If using DHTML popup, write out the required DIV tag near the bottom
100074 // of your page.
100075 <SCRIPT LANGUAGE="JavaScript">cp.writeDiv()</SCRIPT>
100076
100077 // Write the 'pickColor' function that will be called when the user clicks
100078 // a color and do something with the value. This is only required if you
100079 // want to do something other than simply populate a form field, which is
100080 // what the 'select' function will give you.
100081 function pickColor(color) {
100082 field.value = color;
100083 }
100084
100085 NOTES:
100086 1) Requires the functions in AnchorPosition.js and PopupWindow.js
100087
100088 2) Your anchor tag MUST contain both NAME and ID attributes which are the
100089 same. For example:
100090 <A NAME="test" ID="test"> </A>
100091
100092 3) There must be at least a space between <A> </A> for IE5.5 to see the
100093 anchor tag correctly. Do not do <A></A> with no space.
100094
100095 4) When a ColorPicker object is created, a handler for 'onmouseup' is
100096 attached to any event handler you may have already defined. Do NOT define
100097 an event handler for 'onmouseup' after you define a ColorPicker object or
100098 the color picker will not hide itself correctly.
100099 */
100100 ColorPicker_targetInput = null;
100101 function ColorPicker_writeDiv() {
100102 document.writeln("<DIV ID=\"colorPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>");
100103 }
100104
100105 function ColorPicker_show(anchorname) {
100106 this.showPopup(anchorname);
100107 }
100108
100109 function ColorPicker_pickColor(color,obj) {
100110 obj.hidePopup();
100111 pickColor(color);
100112 }
100113
100114 // A Default "pickColor" function to accept the color passed back from popup.
100115 // User can over-ride this with their own function.
100116 function pickColor(color) {
100117 if (ColorPicker_targetInput==null) {
100118 alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!");
100119 return;
100120 }
100121 ColorPicker_targetInput.value = color;
100122 }
100123
100124 // This function is the easiest way to popup the window, select a color, and
100125 // have the value populate a form field, which is what most people want to do.
100126 function ColorPicker_select(inputobj,linkname) {
100127 if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") {
100128 alert("colorpicker.select: Input object passed is not a valid form input object");
100129 window.ColorPicker_targetInput=null;
100130 return;
100131 }
100132 window.ColorPicker_targetInput = inputobj;
100133 this.show(linkname);
100134 }
100135
100136 // This function runs when you move your mouse over a color block, if you have a newer browser
100137 function ColorPicker_highlightColor(c) {
100138 var thedoc = (arguments.length>1)?arguments[1]:window.document;
100139 var d = thedoc.getElementById("colorPickerSelectedColor");
100140 d.style.backgroundColor = c;
100141 d = thedoc.getElementById("colorPickerSelectedColorValue");
100142 d.innerHTML = c;
100143 }
100144
100145 function ColorPicker() {
100146 var windowMode = false;
100147 // Create a new PopupWindow object
100148 if (arguments.length==0) {
100149 var divname = "colorPickerDiv";
100150 }
100151 else if (arguments[0] == "window") {
100152 var divname = '';
100153 windowMode = true;
100154 }
100155 else {
100156 var divname = arguments[0];
100157 }
100158
100159 if (divname != "") {
100160 var cp = new PopupWindow(divname);
100161 }
100162 else {
100163 var cp = new PopupWindow();
100164 cp.setSize(225,250);
100165 }
100166
100167 // Object variables
100168 cp.currentValue = "#FFFFFF";
100169
100170 // Method Mappings
100171 cp.writeDiv = ColorPicker_writeDiv;
100172 cp.highlightColor = ColorPicker_highlightColor;
100173 cp.show = ColorPicker_show;
100174 cp.select = ColorPicker_select;
100175
100176 // Code to populate color picker window
100177 var colors = new Array( "#4180B6","#69AEE7","#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099",
100178 "#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099",
100179 "#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099",
100180 "#FF00CC","#FF00FF","#7FFFFF","#7FFFFF","#7FF7F7","#7FEFEF","#7FE7E7","#7FDFDF","#7FD7D7","#7FCFCF","#7FC7C7","#7FBFBF",
100181 "#7FB7B7","#7FAFAF","#7FA7A7","#7F9F9F","#7F9797","#7F8F8F","#7F8787","#7F7F7F","#7F7777","#7F6F6F","#7F6767","#7F5F5F",
100182 "#7F5757","#7F4F4F","#7F4747","#7F3F3F","#7F3737","#7F2F2F","#7F2727","#7F1F1F","#7F1717","#7F0F0F","#7F0707","#7F0000",
100183
100184 "#4180B6","#69AEE7","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399",
100185 "#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399",
100186 "#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399",
100187 "#FF33CC","#FF33FF","#FF7FFF","#FF7FFF","#F77FF7","#EF7FEF","#E77FE7","#DF7FDF","#D77FD7","#CF7FCF","#C77FC7","#BF7FBF",
100188 "#B77FB7","#AF7FAF","#A77FA7","#9F7F9F","#977F97","#8F7F8F","#877F87","#7F7F7F","#777F77","#6F7F6F","#677F67","#5F7F5F",
100189 "#577F57","#4F7F4F","#477F47","#3F7F3F","#377F37","#2F7F2F","#277F27","#1F7F1F","#177F17","#0F7F0F","#077F07","#007F00",
100190
100191 "#4180B6","#69AEE7","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699",
100192 "#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699",
100193 "#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699",
100194 "#FF66CC","#FF66FF","#FFFF7F","#FFFF7F","#F7F77F","#EFEF7F","#E7E77F","#DFDF7F","#D7D77F","#CFCF7F","#C7C77F","#BFBF7F",
100195 "#B7B77F","#AFAF7F","#A7A77F","#9F9F7F","#97977F","#8F8F7F","#87877F","#7F7F7F","#77777F","#6F6F7F","#67677F","#5F5F7F",
100196 "#57577F","#4F4F7F","#47477F","#3F3F7F","#37377F","#2F2F7F","#27277F","#1F1F7F","#17177F","#0F0F7F","#07077F","#00007F",
100197
100198 "#4180B6","#69AEE7","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999",
100199 "#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999",
100200 "#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999",
100201 "#FF99CC","#FF99FF","#3FFFFF","#3FFFFF","#3FF7F7","#3FEFEF","#3FE7E7","#3FDFDF","#3FD7D7","#3FCFCF","#3FC7C7","#3FBFBF",
100202 "#3FB7B7","#3FAFAF","#3FA7A7","#3F9F9F","#3F9797","#3F8F8F","#3F8787","#3F7F7F","#3F7777","#3F6F6F","#3F6767","#3F5F5F",
100203 "#3F5757","#3F4F4F","#3F4747","#3F3F3F","#3F3737","#3F2F2F","#3F2727","#3F1F1F","#3F1717","#3F0F0F","#3F0707","#3F0000",
100204
100205 "#4180B6","#69AEE7","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99",
100206 "#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99",
100207 "#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99",
100208 "#FFCCCC","#FFCCFF","#FF3FFF","#FF3FFF","#F73FF7","#EF3FEF","#E73FE7","#DF3FDF","#D73FD7","#CF3FCF","#C73FC7","#BF3FBF",
100209 "#B73FB7","#AF3FAF","#A73FA7","#9F3F9F","#973F97","#8F3F8F","#873F87","#7F3F7F","#773F77","#6F3F6F","#673F67","#5F3F5F",
100210 "#573F57","#4F3F4F","#473F47","#3F3F3F","#373F37","#2F3F2F","#273F27","#1F3F1F","#173F17","#0F3F0F","#073F07","#003F00",
100211
100212 "#4180B6","#69AEE7","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99",
100213 "#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99",
100214 "#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99",
100215 "#FFFFCC","#FFFFFF","#FFFF3F","#FFFF3F","#F7F73F","#EFEF3F","#E7E73F","#DFDF3F","#D7D73F","#CFCF3F","#C7C73F","#BFBF3F",
100216 "#B7B73F","#AFAF3F","#A7A73F","#9F9F3F","#97973F","#8F8F3F","#87873F","#7F7F3F","#77773F","#6F6F3F","#67673F","#5F5F3F",
100217 "#57573F","#4F4F3F","#47473F","#3F3F3F","#37373F","#2F2F3F","#27273F","#1F1F3F","#17173F","#0F0F3F","#07073F","#00003F",
100218
100219 "#4180B6","#69AEE7","#FFFFFF","#FFEEEE","#FFDDDD","#FFCCCC","#FFBBBB","#FFAAAA","#FF9999","#FF8888","#FF7777","#FF6666",
100220 "#FF5555","#FF4444","#FF3333","#FF2222","#FF1111","#FF0000","#FF0000","#FF0000","#FF0000","#EE0000","#DD0000","#CC0000",
100221 "#BB0000","#AA0000","#990000","#880000","#770000","#660000","#550000","#440000","#330000","#220000","#110000","#000000",
100222 "#000000","#000000","#000000","#001111","#002222","#003333","#004444","#005555","#006666","#007777","#008888","#009999",
100223 "#00AAAA","#00BBBB","#00CCCC","#00DDDD","#00EEEE","#00FFFF","#00FFFF","#00FFFF","#00FFFF","#11FFFF","#22FFFF","#33FFFF",
100224 "#44FFFF","#55FFFF","#66FFFF","#77FFFF","#88FFFF","#99FFFF","#AAFFFF","#BBFFFF","#CCFFFF","#DDFFFF","#EEFFFF","#FFFFFF",
100225
100226 "#4180B6","#69AEE7","#FFFFFF","#EEFFEE","#DDFFDD","#CCFFCC","#BBFFBB","#AAFFAA","#99FF99","#88FF88","#77FF77","#66FF66",
100227 "#55FF55","#44FF44","#33FF33","#22FF22","#11FF11","#00FF00","#00FF00","#00FF00","#00FF00","#00EE00","#00DD00","#00CC00",
100228 "#00BB00","#00AA00","#009900","#008800","#007700","#006600","#005500","#004400","#003300","#002200","#001100","#000000",
100229 "#000000","#000000","#000000","#110011","#220022","#330033","#440044","#550055","#660066","#770077","#880088","#990099",
100230 "#AA00AA","#BB00BB","#CC00CC","#DD00DD","#EE00EE","#FF00FF","#FF00FF","#FF00FF","#FF00FF","#FF11FF","#FF22FF","#FF33FF",
100231 "#FF44FF","#FF55FF","#FF66FF","#FF77FF","#FF88FF","#FF99FF","#FFAAFF","#FFBBFF","#FFCCFF","#FFDDFF","#FFEEFF","#FFFFFF",
100232
100233 "#4180B6","#69AEE7","#FFFFFF","#EEEEFF","#DDDDFF","#CCCCFF","#BBBBFF","#AAAAFF","#9999FF","#8888FF","#7777FF","#6666FF",
100234 "#5555FF","#4444FF","#3333FF","#2222FF","#1111FF","#0000FF","#0000FF","#0000FF","#0000FF","#0000EE","#0000DD","#0000CC",
100235 "#0000BB","#0000AA","#000099","#000088","#000077","#000066","#000055","#000044","#000033","#000022","#000011","#000000",
100236 "#000000","#000000","#000000","#111100","#222200","#333300","#444400","#555500","#666600","#777700","#888800","#999900",
100237 "#AAAA00","#BBBB00","#CCCC00","#DDDD00","#EEEE00","#FFFF00","#FFFF00","#FFFF00","#FFFF00","#FFFF11","#FFFF22","#FFFF33",
100238 "#FFFF44","#FFFF55","#FFFF66","#FFFF77","#FFFF88","#FFFF99","#FFFFAA","#FFFFBB","#FFFFCC","#FFFFDD","#FFFFEE","#FFFFFF",
100239
100240 "#4180B6","#69AEE7","#FFFFFF","#FFFFFF","#FBFBFB","#F7F7F7","#F3F3F3","#EFEFEF","#EBEBEB","#E7E7E7","#E3E3E3","#DFDFDF",
100241 "#DBDBDB","#D7D7D7","#D3D3D3","#CFCFCF","#CBCBCB","#C7C7C7","#C3C3C3","#BFBFBF","#BBBBBB","#B7B7B7","#B3B3B3","#AFAFAF",
100242 "#ABABAB","#A7A7A7","#A3A3A3","#9F9F9F","#9B9B9B","#979797","#939393","#8F8F8F","#8B8B8B","#878787","#838383","#7F7F7F",
100243 "#7B7B7B","#777777","#737373","#6F6F6F","#6B6B6B","#676767","#636363","#5F5F5F","#5B5B5B","#575757","#535353","#4F4F4F",
100244 "#4B4B4B","#474747","#434343","#3F3F3F","#3B3B3B","#373737","#333333","#2F2F2F","#2B2B2B","#272727","#232323","#1F1F1F",
100245 "#1B1B1B","#171717","#131313","#0F0F0F","#0B0B0B","#070707","#030303","#000000","#000000","#000000","#000000","#000000");
100246 var total = colors.length;
100247 var width = 72;
100248 var cp_contents = "";
100249 var windowRef = (windowMode)?"window.opener.":"";
100250 if (windowMode) {
100251 cp_contents += "<html><head><title>Select Color</title></head>";
100252 cp_contents += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0><span style='text-align: center;'>";
100253 }
100254 cp_contents += "<table style='border: none;' cellspacing=0 cellpadding=0>";
100255 var use_highlight = (document.getElementById || document.all)?true:false;
100256 for (var i=0; i<total; i++) {
100257 if ((i % width) == 0) { cp_contents += "<tr>"; }
100258 if (use_highlight) { var mo = 'onMouseOver="'+windowRef+'ColorPicker_highlightColor(\''+colors[i]+'\',window.document)"'; }
100259 else { mo = ""; }
100260 cp_contents += '<td style="background-color: '+colors[i]+';"><a href="javascript:void()" onclick="'+windowRef+'ColorPicker_pickColor(\''+colors[i]+'\','+windowRef+'window.popupWindowObjects['+cp.index+']);return false;" '+mo+'> </a></td>';
100261 if ( ((i+1)>=total) || (((i+1) % width) == 0)) {
100262 cp_contents += "</tr>";
100263 }
100264 }
100265 // If the browser supports dynamically changing TD cells, add the fancy stuff
100266 if (document.getElementById) {
100267 var width1 = Math.floor(width/2);
100268 var width2 = width = width1;
100269 cp_contents += "<tr><td colspan='"+width1+"' style='background-color: #FFF;' ID='colorPickerSelectedColor'> </td><td colspan='"+width2+"' style='text-align: center;' id='colorPickerSelectedColorValue'>#FFFFFF</td></tr>";
100270 }
100271 cp_contents += "</table>";
100272 if (windowMode) {
100273 cp_contents += "</span></body></html>";
100274 }
100275 // end populate code
100276
100277 // Write the contents to the popup object
100278 cp.populate(cp_contents+"\n");
100279 // Move the table down a bit so you can see it
100280 cp.offsetY = 25;
100281 cp.autoHide();
100282 return cp;
100283 }