diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9e2c39dd1ec1f43da0948ab8dfeca927b71b4df2..9fcb41b6746ae002b9406b7a48d1eea85c9627f6 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -103,7 +103,12 @@ $form=new Form($db); $formadmin=new FormAdmin($db); $formother=new FormOther($db); -llxHeader(); +//$arrayofjs=array('/includes/jquery/plugins/colorpicker/jquery.colorpicker.js'); +//$arrayofcss=array('/includes/jquery/plugins/colorpicker/jquery.colorpicker.css'); +$arrayofjs=array(); +$arrayofcss=array(); + +llxHeader('',$langs->trans("AgendaSetup"),'','',0,0,$arrayofjs,$arrayofcss); $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); @@ -147,7 +152,7 @@ print "<tr class=\"liste_titre\">"; print "<td>".$langs->trans("Parameter")."</td>"; print "<td>".$langs->trans("Name")."</td>"; print "<td>".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)</td>'; -print "<td>".$langs->trans("Color")."</td>"; +print '<td align="center">'.$langs->trans("Color").'</td>'; print "</tr>"; $i=1; @@ -163,11 +168,10 @@ while ($i <= $MAXAGENDA) $color='AGENDA_EXT_COLOR'.$key; print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_name".$key."\" value=\"". $conf->global->$name . "\" size=\"28\"></td>"; print "<td><input type=\"text\" class=\"flat\" name=\"agenda_ext_src".$key."\" value=\"". $conf->global->$src . "\" size=\"60\"></td>"; - print '<td nowrap="nowrap">'; - + print '<td nowrap="nowrap" align="center">'; // Possible colors are limited by Google //print $formadmin->select_colors($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->select_color($conf->global->$color, "agenda_ext_color".$key, 'sitextconfig', 1, $colorlist); + print $formother->select_color($conf->global->$color, "agenda_ext_color".$key, 'extsitesconfig', 1, ''); print '</td>'; print "</tr>"; $i++; @@ -185,8 +189,7 @@ print "</form>\n"; dol_fiche_end(); -if ($mesg) print "<br>$mesg<br>"; -print "<br>"; +dol_htmloutput_mesg($mesg); $db->close(); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 041e6f661025dbbb4855f21afabc83f49af868cd..f9c54d610034bec536da9fa5fef339b564231fbf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -256,7 +256,7 @@ if (empty($showbirthday)) $link.=$langs->trans("AgendaShowBirthdayEvents"); else $link.=$langs->trans("AgendaHideBirthdayEvents"); $link.='</a>'; -print_fiche_titre($title,$link.' '.$nav); +print_fiche_titre($title,$link.' '.$nav, ''); //print '<br>'; //print_fiche_titre($link,'',''); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 30aa156b7fb3059ecc47a947577b7c8716c53408..f744315e7f63c4dbfe58abfdee3c32603326cedf 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -209,7 +209,7 @@ if ($resql) $link.='</a>'; */ - print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0); + print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0,''); //print '<br>'; $i = 0; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index ce1a5b02c5e030891a64e701f340cc02ddc4775f..fc3605adce53bf2f13402c9652189d6780b7908f 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -1,6 +1,6 @@ <?PHP /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2005-2010 Laurent Destailleur <eldy@uers.sourceforge.net> + * Copyright (C) 2005-2011 Laurent Destailleur <eldy@uers.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -316,10 +316,6 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"])) if (! $error) { - // Ajout CSS - if (!empty($mil->bgcolor)) $arr_css['bgcolor'] = $mil->bgcolor; - if (!empty($mil->bgimage)) $arr_css['bgimage'] = $mil->bgimage; - // Le message est-il en html $msgishtml=-1; // Inconnu par defaut if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1; @@ -333,7 +329,11 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"])) $arr_name = array(); $arr_css = array(); - // Attached files + // Ajout CSS + if (!empty($mil->bgcolor)) $arr_css['bgcolor'] = (preg_match('/^#/',$mil->bgcolor)?'':'#').$mil->bgcolor; + if (!empty($mil->bgimage)) $arr_css['bgimage'] = $mil->bgimage; + + // Attached files $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); if (sizeof($listofpaths)) { @@ -901,7 +901,7 @@ else // Subject print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>'; - // Mails + // Joined files $i=''; //$i=0; //while ($i < 4) @@ -926,9 +926,14 @@ else print '</td></tr>'; //} - // Message + // Background color + /*print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">'; + $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing',0); + print '</td></tr>';*/ + + // Message print '<tr><td valign="top">'.$langs->trans("MailMessage").'</td>'; - print '<td colspan="3" bgcolor="'.($mil->bgcolor?$mil->bgcolor:'white').'">'; + print '<td colspan="3" bgcolor="'.($mil->bgcolor?(preg_match('/^#/',$mil->bgcolor)?'':'#').$mil->bgcolor:'white').'">'; print dol_htmlentitiesbr($mil->body); print '</td>'; print '</tr>'; @@ -984,9 +989,10 @@ else print_fiche_titre($langs->trans("EMail"),'',''); print '<table class="border" width="100%">'; + // Subject print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$mil->sujet.'"></td></tr>'; - // Add joined files + // Joined files $i=''; //$i=0; //while ($i < 4) @@ -1021,9 +1027,12 @@ else print '</td></tr>'; //} + // Background color print '<tr><td width="25%">'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">'; $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing',0); print '</td></tr>'; + + // Message print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>'; print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>'; print '__ID__ = '.$langs->trans("IdRecord").'<br>'; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index e615e7d086e5af728e1b25678d9c7c2fc8ea821c..a3181284491972ab8b70b1b447cff909d726b41f 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -320,42 +320,5 @@ class FormAdmin print '</select>'; } - /** - * \brief Return colors list selector - * \param selected Color pre-selected - * \param htmlname Name of html select zone - */ -/* - function select_colors($selected='', $htmlname, $arrayofcolors='', $showcolorbox=1) - { - global $langs,$conf; - - if (! is_array($arrayofcolors)) $arrayofcolors=array('29527A','5229A3','A32929','7A367A','B1365F','0D7813'); - - //$selected=''; - if ($showcolorbox) print '<table class="nobordernopadding"><tr valign="middle" class="nobordernopadding"><td class="nobordernopadding">'; - - print '<select class="flat" name="'.$htmlname.'">'; - print '<option value="-1"> </option>'; - foreach ($arrayofcolors as $val) - { - print '<option value="'.$val.'"'; - if ($selected == $val) print ' selected="selected"'; - print '>'.$val.'</option>'; - } - print '</select>'; - - if ($showcolorbox) - { - print '</td><td style="padding-left: 4px" nowrap="nowrap">'; - print '<!-- Box color '.$selected.' -->'; - print '<table style="border-collapse: collapse; margin:0px; padding: 0px; border: 1px solid #888888; background: #'.$selected.';" width="12" height="10">'; - print '<tr class="nocellnopadd"><td></td></tr>'; - print '</table>'; - print '</td></tr></table>'; - } - } -*/ } - ?> diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index df1652b307039715183a200ed47a0428efb48025..894573499affba869636b020e487a759725632bc 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -371,8 +371,51 @@ class FormOther */ function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') { + global $langs; if (! is_array($arrayofcolors) || sizeof($arrayofcolors) < 1) { + print '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />'; + print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/jpicker-1.1.6.js"></script>'; + print '<script type="text/javascript"> + jQuery(document).ready(function(){ + $(\'#colorpicker'.$prefix.'\').jPicker( { + window: { + title: \''.dol_escape_js($langs->trans("SelectAColor")).'\', /* any title for the jPicker window itself - displays "Drag Markers To Pick A Color" if left null */ + effects: + { + type: \'show\', /* effect used to show/hide an expandable picker. Acceptable values "slide", "show", "fade" */ + speed: + { + show: \'fast\', /* duration of "show" effect. Acceptable values are "fast", "slow", or time in ms */ + hide: \'fast\' /* duration of "hide" effect. Acceptable values are "fast", "slow", or time in ms */ + } + }, + position: + { + x: \'screenCenter\', /* acceptable values "left", "center", "right", "screenCenter", or relative px value */ + y: \'center\' /* acceptable values "top", "bottom", "center", or relative px value */ + }, + }, + images: { + clientPath: \''.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/images/\', + picker: { file: \'../../../../../theme/common/colorpicker.png\', width: 14, height: 14 } + }, + localization: // alter these to change the text presented by the picker (e.g. different language) + { + text: + { + title: \''.dol_escape_js($langs->trans("SelectAColor")).'\', + newColor: \''.dol_escape_js($langs->trans("New")).'\', + currentColor: \''.dol_escape_js($langs->trans("Current")).'\', + ok: \''.dol_escape_js($langs->trans("Change")).'\', + cancel: \''.dol_escape_js($langs->trans("Cancel")).'\' + } + } + } ); }); + </script>'; + print '<input id="colorpicker'.$prefix.'" name="'.$prefix.'" size="6" maxlength="7" class="flat" type="text" value="'.$set_color.'" />'; + + /* // No list of colors forced, we can suggest any color print "\n".'<table class="nobordernopadding"><tr><td valign="middle">'; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_colorpicker.js"></script>'."\n"; @@ -406,14 +449,24 @@ class FormOther } print '</tr></table>'; + */ } - else + else // In most cases, this is not used. We used instead function with no specific list of colors { - // List of colors is forced - if ($showcolorbox) print '<table class="nobordernopadding"><tr valign="middle" class="nobordernopadding"><td class="nobordernopadding">'; - - print '<select class="flat" name="'.$prefix.'">'; - print '<option value="-1"> </option>'; + print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />'; + print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>'; + print '<script type="text/javascript"> + jQuery(document).ready(function(){ + jQuery(\'#colorpicker'.$prefix.'\').colorpicker({ + size: 14, + label: \'\', + hide: true + }); + }); + </script>'; + + print '<select id="colorpicker'.$prefix.'" class="flat" name="'.$prefix.'">'; + //print '<option value="-1"> </option>'; foreach ($arrayofcolors as $val) { print '<option value="'.$val.'"'; @@ -421,16 +474,6 @@ class FormOther print '>'.$val.'</option>'; } print '</select>'; - - if ($showcolorbox) - { - print '</td><td style="padding-left: 4px" nowrap="nowrap">'; - print '<!-- Box color '.$set_color.' -->'; - print '<table style="border-collapse: collapse; margin:0px; padding: 0px; border: 1px solid #888888; background: #'.(preg_replace('/#/','',$set_color)).';" width="12" height="10">'; - print '<tr class="nocellnopadd"><td></td></tr>'; - print '</table>'; - print '</td></tr></table>'; - } } } diff --git a/htdocs/includes/jquery/plugins/jpicker/ChangeLog.txt b/htdocs/includes/jquery/plugins/jpicker/ChangeLog.txt new file mode 100755 index 0000000000000000000000000000000000000000..b173dba9d5e16aa7a8187dae4a9895a2a8da0b90 --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/ChangeLog.txt @@ -0,0 +1,121 @@ +Change Log +______________ +1.1.6 + Corrected bug preventing selections inside input values in some browsers - the onselectstart function no longer captures on input boxes. + Added support for up/down arrow adjustments of the currently focused input box making the picker more keyboard friendly. + Added ticks around the backgroundImage assignments to correct for paths with whitespace. + +1.1.5 + Corrected Color object constructor to allow setting of the "alpha" value as per the documentation which previously didn't work. + Added support for translucency for quickList colors with checkered background - Only available if "alphaSupport" is enabled. + Restricted default color to "alpha" of 255 if "alphaSupport" is disabled - It will now assign an explicit alpha of 255 when disabled. + Added new setting variable "alphaPrecision" which indicates the number of decimal points to allow in the alpha percentage display - Now defaults to 0. + +1.1.4 + Changed "alpha" range from 0-100 to 0-255 to correct truncating and rounding errors caused by attempting to get an integer percentage that matches a hex value. + "alpha" percentage display will now show up to 1 decimal point for more accurate representation of "alpha" value. + Color object now accepts "alpha" values in a range of 0-255 and also returns the same when getting the "alpha" value. You will need to run ((alpha * 100) / 255) to retrieve a percentage value. + Reworked the table layout and labels to remove the need for the label to reference the radio input box. This reduces injected code and removes the need to generate unique ids on the radio buttons. + Transparent/invisible caret on NULL color is now corrected - uses the same caret color as a white color. + Setting a binded input value of "" or no value attribute will now create a NULL color on initialization instead of the settings default color. + Added a dynamic, invisible "iframe" behind a dialog picker in all browsers that fail jQuery.support.boxModel (currently IE <= 7 Quirks Mode). This prevents "select" box from showing through the picker. + +1.1.3 + Now adding popup color pickers to document.body instead of inline with the popup control. This corrects issues with the picker not showing beyond a relative container scope. + No longer need to hide popup icon in Internet Explorer for picker elements lower in the DOM than the currently active one since the picker itself is attached to document.body (it is always higher in the DOM now). + Popup pickers are now bring-to-front selectable. Clicking on the picker will bring it above all other pickers on the page instead of having to drag one out from underneath another. + Corrected jPicker.List/setTimeout bug which allowed an instance to bind to the List in an order other than the order the initialization function was called. + Added a updateInputColor option (default true) to allow for a binded input field that does not automatically update its background/text color. + +1.1.2 + Reworked the find methods and contexts for element searches. Now using ":first" instead of ".eq(0)" to take advantage of early out searches. Much faster initialization of the picker, on the order of 6 times. + Now using setTimeout for calling visual updates. Dramatically improved marker dragging in all browsers. Reduces blocking as re-rendering is internal to the browser and independent of the other javascript still in progress. + Marker updates can now cancel a previous valueChanged event when a new mouseMove event comes in. IE8 marker dragging is still slower, much over 5 times faster than it was. + Reworked entire quickPick list creation. It now adds up source code and does a single "html" method instead of multiple "append" methods. This is a large part of the speed increase on initialization. + The vast majority of all running scripts on both initialization and dragging is now occupied altering the style rules and finding elements (init only) instead of jPicker code. + All methods previously called with global context now use the "call" method for using the context of the class running the method. "this" in a callback is now the DOM node (jQuery style) and jPicker instead of "window". + Added "effects" section of window settings to allow different show/hide effects and durations. + Removed change log and read me from the full source code to separate files (ChangeLog.txt and ReadMe.txt) and an HTML demonstration/documentation page (Example.txt). + +1.1.1 + Correct IE exception caused by attempting to set "#transparent" to CSS background-color. + +1.1.0 + Reworked nearly the entire plugin including the internal and external event model, bindings, DOM searches, classes, and overall presentation. + The Color object now supports a changed event that you can bind to (or just bind to the picker events still included). + Event order has been reversed, instead of a change event on the map/bar/text fields updating the display, they now update the Color object which then fires the events that update the display. + alphaSupport re-implemented by request - default behavior is off. + Hex code now only 6 characters again. + Color object can now have its value changed from code, using the "val" method, and it will fire all events necessary to update the display. + Removed all "get_*" methods from the color object, instead opting for a single "val" method for getting and setting, more in line with familiar jQuery methods. + Better rendering for all IE versions in Quirks mode. + +1.0.13 + Updated transparency algorithm for red/green/blue color modes. The algorithm from John Dyers' color picker was close but incorrect. Bar colors are now pixel perfect with the new algorithm. + Changed from using "background-position" on the color maps to an element of full height using the "top" attribute for image-map location using "overflow: hidden" to hide overdraw. + IE7/8 ignores opacity on elements taller than 4096px. Image maps therefore no longer include a blank first map so the Bar is just under 4096. Blank is now accomplished by setting the "top" setting to below the map display. + New colorBar picker image that does not draw outside of the element since the elements now hide overdraw. + Added IE5.5/6 support for the picker. This is why it now uses maps of full height and the "top" attribute for map locations. + Moved the images in the maps to 4 pixels apart from each other. IE7/8 change the first pixel of the bottom-border of 2px to partially transparent showing a portion of a different color map without this. + +1.0.12 + Added minified CSS file. + Added IE7/8 Quirks Mode support. + Added configurable string constants for all text and tooltips. You can now change the default values for different languages. + Privatized the RGBA values in the Color object for better NULL handling. YOU MUST USE THE NEW GET FUNCTIONS TO ACCESS THE COLOR PROPERTIES. + Better NULL color handling and an additional "No Color Selected" quick pick color. + More consistent behavior across multiple versions of browsers. + Added alpha response to the binded color picker icon. + Removed "alphaSupport" variable. It is now always supported. + +1.0.11b + Corrected NULL behavior in IE. jQuery was getting an exception when attempting to assign a backgroundColor style of '#'. Now assigns 'transparent' if color is NULL. + Can now create new Color object WITH OR WITHOUT the '#' prefix. + +1.0.11 + Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well. + cancelCallback now returns the original color for use in programming responses. + +1.0.10 + Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier. + +1.0.9 + Added optional title variable for each jPicker window. + +1.0.8 + Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run. + +1.0.7 + RENAMED CSS FILE TO INCLUDE VERSION NUMBER!!! YOU MUST USE THIS VERSIONED CSS FILE!!! There will be no need to do your own CSS version number increments from now on. + Added opacity feedback to color preview boxes. + Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code. + Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required. + +1.0.6 + Corrected picker bugs introduced with 1.0.5. + Removed alpha slider bar until activated - default behavior for alpha is now OFF. + Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol). + Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip). + THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!! + +1.0.5 + Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol) + Added title attributes to input elements - gives short tooltip directions on what button or field does. + Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization. + THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!! + +1.0.4 + Added ability for smaller picker icon with expandable window on any DOM element (not just input). + "draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker. + +1.0.3 + Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol) + +1.0.2 + Random bug fixes - speed concerns. + +1.0.1 + Corrected closure based memeory leak - there may be others? + +1.0.0 + First Release. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/Example.html b/htdocs/includes/jquery/plugins/jpicker/Example.html new file mode 100755 index 0000000000000000000000000000000000000000..0c70908fc59d1696e972c503d1d75f9aadb2af61 --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/Example.html @@ -0,0 +1,774 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Digital Magic Productions - jPicker - A jQuery Color Picker Plugin</title> + <link rel="Stylesheet" type="text/css" href="css/jpicker-1.1.6.min.css" /> + <link rel="Stylesheet" type="text/css" href="jPicker.css" /> + <script src="jquery-1.4.4.min.js" type="text/javascript"></script> + <script src="jpicker-1.1.6.min.js" type="text/javascript"></script> + <script type="text/javascript"> + $(function() + { + $.fn.jPicker.defaults.images.clientPath='images/'; + var LiveCallbackElement = $('#Live'), + LiveCallbackButton = $('#LiveButton'); + $('#Inline').jPicker({window:{title:'Inline Example'}}); + $('#Expandable').jPicker({window:{expandable:true,title:'Expandable Example'}}); + $('#Alpha').jPicker({window:{expandable:true,title:'Alpha (Transparency) Example)',alphaSupport:true},color:{active:new $.jPicker.Color({ahex:'99330099'})}}); + $('#Binded').jPicker({window:{title:'Binded Example'},color:{active:new $.jPicker.Color({ahex:'993300ff'})}}); + $('.Multiple').jPicker({window:{title:'Multiple Binded Example'}}); + $('#Callbacks').jPicker( + {window:{title:'Callback Example'}}, + function(color, context) + { + var all = color.val('all'); + alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none')); + $('#Commit').css({ backgroundColor: all && '#' + all.hex || 'transparent' }); + }, + function(color, context) + { + if (context == LiveCallbackButton.get(0)) alert('Color set from button'); + var hex = color.val('hex'); + LiveCallbackElement.css({ backgroundColor: hex && '#' + hex || 'transparent' }); + }, + function(color, context) + { + alert('"Cancel" Button Clicked'); + }); + $('#LiveButton').click( + function() + { + $.jPicker.List[7].color.active.val('hex', 'e2ddcf', this); + }); + $('#AlterColors').jPicker({window:{title:'Color Interaction Example'}}); + $('#GetActiveColor').click( + function() + { + alert($.jPicker.List[8].color.active.val('ahex')); + }); + $('#GetRG').click( + function() + { + var rg=$.jPicker.List[8].color.active.val('rg'); + alert('red: ' + rg.r + ', green: ' + rg.g); + }); + $('#SetHue').click( + function() + { + $.jPicker.List[8].color.active.val('h', 133); + }); + $('#SetValue').click( + function() + { + $.jPicker.List[8].color.active.val('v', 38); + }); + $('#SetRG').click( + function() + { + $.jPicker.List[8].color.active.val('rg', { r: 213, g: 118 }); + }); + }); + </script> +</head> +<body> + <div id="jPicker"> + <h2>jPicker - A jQuery Color Picker Plugin.</h2> + <p> + jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects. It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.<br /><br /> + jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari, and Opera.<br /><br /> + If you are updating a current version, you MUST always use the CSS and image files from the download as there may have been changes.<br /><br /> + If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the Color object returned by the callback functions.<br /><br /> + <a href="http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx" class="newWindow">View John Dyer's prototype plugin here.</a><br /><br /> + View jPicker details a docs below.<br /><br /> + <a href="http://code.google.com/p/jpicker/" class="newWindow">Check out the source from Google Code.</a> + </p><hr /><br /> + <h2>jPicker Inline Example</h2> + <p> + jPicker can be used inline by binding to any block level element.<br /><br /> + <code>jPicker() -- no arguments</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('#Inline').jPicker(); + }); +</script> +<div id="Inline"></div></pre> + <div id="Inline"></div> + </p><hr /><br /> + <h2>jPicker Expandable Example</h2> + <p> + jPicker can also display only a small picker icon that opens a popup for editing.<br /><br /> + <code>jPicker({ window: { expandable: true }})</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('#Expandable').jPicker( + { + window: + { + expandable: true + } + }); + }); +</script> +<span id="Expandable"></span></pre> + <span id="Expandable"></span> + </p><hr /><br /> + <h2>jPicker Alpha Channel Example</h2> + <p> + jPicker can also pick colors with alpha (transparency) values.<br /><br /> + <code>jPicker({ window: { expandable: true }})</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('#Alpha').jPicker( + { + window: + { + expandable: true + }, + color: + { + alphaSupport: true, + active: new $.jPicker.Color({ ahex: '99330099' }) + } + }); + }); +</script> +<span id="Alpha"></span></pre> + <span id="Alpha"></span> + </p><hr /><br /> + <h2>jPicker Binded Example</h2> + <p> + jPicker can also be binded to an input element.<br /><br /> + <code>jPicker() -- no arguments</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('#Binded').jPicker(); + }); +</script> +<input id="Binded" type="text" value="e2ddcf" /></pre> + <input id="Binded" type="text" value="e2ddcf" /> + </p><hr /><br /> + <h2>Multiple jPicker Binded Example</h2> + <p> + jPicker can also be binded to multiple elements at a time.<br /><br /> + <code>jPicker() -- no arguments</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('.Multiple').jPicker(); + }); +</script> +<input class="Multiple" type="text" value="e2ddcf" /><br /> +<input class="Multiple" type="text" value="" /><br /> +<input class="Multiple" type="text" value="fda0f7" /></pre> + <input class="Multiple" type="text" value="e2ddcf" /><br /> + <input class="Multiple" type="text" value="" /><br /> + <input class="Multiple" type="text" value="fda0f7" /><br /> + </p><hr /><br /> + <h2>jPicker Callback Functions</h2> + <p> + Register for callback function to have it interact with your page.<br /><br /> + <code>jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]])</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + var LiveCallbackElement = $('#Live'), + LiveCallbackButton = $('#LiveButton'); // you don't want it searching this + // on every live callback!!! + $('#Callbacks').jPicker( + {}, + function(color, context) + { + var all = color.val('all'); + alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + + ' - alpha: ' + (all && all.a + '%' || 'none')); + $('#Commit').css( + { + backgroundColor: all && '#' + all.hex || 'transparent' + }); // prevent IE from throwing exception if hex is empty + }, + function(color, context) + { + if (context == LiveCallbackButton.get(0)) alert('Color set from button'); + var hex = color.val('hex'); + LiveCallbackElement.css( + { + backgroundColor: hex && '#' + hex || 'transparent' + }); // prevent IE from throwing exception if hex is empty + }, + function(color, context) + { + alert('"Cancel" Button Clicked'); + }); + $('#LiveButton').click( + function() + { + $.jPicker.List[0].color.active.val('hex', 'e2ddcf', this); + }); + }); +</script> +<input id="Callbacks" type="text" value="e2ddcf" /> +<span id="Commit" style="background-color: #e2ddcf; display: block; -- + float: left; height: 50px; margin: 10px; width: 50px;"> -- + Commit</span> +<span id="Live" style="display: block; float: left; height: 50px; -- + margin: 10px; width: 50px;">Live</span> +<input id="LiveButton" type="button" value="Set To #e2ddcf" /></pre> + <input id="Callbacks" type="text" value="e2ddcf" /><br /> + <span id="Commit" style="background-color: #e2ddcf; display: block; float: left; height: 50px; margin: 10px; width: 50px;">Commit</span> + <span id="Live" style="display: block; float: left; height: 50px; margin: 10px; width: 50px;">Live</span> + <input id="LiveButton" type="button" value="Set To #e2ddcf" /> + </p><hr /><br /> + <h2>jPicker Settings And Colors</h2> + <p> + Use the "val" method on the active color for interaction with the picker.<br /><br /> + <code>(jQuery).jPicker.List[index]</code> + <pre> +<script type="text/javascript"> + $(document).ready( + function() + { + $('#AlterColors').jPicker(); + $('#GetActiveColor').click( + function() + { + alert($.jPicker.List[0].color.active.val('ahex')); + }); + $('#GetRG').click( + function() + { + var rg=$.jPicker.List[0].color.active.val('rg'); + alert('red: ' + rg.r + ', green: ' + rg.g); + }); + $('#SetHue').click( + function() + { + $.jPicker.List[0].color.active.val('h', 133); + }); + $('#SetValue').click( + function() + { + $.jPicker.List[0].color.active.val('v', 38); + }); + $('#SetRG').click( + function() + { + $.jPicker.List[0].color.active.val('rg', { r: 213, g: 118 }); + }); + }); +</script> +<input id="AlterColors" type="text" value="e2ddcf" /><br /> +<input id="GetActiveColor" type="button" value="Get Active Color" /><br /> +<input id="GetRG" type="button" value="Get Red/Green Value" /><br /> +<input id="SetHue" type="button" value="Set Hue To 133" /><br /> +<input id="SetValue" type="button" value="Set Value To 38" /><br /> +<input id="SetRG" type="button" value="Set Red/Green To 213, 118" /></pre> + <input id="AlterColors" type="text" value="e2ddcf" /><br /> + <input id="GetActiveColor" type="button" value="Get Active Color" /><br /> + <input id="GetRG" type="button" value="Get Red/Green Value" /><br /> + <input id="SetHue" type="button" value="Set Hue To 133" /><br /> + <input id="SetValue" type="button" value="Set Value To 38" /><br /> + <input id="SetRG" type="button" value="Set Red/Green To 213, 118" /> + </p><hr /><br /> + <h2>jPicker Core</h2> + <p> + jPicker Core function - returns the jQuery object.<br /><br /> + <code>jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]])</code> + </p><hr /><br /> + <h2>Settings</h2> + <p> + settings [object]: (with defaults)<br /> + <pre> +{ + window: // used to define the position of the popup window + // only useful in binded mode + { + title: null, // any title for the jPicker window itself - displays + // "Drag Markers To Pick A Color" if left null + position: + { + x: 'screenCenter', // acceptable values "left", "center", "right", + // "screenCenter", or relative px value + y: 'top', // acceptable values "top", "bottom", "center", or relative px + // value + }, + expandable: false, // default to large static picker - set to true to make an + // expandable picker (small icon with popup) - set + // automatically when binded to input element + liveUpdate: true, // set false if you want the user to click "OK" before the + // binded input box updates values (always "true" for + // expandable picker) + alphaSupport: false, // set to true to enable alpha picking + alphaPrecision: 0, // set decimal precision for alpha percentage display - + // hex codes do not map directly to percentage integers - + // range 0-2 + updateInputColor: true // set to false to prevent binded input colors from + // changing + }, + color: + { + mode: 'h', // acceptable values "h" (hue), "s" (saturation), "v" (brightness), + // "r" (red), "g" (green), "b" (blue), "a" (alpha) + active: new $.jPicker.Color({ hex: 'ffc000' }), // accepts any declared + // jPicker.Color object or hex string WITH OR WITHOUT '#' + quickList: // this list of quick pick colors - override for a different list + [ + new $.jPicker.Color({ h: 360, s: 33, v: 100}), // accepts any declared + // jPicker.Color object or hex string WITH OR WITHOUT '#' + new $.jPicker.Color({ h: 360, s: 66, v: 100}), + (...) // removed for brevity + new $.jPicker.Color({ h: 330, s: 100, v: 50}), + new $.jPicker.Color() + ] + }, + images + { + clientPath: '/jPicker/images/', // Path to image files + colorMap: // colorMap size and arrow icon + { + width: 256, // Map width - don't override unless using a smaller image set + height: 256, // Map height - don't override unles using a smaller image set + arrow: + { + file: 'mappoint.gif', // Arrow icon image file + width: 15, // Arrow icon width + height: 15 // Arrow icon height + } + }, + colorBar: // colorBar size and arrow icon + { + width: 20, // Bar width - don't override unless using a smaller image set + height: 256, // Bar height - don't override unless using a smaller image set + arrow: + { + file: 'rangearrows.gif', // Arrow icon image file + width: 40, // Arrow icon width + height: 9 // Arrow icon height + } + }, + picker: // picker icon and size + { + file: 'picker.gif', // Picker icon image file + width: 25, // Picker width - don't override unless using a smaller image set + height: 24 // Picker height - don't override unless using a smaller image set + } + }, + localization: + { + text: + { + title: 'Drag Markers To Pick A Color', + newColor: 'new', + currentColor: 'current', + ok: 'OK', + cancel: 'Cancel' + }, + tooltips: + { + colors: + { + newColor: 'New Color - Press “OK” To Commit', + currentColor: 'Click To Revert To Original Color' + }, + buttons: + { + ok: 'Commit To This Color Selection', + cancel: 'Cancel And Revert To Original Color' + }, + hue: + { + radio: 'Set To “Hue” Color Mode', + textbox: 'Enter A “Hue” Value (0-360°)' + }, + saturation: + { + radio: 'Set To “Saturation” Color Mode', + textbox: 'Enter A “Saturation” Value (0-100%)' + }, + brightness: + { + radio: 'Set To “Brightness” Color Mode', + textbox: 'Enter A “Brightness” Value (0-100%)' + }, + red: + { + radio: 'Set To “Red” Color Mode', + textbox: 'Enter A “Red” Value (0-255)' + }, + green: + { + radio: 'Set To “Green” Color Mode', + textbox: 'Enter A “Green” Value (0-255)' + }, + blue: + { + radio: 'Set To “Blue” Color Mode', + textbox: 'Enter A “Blue” Value (0-255)' + }, + alpha: + { + radio: 'Set To “Alpha” Color Mode', + textbox: 'Enter A “Alpha” Value (0-100)' + }, + hex: + { + textbox: 'Enter A “Hex” Color Value (#000000-#ffffff)', + alpha: 'Enter A “Alpha” Value (#00-#ff)' + } + } + } +}</pre> + </p><hr /><br /> + <h2>Callback Pattern</h2> + <p> + <code>function(jPicker.Color color, object context){...}</code> + </p><hr /><br /> + <h2>jPicker List</h2> + <p> + The list of active jPicker objects.<br /><br /> + <code>(jQuery).jPicker.List[]</code> + </p><hr /><br /> + <h2>jPicker Color Class</h2> + <p> + Definition of the jPicker.Color class.<br /> + <pre> +(jQuery).jPicker.Color() +(jQuery).jPicker.Color({ ahex: 'ffffffff' }) +(jQuery).jPicker.Color({ hex: 'ffffff', [a: (0-255)] }) +(jQuery).jPicker.Color({ r: (0-255), g: (0-255), b: (0-255), [a: (0-255)] }) +(jQuery).jPicker.Color({ h: (0-360), s: (0-100), v: (0-100), [a: (0-255)] }) +{ + val: function(name, value, context), + bind: function(callback) where callback is function(color, [context]), + unbind: function(callback) +} + +method "val" usage + +val(name) : get value + + 'r': red (0-255) + 'g': green (0-255) + 'b': blue (0-255) + 'a': alpha (0-255) + 'h': hue (0-360) + 's': saturation (0-100) + 'v': value (0-100) + 'hex': hex (000000-ffffff) + 'ahex': ahex (00000000-ffffffff) + 'all': all all + + ex. Usage + + val('r'): (0-255) + val('h'): (0-360) + val('hex'): (000000-ffffff) + val('rg'): { r: (0-255), g: (0-255) } + val('rgba'): { r: (0-255), g: (0-255), b: (0-255), a: (0-255) } + val('hvga'): { h: (0-255), v: (0-100), g: (0-255), a: (0-255) } + val('all'): { r: (0-255), g: (0-255), b: (0-255), a: (0-255), h: (0-360) -- + s: (0-100), v: (0-100), hex: (000000-ffffff), -- + ahex: (00000000-ffffffff) } + +val(name, value, [context]) : set value + + 'r': red (0-255) + 'g': green (0-255) + 'b': blue (0-255) + 'a': alpha (0-255) + 'h': hue (0-360) + 's': saturation (0-100) + 'v': value (0-100) + 'hex': hex (000000-ffffff) + 'ahex': ahex (00000000-ffffffff) + + ex. Usage + + val('r', (0-255)) || val('r', { r: (0-255) }) + val('h', (0-360)) || val('h', { h: (0-360) }) + val('hex', (000000-ffffff)) || val('hex', { hex: (000000-ffffff) }) + val('rg', { r: (0-255), g: (0-255) }) + val('rgba', { r: (-255), g: (0-255), b: (0-255), a: (0-255) }) + val(null, { r: (0-255), g: (0-255) }) + val('hvga'): incorrect usage - cannot set hsv AND rgb as they will conflict</pre> + </p><hr /><br /> + <h2>jPicker ColorMethod Utility Class</h2> + <p> + Static methods for altering and retrieving different color spaces.<br /> + <pre> +(jQuery).jPicker.ColorMethods.hexToRgba: + function(hex) + returns { r: (0-255), g: (0-255), b: (0-255), a: (0-255) } + +(jQuery).jPicker.ColorMethods.validateHex: + function(hex) + returns new hex string + +(jQuery).jPicker.ColorMethods.rgbaToHex: + function({ r: (0-255), g: (0-255), b: (0-255), a: (0-255) }) + returns hex string + +(jQuery).jPicker.ColorMethods.intToHex: + function(number) + returns hex string + +(jQuery).jPicker.ColorMethods.hexToInt: + function(hex) + return integer + +(jQuery).jPicker.ColorMethods.rgbToHsv: + function({ r: (0-255), g: (0-255), b: (0-255) }) + returns { h: (0-360), s: (0-100), v: (0-100) } + +(jQuery).jPicker.ColorMethods.hsvToRgb: + function({ h: (0-360), s: (0-100), v: (0-100) }) + returns { r: (0-255), g: (0-255), b: (0-255) } +</pre> + </p><hr /><br /> + <h2>Known Issues</h2> + <ul> + <li> + <h3>Attaching multiple jPicker objects on a single page will slow performance.</h3> + <ul> + <li>jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances.</li> + </ul> + </li> + </ul><hr /> + <h2>Coming Soon</h2> + <ul> + <li> + <ul> + <li>Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists.</li> + </ul> + </li> + </ul><hr /> + <h2>Planned For Future Release</h2> + <ul> + <li> + Move the jPicker object to a single instance that all selection instances point to. + <ul> + <li>This will result in much faster operation and initialization for pages with multiple pickers.</li> + </ul> + </li> + <li>Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.</li> + </ul><hr /> + <h2>Change Log</h2> + <ul> + <li> + <h3>V1.1.5:</h3> + <ul> + <li>Corrected Color object constructor to allow setting of the "alpha" value as per the documentation which previously didn't work.</li> + <li>Added support for translucency for quickList colors with checkered background - Only available if "alphaSupport" is enabled.</li> + <li>Restricted default color to "alpha" of 255 if "alphaSupport" is disabled - It will now assign an explicit alpha of 255 when disabled.</li> + <li>Added new setting variable "alphaPrecision" which indicates the number of decimal points to allow in the alpha percentage display - Now defaults to 0.</li> + </ul> + </li> + <li> + <h3>V1.1.4:</h3> + <ul> + <li>Changed "alpha" range from 0-100 to 0-255 to correct truncating and rounding errors caused by attempting to get an integer percentage that matches a hex value.</li> + <li>"alpha" percentage display will now show up to 1 decimal point for more accurate representation of "alpha" value.</li> + <li>Color object now accepts "alpha" values in a range of 0-255 and also returns the same when getting the "alpha" value. You will need to run ((alpha * 100) / 255) to retrieve a percentage value.</li> + <li>Reworked the table layout and labels to remove the need for the label to reference the radio input box. This reduces injected code and removes the need to generate unique ids on the radio buttons.</li> + <li>Transparent/invisible caret on NULL color is now corrected - uses the same caret color as a white color.</li> + <li>Setting a binded input value of "" or no value attribute will now create a NULL color on initialization instead of the settings default color.</li> + <li>Added a dynamic, invisible "iframe" behind a dialog picker in all browsers that fail jQuery.support.boxModel (currently IE <= 7 Quirks Mode). This prevents "select" box from showing through the picker.</li> + </ul> + </li> + <li> + <h3>V1.1.3:</h3> + <ul> + <li>Now adding popup color pickers to document.body instead of inline with the popup control. This corrects issues with the picker not showing beyond a relative container scope.</li> + <li>No longer need to hide popup icon in Internet Explorer for picker elements lower in the DOM than the currently active one since the picker itself is attached to document.body (it is always higher in the DOM now).</li> + <li>Popup pickers are now bring-to-front selectable. Clicking on the picker will bring it above all other pickers on the page instead of having to drag one out from underneath another.</li> + <li>Corrected jPicker.List/setTimeout bug which allowed an instance to bind to the List in an order other than the order the initialization function was called.</li> + <li>Added a updateInputColor option (default true) to allow for a binded input field that does not automatically update its background/text color.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.1.2:</h3> + <ul> + <li>Reworked the find methods and contexts for element searches. Now using ":first" instead of ".eq(0)" to take advantage of early out searches. Much faster initialization of the picker, on the order of 6 times.</li> + <li>Now using setTimeout for calling visual updates. Dramatically improved marker dragging in all browsers. Reduces blocking as re-rendering is internal to the browser and independent of the other javascript still in progress.</li> + <li>Marker updates can now cancel a previous valueChanged event when a new mouseMove event comes in. IE8 marker dragging is still slower, much over 5 times faster than it was.</li> + <li>Reworked entire quickPick list creation. It now adds up source code and does a single "html" method instead of multiple "append" methods. This is a large part of the speed increase on initialization.</li> + <li>The vast majority of all running scripts on both initialization and dragging is now occupied altering the style rules and finding elements (init only) instead of jPicker code.</li> + <li>All methods previously called with global context now use the "call" method for using the context of the class running the method. "this" in a callback is now the DOM node (jQuery style) and jPicker instead of "window".</li> + <li>Added "effects" section of window settings to allow different show/hide effects and durations.</li> + <li>Removed change log and read me from the full source code to separate files (ChangeLog.txt and ReadMe.txt) and an HTML demonstration/documentation page (Example.txt).</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.1.1:</h3> + <ul> + <li>Correct IE exception caused by attempting to set "#transparent" to CSS background-color.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.1.0:</h3> + <ul> + <li>Reworked nearly the entire plugin including the internal and external event model, bindings, DOM searches, classes, and overall presentation.</li> + <li>The Color object now supports a changed event that you can bind to (or just bind to the picker events still included).</li> + <li>Event order has been reversed, instead of an change event on the map/bar/text fields updating the display, they now update the Color object which then fires the events that update the display.</li> + <li>alphaSupport re-implemented by request - default behavior is off.</li> + <li>Hex code now only 6 characters again.</li> + <li>Color object can now have its value changed from code, using the "val" method, and it will fire all events necessary to update the display.</li> + <li>Removed all "get_*" methods from the color object, instead opting for a single "val" method for getting and setting, more in line with familiar jQuery methods.</li> + <li>Better rendering for all IE versions in Quirks mode.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.13:</h3> + <ul> + <li>Updated transparency algorithm for red/green/blue color modes. The algorithm from John Dyers' color picker was close but incorrect. Bar colors are now pixel perfect with the new algorithm.</li> + <li>Changed from using "background-position" on the color maps to an element of full height using the "top" attribute for image-map location using "overflow: hidden" to hide overdraw.</li> + <li>IE7/8 ignores opacity on elements taller than 4096px. Image maps therefore no longer include a blank first map so the Bar is just under 4096. Blank is now accomplished by setting the "top" setting to below the map display.</li> + <li>New colorBar picker image that does not draw outside of the element since the elements now hide overdraw.</li> + <li>Added IE5.5/6 support for the picker. This is why it now uses maps of full height and the "top" attribute for map locations.</li> + <li>Moved the images in the maps to 4 pixels apart from each other. IE7/8 change the first pixel of the bottom-border of 2px to partially transparent showing a portion of a different color map without this.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.12:</h3> + <ul> + <li>Added minified CSS file.</li> + <li>Added IE7/8 Quirks Mode support.</li> + <li>Added configurable string constants for all text and tooltips. You can now change the default values for different languages.</li> + <li>Privatized the RGBA values in the Color object for better NULL handling. YOU MUST USE THE NEW GET FUNCTIONS TO ACCESS THE COLOR PROPERTIES.</li> + <li>Better NULL color handling and an additional "No Color Selected" quick pick color.</li> + <li>More consistent behavior across multiple versions of browsers.</li> + <li>Added alpha response to the binded color picker icon.</li> + <li>Removed "alphaSupport" variable. It is now always supported.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.11b:</h3> + <ul> + <li>Corrected NULL behavior in IE. jQuery was getting an exception when attempting to assign a backgroundColor style of '#'. Now assigns 'transparent' if color is NULL.</li> + <li>Can now create new Color object WITH OR WITHOUT the '#' prefix.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.11:</h3> + <ul> + <li>Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well.</li> + <li>cancelCallback now returns the original color for use in programming responses.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.10:</h3> + <ul> + <li>Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.9:</h3> + <ul> + <li>Added optional title variable for each jPicker window.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.8:</h3> + <ul> + <li>Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.7:</h3> + <ul> + <li>RENAMED CSS FILE TO INCLUDE VERSION NUMBER!!! YOU MUST USE THIS VERSIONED CSS FILE!!! There will be no need to do your own CSS version number increments from now on.</li> + <li>Added opacity feedback to color preview boxes.</li> + <li>Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code.</li> + <li>Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.6:</h3> + <ul> + <li>Corrected picker bugs introduced with 1.0.5.</li> + <li>Removed alpha slider bar until activated - default behavior for alpha is now OFF.</li> + <li>Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol).</li> + <li>Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).</li> + <li>THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.5:</h3> + <ul> + <li>Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol)</li> + <li>Added title attributes to input elements - gives short tooltip directions on what button or field does.</li> + <li>Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization.</li> + <li>THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.4:</h3> + <ul> + <li>Added ability for smaller picker icon with expandable window on any DOM element (not just input).</li> + <li>"draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.3</h3> + <ul> + <li>Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.2</h3> + <ul> + <li>Random bug fixes - speed concerns.</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.1</h3> + <ul> + <li>Corrected closure based memeory leak - there may be others?</li> + </ul> + <hr /> + </li> + <li> + <h3>V1.0.0</h3> + <ul> + <li>First Release.</li> + </ul> + <hr /> + </li> + </ul> + </div> +</body> +</html> \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/ReadMe.txt b/htdocs/includes/jquery/plugins/jpicker/ReadMe.txt new file mode 100755 index 0000000000000000000000000000000000000000..a2006d2f17a4c5916fa8496b68b7dd6174ae4c80 --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/ReadMe.txt @@ -0,0 +1,47 @@ +jPicker 1.1.6 + +jQuery Plugin for Photoshop style color picker + +Copyright (c) 2010 Christopher T. Tillman +Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/) +MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE + +Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework. + +John Dyers' website: (http://johndyer.name) +Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx) + + + jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects. +It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework. + + jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari, +and Opera. + + If you are updating a current version, you MUST always use the CSS and image files from the download as +there may have been changes. + + If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the +Color object returned by the callback functions. + + +Known Issues +______________ +Attaching multiple jPicker objects on a single page will slow performance. + jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances. + + +Coming Soon +______________ + + Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists. + +Planned For Future Release +______________ + + Move the jPicker object to a single instance that all selection instances point to. + - This will result in much faster operation and initialization for pages with multiple pickers. + + Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element. + + Add multiple window modes for picker operation, include modal, popup, windowed, and exclusive. \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css new file mode 100755 index 0000000000000000000000000000000000000000..a4352ef4272ab08146425fd155430778a568fd6f --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css @@ -0,0 +1,232 @@ +.jPicker .Icon { + display: inline-block; + height: 16px; /* change this value if using a different sized color picker icon */ + position: relative; /* make this element an absolute positioning container */ + text-align: left; /* make the zero width children position to the left of container */ + width: 21px; /* change this value if using a different sized color picker icon */ +} +.jPicker .Icon span.Color, .jPicker .Icon span.Alpha { + background-position: 2px 2px; + display: block; + height: 100%; + left: 0px; + position: absolute; + top: 0px; + width: 100%; +} +.jPicker .Icon span.Image { + background-repeat: no-repeat; + cursor: pointer; + display: block; + height: 100%; + left: 0px; + position: absolute; + top: 0px; + width: 100%; +} +.jPicker.Container { + color: #000; + z-index: 10; +} +table.jPicker { + background-color: #efefef; + border: 1px outset #666; + font-family: Arial, Helvetica, Sans-Serif; + font-size: 12px !important; + margin: 0px; + padding: 5px; + width: 545px; + z-index: 20; +} +.jPicker .Move { + background-color: #dddddd; + border-color: #fff #666 #666 #fff; + border-style: solid; + border-width: 1px; + cursor: move; + height: 12px; + padding: 0px; +} +.jPicker .Title { + font-size: 11px !important; + font-weight: bold; + margin: -2px 0px 0px 0px; + padding: 10px 0px 0px 0px; + text-align: center; + width: 100%; +} +.jPicker div.Map { + border-bottom: 2px solid #fff; + border-left: 2px solid #9a9a9a; + border-right: 2px solid #fff; + border-top: 2px solid #9a9a9a; + cursor: crosshair; + height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */ + margin: 0px 10px 10px 10px; + overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */ + padding: 0px; + position: relative; /* make this element an absolute positioning container */ + width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */ +} +.jPicker div[class="Map"] { + height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */ + width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */ +} +.jPicker div.Bar { + border-bottom: 2px solid #fff; + border-left: 2px solid #9a9a9a; + border-right: 2px solid #fff; + border-top: 2px solid #9a9a9a; + cursor: n-resize; + height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */ + margin: 12px 10px 0px 5px; + overflow: hidden; + padding: 0px; + position: relative; + width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */ +} +.jPicker div[class="Bar"] { + height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */ + width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */ +} +.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 { + background-color: transparent; + background-image: none; + display: block; + left: 0px; + position: absolute; + top: 0px; +} +.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 { + height: 2596px; + width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar + would not be drawn if its overflow is set to hidden. */ +} +.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 { + height: 3896px; + width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar + would not be drawn if its overflow is set to hidden. */ +} +.jPicker .Bar .Map5, .jPicker .Bar .Map6 { + height: 256px; + width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar + would not be drawn if its overflow is set to hidden. */ +} +.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 { + background-repeat: no-repeat; +} +.jPicker .Map .Map3, .jPicker .Bar .Map5 { + background-repeat: repeat; +} +.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 { + background-repeat: repeat-x; +} +.jPicker .Map .Arrow { + display: block; + position: absolute; +} +.jPicker .Bar .Arrow { + display: block; + left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */ + position: absolute; +} +.jPicker .Preview { + font-size: 9px; + padding: 5px 0px 0px 0px; + text-align: center; +} +.jPicker .Preview div { + border: 2px inset #eee; + height: 62px; + margin: 0px auto; + padding: 0px; + width: 62px; +} +.jPicker .Preview div span { + border: 1px solid #000; + display: block; + height: 30px; + margin: 0px auto; + padding: 0px; + width: 60px; +} +.jPicker .Preview .Active { + border-bottom-width: 0px; +} +.jPicker .Preview .Current { + border-top-width: 0px; + cursor: pointer; +} +.jPicker input { + font-size: 13px; +} +.jPicker .Button { + text-align: center; + padding: 0px 4px; + width: 115px; +} +.jPicker .Button input { + padding: 2px 0px; + width: 100px; +} +.jPicker .Button .Ok { + margin: 12px 0px 5px 0px; +} +.jPicker td { + margin: 0px; + padding: 0px; +} +.jPicker td.Radio { + margin: 0px; + padding: 0px; + width: 31px; +} +.jPicker td.Radio input { + margin: 0px 5px 0px 0px; + padding: 0px; +} +.jPicker td.Text { + font-size: 12px !important; + height: 22px; + margin: 0px; + padding: 0px; + text-align: left; + width: 70px; +} +.jPicker tr.Hex td.Text { + width: 100px; +} +.jPicker td.Text input { + background-color: #fff; + border: 1px inset #aaa; + height: 19px; + margin: 0px 0px 0px 5px; + text-align: left; + width: 30px; +} +.jPicker td[class="Text"] input { + height: 15px; +} +.jPicker tr.Hex td.Text input.Hex { + width: 50px; +} +.jPicker tr.Hex td.Text input.AHex { + width: 20px; +} +.jPicker .Grid { + text-align: center; + width: 114px; +} +.jPicker .Grid span.QuickColor { + border: 1px inset #aaa; + cursor: pointer; + display: inline-block; + height: 15px; + line-height: 15px; + margin: 0px; + padding: 0px; + width: 19px; +} +.jPicker .Grid span[class="QuickColor"] { + width: 17px; +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css new file mode 100755 index 0000000000000000000000000000000000000000..c131616fb9d744d79234f7a8430eb73c0762bb4a --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css @@ -0,0 +1 @@ +.jPicker .Icon{display:inline-block;height:24px;position:relative;text-align:left;width:25px}.jPicker .Icon span.Color,.jPicker .Icon span.Alpha{background-position:2px 2px;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker .Icon span.Image{background-repeat:no-repeat;cursor:pointer;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker.Container{color:#000;z-index:10}table.jPicker{background-color:#efefef;border:1px outset #666;font-family:Arial,Helvetica,Sans-Serif;font-size:12px!important;margin:0;padding:5px;width:545px;z-index:20}.jPicker .Move{background-color:#ddd;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;cursor:move;height:12px;padding:0}.jPicker .Title{font-size:11px!important;font-weight:bold;margin:-2px 0 0 0;padding:10px 0 0 0;text-align:center;width:100%}.jPicker div.Map{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:crosshair;height:260px;margin:0 10px 10px 10px;overflow:hidden;padding:0;position:relative;width:260px}.jPicker div[class="Map"]{height:256px;width:256px}.jPicker div.Bar{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:n-resize;height:260px;margin:12px 10px 0 5px;overflow:hidden;padding:0;position:relative;width:24px}.jPicker div[class="Bar"]{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3,.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4,.jPicker .Bar .Map5,.jPicker .Bar .Map6{background-color:transparent;background-image:none;display:block;left:0;position:absolute;top:0}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3{height:2596px;width:256px}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{height:3896px;width:20px}.jPicker .Bar .Map5,.jPicker .Bar .Map6{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Bar .Map6{background-repeat:no-repeat}.jPicker .Map .Map3,.jPicker .Bar .Map5{background-repeat:repeat}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{background-repeat:repeat-x}.jPicker .Map .Arrow{display:block;position:absolute}.jPicker .Bar .Arrow{display:block;left:0;position:absolute}.jPicker .Preview{font-size:9px;padding:5px 0 0 0;text-align:center}.jPicker .Preview div{border:2px inset #eee;height:62px;margin:0 auto;padding:0;width:62px}.jPicker .Preview div span{border:1px solid #000;display:block;height:30px;margin:0 auto;padding:0;width:60px}.jPicker .Preview .Active{border-bottom-width:0}.jPicker .Preview .Current{border-top-width:0;cursor:pointer}.jPicker input{font-size:13px}.jPicker .Button{text-align:center;padding:0 4px;width:115px}.jPicker .Button input{padding:2px 0;width:100px}.jPicker .Button .Ok{margin:12px 0 5px 0}.jPicker td{margin:0;padding:0}.jPicker td.Radio{margin:0;padding:0;width:31px}.jPicker td.Radio input{margin:0 5px 0 0;padding:0}.jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px}.jPicker tr.Hex td.Text{width:100px}.jPicker td.Text input{background-color:#fff;border:1px inset #aaa;height:19px;margin:0 0 0 5px;text-align:left;width:30px}.jPicker td[class="Text"] input{height:15px}.jPicker tr.Hex td.Text input.Hex{width:50px}.jPicker tr.Hex td.Text input.AHex{width:20px}.jPicker .Grid{text-align:center;width:114px}.jPicker .Grid span.QuickColor{border:1px inset #aaa;cursor:pointer;display:inline-block;height:15px;line-height:15px;margin:0;padding:0;width:19px}.jPicker .Grid span[class="QuickColor"]{width:17px} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/images/AlphaBar.png b/htdocs/includes/jquery/plugins/jpicker/images/AlphaBar.png new file mode 100755 index 0000000000000000000000000000000000000000..2950daeb877f9e917f841953f29c64266b691fcc Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/AlphaBar.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/Bars.png b/htdocs/includes/jquery/plugins/jpicker/images/Bars.png new file mode 100755 index 0000000000000000000000000000000000000000..80eb2bbe76b26159a17b1cc19aca8e39da447e3e Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/Bars.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/Maps.png b/htdocs/includes/jquery/plugins/jpicker/images/Maps.png new file mode 100755 index 0000000000000000000000000000000000000000..853d38c68e24553c3086438d7ee2ce3f1e97b803 Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/Maps.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/NoColor.png b/htdocs/includes/jquery/plugins/jpicker/images/NoColor.png new file mode 100755 index 0000000000000000000000000000000000000000..5dc47670ef4eae06eec62292e0b1786594428c9b Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/NoColor.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/Thumbs.db b/htdocs/includes/jquery/plugins/jpicker/images/Thumbs.db new file mode 100755 index 0000000000000000000000000000000000000000..27621da65d4f1859df0e6939fb6c4f070894ea45 Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/Thumbs.db differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/bar-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/bar-opacity.png new file mode 100755 index 0000000000000000000000000000000000000000..e42ad081260dcf697ad046e61356993d4c3c3d5b Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/bar-opacity.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/map-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/map-opacity.png new file mode 100755 index 0000000000000000000000000000000000000000..6756cee6df14dabac21fee85d68fd2e30f1873cb Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/map-opacity.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/mappoint.gif b/htdocs/includes/jquery/plugins/jpicker/images/mappoint.gif new file mode 100755 index 0000000000000000000000000000000000000000..f5f855745cfda02dcfa684d3fcd628eadf3d39e8 Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/mappoint.gif differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/picker.gif b/htdocs/includes/jquery/plugins/jpicker/images/picker.gif new file mode 100755 index 0000000000000000000000000000000000000000..374d891042f22ff5c23eed3148b6ae5fe2cfdb1c Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/picker.gif differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/preview-opacity.png b/htdocs/includes/jquery/plugins/jpicker/images/preview-opacity.png new file mode 100755 index 0000000000000000000000000000000000000000..0dd9a2f8b9d2a8ff3f52bf7ca4c772196a5dd8d6 Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/preview-opacity.png differ diff --git a/htdocs/includes/jquery/plugins/jpicker/images/rangearrows.gif b/htdocs/includes/jquery/plugins/jpicker/images/rangearrows.gif new file mode 100755 index 0000000000000000000000000000000000000000..9fe89f472d1fae2552b8a43da7a1788327b87fe8 Binary files /dev/null and b/htdocs/includes/jquery/plugins/jpicker/images/rangearrows.gif differ diff --git a/htdocs/includes/jquery/plugins/jpicker/jPicker.css b/htdocs/includes/jquery/plugins/jpicker/jPicker.css new file mode 100755 index 0000000000000000000000000000000000000000..f63f8e5fb7db4dfa0740abc86d7a1dc0ee82f67c --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/jPicker.css @@ -0,0 +1,17 @@ +@media all +{ + #jPicker { margin: 0px 8px; text-align: left; } + #jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; } + #jPicker ul li { list-style: disc; padding: 2px 0px; } + #jPicker ul li ul { margin-bottom: 10px; } + #jPicker ul li ul li { list-style: circle; } + #jPicker p { font-size: 13px; padding: 0px 10px; } + #jPicker hr { clear: both; } + #jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; } + #jPicker code { color: #8bd; font-size: 14px; font-weight: bold; } + #jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; } + #jPicker span { font-size: 13px; text-align: center; } + #jPicker a { color: #ff8050; } + #jPicker input { font-size: 13px; padding: 2px 5px; } + #jPicker h2 { font-size: 16px; margin: 10px 0px; } +} \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.js b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.js new file mode 100755 index 0000000000000000000000000000000000000000..3392159ffcb0329f534c7482dfa1ea04b580846e --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.js @@ -0,0 +1,2086 @@ +/* + * jPicker 1.1.6 + * + * jQuery Plugin for Photoshop style color picker + * + * Copyright (c) 2010 Christopher T. Tillman + * Digital Magic Productions, Inc. (http://www.digitalmagicpro.com/) + * MIT style license, FREE to use, alter, copy, sell, and especially ENHANCE + * + * Painstakingly ported from John Dyers' excellent work on his own color picker based on the Prototype framework. + * + * John Dyers' website: (http://johndyer.name) + * Color Picker page: (http://johndyer.name/post/2007/09/PhotoShop-like-JavaScript-Color-Picker.aspx) + * + */ +(function($, version) +{ + Math.precision = function(value, precision) + { + if (precision === undefined) precision = 0; + return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision); + }; + var Slider = // encapsulate slider functionality for the ColorMap and ColorBar - could be useful to use a jQuery UI draggable for this with certain extensions + function(bar, options) + { + var $this = this, // private properties, methods, and events - keep these variables and classes invisible to outside code + arrow = bar.find('img:first'), // the arrow image to drag + minX = 0, + maxX = 100, + rangeX = 100, + minY = 0, + maxY = 100, + rangeY = 100, + x = 0, + y = 0, + offset, + timeout, + changeEvents = new Array(), + fireChangeEvents = + function(context) + { + for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context); + }, + mouseDown = // bind the mousedown to the bar not the arrow for quick snapping to the clicked location + function(e) + { + var off = bar.offset(); + offset = { l: off.left | 0, t: off.top | 0 }; + clearTimeout(timeout); + timeout = setTimeout( // using setTimeout for visual updates - once the style is updated the browser will re-render internally allowing the next Javascript to run + function() + { + setValuesFromMousePosition.call($this, e); + }, 0); + // Bind mousemove and mouseup event to the document so it responds when dragged of of the bar - we will unbind these when on mouseup to save processing + $(document).bind('mousemove', mouseMove).bind('mouseup', mouseUp); + e.preventDefault(); // don't try to select anything or drag the image to the desktop + }, + mouseMove = // set the values as the mouse moves + function(e) + { + clearTimeout(timeout); + timeout = setTimeout( + function() + { + setValuesFromMousePosition.call($this, e); + }, 0); + e.stopPropagation(); + e.preventDefault(); + return false; + }, + mouseUp = // unbind the document events - they aren't needed when not dragging + function(e) + { + $(document).unbind('mouseup', mouseUp).unbind('mousemove', mouseMove); + e.stopPropagation(); + e.preventDefault(); + return false; + }, + setValuesFromMousePosition = // calculate mouse position and set value within the current range + function(e) + { + var locX = e.pageX - offset.l, + locY = e.pageY - offset.t, + barW = bar.w, // local copies for YUI compressor + barH = bar.h; + // keep the arrow within the bounds of the bar + if (locX < 0) locX = 0; + else if (locX > barW) locX = barW; + if (locY < 0) locY = 0; + else if (locY > barH) locY = barH; + val.call($this, 'xy', { x: ((locX / barW) * rangeX) + minX, y: ((locY / barH) * rangeY) + minY }); + }, + draw = + function() + { + var arrowOffsetX = 0, + arrowOffsetY = 0, + barW = bar.w, + barH = bar.h, + arrowW = arrow.w, + arrowH = arrow.h; + setTimeout( + function() + { + if (rangeX > 0) // range is greater than zero + { + // constrain to bounds + if (x == maxX) arrowOffsetX = barW; + else arrowOffsetX = ((x / rangeX) * barW) | 0; + } + if (rangeY > 0) // range is greater than zero + { + // constrain to bounds + if (y == maxY) arrowOffsetY = barH; + else arrowOffsetY = ((y / rangeY) * barH) | 0; + } + // if arrow width is greater than bar width, center arrow and prevent horizontal dragging + if (arrowW >= barW) arrowOffsetX = (barW >> 1) - (arrowW >> 1); // number >> 1 - superfast bitwise divide by two and truncate (move bits over one bit discarding lowest) + else arrowOffsetX -= arrowW >> 1; + // if arrow height is greater than bar height, center arrow and prevent vertical dragging + if (arrowH >= barH) arrowOffsetY = (barH >> 1) - (arrowH >> 1); + else arrowOffsetY -= arrowH >> 1; + // set the arrow position based on these offsets + arrow.css({ left: arrowOffsetX + 'px', top: arrowOffsetY + 'px' }); + }, 0); + }, + val = + function(name, value, context) + { + var set = value !== undefined; + if (!set) + { + if (name === undefined || name == null) name = 'xy'; + switch (name.toLowerCase()) + { + case 'x': return x; + case 'y': return y; + case 'xy': + default: return { x: x, y: y }; + } + } + if (context != null && context == $this) return; + var changed = false, + newX, + newY; + if (name == null) name = 'xy'; + switch (name.toLowerCase()) + { + case 'x': + newX = value && (value.x && value.x | 0 || value | 0) || 0; + break; + case 'y': + newY = value && (value.y && value.y | 0 || value | 0) || 0; + break; + case 'xy': + default: + newX = value && value.x && value.x | 0 || 0; + newY = value && value.y && value.y | 0 || 0; + break; + } + if (newX != null) + { + if (newX < minX) newX = minX; + else if (newX > maxX) newX = maxX; + if (x != newX) + { + x = newX; + changed = true; + } + } + if (newY != null) + { + if (newY < minY) newY = minY; + else if (newY > maxY) newY = maxY; + if (y != newY) + { + y = newY; + changed = true; + } + } + changed && fireChangeEvents.call($this, context || $this); + }, + range = + function (name, value) + { + var set = value !== undefined; + if (!set) + { + if (name === undefined || name == null) name = 'all'; + switch (name.toLowerCase()) + { + case 'minx': return minX; + case 'maxx': return maxX; + case 'rangex': return { minX: minX, maxX: maxX, rangeX: rangeX }; + case 'miny': return minY; + case 'maxy': return maxY; + case 'rangey': return { minY: minY, maxY: maxY, rangeY: rangeY }; + case 'all': + default: return { minX: minX, maxX: maxX, rangeX: rangeX, minY: minY, maxY: maxY, rangeY: rangeY }; + } + } + var changed = false, + newMinX, + newMaxX, + newMinY, + newMaxY; + if (name == null) name = 'all'; + switch (name.toLowerCase()) + { + case 'minx': + newMinX = value && (value.minX && value.minX | 0 || value | 0) || 0; + break; + case 'maxx': + newMaxX = value && (value.maxX && value.maxX | 0 || value | 0) || 0; + break; + case 'rangex': + newMinX = value && value.minX && value.minX | 0 || 0; + newMaxX = value && value.maxX && value.maxX | 0 || 0; + break; + case 'miny': + newMinY = value && (value.minY && value.minY | 0 || value | 0) || 0; + break; + case 'maxy': + newMaxY = value && (value.maxY && value.maxY | 0 || value | 0) || 0; + break; + case 'rangey': + newMinY = value && value.minY && value.minY | 0 || 0; + newMaxY = value && value.maxY && value.maxY | 0 || 0; + break; + case 'all': + default: + newMinX = value && value.minX && value.minX | 0 || 0; + newMaxX = value && value.maxX && value.maxX | 0 || 0; + newMinY = value && value.minY && value.minY | 0 || 0; + newMaxY = value && value.maxY && value.maxY | 0 || 0; + break; + } + if (newMinX != null && minX != newMinX) + { + minX = newMinX; + rangeX = maxX - minX; + } + if (newMaxX != null && maxX != newMaxX) + { + maxX = newMaxX; + rangeX = maxX - minX; + } + if (newMinY != null && minY != newMinY) + { + minY = newMinY; + rangeY = maxY - minY; + } + if (newMaxY != null && maxY != newMaxY) + { + maxY = newMaxY; + rangeY = maxY - minY; + } + }, + bind = + function (callback) + { + if ($.isFunction(callback)) changeEvents.push(callback); + }, + unbind = + function (callback) + { + if (!$.isFunction(callback)) return; + var i; + while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1); + }, + destroy = + function() + { + // unbind all possible events and null objects + $(document).unbind('mouseup', mouseUp).unbind('mousemove', mouseMove); + bar.unbind('mousedown', mouseDown); + bar = null; + arrow = null; + changeEvents = null; + }; + $.extend(true, $this, // public properties, methods, and event bindings - these we need to access from other controls + { + val: val, + range: range, + bind: bind, + unbind: unbind, + destroy: destroy + }); + // initialize this control + arrow.src = options.arrow && options.arrow.image; + arrow.w = options.arrow && options.arrow.width || arrow.width(); + arrow.h = options.arrow && options.arrow.height || arrow.height(); + bar.w = options.map && options.map.width || bar.width(); + bar.h = options.map && options.map.height || bar.height(); + // bind mousedown event + bar.bind('mousedown', mouseDown); + bind.call($this, draw); + }, + ColorValuePicker = // controls for all the input elements for the typing in color values + function(picker, color, bindedHex, alphaPrecision) + { + var $this = this, // private properties and methods + inputs = picker.find('td.Text input'), + red = inputs.eq(3), + green = inputs.eq(4), + blue = inputs.eq(5), + alpha = inputs.length > 7 ? inputs.eq(6) : null, + hue = inputs.eq(0), + saturation = inputs.eq(1), + value = inputs.eq(2), + hex = inputs.eq(inputs.length > 7 ? 7 : 6), + ahex = inputs.length > 7 ? inputs.eq(8) : null, + keyDown = // input box key down - use arrows to alter color + function(e) + { + if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return; + if (!validateKey(e)) return e; + switch (e.target) + { + case red.get(0): + switch (e.keyCode) + { + case 38: + red.val(setValueInRange.call($this, (red.val() << 0) + 1, 0, 255)); + color.val('r', red.val(), e.target); + return false; + case 40: + red.val(setValueInRange.call($this, (red.val() << 0) - 1, 0, 255)); + color.val('r', red.val(), e.target); + return false; + } + break; + case green.get(0): + switch (e.keyCode) + { + case 38: + green.val(setValueInRange.call($this, (green.val() << 0) + 1, 0, 255)); + color.val('g', green.val(), e.target); + return false; + case 40: + green.val(setValueInRange.call($this, (green.val() << 0) - 1, 0, 255)); + color.val('g', green.val(), e.target); + return false; + } + break; + case blue.get(0): + switch (e.keyCode) + { + case 38: + blue.val(setValueInRange.call($this, (blue.val() << 0) + 1, 0, 255)); + color.val('b', blue.val(), e.target); + return false; + case 40: + blue.val(setValueInRange.call($this, (blue.val() << 0) - 1, 0, 255)); + color.val('b', blue.val(), e.target); + return false; + } + break; + case alpha && alpha.get(0): + switch (e.keyCode) + { + case 38: + alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) + 1, 0, 100)); + color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target); + return false; + case 40: + alpha.val(setValueInRange.call($this, parseFloat(alpha.val()) - 1, 0, 100)); + color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target); + return false; + } + break; + case hue.get(0): + switch (e.keyCode) + { + case 38: + hue.val(setValueInRange.call($this, (hue.val() << 0) + 1, 0, 360)); + color.val('h', hue.val(), e.target); + return false; + case 40: + hue.val(setValueInRange.call($this, (hue.val() << 0) - 1, 0, 360)); + color.val('h', hue.val(), e.target); + return false; + } + break; + case saturation.get(0): + switch (e.keyCode) + { + case 38: + saturation.val(setValueInRange.call($this, (saturation.val() << 0) + 1, 0, 100)); + color.val('s', saturation.val(), e.target); + return false; + case 40: + saturation.val(setValueInRange.call($this, (saturation.val() << 0) - 1, 0, 100)); + color.val('s', saturation.val(), e.target); + return false; + } + break; + case value.get(0): + switch (e.keyCode) + { + case 38: + value.val(setValueInRange.call($this, (value.val() << 0) + 1, 0, 100)); + color.val('v', value.val(), e.target); + return false; + case 40: + value.val(setValueInRange.call($this, (value.val() << 0) - 1, 0, 100)); + color.val('v', value.val(), e.target); + return false; + } + break; + } + }, + keyUp = // input box key up - validate value and set color + function(e) + { + if (e.target.value == '' && e.target != hex.get(0) && (bindedHex != null && e.target != bindedHex.get(0) || bindedHex == null)) return; + if (!validateKey(e)) return e; + switch (e.target) + { + case red.get(0): + red.val(setValueInRange.call($this, red.val(), 0, 255)); + color.val('r', red.val(), e.target); + break; + case green.get(0): + green.val(setValueInRange.call($this, green.val(), 0, 255)); + color.val('g', green.val(), e.target); + break; + case blue.get(0): + blue.val(setValueInRange.call($this, blue.val(), 0, 255)); + color.val('b', blue.val(), e.target); + break; + case alpha && alpha.get(0): + alpha.val(setValueInRange.call($this, alpha.val(), 0, 100)); + color.val('a', Math.precision((alpha.val() * 255) / 100, alphaPrecision), e.target); + break; + case hue.get(0): + hue.val(setValueInRange.call($this, hue.val(), 0, 360)); + color.val('h', hue.val(), e.target); + break; + case saturation.get(0): + saturation.val(setValueInRange.call($this, saturation.val(), 0, 100)); + color.val('s', saturation.val(), e.target); + break; + case value.get(0): + value.val(setValueInRange.call($this, value.val(), 0, 100)); + color.val('v', value.val(), e.target); + break; + case hex.get(0): + hex.val(hex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6)); + bindedHex && bindedHex.val(hex.val()); + color.val('hex', hex.val() != '' ? hex.val() : null, e.target); + break; + case bindedHex && bindedHex.get(0): + bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 6)); + hex.val(bindedHex.val()); + color.val('hex', bindedHex.val() != '' ? bindedHex.val() : null, e.target); + break; + case ahex && ahex.get(0): + ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g, '').toLowerCase().substring(0, 2)); + color.val('a', ahex.val() != null ? parseInt(ahex.val(), 16) : null, e.target); + break; + } + }, + blur = // input box blur - reset to original if value empty + function(e) + { + if (color.val() != null) + { + switch (e.target) + { + case red.get(0): red.val(color.val('r')); break; + case green.get(0): green.val(color.val('g')); break; + case blue.get(0): blue.val(color.val('b')); break; + case alpha && alpha.get(0): alpha.val(Math.precision((color.val('a') * 100) / 255, alphaPrecision)); break; + case hue.get(0): hue.val(color.val('h')); break; + case saturation.get(0): saturation.val(color.val('s')); break; + case value.get(0): value.val(color.val('v')); break; + case hex.get(0): + case bindedHex && bindedHex.get(0): + hex.val(color.val('hex')); + bindedHex && bindedHex.val(color.val('hex')); + break; + case ahex && ahex.get(0): ahex.val(color.val('ahex').substring(6)); break; + } + } + }, + validateKey = // validate key + function(e) + { + switch(e.keyCode) + { + case 9: + case 16: + case 29: + case 37: + case 39: + return false; + case 'c'.charCodeAt(): + case 'v'.charCodeAt(): + if (e.ctrlKey) return false; + } + return true; + }, + setValueInRange = // constrain value within range + function(value, min, max) + { + if (value == '' || isNaN(value)) return min; + if (value > max) return max; + if (value < min) return min; + return value; + }, + colorChanged = + function(ui, context) + { + var all = ui.val('all'); + if (context != red.get(0)) red.val(all != null ? all.r : ''); + if (context != green.get(0)) green.val(all != null ? all.g : ''); + if (context != blue.get(0)) blue.val(all != null ? all.b : ''); + if (alpha && context != alpha.get(0)) alpha.val(all != null ? Math.precision((all.a * 100) / 255, alphaPrecision) : ''); + if (context != hue.get(0)) hue.val(all != null ? all.h : ''); + if (context != saturation.get(0)) saturation.val(all != null ? all.s : ''); + if (context != value.get(0)) value.val(all != null ? all.v : ''); + if (context != hex.get(0) && (bindedHex && context != bindedHex.get(0) || !bindedHex)) hex.val(all != null ? all.hex : ''); + if (bindedHex && context != bindedHex.get(0) && context != hex.get(0)) bindedHex.val(all != null ? all.hex : ''); + if (ahex && context != ahex.get(0)) ahex.val(all != null ? all.ahex.substring(6) : ''); + }, + destroy = + function() + { + // unbind all events and null objects + red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).unbind('keyup', keyUp).unbind('blur', blur); + red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).unbind('keydown', keyDown); + color.unbind(colorChanged); + red = null; + green = null; + blue = null; + alpha = null; + hue = null; + saturation = null; + value = null; + hex = null; + ahex = null; + }; + $.extend(true, $this, // public properties and methods + { + destroy: destroy + }); + red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).bind('keyup', keyUp).bind('blur', blur); + red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).bind('keydown', keyDown); + color.bind(colorChanged); + }; + $.jPicker = + { + List: [], // array holding references to each active instance of the control + Color: // color object - we will be able to assign by any color space type or retrieve any color space info + // we want this public so we can optionally assign new color objects to initial values using inputs other than a string hex value (also supported) + function(init) + { + var $this = this, + r, + g, + b, + a, + h, + s, + v, + changeEvents = new Array(), + fireChangeEvents = + function(context) + { + for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context); + }, + val = + function(name, value, context) + { + var set = value !== undefined; + if (!set) + { + if (name === undefined || name == null || name == '') name = 'all'; + if (r == null) return null; + switch (name.toLowerCase()) + { + case 'ahex': return ColorMethods.rgbaToHex({ r: r, g: g, b: b, a: a }); + case 'hex': return val('ahex').substring(0, 6); + case 'all': return { r: r, g: g, b: b, a: a, h: h, s: s, v: v, hex: val.call($this, 'hex'), ahex: val.call($this, 'ahex') }; + default: + var ret={}; + for (var i = 0; i < name.length; i++) + { + switch (name.charAt(i)) + { + case 'r': + if (name.length == 1) ret = r; + else ret.r = r; + break; + case 'g': + if (name.length == 1) ret = g; + else ret.g = g; + break; + case 'b': + if (name.length == 1) ret = b; + else ret.b = b; + break; + case 'a': + if (name.length == 1) ret = a; + else ret.a = a; + break; + case 'h': + if (name.length == 1) ret = h; + else ret.h = h; + break; + case 's': + if (name.length == 1) ret = s; + else ret.s = s; + break; + case 'v': + if (name.length == 1) ret = v; + else ret.v = v; + break; + } + } + return ret == {} ? val.call($this, 'all') : ret; + break; + } + } + if (context != null && context == $this) return; + var changed = false; + if (name == null) name = ''; + if (value == null) + { + if (r != null) + { + r = null; + changed = true; + } + if (g != null) + { + g = null; + changed = true; + } + if (b != null) + { + b = null; + changed = true; + } + if (a != null) + { + a = null; + changed = true; + } + if (h != null) + { + h = null; + changed = true; + } + if (s != null) + { + s = null; + changed = true; + } + if (v != null) + { + v = null; + changed = true; + } + changed && fireChangeEvents.call($this, context || $this); + return; + } + switch (name.toLowerCase()) + { + case 'ahex': + case 'hex': + var ret = ColorMethods.hexToRgba(value && (value.ahex || value.hex) || value || '00000000'); + val.call($this, 'rgba', { r: ret.r, g: ret.g, b: ret.b, a: name == 'ahex' ? ret.a : a != null ? a : 255 }, context); + break; + default: + if (value && (value.ahex != null || value.hex != null)) + { + val.call($this, 'ahex', value.ahex || value.hex || '00000000', context); + return; + } + var newV = {}, rgb = false, hsv = false; + if (value.r !== undefined && !name.indexOf('r') == -1) name += 'r'; + if (value.g !== undefined && !name.indexOf('g') == -1) name += 'g'; + if (value.b !== undefined && !name.indexOf('b') == -1) name += 'b'; + if (value.a !== undefined && !name.indexOf('a') == -1) name += 'a'; + if (value.h !== undefined && !name.indexOf('h') == -1) name += 'h'; + if (value.s !== undefined && !name.indexOf('s') == -1) name += 's'; + if (value.v !== undefined && !name.indexOf('v') == -1) name += 'v'; + for (var i = 0; i < name.length; i++) + { + switch (name.charAt(i)) + { + case 'r': + if (hsv) continue; + rgb = true; + newV.r = value && value.r && value.r | 0 || value && value | 0 || 0; + if (newV.r < 0) newV.r = 0; + else if (newV.r > 255) newV.r = 255; + if (r != newV.r) + { + r = newV.r; + changed = true; + } + break; + case 'g': + if (hsv) continue; + rgb = true; + newV.g = value && value.g && value.g | 0 || value && value | 0 || 0; + if (newV.g < 0) newV.g = 0; + else if (newV.g > 255) newV.g = 255; + if (g != newV.g) + { + g = newV.g; + changed = true; + } + break; + case 'b': + if (hsv) continue; + rgb = true; + newV.b = value && value.b && value.b | 0 || value && value | 0 || 0; + if (newV.b < 0) newV.b = 0; + else if (newV.b > 255) newV.b = 255; + if (b != newV.b) + { + b = newV.b; + changed = true; + } + break; + case 'a': + newV.a = value && value.a != null ? value.a | 0 : value != null ? value | 0 : 255; + if (newV.a < 0) newV.a = 0; + else if (newV.a > 255) newV.a = 255; + if (a != newV.a) + { + a = newV.a; + changed = true; + } + break; + case 'h': + if (rgb) continue; + hsv = true; + newV.h = value && value.h && value.h | 0 || value && value | 0 || 0; + if (newV.h < 0) newV.h = 0; + else if (newV.h > 360) newV.h = 360; + if (h != newV.h) + { + h = newV.h; + changed = true; + } + break; + case 's': + if (rgb) continue; + hsv = true; + newV.s = value && value.s != null ? value.s | 0 : value != null ? value | 0 : 100; + if (newV.s < 0) newV.s = 0; + else if (newV.s > 100) newV.s = 100; + if (s != newV.s) + { + s = newV.s; + changed = true; + } + break; + case 'v': + if (rgb) continue; + hsv = true; + newV.v = value && value.v != null ? value.v | 0 : value != null ? value | 0 : 100; + if (newV.v < 0) newV.v = 0; + else if (newV.v > 100) newV.v = 100; + if (v != newV.v) + { + v = newV.v; + changed = true; + } + break; + } + } + if (changed) + { + if (rgb) + { + r = r || 0; + g = g || 0; + b = b || 0; + var ret = ColorMethods.rgbToHsv({ r: r, g: g, b: b }); + h = ret.h; + s = ret.s; + v = ret.v; + } + else if (hsv) + { + h = h || 0; + s = s != null ? s : 100; + v = v != null ? v : 100; + var ret = ColorMethods.hsvToRgb({ h: h, s: s, v: v }); + r = ret.r; + g = ret.g; + b = ret.b; + } + a = a != null ? a : 255; + fireChangeEvents.call($this, context || $this); + } + break; + } + }, + bind = + function(callback) + { + if ($.isFunction(callback)) changeEvents.push(callback); + }, + unbind = + function(callback) + { + if (!$.isFunction(callback)) return; + var i; + while ((i = $.inArray(callback, changeEvents)) != -1) changeEvents.splice(i, 1); + }, + destroy = + function() + { + changeEvents = null; + } + $.extend(true, $this, // public properties and methods + { + val: val, + bind: bind, + unbind: unbind, + destroy: destroy + }); + if (init) + { + if (init.ahex != null) val('ahex', init); + else if (init.hex != null) val((init.a != null ? 'a' : '') + 'hex', init.a != null ? { ahex: init.hex + ColorMethods.intToHex(init.a) } : init); + else if (init.r != null && init.g != null && init.b != null) val('rgb' + (init.a != null ? 'a' : ''), init); + else if (init.h != null && init.s != null && init.v != null) val('hsv' + (init.a != null ? 'a' : ''), init); + } + }, + ColorMethods: // color conversion methods - make public to give use to external scripts + { + hexToRgba: + function(hex) + { + hex = this.validateHex(hex); + if (hex == '') return { r: null, g: null, b: null, a: null }; + var r = '00', g = '00', b = '00', a = '255'; + if (hex.length == 6) hex += 'ff'; + if (hex.length > 6) + { + r = hex.substring(0, 2); + g = hex.substring(2, 4); + b = hex.substring(4, 6); + a = hex.substring(6, hex.length); + } + else + { + if (hex.length > 4) + { + r = hex.substring(4, hex.length); + hex = hex.substring(0, 4); + } + if (hex.length > 2) + { + g = hex.substring(2, hex.length); + hex = hex.substring(0, 2); + } + if (hex.length > 0) b = hex.substring(0, hex.length); + } + return { r: this.hexToInt(r), g: this.hexToInt(g), b: this.hexToInt(b), a: this.hexToInt(a) }; + }, + validateHex: + function(hex) + { + hex = hex.toLowerCase().replace(/[^a-f0-9]/g, ''); + if (hex.length > 8) hex = hex.substring(0, 8); + return hex; + }, + rgbaToHex: + function(rgba) + { + return this.intToHex(rgba.r) + this.intToHex(rgba.g) + this.intToHex(rgba.b) + this.intToHex(rgba.a); + }, + intToHex: + function(dec) + { + var result = (dec | 0).toString(16); + if (result.length == 1) result = ('0' + result); + return result.toLowerCase(); + }, + hexToInt: + function(hex) + { + return parseInt(hex, 16); + }, + rgbToHsv: + function(rgb) + { + var r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255, hsv = { h: 0, s: 0, v: 0 }, min = 0, max = 0, delta; + if (r >= g && r >= b) + { + max = r; + min = g > b ? b : g; + } + else if (g >= b && g >= r) + { + max = g; + min = r > b ? b : r; + } + else + { + max = b; + min = g > r ? r : g; + } + hsv.v = max; + hsv.s = max ? (max - min) / max : 0; + if (!hsv.s) hsv.h = 0; + else + { + delta = max - min; + if (r == max) hsv.h = (g - b) / delta; + else if (g == max) hsv.h = 2 + (b - r) / delta; + else hsv.h = 4 + (r - g) / delta; + hsv.h = parseInt(hsv.h * 60); + if (hsv.h < 0) hsv.h += 360; + } + hsv.s = (hsv.s * 100) | 0; + hsv.v = (hsv.v * 100) | 0; + return hsv; + }, + hsvToRgb: + function(hsv) + { + var rgb = { r: 0, g: 0, b: 0, a: 100 }, h = hsv.h, s = hsv.s, v = hsv.v; + if (s == 0) + { + if (v == 0) rgb.r = rgb.g = rgb.b = 0; + else rgb.r = rgb.g = rgb.b = (v * 255 / 100) | 0; + } + else + { + if (h == 360) h = 0; + h /= 60; + s = s / 100; + v = v / 100; + var i = h | 0, + f = h - i, + p = v * (1 - s), + q = v * (1 - (s * f)), + t = v * (1 - (s * (1 - f))); + switch (i) + { + case 0: + rgb.r = v; + rgb.g = t; + rgb.b = p; + break; + case 1: + rgb.r = q; + rgb.g = v; + rgb.b = p; + break; + case 2: + rgb.r = p; + rgb.g = v; + rgb.b = t; + break; + case 3: + rgb.r = p; + rgb.g = q; + rgb.b = v; + break; + case 4: + rgb.r = t; + rgb.g = p; + rgb.b = v; + break; + case 5: + rgb.r = v; + rgb.g = p; + rgb.b = q; + break; + } + rgb.r = (rgb.r * 255) | 0; + rgb.g = (rgb.g * 255) | 0; + rgb.b = (rgb.b * 255) | 0; + } + return rgb; + } + } + }; + var Color = $.jPicker.Color, List = $.jPicker.List, ColorMethods = $.jPicker.ColorMethods; // local copies for YUI compressor + $.fn.jPicker = + function(options) + { + var $arguments = arguments; + return this.each( + function() + { + var $this = this, settings = $.extend(true, {}, $.fn.jPicker.defaults, options); // local copies for YUI compressor + if ($($this).get(0).nodeName.toLowerCase() == 'input') // Add color picker icon if binding to an input element and bind the events to the input + { + $.extend(true, settings, + { + window: + { + bindToInput: true, + expandable: true, + input: $($this) + } + }); + if($($this).val()=='') + { + settings.color.active = new Color({ hex: null }); + settings.color.current = new Color({ hex: null }); + } + else if (ColorMethods.validateHex($($this).val())) + { + settings.color.active = new Color({ hex: $($this).val(), a: settings.color.active.val('a') }); + settings.color.current = new Color({ hex: $($this).val(), a: settings.color.active.val('a') }); + } + } + if (settings.window.expandable) + $($this).after('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>'); + else settings.window.liveUpdate = false; // Basic control binding for inline use - You will need to override the liveCallback or commitCallback function to retrieve results + var isLessThanIE7 = parseFloat(navigator.appVersion.split('MSIE')[1]) < 7 && document.body.filters, // needed to run the AlphaImageLoader function for IE6 + container = null, + colorMapDiv = null, + colorBarDiv = null, + colorMapL1 = null, // different layers of colorMap and colorBar + colorMapL2 = null, + colorMapL3 = null, + colorBarL1 = null, + colorBarL2 = null, + colorBarL3 = null, + colorBarL4 = null, + colorBarL5 = null, + colorBarL6 = null, + colorMap = null, // color maps + colorBar = null, + colorPicker = null, + elementStartX = null, // Used to record the starting css positions for dragging the control + elementStartY = null, + pageStartX = null, // Used to record the mousedown coordinates for dragging the control + pageStartY = null, + activePreview = null, // color boxes above the radio buttons + currentPreview = null, + okButton = null, + cancelButton = null, + grid = null, // preset colors grid + iconColor = null, // iconColor for popup icon + iconAlpha = null, // iconAlpha for popup icon + iconImage = null, // iconImage popup icon + moveBar = null, // drag bar + setColorMode = // set color mode and update visuals for the new color mode + function(colorMode) + { + var active = color.active, // local copies for YUI compressor + clientPath = images.clientPath, + hex = active.val('hex'), + rgbMap, + rgbBar; + settings.color.mode = colorMode; + switch (colorMode) + { + case 'h': + setTimeout( + function() + { + setBG.call($this, colorMapDiv, 'transparent'); + setImgLoc.call($this, colorMapL1, 0); + setAlpha.call($this, colorMapL1, 100); + setImgLoc.call($this, colorMapL2, 260); + setAlpha.call($this, colorMapL2, 100); + setBG.call($this, colorBarDiv, 'transparent'); + setImgLoc.call($this, colorBarL1, 0); + setAlpha.call($this, colorBarL1, 100); + setImgLoc.call($this, colorBarL2, 260); + setAlpha.call($this, colorBarL2, 100); + setImgLoc.call($this, colorBarL3, 260); + setAlpha.call($this, colorBarL3, 100); + setImgLoc.call($this, colorBarL4, 260); + setAlpha.call($this, colorBarL4, 100); + setImgLoc.call($this, colorBarL6, 260); + setAlpha.call($this, colorBarL6, 100); + }, 0); + colorMap.range('all', { minX: 0, maxX: 100, minY: 0, maxY: 100 }); + colorBar.range('rangeY', { minY: 0, maxY: 360 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('s'), y: 100 - active.val('v') }, colorMap); + colorBar.val('y', 360 - active.val('h'), colorBar); + break; + case 's': + setTimeout( + function() + { + setBG.call($this, colorMapDiv, 'transparent'); + setImgLoc.call($this, colorMapL1, -260); + setImgLoc.call($this, colorMapL2, -520); + setImgLoc.call($this, colorBarL1, -260); + setImgLoc.call($this, colorBarL2, -520); + setImgLoc.call($this, colorBarL6, 260); + setAlpha.call($this, colorBarL6, 100); + }, 0); + colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 }); + colorBar.range('rangeY', { minY: 0, maxY: 100 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap); + colorBar.val('y', 100 - active.val('s'), colorBar); + break; + case 'v': + setTimeout( + function() + { + setBG.call($this, colorMapDiv, '000000'); + setImgLoc.call($this, colorMapL1, -780); + setImgLoc.call($this, colorMapL2, 260); + setBG.call($this, colorBarDiv, hex); + setImgLoc.call($this, colorBarL1, -520); + setImgLoc.call($this, colorBarL2, 260); + setAlpha.call($this, colorBarL2, 100); + setImgLoc.call($this, colorBarL6, 260); + setAlpha.call($this, colorBarL6, 100); + }, 0); + colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 }); + colorBar.range('rangeY', { minY: 0, maxY: 100 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('s') }, colorMap); + colorBar.val('y', 100 - active.val('v'), colorBar); + break; + case 'r': + rgbMap = -1040; + rgbBar = -780; + colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 }); + colorBar.range('rangeY', { minY: 0, maxY: 255 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('g') }, colorMap); + colorBar.val('y', 255 - active.val('r'), colorBar); + break; + case 'g': + rgbMap = -1560; + rgbBar = -1820; + colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 }); + colorBar.range('rangeY', { minY: 0, maxY: 255 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('b'), y: 255 - active.val('r') }, colorMap); + colorBar.val('y', 255 - active.val('g'), colorBar); + break; + case 'b': + rgbMap = -2080; + rgbBar = -2860; + colorMap.range('all', { minX: 0, maxX: 255, minY: 0, maxY: 255 }); + colorBar.range('rangeY', { minY: 0, maxY: 255 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('r'), y: 255 - active.val('g') }, colorMap); + colorBar.val('y', 255 - active.val('b'), colorBar); + break; + case 'a': + setTimeout( + function() + { + setBG.call($this, colorMapDiv, 'transparent'); + setImgLoc.call($this, colorMapL1, -260); + setImgLoc.call($this, colorMapL2, -520); + setImgLoc.call($this, colorBarL1, 260); + setImgLoc.call($this, colorBarL2, 260); + setAlpha.call($this, colorBarL2, 100); + setImgLoc.call($this, colorBarL6, 0); + setAlpha.call($this, colorBarL6, 100); + }, 0); + colorMap.range('all', { minX: 0, maxX: 360, minY: 0, maxY: 100 }); + colorBar.range('rangeY', { minY: 0, maxY: 255 }); + if (active.val('ahex') == null) break; + colorMap.val('xy', { x: active.val('h'), y: 100 - active.val('v') }, colorMap); + colorBar.val('y', 255 - active.val('a'), colorBar); + break; + default: + throw ('Invalid Mode'); + break; + } + switch (colorMode) + { + case 'h': + break; + case 's': + case 'v': + case 'a': + setTimeout( + function() + { + setAlpha.call($this, colorMapL1, 100); + setAlpha.call($this, colorBarL1, 100); + setImgLoc.call($this, colorBarL3, 260); + setAlpha.call($this, colorBarL3, 100); + setImgLoc.call($this, colorBarL4, 260); + setAlpha.call($this, colorBarL4, 100); + }, 0); + break; + case 'r': + case 'g': + case 'b': + setTimeout( + function() + { + setBG.call($this, colorMapDiv, 'transparent'); + setBG.call($this, colorBarDiv, 'transparent'); + setAlpha.call($this, colorBarL1, 100); + setAlpha.call($this, colorMapL1, 100); + setImgLoc.call($this, colorMapL1, rgbMap); + setImgLoc.call($this, colorMapL2, rgbMap - 260); + setImgLoc.call($this, colorBarL1, rgbBar - 780); + setImgLoc.call($this, colorBarL2, rgbBar - 520); + setImgLoc.call($this, colorBarL3, rgbBar); + setImgLoc.call($this, colorBarL4, rgbBar - 260); + setImgLoc.call($this, colorBarL6, 260); + setAlpha.call($this, colorBarL6, 100); + }, 0); + break; + } + if (active.val('ahex') == null) return; + activeColorChanged.call($this, active); + }, + activeColorChanged = // Update color when user changes text values + function(ui, context) + { + if (context == null || (context != colorBar && context != colorMap)) positionMapAndBarArrows.call($this, ui, context); + setTimeout( + function() + { + updatePreview.call($this, ui); + updateMapVisuals.call($this, ui); + updateBarVisuals.call($this, ui); + }, 0); + }, + mapValueChanged = // user has dragged the ColorMap pointer + function(ui, context) + { + var active = color.active; + if (context != colorMap && active.val() == null) return; + var xy = ui.val('all'); + switch (settings.color.mode) + { + case 'h': + active.val('sv', { s: xy.x, v: 100 - xy.y }, context); + break; + case 's': + case 'a': + active.val('hv', { h: xy.x, v: 100 - xy.y }, context); + break; + case 'v': + active.val('hs', { h: xy.x, s: 100 - xy.y }, context); + break; + case 'r': + active.val('gb', { g: 255 - xy.y, b: xy.x }, context); + break; + case 'g': + active.val('rb', { r: 255 - xy.y, b: xy.x }, context); + break; + case 'b': + active.val('rg', { r: xy.x, g: 255 - xy.y }, context); + break; + } + }, + colorBarValueChanged = // user has dragged the ColorBar slider + function(ui, context) + { + var active = color.active; + if (context != colorBar && active.val() == null) return; + switch (settings.color.mode) + { + case 'h': + active.val('h', { h: 360 - ui.val('y') }, context); + break; + case 's': + active.val('s', { s: 100 - ui.val('y') }, context); + break; + case 'v': + active.val('v', { v: 100 - ui.val('y') }, context); + break; + case 'r': + active.val('r', { r: 255 - ui.val('y') }, context); + break; + case 'g': + active.val('g', { g: 255 - ui.val('y') }, context); + break; + case 'b': + active.val('b', { b: 255 - ui.val('y') }, context); + break; + case 'a': + active.val('a', 255 - ui.val('y'), context); + break; + } + }, + positionMapAndBarArrows = // position map and bar arrows to match current color + function(ui, context) + { + if (context != colorMap) + { + switch (settings.color.mode) + { + case 'h': + var sv = ui.val('sv'); + colorMap.val('xy', { x: sv != null ? sv.s : 100, y: 100 - (sv != null ? sv.v : 100) }, context); + break; + case 's': + case 'a': + var hv = ui.val('hv'); + colorMap.val('xy', { x: hv && hv.h || 0, y: 100 - (hv != null ? hv.v : 100) }, context); + break; + case 'v': + var hs = ui.val('hs'); + colorMap.val('xy', { x: hs && hs.h || 0, y: 100 - (hs != null ? hs.s : 100) }, context); + break; + case 'r': + var bg = ui.val('bg'); + colorMap.val('xy', { x: bg && bg.b || 0, y: 255 - (bg && bg.g || 0) }, context); + break; + case 'g': + var br = ui.val('br'); + colorMap.val('xy', { x: br && br.b || 0, y: 255 - (br && br.r || 0) }, context); + break; + case 'b': + var rg = ui.val('rg'); + colorMap.val('xy', { x: rg && rg.r || 0, y: 255 - (rg && rg.g || 0) }, context); + break; + } + } + if (context != colorBar) + { + switch (settings.color.mode) + { + case 'h': + colorBar.val('y', 360 - (ui.val('h') || 0), context); + break; + case 's': + var s = ui.val('s'); + colorBar.val('y', 100 - (s != null ? s : 100), context); + break; + case 'v': + var v = ui.val('v'); + colorBar.val('y', 100 - (v != null ? v : 100), context); + break; + case 'r': + colorBar.val('y', 255 - (ui.val('r') || 0), context); + break; + case 'g': + colorBar.val('y', 255 - (ui.val('g') || 0), context); + break; + case 'b': + colorBar.val('y', 255 - (ui.val('b') || 0), context); + break; + case 'a': + var a = ui.val('a'); + colorBar.val('y', 255 - (a != null ? a : 255), context); + break; + } + } + }, + updatePreview = + function(ui) + { + try + { + var all = ui.val('all'); + activePreview.css({ backgroundColor: all && '#' + all.hex || 'transparent' }); + setAlpha.call($this, activePreview, all && Math.precision((all.a * 100) / 255, 4) || 0); + } + catch (e) { } + }, + updateMapVisuals = + function(ui) + { + switch (settings.color.mode) + { + case 'h': + setBG.call($this, colorMapDiv, new Color({ h: ui.val('h') || 0, s: 100, v: 100 }).val('hex')); + break; + case 's': + case 'a': + var s = ui.val('s'); + setAlpha.call($this, colorMapL2, 100 - (s != null ? s : 100)); + break; + case 'v': + var v = ui.val('v'); + setAlpha.call($this, colorMapL1, v != null ? v : 100); + break; + case 'r': + setAlpha.call($this, colorMapL2, Math.precision((ui.val('r') || 0) / 255 * 100, 4)); + break; + case 'g': + setAlpha.call($this, colorMapL2, Math.precision((ui.val('g') || 0) / 255 * 100, 4)); + break; + case 'b': + setAlpha.call($this, colorMapL2, Math.precision((ui.val('b') || 0) / 255 * 100)); + break; + } + var a = ui.val('a'); + setAlpha.call($this, colorMapL3, Math.precision(((255 - (a || 0)) * 100) / 255, 4)); + }, + updateBarVisuals = + function(ui) + { + switch (settings.color.mode) + { + case 'h': + var a = ui.val('a'); + setAlpha.call($this, colorBarL5, Math.precision(((255 - (a || 0)) * 100) / 255, 4)); + break; + case 's': + var hva = ui.val('hva'), + saturatedColor = new Color({ h: hva && hva.h || 0, s: 100, v: hva != null ? hva.v : 100 }); + setBG.call($this, colorBarDiv, saturatedColor.val('hex')); + setAlpha.call($this, colorBarL2, 100 - (hva != null ? hva.v : 100)); + setAlpha.call($this, colorBarL5, Math.precision(((255 - (hva && hva.a || 0)) * 100) / 255, 4)); + break; + case 'v': + var hsa = ui.val('hsa'), + valueColor = new Color({ h: hsa && hsa.h || 0, s: hsa != null ? hsa.s : 100, v: 100 }); + setBG.call($this, colorBarDiv, valueColor.val('hex')); + setAlpha.call($this, colorBarL5, Math.precision(((255 - (hsa && hsa.a || 0)) * 100) / 255, 4)); + break; + case 'r': + case 'g': + case 'b': + var hValue = 0, vValue = 0, rgba = ui.val('rgba'); + if (settings.color.mode == 'r') + { + hValue = rgba && rgba.b || 0; + vValue = rgba && rgba.g || 0; + } + else if (settings.color.mode == 'g') + { + hValue = rgba && rgba.b || 0; + vValue = rgba && rgba.r || 0; + } + else if (settings.color.mode == 'b') + { + hValue = rgba && rgba.r || 0; + vValue = rgba && rgba.g || 0; + } + var middle = vValue > hValue ? hValue : vValue; + setAlpha.call($this, colorBarL2, hValue > vValue ? Math.precision(((hValue - vValue) / (255 - vValue)) * 100, 4) : 0); + setAlpha.call($this, colorBarL3, vValue > hValue ? Math.precision(((vValue - hValue) / (255 - hValue)) * 100, 4) : 0); + setAlpha.call($this, colorBarL4, Math.precision((middle / 255) * 100, 4)); + setAlpha.call($this, colorBarL5, Math.precision(((255 - (rgba && rgba.a || 0)) * 100) / 255, 4)); + break; + case 'a': + var a = ui.val('a'); + setBG.call($this, colorBarDiv, ui.val('hex') || '000000'); + setAlpha.call($this, colorBarL5, a != null ? 0 : 100); + setAlpha.call($this, colorBarL6, a != null ? 100 : 0); + break; + } + }, + setBG = + function(el, c) + { + el.css({ backgroundColor: c && c.length == 6 && '#' + c || 'transparent' }); + }, + setImg = + function(img, src) + { + if (isLessThanIE7 && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1)) + { + img.attr('pngSrc', src); + img.css({ backgroundImage: 'none', filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' }); + } + else img.css({ backgroundImage: 'url(\'' + src + '\')' }); + }, + setImgLoc = + function(img, y) + { + img.css({ top: y + 'px' }); + }, + setAlpha = + function(obj, alpha) + { + obj.css({ visibility: alpha > 0 ? 'visible' : 'hidden' }); + if (alpha > 0 && alpha < 100) + { + if (isLessThanIE7) + { + var src = obj.attr('pngSrc'); + if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1)) + obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\') progid:DXImageTransform.Microsoft.Alpha(opacity=' + alpha + ')' }); + else obj.css({ opacity: Math.precision(alpha / 100, 4) }); + } + else obj.css({ opacity: Math.precision(alpha / 100, 4) }); + } + else if (alpha == 0 || alpha == 100) + { + if (isLessThanIE7) + { + var src = obj.attr('pngSrc'); + if (src != null && (src.indexOf('AlphaBar.png') != -1 || src.indexOf('Bars.png') != -1 || src.indexOf('Maps.png') != -1)) + obj.css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')' }); + else obj.css({ opacity: '' }); + } + else obj.css({ opacity: '' }); + } + }, + revertColor = // revert color to original color when opened + function() + { + color.active.val('ahex', color.current.val('ahex')); + }, + commitColor = // commit the color changes + function() + { + color.current.val('ahex', color.active.val('ahex')); + }, + radioClicked = + function(e) + { + $(this).parents('tbody:first').find('input:radio[value!="'+e.target.value+'"]').removeAttr('checked'); + setColorMode.call($this, e.target.value); + }, + currentClicked = + function() + { + revertColor.call($this); + }, + cancelClicked = + function() + { + revertColor.call($this); + settings.window.expandable && hide.call($this); + $.isFunction(cancelCallback) && cancelCallback.call($this, color.active, cancelButton); + }, + okClicked = + function() + { + commitColor.call($this); + settings.window.expandable && hide.call($this); + $.isFunction(commitCallback) && commitCallback.call($this, color.active, okButton); + }, + iconImageClicked = + function() + { + show.call($this); + }, + currentColorChanged = + function(ui, context) + { + var hex = ui.val('hex'); + currentPreview.css({ backgroundColor: hex && '#' + hex || 'transparent' }); + setAlpha.call($this, currentPreview, Math.precision(((ui.val('a') || 0) * 100) / 255, 4)); + }, + expandableColorChanged = + function(ui, context) + { + var hex = ui.val('hex'); + var va = ui.val('va'); + iconColor.css({ backgroundColor: hex && '#' + hex || 'transparent' }); + setAlpha.call($this, iconAlpha, Math.precision(((255 - (va && va.a || 0)) * 100) / 255, 4)); + if (settings.window.bindToInput&&settings.window.updateInputColor) + settings.window.input.css( + { + backgroundColor: hex && '#' + hex || 'transparent', + color: va == null || va.v > 75 ? '#000000' : '#ffffff' + }); + }, + moveBarMouseDown = + function(e) + { + var element = settings.window.element, // local copies for YUI compressor + page = settings.window.page; + elementStartX = parseInt(container.css('left')); + elementStartY = parseInt(container.css('top')); + pageStartX = e.pageX; + pageStartY = e.pageY; + // bind events to document to move window - we will unbind these on mouseup + $(document).bind('mousemove', documentMouseMove).bind('mouseup', documentMouseUp); + e.preventDefault(); // prevent attempted dragging of the column + }, + documentMouseMove = + function(e) + { + container.css({ left: elementStartX - (pageStartX - e.pageX) + 'px', top: elementStartY - (pageStartY - e.pageY) + 'px' }); + if (settings.window.expandable && !$.support.boxModel) container.prev().css({ left: container.css("left"), top: container.css("top") }); + e.stopPropagation(); + e.preventDefault(); + return false; + }, + documentMouseUp = + function(e) + { + $(document).unbind('mousemove', documentMouseMove).unbind('mouseup', documentMouseUp); + e.stopPropagation(); + e.preventDefault(); + return false; + }, + quickPickClicked = + function(e) + { + e.preventDefault(); + e.stopPropagation(); + color.active.val('ahex', $(this).attr('title') || null, e.target); + return false; + }, + commitCallback = $.isFunction($arguments[1]) && $arguments[1] || null, + liveCallback = $.isFunction($arguments[2]) && $arguments[2] || null, + cancelCallback = $.isFunction($arguments[3]) && $arguments[3] || null, + show = + function() + { + color.current.val('ahex', color.active.val('ahex')); + var attachIFrame = function() + { + if (!settings.window.expandable || $.support.boxModel) return; + var table = container.find('table:first'); + container.before('<iframe/>'); + container.prev().css({ width: table.width(), height: container.height(), opacity: 0, position: 'absolute', left: container.css("left"), top: container.css("top") }); + }; + if (settings.window.expandable) + { + $(document.body).children('div.jPicker.Container').css({zIndex:10}); + container.css({zIndex:20}); + } + switch (settings.window.effects.type) + { + case 'fade': + container.fadeIn(settings.window.effects.speed.show, attachIFrame); + break; + case 'slide': + container.slideDown(settings.window.effects.speed.show, attachIFrame); + break; + case 'show': + default: + container.show(settings.window.effects.speed.show, attachIFrame); + break; + } + }, + hide = + function() + { + var removeIFrame = function() + { + if (settings.window.expandable) container.css({ zIndex: 10 }); + if (!settings.window.expandable || $.support.boxModel) return; + container.prev().remove(); + }; + switch (settings.window.effects.type) + { + case 'fade': + container.fadeOut(settings.window.effects.speed.hide, removeIFrame); + break; + case 'slide': + container.slideUp(settings.window.effects.speed.hide, removeIFrame); + break; + case 'show': + default: + container.hide(settings.window.effects.speed.hide, removeIFrame); + break; + } + }, + initialize = + function() + { + var win = settings.window, + popup = win.expandable ? $($this).next().find('.Container:first') : null; + container = win.expandable ? $('<div/>') : $($this); + container.addClass('jPicker Container'); + if (win.expandable) container.hide(); + container.get(0).onselectstart = function(event){ if (event.target.nodeName.toLowerCase() !== 'input') return false; }; + // inject html source code - we are using a single table for this control - I know tables are considered bad, but it takes care of equal height columns and + // this control really is tabular data, so I believe it is the right move + var all = color.active.val('all'); + if (win.alphaPrecision < 0) win.alphaPrecision = 0; + else if (win.alphaPrecision > 2) win.alphaPrecision = 2; + var controlHtml='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>' + (win.expandable ? '<tr><td class="Move" colspan="5"> </td></tr>' : '') + '<tr><td rowspan="9"><h2 class="Title">' + (win.title || localization.text.title) + '</h2><div class="Map"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><img src="' + images.clientPath + images.colorMap.arrow.file + '" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><span class="Map4"> </span><span class="Map5"> </span><span class="Map6"> </span><img src="' + images.clientPath + images.colorBar.arrow.file + '" class="Arrow"/></div></td><td colspan="2" class="Preview">' + localization.text.newColor + '<div><span class="Active" title="' + localization.tooltips.colors.newColor + '"> </span><span class="Current" title="' + localization.tooltips.colors.currentColor + '"> </span></div>' + localization.text.currentColor + '</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="' + localization.text.ok + '" title="' + localization.tooltips.buttons.ok + '"/><input type="button" class="Cancel" value="' + localization.text.cancel + '" title="' + localization.tooltips.buttons.cancel + '"/><hr/><div class="Grid"> </div></td></tr><tr class="Hue"><td class="Radio"><label title="' + localization.tooltips.hue.radio + '"><input type="radio" value="h"' + (settings.color.mode == 'h' ? ' checked="checked"' : '') + '/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.h : '') + '" title="' + localization.tooltips.hue.textbox + '"/> °</td></tr><tr class="Saturation"><td class="Radio"><label title="' + localization.tooltips.saturation.radio + '"><input type="radio" value="s"' + (settings.color.mode == 's' ? ' checked="checked"' : '') + '/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.s : '') + '" title="' + localization.tooltips.saturation.textbox + '"/> %</td></tr><tr class="Value"><td class="Radio"><label title="' + localization.tooltips.value.radio + '"><input type="radio" value="v"' + (settings.color.mode == 'v' ? ' checked="checked"' : '') + '/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.v : '') + '" title="' + localization.tooltips.value.textbox + '"/> %<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="' + localization.tooltips.red.radio + '"><input type="radio" value="r"' + (settings.color.mode == 'r' ? ' checked="checked"' : '') + '/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.r : '') + '" title="' + localization.tooltips.red.textbox + '"/></td></tr><tr class="Green"><td class="Radio"><label title="' + localization.tooltips.green.radio + '"><input type="radio" value="g"' + (settings.color.mode == 'g' ? ' checked="checked"' : '') + '/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.g : '') + '" title="' + localization.tooltips.green.textbox + '"/></td></tr><tr class="Blue"><td class="Radio"><label title="' + localization.tooltips.blue.radio + '"><input type="radio" value="b"' + (settings.color.mode == 'b' ? ' checked="checked"' : '') + '/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="' + (all != null ? all.b : '') + '" title="' + localization.tooltips.blue.textbox + '"/></td></tr><tr class="Alpha"><td class="Radio">' + (win.alphaSupport ? '<label title="' + localization.tooltips.alpha.radio + '"><input type="radio" value="a"' + (settings.color.mode == 'a' ? ' checked="checked"' : '') + '/>A:</label>' : ' ') + '</td><td class="Text">' + (win.alphaSupport ? '<input type="text" maxlength="' + (3 + win.alphaPrecision) + '" value="' + (all != null ? Math.precision((all.a * 100) / 255, win.alphaPrecision) : '') + '" title="' + localization.tooltips.alpha.textbox + '"/> %' : ' ') + '</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="' + localization.tooltips.hex.textbox + '">#:<input type="text" maxlength="6" class="Hex" value="' + (all != null ? all.hex : '') + '"/></label>' + (win.alphaSupport ? '<input type="text" maxlength="2" class="AHex" value="' + (all != null ? all.ahex.substring(6) : '') + '" title="' + localization.tooltips.hex.alpha + '"/></td>' : ' ') + '</tr></tbody></table>'; + if (win.expandable) + { + container.html(controlHtml); + if($(document.body).children('div.jPicker.Container').length==0)$(document.body).prepend(container); + else $(document.body).children('div.jPicker.Container:last').after(container); + container.mousedown( + function() + { + $(document.body).children('div.jPicker.Container').css({zIndex:10}); + container.css({zIndex:20}); + }); + container.css( // positions must be set and display set to absolute before source code injection or IE will size the container to fit the window + { + left: + win.position.x == 'left' ? (popup.offset().left - 530 - (win.position.y == 'center' ? 25 : 0)) + 'px' : + win.position.x == 'center' ? (popup.offset().left - 260) + 'px' : + win.position.x == 'right' ? (popup.offset().left - 10 + (win.position.y == 'center' ? 25 : 0)) + 'px' : + win.position.x == 'screenCenter' ? (($(document).width() >> 1) - 260) + 'px' : (popup.offset().left + parseInt(win.position.x)) + 'px', + position: 'absolute', + top: win.position.y == 'top' ? (popup.offset().top - 312) + 'px' : + win.position.y == 'center' ? (popup.offset().top - 156) + 'px' : + win.position.y == 'bottom' ? (popup.offset().top + 25) + 'px' : (popup.offset().top + parseInt(win.position.y)) + 'px' + }); + } + else + { + container = $($this); + container.html(controlHtml); + } + // initialize the objects to the source code just injected + var tbody = container.find('tbody:first'); + colorMapDiv = tbody.find('div.Map:first'); + colorBarDiv = tbody.find('div.Bar:first'); + var MapMaps = colorMapDiv.find('span'), + BarMaps = colorBarDiv.find('span'); + colorMapL1 = MapMaps.filter('.Map1:first'); + colorMapL2 = MapMaps.filter('.Map2:first'); + colorMapL3 = MapMaps.filter('.Map3:first'); + colorBarL1 = BarMaps.filter('.Map1:first'); + colorBarL2 = BarMaps.filter('.Map2:first'); + colorBarL3 = BarMaps.filter('.Map3:first'); + colorBarL4 = BarMaps.filter('.Map4:first'); + colorBarL5 = BarMaps.filter('.Map5:first'); + colorBarL6 = BarMaps.filter('.Map6:first'); + // create color pickers and maps + colorMap = new Slider(colorMapDiv, + { + map: + { + width: images.colorMap.width, + height: images.colorMap.height + }, + arrow: + { + image: images.clientPath + images.colorMap.arrow.file, + width: images.colorMap.arrow.width, + height: images.colorMap.arrow.height + } + }); + colorMap.bind(mapValueChanged); + colorBar = new Slider(colorBarDiv, + { + map: + { + width: images.colorBar.width, + height: images.colorBar.height + }, + arrow: + { + image: images.clientPath + images.colorBar.arrow.file, + width: images.colorBar.arrow.width, + height: images.colorBar.arrow.height + } + }); + colorBar.bind(colorBarValueChanged); + colorPicker = new ColorValuePicker(tbody, color.active, win.expandable && win.bindToInput ? win.input : null, win.alphaPrecision); + var hex = all != null ? all.hex : null, + preview = tbody.find('.Preview'), + button = tbody.find('.Button'); + activePreview = preview.find('.Active:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }); + currentPreview = preview.find('.Current:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }).bind('click', currentClicked); + setAlpha.call($this, currentPreview, Math.precision(color.current.val('a') * 100) / 255, 4); + okButton = button.find('.Ok:first').bind('click', okClicked); + cancelButton = button.find('.Cancel:first').bind('click', cancelClicked); + grid = button.find('.Grid:first'); + setTimeout( + function() + { + setImg.call($this, colorMapL1, images.clientPath + 'Maps.png'); + setImg.call($this, colorMapL2, images.clientPath + 'Maps.png'); + setImg.call($this, colorMapL3, images.clientPath + 'map-opacity.png'); + setImg.call($this, colorBarL1, images.clientPath + 'Bars.png'); + setImg.call($this, colorBarL2, images.clientPath + 'Bars.png'); + setImg.call($this, colorBarL3, images.clientPath + 'Bars.png'); + setImg.call($this, colorBarL4, images.clientPath + 'Bars.png'); + setImg.call($this, colorBarL5, images.clientPath + 'bar-opacity.png'); + setImg.call($this, colorBarL6, images.clientPath + 'AlphaBar.png'); + setImg.call($this, preview.find('div:first'), images.clientPath + 'preview-opacity.png'); + }, 0); + tbody.find('td.Radio input').bind('click', radioClicked); + // initialize quick list + if (color.quickList && color.quickList.length > 0) + { + var html = ''; + for (i = 0; i < color.quickList.length; i++) + { + /* if default colors are hex strings, change them to color objects */ + if ((typeof (color.quickList[i])).toString().toLowerCase() == 'string') color.quickList[i] = new Color({ hex: color.quickList[i] }); + var alpha = color.quickList[i].val('a'); + var ahex = color.quickList[i].val('ahex'); + if (!win.alphaSupport && ahex) ahex = ahex.substring(0, 6) + 'ff'; + var quickHex = color.quickList[i].val('hex'); + html+='<span class="QuickColor"' + (ahex && ' title="#' + ahex + '"' || '') + ' style="background-color:' + (quickHex && '#' + quickHex || '') + ';' + (quickHex ? '' : 'background-image:url(' + images.clientPath + 'NoColor.png)') + (win.alphaSupport && alpha && alpha < 255 ? ';opacity:' + Math.precision(alpha / 255, 4) + ';filter:Alpha(opacity=' + Math.precision(alpha / 2.55, 4) + ')' : '') + '"> </span>'; + } + setImg.call($this, grid, images.clientPath + 'bar-opacity.png'); + grid.html(html); + grid.find('.QuickColor').click(quickPickClicked); + } + setColorMode.call($this, settings.color.mode); + color.active.bind(activeColorChanged); + $.isFunction(liveCallback) && color.active.bind(liveCallback); + color.current.bind(currentColorChanged); + // bind to input + if (win.expandable) + { + $this.icon = popup.parents('.Icon:first'); + iconColor = $this.icon.find('.Color:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }); + iconAlpha = $this.icon.find('.Alpha:first'); + setImg.call($this, iconAlpha, images.clientPath + 'bar-opacity.png'); + setAlpha.call($this, iconAlpha, Math.precision(((255 - (all != null ? all.a : 0)) * 100) / 255, 4)); + iconImage = $this.icon.find('.Image:first').css( + { + backgroundImage: 'url(\'' + images.clientPath + images.picker.file + '\')' + }).bind('click', iconImageClicked); + if (win.bindToInput&&win.updateInputColor) + win.input.css( + { + backgroundColor: hex && '#' + hex || 'transparent', + color: all == null || all.v > 75 ? '#000000' : '#ffffff' + }); + moveBar = tbody.find('.Move:first').bind('mousedown', moveBarMouseDown); + color.active.bind(expandableColorChanged); + } + else show.call($this); + }, + destroy = + function() + { + container.find('td.Radio input').unbind('click', radioClicked); + currentPreview.unbind('click', currentClicked); + cancelButton.unbind('click', cancelClicked); + okButton.unbind('click', okClicked); + if (settings.window.expandable) + { + iconImage.unbind('click', iconImageClicked); + moveBar.unbind('mousedown', moveBarMouseDown); + $this.icon = null; + } + container.find('.QuickColor').unbind('click', quickPickClicked); + colorMapDiv = null; + colorBarDiv = null; + colorMapL1 = null; + colorMapL2 = null; + colorMapL3 = null; + colorBarL1 = null; + colorBarL2 = null; + colorBarL3 = null; + colorBarL4 = null; + colorBarL5 = null; + colorBarL6 = null; + colorMap.destroy(); + colorMap = null; + colorBar.destroy(); + colorBar = null; + colorPicker.destroy(); + colorPicker = null; + activePreview = null; + currentPreview = null; + okButton = null; + cancelButton = null; + grid = null; + commitCallback = null; + cancelCallback = null; + liveCallback = null; + container.html(''); + for (i = 0; i < List.length; i++) if (List[i] == $this) List.splice(i, 1); + }, + images = settings.images, // local copies for YUI compressor + localization = settings.localization, + color = + { + active: (typeof(settings.color.active)).toString().toLowerCase() == 'string' ? new Color({ ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex') }), + current: (typeof(settings.color.active)).toString().toLowerCase() == 'string' ? new Color({ ahex: !settings.window.alphaSupport && settings.color.active ? settings.color.active.substring(0, 6) + 'ff' : settings.color.active }) : new Color({ ahex: !settings.window.alphaSupport && settings.color.active.val('ahex') ? settings.color.active.val('ahex').substring(0, 6) + 'ff' : settings.color.active.val('ahex') }), + quickList: settings.color.quickList + }; + $.extend(true, $this, // public properties, methods, and callbacks + { + commitCallback: commitCallback, // commitCallback function can be overridden to return the selected color to a method you specify when the user clicks "OK" + liveCallback: liveCallback, // liveCallback function can be overridden to return the selected color to a method you specify in live mode (continuous update) + cancelCallback: cancelCallback, // cancelCallback function can be overridden to a method you specify when the user clicks "Cancel" + color: color, + show: show, + hide: hide, + destroy: destroy // destroys this control entirely, removing all events and objects, and removing itself from the List + }); + List.push($this); + setTimeout( + function() + { + initialize.call($this); + }, 0); + }); + }; + $.fn.jPicker.defaults = /* jPicker defaults - you can change anything in this section (such as the clientPath to your images) without fear of breaking the program */ + { + window: + { + title: null, /* any title for the jPicker window itself - displays "Drag Markers To Pick A Color" if left null */ + effects: + { + type: 'slide', /* effect used to show/hide an expandable picker. Acceptable values "slide", "show", "fade" */ + speed: + { + show: 'slow', /* duration of "show" effect. Acceptable values are "fast", "slow", or time in ms */ + hide: 'fast' /* duration of "hide" effect. Acceptable values are "fast", "slow", or time in ms */ + } + }, + position: + { + x: 'screenCenter', /* acceptable values "left", "center", "right", "screenCenter", or relative px value */ + y: 'top' /* acceptable values "top", "bottom", "center", or relative px value */ + }, + expandable: false, /* default to large static picker - set to true to make an expandable picker (small icon with popup) - set automatically when binded to input element */ + liveUpdate: true, /* set false if you want the user to have to click "OK" before the binded input box updates values (always "true" for expandable picker) */ + alphaSupport: false, /* set to true to enable alpha picking */ + alphaPrecision: 0, /* set decimal precision for alpha percentage display - hex codes do not map directly to percentage integers - range 0-2 */ + updateInputColor: true /* set to false to prevent binded input colors from changing */ + }, + color: + { + mode: 'h', /* acceptabled values "h" (hue), "s" (saturation), "v" (value), "r" (red), "g" (green), "b" (blue), "a" (alpha) */ + active: new Color({ ahex: '#ffcc00ff' }), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */ + quickList: /* the quick pick color list */ + [ + new Color({ h: 360, s: 33, v: 100 }), /* acceptable values are any declared $.jPicker.Color object or string HEX value (e.g. #ffc000) WITH OR WITHOUT the "#" prefix */ + new Color({ h: 360, s: 66, v: 100 }), + new Color({ h: 360, s: 100, v: 100 }), + new Color({ h: 360, s: 100, v: 75 }), + new Color({ h: 360, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 100 }), + new Color({ h: 30, s: 33, v: 100 }), + new Color({ h: 30, s: 66, v: 100 }), + new Color({ h: 30, s: 100, v: 100 }), + new Color({ h: 30, s: 100, v: 75 }), + new Color({ h: 30, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 90 }), + new Color({ h: 60, s: 33, v: 100 }), + new Color({ h: 60, s: 66, v: 100 }), + new Color({ h: 60, s: 100, v: 100 }), + new Color({ h: 60, s: 100, v: 75 }), + new Color({ h: 60, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 80 }), + new Color({ h: 90, s: 33, v: 100 }), + new Color({ h: 90, s: 66, v: 100 }), + new Color({ h: 90, s: 100, v: 100 }), + new Color({ h: 90, s: 100, v: 75 }), + new Color({ h: 90, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 70 }), + new Color({ h: 120, s: 33, v: 100 }), + new Color({ h: 120, s: 66, v: 100 }), + new Color({ h: 120, s: 100, v: 100 }), + new Color({ h: 120, s: 100, v: 75 }), + new Color({ h: 120, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 60 }), + new Color({ h: 150, s: 33, v: 100 }), + new Color({ h: 150, s: 66, v: 100 }), + new Color({ h: 150, s: 100, v: 100 }), + new Color({ h: 150, s: 100, v: 75 }), + new Color({ h: 150, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 50 }), + new Color({ h: 180, s: 33, v: 100 }), + new Color({ h: 180, s: 66, v: 100 }), + new Color({ h: 180, s: 100, v: 100 }), + new Color({ h: 180, s: 100, v: 75 }), + new Color({ h: 180, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 40 }), + new Color({ h: 210, s: 33, v: 100 }), + new Color({ h: 210, s: 66, v: 100 }), + new Color({ h: 210, s: 100, v: 100 }), + new Color({ h: 210, s: 100, v: 75 }), + new Color({ h: 210, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 30 }), + new Color({ h: 240, s: 33, v: 100 }), + new Color({ h: 240, s: 66, v: 100 }), + new Color({ h: 240, s: 100, v: 100 }), + new Color({ h: 240, s: 100, v: 75 }), + new Color({ h: 240, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 20 }), + new Color({ h: 270, s: 33, v: 100 }), + new Color({ h: 270, s: 66, v: 100 }), + new Color({ h: 270, s: 100, v: 100 }), + new Color({ h: 270, s: 100, v: 75 }), + new Color({ h: 270, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 10 }), + new Color({ h: 300, s: 33, v: 100 }), + new Color({ h: 300, s: 66, v: 100 }), + new Color({ h: 300, s: 100, v: 100 }), + new Color({ h: 300, s: 100, v: 75 }), + new Color({ h: 300, s: 100, v: 50 }), + new Color({ h: 180, s: 0, v: 0 }), + new Color({ h: 330, s: 33, v: 100 }), + new Color({ h: 330, s: 66, v: 100 }), + new Color({ h: 330, s: 100, v: 100 }), + new Color({ h: 330, s: 100, v: 75 }), + new Color({ h: 330, s: 100, v: 50 }), + new Color() + ] + }, + images: + { + clientPath: '/jPicker/images/', /* Path to image files */ + colorMap: + { + width: 256, + height: 256, + arrow: + { + file: 'mappoint.gif', /* ColorMap arrow icon */ + width: 15, + height: 15 + } + }, + colorBar: + { + width: 20, + height: 256, + arrow: + { + file: 'rangearrows.gif', /* ColorBar arrow icon */ + width: 20, + height: 7 + } + }, + picker: + { + file: 'picker.gif', /* Color Picker icon */ + width: 25, + height: 24 + } + }, + localization: /* alter these to change the text presented by the picker (e.g. different language) */ + { + text: + { + title: 'Drag Markers To Pick A Color', + newColor: 'new', + currentColor: 'current', + ok: 'OK', + cancel: 'Cancel' + }, + tooltips: + { + colors: + { + newColor: 'New Color - Press “OK” To Commit', + currentColor: 'Click To Revert To Original Color' + }, + buttons: + { + ok: 'Commit To This Color Selection', + cancel: 'Cancel And Revert To Original Color' + }, + hue: + { + radio: 'Set To “Hue” Color Mode', + textbox: 'Enter A “Hue” Value (0-360°)' + }, + saturation: + { + radio: 'Set To “Saturation” Color Mode', + textbox: 'Enter A “Saturation” Value (0-100%)' + }, + value: + { + radio: 'Set To “Value” Color Mode', + textbox: 'Enter A “Value” Value (0-100%)' + }, + red: + { + radio: 'Set To “Red” Color Mode', + textbox: 'Enter A “Red” Value (0-255)' + }, + green: + { + radio: 'Set To “Green” Color Mode', + textbox: 'Enter A “Green” Value (0-255)' + }, + blue: + { + radio: 'Set To “Blue” Color Mode', + textbox: 'Enter A “Blue” Value (0-255)' + }, + alpha: + { + radio: 'Set To “Alpha” Color Mode', + textbox: 'Enter A “Alpha” Value (0-100)' + }, + hex: + { + textbox: 'Enter A “Hex” Color Value (#000000-#ffffff)', + alpha: 'Enter A “Alpha” Value (#00-#ff)' + } + } + } + }; +})(jQuery, '1.1.6'); \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.min.js b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.min.js new file mode 100755 index 0000000000000000000000000000000000000000..beb1b4079ddeaf0c19ee9c148aff9450143199c1 --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/jpicker-1.1.6.min.js @@ -0,0 +1 @@ +(function(e,a){Math.precision=function(j,h){if(h===undefined){h=0}return Math.round(j*Math.pow(10,h))/Math.pow(10,h)};var d=function(z,k){var o=this,j=z.find("img:first"),F=0,E=100,w=100,D=0,C=100,v=100,s=0,p=0,n,q,u=new Array(),l=function(y){for(var x=0;x<u.length;x++){u[x].call(o,o,y)}},H=function(x){var y=z.offset();n={l:y.left|0,t:y.top|0};clearTimeout(q);q=setTimeout(function(){A.call(o,x)},0);e(document).bind("mousemove",h).bind("mouseup",B);x.preventDefault()},h=function(x){clearTimeout(q);q=setTimeout(function(){A.call(o,x)},0);x.stopPropagation();x.preventDefault();return false},B=function(x){e(document).unbind("mouseup",B).unbind("mousemove",h);x.stopPropagation();x.preventDefault();return false},A=function(M){var K=M.pageX-n.l,x=M.pageY-n.t,L=z.w,y=z.h;if(K<0){K=0}else{if(K>L){K=L}}if(x<0){x=0}else{if(x>y){x=y}}J.call(o,"xy",{x:((K/L)*w)+F,y:((x/y)*v)+D})},r=function(){var L=0,x=0,N=z.w,K=z.h,M=j.w,y=j.h;setTimeout(function(){if(w>0){if(s==E){L=N}else{L=((s/w)*N)|0}}if(v>0){if(p==C){x=K}else{x=((p/v)*K)|0}}if(M>=N){L=(N>>1)-(M>>1)}else{L-=M>>1}if(y>=K){x=(K>>1)-(y>>1)}else{x-=y>>1}j.css({left:L+"px",top:x+"px"})},0)},J=function(x,K,y){var O=K!==undefined;if(!O){if(x===undefined||x==null){x="xy"}switch(x.toLowerCase()){case"x":return s;case"y":return p;case"xy":default:return{x:s,y:p}}}if(y!=null&&y==o){return}var N=false,M,L;if(x==null){x="xy"}switch(x.toLowerCase()){case"x":M=K&&(K.x&&K.x|0||K|0)||0;break;case"y":L=K&&(K.y&&K.y|0||K|0)||0;break;case"xy":default:M=K&&K.x&&K.x|0||0;L=K&&K.y&&K.y|0||0;break}if(M!=null){if(M<F){M=F}else{if(M>E){M=E}}if(s!=M){s=M;N=true}}if(L!=null){if(L<D){L=D}else{if(L>C){L=C}}if(p!=L){p=L;N=true}}N&&l.call(o,y||o)},t=function(x,L){var P=L!==undefined;if(!P){if(x===undefined||x==null){x="all"}switch(x.toLowerCase()){case"minx":return F;case"maxx":return E;case"rangex":return{minX:F,maxX:E,rangeX:w};case"miny":return D;case"maxy":return C;case"rangey":return{minY:D,maxY:C,rangeY:v};case"all":default:return{minX:F,maxX:E,rangeX:w,minY:D,maxY:C,rangeY:v}}}var O=false,N,K,M,y;if(x==null){x="all"}switch(x.toLowerCase()){case"minx":N=L&&(L.minX&&L.minX|0||L|0)||0;break;case"maxx":K=L&&(L.maxX&&L.maxX|0||L|0)||0;break;case"rangex":N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;break;case"miny":M=L&&(L.minY&&L.minY|0||L|0)||0;break;case"maxy":y=L&&(L.maxY&&L.maxY|0||L|0)||0;break;case"rangey":M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break;case"all":default:N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break}if(N!=null&&F!=N){F=N;w=E-F}if(K!=null&&E!=K){E=K;w=E-F}if(M!=null&&D!=M){D=M;v=C-D}if(y!=null&&C!=y){C=y;v=C-D}},I=function(x){if(e.isFunction(x)){u.push(x)}},m=function(y){if(!e.isFunction(y)){return}var x;while((x=e.inArray(y,u))!=-1){u.splice(x,1)}},G=function(){e(document).unbind("mouseup",B).unbind("mousemove",h);z.unbind("mousedown",H);z=null;j=null;u=null};e.extend(true,o,{val:J,range:t,bind:I,unbind:m,destroy:G});j.src=k.arrow&&k.arrow.image;j.w=k.arrow&&k.arrow.width||j.width();j.h=k.arrow&&k.arrow.height||j.height();z.w=k.map&&k.map.width||z.width();z.h=k.map&&k.map.height||z.height();z.bind("mousedown",H);I.call(o,r)},b=function(u,z,k,y){var q=this,l=u.find("td.Text input"),r=l.eq(3),v=l.eq(4),h=l.eq(5),o=l.length>7?l.eq(6):null,n=l.eq(0),p=l.eq(1),x=l.eq(2),s=l.eq(l.length>7?7:6),B=l.length>7?l.eq(8):null,C=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):switch(E.keyCode){case 38:r.val(j.call(q,(r.val()<<0)+1,0,255));z.val("r",r.val(),E.target);return false;case 40:r.val(j.call(q,(r.val()<<0)-1,0,255));z.val("r",r.val(),E.target);return false}break;case v.get(0):switch(E.keyCode){case 38:v.val(j.call(q,(v.val()<<0)+1,0,255));z.val("g",v.val(),E.target);return false;case 40:v.val(j.call(q,(v.val()<<0)-1,0,255));z.val("g",v.val(),E.target);return false}break;case h.get(0):switch(E.keyCode){case 38:h.val(j.call(q,(h.val()<<0)+1,0,255));z.val("b",h.val(),E.target);return false;case 40:h.val(j.call(q,(h.val()<<0)-1,0,255));z.val("b",h.val(),E.target);return false}break;case o&&o.get(0):switch(E.keyCode){case 38:o.val(j.call(q,parseFloat(o.val())+1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false;case 40:o.val(j.call(q,parseFloat(o.val())-1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false}break;case n.get(0):switch(E.keyCode){case 38:n.val(j.call(q,(n.val()<<0)+1,0,360));z.val("h",n.val(),E.target);return false;case 40:n.val(j.call(q,(n.val()<<0)-1,0,360));z.val("h",n.val(),E.target);return false}break;case p.get(0):switch(E.keyCode){case 38:p.val(j.call(q,(p.val()<<0)+1,0,100));z.val("s",p.val(),E.target);return false;case 40:p.val(j.call(q,(p.val()<<0)-1,0,100));z.val("s",p.val(),E.target);return false}break;case x.get(0):switch(E.keyCode){case 38:x.val(j.call(q,(x.val()<<0)+1,0,100));z.val("v",x.val(),E.target);return false;case 40:x.val(j.call(q,(x.val()<<0)-1,0,100));z.val("v",x.val(),E.target);return false}break}},w=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):r.val(j.call(q,r.val(),0,255));z.val("r",r.val(),E.target);break;case v.get(0):v.val(j.call(q,v.val(),0,255));z.val("g",v.val(),E.target);break;case h.get(0):h.val(j.call(q,h.val(),0,255));z.val("b",h.val(),E.target);break;case o&&o.get(0):o.val(j.call(q,o.val(),0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);break;case n.get(0):n.val(j.call(q,n.val(),0,360));z.val("h",n.val(),E.target);break;case p.get(0):p.val(j.call(q,p.val(),0,100));z.val("s",p.val(),E.target);break;case x.get(0):x.val(j.call(q,x.val(),0,100));z.val("v",x.val(),E.target);break;case s.get(0):s.val(s.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));k&&k.val(s.val());z.val("hex",s.val()!=""?s.val():null,E.target);break;case k&&k.get(0):k.val(k.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));s.val(k.val());z.val("hex",k.val()!=""?k.val():null,E.target);break;case B&&B.get(0):B.val(B.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2));z.val("a",B.val()!=null?parseInt(B.val(),16):null,E.target);break}},A=function(E){if(z.val()!=null){switch(E.target){case r.get(0):r.val(z.val("r"));break;case v.get(0):v.val(z.val("g"));break;case h.get(0):h.val(z.val("b"));break;case o&&o.get(0):o.val(Math.precision((z.val("a")*100)/255,y));break;case n.get(0):n.val(z.val("h"));break;case p.get(0):p.val(z.val("s"));break;case x.get(0):x.val(z.val("v"));break;case s.get(0):case k&&k.get(0):s.val(z.val("hex"));k&&k.val(z.val("hex"));break;case B&&B.get(0):B.val(z.val("ahex").substring(6));break}}},t=function(E){switch(E.keyCode){case 9:case 16:case 29:case 37:case 39:return false;case"c".charCodeAt():case"v".charCodeAt():if(E.ctrlKey){return false}}return true},j=function(G,F,E){if(G==""||isNaN(G)){return F}if(G>E){return E}if(G<F){return F}return G},m=function(G,E){var F=G.val("all");if(E!=r.get(0)){r.val(F!=null?F.r:"")}if(E!=v.get(0)){v.val(F!=null?F.g:"")}if(E!=h.get(0)){h.val(F!=null?F.b:"")}if(o&&E!=o.get(0)){o.val(F!=null?Math.precision((F.a*100)/255,y):"")}if(E!=n.get(0)){n.val(F!=null?F.h:"")}if(E!=p.get(0)){p.val(F!=null?F.s:"")}if(E!=x.get(0)){x.val(F!=null?F.v:"")}if(E!=s.get(0)&&(k&&E!=k.get(0)||!k)){s.val(F!=null?F.hex:"")}if(k&&E!=k.get(0)&&E!=s.get(0)){k.val(F!=null?F.hex:"")}if(B&&E!=B.get(0)){B.val(F!=null?F.ahex.substring(6):"")}},D=function(){r.add(v).add(h).add(o).add(n).add(p).add(x).add(s).add(k).add(B).unbind("keyup",w).unbind("blur",A);r.add(v).add(h).add(o).add(n).add(p).add(x).unbind("keydown",C);z.unbind(m);r=null;v=null;h=null;o=null;n=null;p=null;x=null;s=null;B=null};e.extend(true,q,{destroy:D});r.add(v).add(h).add(o).add(n).add(p).add(x).add(s).add(k).add(B).bind("keyup",w).bind("blur",A);r.add(v).add(h).add(o).add(n).add(p).add(x).bind("keydown",C);z.bind(m)};e.jPicker={List:[],Color:function(z){var q=this,j,o,t,u,n,A,x,k=new Array(),m=function(r){for(var h=0;h<k.length;h++){k[h].call(q,q,r)}},l=function(h,G,r){var F=G!==undefined;if(!F){if(h===undefined||h==null||h==""){h="all"}if(j==null){return null}switch(h.toLowerCase()){case"ahex":return g.rgbaToHex({r:j,g:o,b:t,a:u});case"hex":return l("ahex").substring(0,6);case"all":return{r:j,g:o,b:t,a:u,h:n,s:A,v:x,hex:l.call(q,"hex"),ahex:l.call(q,"ahex")};default:var D={};for(var B=0;B<h.length;B++){switch(h.charAt(B)){case"r":if(h.length==1){D=j}else{D.r=j}break;case"g":if(h.length==1){D=o}else{D.g=o}break;case"b":if(h.length==1){D=t}else{D.b=t}break;case"a":if(h.length==1){D=u}else{D.a=u}break;case"h":if(h.length==1){D=n}else{D.h=n}break;case"s":if(h.length==1){D=A}else{D.s=A}break;case"v":if(h.length==1){D=x}else{D.v=x}break}}return D=={}?l.call(q,"all"):D;break}}if(r!=null&&r==q){return}var v=false;if(h==null){h=""}if(G==null){if(j!=null){j=null;v=true}if(o!=null){o=null;v=true}if(t!=null){t=null;v=true}if(u!=null){u=null;v=true}if(n!=null){n=null;v=true}if(A!=null){A=null;v=true}if(x!=null){x=null;v=true}v&&m.call(q,r||q);return}switch(h.toLowerCase()){case"ahex":case"hex":var D=g.hexToRgba(G&&(G.ahex||G.hex)||G||"00000000");l.call(q,"rgba",{r:D.r,g:D.g,b:D.b,a:h=="ahex"?D.a:u!=null?u:255},r);break;default:if(G&&(G.ahex!=null||G.hex!=null)){l.call(q,"ahex",G.ahex||G.hex||"00000000",r);return}var s={},E=false,C=false;if(G.r!==undefined&&!h.indexOf("r")==-1){h+="r"}if(G.g!==undefined&&!h.indexOf("g")==-1){h+="g"}if(G.b!==undefined&&!h.indexOf("b")==-1){h+="b"}if(G.a!==undefined&&!h.indexOf("a")==-1){h+="a"}if(G.h!==undefined&&!h.indexOf("h")==-1){h+="h"}if(G.s!==undefined&&!h.indexOf("s")==-1){h+="s"}if(G.v!==undefined&&!h.indexOf("v")==-1){h+="v"}for(var B=0;B<h.length;B++){switch(h.charAt(B)){case"r":if(C){continue}E=true;s.r=G&&G.r&&G.r|0||G&&G|0||0;if(s.r<0){s.r=0}else{if(s.r>255){s.r=255}}if(j!=s.r){j=s.r;v=true}break;case"g":if(C){continue}E=true;s.g=G&&G.g&&G.g|0||G&&G|0||0;if(s.g<0){s.g=0}else{if(s.g>255){s.g=255}}if(o!=s.g){o=s.g;v=true}break;case"b":if(C){continue}E=true;s.b=G&&G.b&&G.b|0||G&&G|0||0;if(s.b<0){s.b=0}else{if(s.b>255){s.b=255}}if(t!=s.b){t=s.b;v=true}break;case"a":s.a=G&&G.a!=null?G.a|0:G!=null?G|0:255;if(s.a<0){s.a=0}else{if(s.a>255){s.a=255}}if(u!=s.a){u=s.a;v=true}break;case"h":if(E){continue}C=true;s.h=G&&G.h&&G.h|0||G&&G|0||0;if(s.h<0){s.h=0}else{if(s.h>360){s.h=360}}if(n!=s.h){n=s.h;v=true}break;case"s":if(E){continue}C=true;s.s=G&&G.s!=null?G.s|0:G!=null?G|0:100;if(s.s<0){s.s=0}else{if(s.s>100){s.s=100}}if(A!=s.s){A=s.s;v=true}break;case"v":if(E){continue}C=true;s.v=G&&G.v!=null?G.v|0:G!=null?G|0:100;if(s.v<0){s.v=0}else{if(s.v>100){s.v=100}}if(x!=s.v){x=s.v;v=true}break}}if(v){if(E){j=j||0;o=o||0;t=t||0;var D=g.rgbToHsv({r:j,g:o,b:t});n=D.h;A=D.s;x=D.v}else{if(C){n=n||0;A=A!=null?A:100;x=x!=null?x:100;var D=g.hsvToRgb({h:n,s:A,v:x});j=D.r;o=D.g;t=D.b}}u=u!=null?u:255;m.call(q,r||q)}break}},p=function(h){if(e.isFunction(h)){k.push(h)}},y=function(r){if(!e.isFunction(r)){return}var h;while((h=e.inArray(r,k))!=-1){k.splice(h,1)}},w=function(){k=null};e.extend(true,q,{val:l,bind:p,unbind:y,destroy:w});if(z){if(z.ahex!=null){l("ahex",z)}else{if(z.hex!=null){l((z.a!=null?"a":"")+"hex",z.a!=null?{ahex:z.hex+g.intToHex(z.a)}:z)}else{if(z.r!=null&&z.g!=null&&z.b!=null){l("rgb"+(z.a!=null?"a":""),z)}else{if(z.h!=null&&z.s!=null&&z.v!=null){l("hsv"+(z.a!=null?"a":""),z)}}}}}},ColorMethods:{hexToRgba:function(m){m=this.validateHex(m);if(m==""){return{r:null,g:null,b:null,a:null}}var l="00",k="00",h="00",j="255";if(m.length==6){m+="ff"}if(m.length>6){l=m.substring(0,2);k=m.substring(2,4);h=m.substring(4,6);j=m.substring(6,m.length)}else{if(m.length>4){l=m.substring(4,m.length);m=m.substring(0,4)}if(m.length>2){k=m.substring(2,m.length);m=m.substring(0,2)}if(m.length>0){h=m.substring(0,m.length)}}return{r:this.hexToInt(l),g:this.hexToInt(k),b:this.hexToInt(h),a:this.hexToInt(j)}},validateHex:function(h){h=h.toLowerCase().replace(/[^a-f0-9]/g,"");if(h.length>8){h=h.substring(0,8)}return h},rgbaToHex:function(h){return this.intToHex(h.r)+this.intToHex(h.g)+this.intToHex(h.b)+this.intToHex(h.a)},intToHex:function(j){var h=(j|0).toString(16);if(h.length==1){h=("0"+h)}return h.toLowerCase()},hexToInt:function(h){return parseInt(h,16)},rgbToHsv:function(l){var o=l.r/255,n=l.g/255,j=l.b/255,k={h:0,s:0,v:0},m=0,h=0,p;if(o>=n&&o>=j){h=o;m=n>j?j:n}else{if(n>=j&&n>=o){h=n;m=o>j?j:o}else{h=j;m=n>o?o:n}}k.v=h;k.s=h?(h-m)/h:0;if(!k.s){k.h=0}else{p=h-m;if(o==h){k.h=(n-j)/p}else{if(n==h){k.h=2+(j-o)/p}else{k.h=4+(o-n)/p}}k.h=parseInt(k.h*60);if(k.h<0){k.h+=360}}k.s=(k.s*100)|0;k.v=(k.v*100)|0;return k},hsvToRgb:function(n){var r={r:0,g:0,b:0,a:100},m=n.h,x=n.s,u=n.v;if(x==0){if(u==0){r.r=r.g=r.b=0}else{r.r=r.g=r.b=(u*255/100)|0}}else{if(m==360){m=0}m/=60;x=x/100;u=u/100;var l=m|0,o=m-l,k=u*(1-x),j=u*(1-(x*o)),w=u*(1-(x*(1-o)));switch(l){case 0:r.r=u;r.g=w;r.b=k;break;case 1:r.r=j;r.g=u;r.b=k;break;case 2:r.r=k;r.g=u;r.b=w;break;case 3:r.r=k;r.g=j;r.b=u;break;case 4:r.r=w;r.g=k;r.b=u;break;case 5:r.r=u;r.g=k;r.b=j;break}r.r=(r.r*255)|0;r.g=(r.g*255)|0;r.b=(r.b*255)|0}return r}}};var f=e.jPicker.Color,c=e.jPicker.List,g=e.jPicker.ColorMethods;e.fn.jPicker=function(j){var h=arguments;return this.each(function(){var w=this,av=e.extend(true,{},e.fn.jPicker.defaults,j);if(e(w).get(0).nodeName.toLowerCase()=="input"){e.extend(true,av,{window:{bindToInput:true,expandable:true,input:e(w)}});if(e(w).val()==""){av.color.active=new f({hex:null});av.color.current=new f({hex:null})}else{if(g.validateHex(e(w).val())){av.color.active=new f({hex:e(w).val(),a:av.color.active.val("a")});av.color.current=new f({hex:e(w).val(),a:av.color.active.val("a")})}}}if(av.window.expandable){e(w).after('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>')}else{av.window.liveUpdate=false}var Q=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,R=null,l=null,s=null,au=null,at=null,ar=null,P=null,O=null,N=null,M=null,L=null,K=null,D=null,U=null,aw=null,J=null,I=null,am=null,ai=null,E=null,an=null,ah=null,X=null,ab=null,aq=null,r=null,C=null,u=null,ag=function(aB){var aD=G.active,aE=n.clientPath,aA=aD.val("hex"),aC,az;av.color.mode=aB;switch(aB){case"h":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,0);Y.call(w,au,100);x.call(w,at,260);Y.call(w,at,100);y.call(w,s,"transparent");x.call(w,P,0);Y.call(w,P,100);x.call(w,O,260);Y.call(w,O,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:100,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:360});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("s"),y:100-aD.val("v")},D);U.val("y",360-aD.val("h"),U);break;case"s":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,-260);x.call(w,O,-520);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",100-aD.val("s"),U);break;case"v":setTimeout(function(){y.call(w,l,"000000");x.call(w,au,-780);x.call(w,at,260);y.call(w,s,aA);x.call(w,P,-520);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("s")},D);U.val("y",100-aD.val("v"),U);break;case"r":aC=-1040;az=-780;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("g")},D);U.val("y",255-aD.val("r"),U);break;case"g":aC=-1560;az=-1820;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("r")},D);U.val("y",255-aD.val("g"),U);break;case"b":aC=-2080;az=-2860;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("r"),y:255-aD.val("g")},D);U.val("y",255-aD.val("b"),U);break;case"a":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,260);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,0);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",255-aD.val("a"),U);break;default:throw ("Invalid Mode");break}switch(aB){case"h":break;case"s":case"v":case"a":setTimeout(function(){Y.call(w,au,100);Y.call(w,P,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100)},0);break;case"r":case"g":case"b":setTimeout(function(){y.call(w,l,"transparent");y.call(w,s,"transparent");Y.call(w,P,100);Y.call(w,au,100);x.call(w,au,aC);x.call(w,at,aC-260);x.call(w,P,az-780);x.call(w,O,az-520);x.call(w,N,az);x.call(w,M,az-260);x.call(w,K,260);Y.call(w,K,100)},0);break}if(aD.val("ahex")==null){return}aj.call(w,aD)},aj=function(aA,az){if(az==null||(az!=U&&az!=D)){v.call(w,aA,az)}setTimeout(function(){ay.call(w,aA);al.call(w,aA);W.call(w,aA)},0)},z=function(aA,az){var aC=G.active;if(az!=D&&aC.val()==null){return}var aB=aA.val("all");switch(av.color.mode){case"h":aC.val("sv",{s:aB.x,v:100-aB.y},az);break;case"s":case"a":aC.val("hv",{h:aB.x,v:100-aB.y},az);break;case"v":aC.val("hs",{h:aB.x,s:100-aB.y},az);break;case"r":aC.val("gb",{g:255-aB.y,b:aB.x},az);break;case"g":aC.val("rb",{r:255-aB.y,b:aB.x},az);break;case"b":aC.val("rg",{r:aB.x,g:255-aB.y},az);break}},ac=function(aA,az){var aB=G.active;if(az!=U&&aB.val()==null){return}switch(av.color.mode){case"h":aB.val("h",{h:360-aA.val("y")},az);break;case"s":aB.val("s",{s:100-aA.val("y")},az);break;case"v":aB.val("v",{v:100-aA.val("y")},az);break;case"r":aB.val("r",{r:255-aA.val("y")},az);break;case"g":aB.val("g",{g:255-aA.val("y")},az);break;case"b":aB.val("b",{b:255-aA.val("y")},az);break;case"a":aB.val("a",255-aA.val("y"),az);break}},v=function(aC,az){if(az!=D){switch(av.color.mode){case"h":var aH=aC.val("sv");D.val("xy",{x:aH!=null?aH.s:100,y:100-(aH!=null?aH.v:100)},az);break;case"s":case"a":var aB=aC.val("hv");D.val("xy",{x:aB&&aB.h||0,y:100-(aB!=null?aB.v:100)},az);break;case"v":var aE=aC.val("hs");D.val("xy",{x:aE&&aE.h||0,y:100-(aE!=null?aE.s:100)},az);break;case"r":var aA=aC.val("bg");D.val("xy",{x:aA&&aA.b||0,y:255-(aA&&aA.g||0)},az);break;case"g":var aI=aC.val("br");D.val("xy",{x:aI&&aI.b||0,y:255-(aI&&aI.r||0)},az);break;case"b":var aG=aC.val("rg");D.val("xy",{x:aG&&aG.r||0,y:255-(aG&&aG.g||0)},az);break}}if(az!=U){switch(av.color.mode){case"h":U.val("y",360-(aC.val("h")||0),az);break;case"s":var aJ=aC.val("s");U.val("y",100-(aJ!=null?aJ:100),az);break;case"v":var aF=aC.val("v");U.val("y",100-(aF!=null?aF:100),az);break;case"r":U.val("y",255-(aC.val("r")||0),az);break;case"g":U.val("y",255-(aC.val("g")||0),az);break;case"b":U.val("y",255-(aC.val("b")||0),az);break;case"a":var aD=aC.val("a");U.val("y",255-(aD!=null?aD:255),az);break}}},ay=function(aA){try{var az=aA.val("all");E.css({backgroundColor:az&&"#"+az.hex||"transparent"});Y.call(w,E,az&&Math.precision((az.a*100)/255,4)||0)}catch(aB){}},al=function(aC){switch(av.color.mode){case"h":y.call(w,l,new f({h:aC.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var aB=aC.val("s");Y.call(w,at,100-(aB!=null?aB:100));break;case"v":var aA=aC.val("v");Y.call(w,au,aA!=null?aA:100);break;case"r":Y.call(w,at,Math.precision((aC.val("r")||0)/255*100,4));break;case"g":Y.call(w,at,Math.precision((aC.val("g")||0)/255*100,4));break;case"b":Y.call(w,at,Math.precision((aC.val("b")||0)/255*100));break}var az=aC.val("a");Y.call(w,ar,Math.precision(((255-(az||0))*100)/255,4))},W=function(aF){switch(av.color.mode){case"h":var aH=aF.val("a");Y.call(w,L,Math.precision(((255-(aH||0))*100)/255,4));break;case"s":var aA=aF.val("hva"),aB=new f({h:aA&&aA.h||0,s:100,v:aA!=null?aA.v:100});y.call(w,s,aB.val("hex"));Y.call(w,O,100-(aA!=null?aA.v:100));Y.call(w,L,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));break;case"v":var aC=aF.val("hsa"),aE=new f({h:aC&&aC.h||0,s:aC!=null?aC.s:100,v:100});y.call(w,s,aE.val("hex"));Y.call(w,L,Math.precision(((255-(aC&&aC.a||0))*100)/255,4));break;case"r":case"g":case"b":var aD=0,aG=0,az=aF.val("rgba");if(av.color.mode=="r"){aD=az&&az.b||0;aG=az&&az.g||0}else{if(av.color.mode=="g"){aD=az&&az.b||0;aG=az&&az.r||0}else{if(av.color.mode=="b"){aD=az&&az.r||0;aG=az&&az.g||0}}}var aI=aG>aD?aD:aG;Y.call(w,O,aD>aG?Math.precision(((aD-aG)/(255-aG))*100,4):0);Y.call(w,N,aG>aD?Math.precision(((aG-aD)/(255-aD))*100,4):0);Y.call(w,M,Math.precision((aI/255)*100,4));Y.call(w,L,Math.precision(((255-(az&&az.a||0))*100)/255,4));break;case"a":var aH=aF.val("a");y.call(w,s,aF.val("hex")||"000000");Y.call(w,L,aH!=null?0:100);Y.call(w,K,aH!=null?100:0);break}},y=function(az,aA){az.css({backgroundColor:aA&&aA.length==6&&"#"+aA||"transparent"})},t=function(az,aA){if(Q&&(aA.indexOf("AlphaBar.png")!=-1||aA.indexOf("Bars.png")!=-1||aA.indexOf("Maps.png")!=-1)){az.attr("pngSrc",aA);az.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aA+"', sizingMethod='scale')"})}else{az.css({backgroundImage:"url('"+aA+"')"})}},x=function(az,aA){az.css({top:aA+"px"})},Y=function(aA,az){aA.css({visibility:az>0?"visible":"hidden"});if(az>0&&az<100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+az+")"})}else{aA.css({opacity:Math.precision(az/100,4)})}}else{aA.css({opacity:Math.precision(az/100,4)})}}else{if(az==0||az==100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale')"})}else{aA.css({opacity:""})}}else{aA.css({opacity:""})}}}},B=function(){G.active.val("ahex",G.current.val("ahex"))},T=function(){G.current.val("ahex",G.active.val("ahex"))},A=function(az){e(this).parents("tbody:first").find('input:radio[value!="'+az.target.value+'"]').removeAttr("checked");ag.call(w,az.target.value)},Z=function(){B.call(w)},q=function(){B.call(w);av.window.expandable&&ao.call(w);e.isFunction(ax)&&ax.call(w,G.active,X)},m=function(){T.call(w);av.window.expandable&&ao.call(w);e.isFunction(ae)&&ae.call(w,G.active,ah)},af=function(){V.call(w)},ap=function(aB,az){var aA=aB.val("hex");an.css({backgroundColor:aA&&"#"+aA||"transparent"});Y.call(w,an,Math.precision(((aB.val("a")||0)*100)/255,4))},H=function(aC,az){var aB=aC.val("hex");var aA=aC.val("va");aq.css({backgroundColor:aB&&"#"+aB||"transparent"});Y.call(w,r,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));if(av.window.bindToInput&&av.window.updateInputColor){av.window.input.css({backgroundColor:aB&&"#"+aB||"transparent",color:aA==null||aA.v>75?"#000000":"#ffffff"})}},S=function(aB){var az=av.window.element,aA=av.window.page;J=parseInt(R.css("left"));I=parseInt(R.css("top"));am=aB.pageX;ai=aB.pageY;e(document).bind("mousemove",k).bind("mouseup",p);aB.preventDefault()},k=function(az){R.css({left:J-(am-az.pageX)+"px",top:I-(ai-az.pageY)+"px"});if(av.window.expandable&&!e.support.boxModel){R.prev().css({left:R.css("left"),top:R.css("top")})}az.stopPropagation();az.preventDefault();return false},p=function(az){e(document).unbind("mousemove",k).unbind("mouseup",p);az.stopPropagation();az.preventDefault();return false},F=function(az){az.preventDefault();az.stopPropagation();G.active.val("ahex",e(this).attr("title")||null,az.target);return false},ae=e.isFunction(h[1])&&h[1]||null,ad=e.isFunction(h[2])&&h[2]||null,ax=e.isFunction(h[3])&&h[3]||null,V=function(){G.current.val("ahex",G.active.val("ahex"));var az=function(){if(!av.window.expandable||e.support.boxModel){return}var aA=R.find("table:first");R.before("<iframe/>");R.prev().css({width:aA.width(),height:R.height(),opacity:0,position:"absolute",left:R.css("left"),top:R.css("top")})};if(av.window.expandable){e(document.body).children("div.jPicker.Container").css({zIndex:10});R.css({zIndex:20})}switch(av.window.effects.type){case"fade":R.fadeIn(av.window.effects.speed.show,az);break;case"slide":R.slideDown(av.window.effects.speed.show,az);break;case"show":default:R.show(av.window.effects.speed.show,az);break}},ao=function(){var az=function(){if(av.window.expandable){R.css({zIndex:10})}if(!av.window.expandable||e.support.boxModel){return}R.prev().remove()};switch(av.window.effects.type){case"fade":R.fadeOut(av.window.effects.speed.hide,az);break;case"slide":R.slideUp(av.window.effects.speed.hide,az);break;case"show":default:R.hide(av.window.effects.speed.hide,az);break}},o=function(){var aG=av.window,az=aG.expandable?e(w).next().find(".Container:first"):null;R=aG.expandable?e("<div/>"):e(w);R.addClass("jPicker Container");if(aG.expandable){R.hide()}R.get(0).onselectstart=function(aN){if(aN.target.nodeName.toLowerCase()!=="input"){return false}};var aJ=G.active.val("all");if(aG.alphaPrecision<0){aG.alphaPrecision=0}else{if(aG.alphaPrecision>2){aG.alphaPrecision=2}}var aK='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>'+(aG.expandable?'<tr><td class="Move" colspan="5"> </td></tr>':"")+'<tr><td rowspan="9"><h2 class="Title">'+(aG.title||aa.text.title)+'</h2><div class="Map"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><img src="'+n.clientPath+n.colorMap.arrow.file+'" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><span class="Map4"> </span><span class="Map5"> </span><span class="Map6"> </span><img src="'+n.clientPath+n.colorBar.arrow.file+'" class="Arrow"/></div></td><td colspan="2" class="Preview">'+aa.text.newColor+'<div><span class="Active" title="'+aa.tooltips.colors.newColor+'"> </span><span class="Current" title="'+aa.tooltips.colors.currentColor+'"> </span></div>'+aa.text.currentColor+'</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="'+aa.text.ok+'" title="'+aa.tooltips.buttons.ok+'"/><input type="button" class="Cancel" value="'+aa.text.cancel+'" title="'+aa.tooltips.buttons.cancel+'"/><hr/><div class="Grid"> </div></td></tr><tr class="Hue"><td class="Radio"><label title="'+aa.tooltips.hue.radio+'"><input type="radio" value="h"'+(av.color.mode=="h"?' checked="checked"':"")+'/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.h:"")+'" title="'+aa.tooltips.hue.textbox+'"/> °</td></tr><tr class="Saturation"><td class="Radio"><label title="'+aa.tooltips.saturation.radio+'"><input type="radio" value="s"'+(av.color.mode=="s"?' checked="checked"':"")+'/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.s:"")+'" title="'+aa.tooltips.saturation.textbox+'"/> %</td></tr><tr class="Value"><td class="Radio"><label title="'+aa.tooltips.value.radio+'"><input type="radio" value="v"'+(av.color.mode=="v"?' checked="checked"':"")+'/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.v:"")+'" title="'+aa.tooltips.value.textbox+'"/> %<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="'+aa.tooltips.red.radio+'"><input type="radio" value="r"'+(av.color.mode=="r"?' checked="checked"':"")+'/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.r:"")+'" title="'+aa.tooltips.red.textbox+'"/></td></tr><tr class="Green"><td class="Radio"><label title="'+aa.tooltips.green.radio+'"><input type="radio" value="g"'+(av.color.mode=="g"?' checked="checked"':"")+'/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.g:"")+'" title="'+aa.tooltips.green.textbox+'"/></td></tr><tr class="Blue"><td class="Radio"><label title="'+aa.tooltips.blue.radio+'"><input type="radio" value="b"'+(av.color.mode=="b"?' checked="checked"':"")+'/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.b:"")+'" title="'+aa.tooltips.blue.textbox+'"/></td></tr><tr class="Alpha"><td class="Radio">'+(aG.alphaSupport?'<label title="'+aa.tooltips.alpha.radio+'"><input type="radio" value="a"'+(av.color.mode=="a"?' checked="checked"':"")+"/>A:</label>":" ")+'</td><td class="Text">'+(aG.alphaSupport?'<input type="text" maxlength="'+(3+aG.alphaPrecision)+'" value="'+(aJ!=null?Math.precision((aJ.a*100)/255,aG.alphaPrecision):"")+'" title="'+aa.tooltips.alpha.textbox+'"/> %':" ")+'</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="'+aa.tooltips.hex.textbox+'">#:<input type="text" maxlength="6" class="Hex" value="'+(aJ!=null?aJ.hex:"")+'"/></label>'+(aG.alphaSupport?'<input type="text" maxlength="2" class="AHex" value="'+(aJ!=null?aJ.ahex.substring(6):"")+'" title="'+aa.tooltips.hex.alpha+'"/></td>':" ")+"</tr></tbody></table>";if(aG.expandable){R.html(aK);if(e(document.body).children("div.jPicker.Container").length==0){e(document.body).prepend(R)}else{e(document.body).children("div.jPicker.Container:last").after(R)}R.mousedown(function(){e(document.body).children("div.jPicker.Container").css({zIndex:10});R.css({zIndex:20})});R.css({left:aG.position.x=="left"?(az.offset().left-530-(aG.position.y=="center"?25:0))+"px":aG.position.x=="center"?(az.offset().left-260)+"px":aG.position.x=="right"?(az.offset().left-10+(aG.position.y=="center"?25:0))+"px":aG.position.x=="screenCenter"?((e(document).width()>>1)-260)+"px":(az.offset().left+parseInt(aG.position.x))+"px",position:"absolute",top:aG.position.y=="top"?(az.offset().top-312)+"px":aG.position.y=="center"?(az.offset().top-156)+"px":aG.position.y=="bottom"?(az.offset().top+25)+"px":(az.offset().top+parseInt(aG.position.y))+"px"})}else{R=e(w);R.html(aK)}var aD=R.find("tbody:first");l=aD.find("div.Map:first");s=aD.find("div.Bar:first");var aL=l.find("span"),aI=s.find("span");au=aL.filter(".Map1:first");at=aL.filter(".Map2:first");ar=aL.filter(".Map3:first");P=aI.filter(".Map1:first");O=aI.filter(".Map2:first");N=aI.filter(".Map3:first");M=aI.filter(".Map4:first");L=aI.filter(".Map5:first");K=aI.filter(".Map6:first");D=new d(l,{map:{width:n.colorMap.width,height:n.colorMap.height},arrow:{image:n.clientPath+n.colorMap.arrow.file,width:n.colorMap.arrow.width,height:n.colorMap.arrow.height}});D.bind(z);U=new d(s,{map:{width:n.colorBar.width,height:n.colorBar.height},arrow:{image:n.clientPath+n.colorBar.arrow.file,width:n.colorBar.arrow.width,height:n.colorBar.arrow.height}});U.bind(ac);aw=new b(aD,G.active,aG.expandable&&aG.bindToInput?aG.input:null,aG.alphaPrecision);var aB=aJ!=null?aJ.hex:null,aH=aD.find(".Preview"),aF=aD.find(".Button");E=aH.find(".Active:first").css({backgroundColor:aB&&"#"+aB||"transparent"});an=aH.find(".Current:first").css({backgroundColor:aB&&"#"+aB||"transparent"}).bind("click",Z);Y.call(w,an,Math.precision(G.current.val("a")*100)/255,4);ah=aF.find(".Ok:first").bind("click",m);X=aF.find(".Cancel:first").bind("click",q);ab=aF.find(".Grid:first");setTimeout(function(){t.call(w,au,n.clientPath+"Maps.png");t.call(w,at,n.clientPath+"Maps.png");t.call(w,ar,n.clientPath+"map-opacity.png");t.call(w,P,n.clientPath+"Bars.png");t.call(w,O,n.clientPath+"Bars.png");t.call(w,N,n.clientPath+"Bars.png");t.call(w,M,n.clientPath+"Bars.png");t.call(w,L,n.clientPath+"bar-opacity.png");t.call(w,K,n.clientPath+"AlphaBar.png");t.call(w,aH.find("div:first"),n.clientPath+"preview-opacity.png")},0);aD.find("td.Radio input").bind("click",A);if(G.quickList&&G.quickList.length>0){var aE="";for(i=0;i<G.quickList.length;i++){if((typeof(G.quickList[i])).toString().toLowerCase()=="string"){G.quickList[i]=new f({hex:G.quickList[i]})}var aC=G.quickList[i].val("a");var aM=G.quickList[i].val("ahex");if(!aG.alphaSupport&&aM){aM=aM.substring(0,6)+"ff"}var aA=G.quickList[i].val("hex");aE+='<span class="QuickColor"'+(aM&&' title="#'+aM+'"'||"")+' style="background-color:'+(aA&&"#"+aA||"")+";"+(aA?"":"background-image:url("+n.clientPath+"NoColor.png)")+(aG.alphaSupport&&aC&&aC<255?";opacity:"+Math.precision(aC/255,4)+";filter:Alpha(opacity="+Math.precision(aC/2.55,4)+")":"")+'"> </span>'}t.call(w,ab,n.clientPath+"bar-opacity.png");ab.html(aE);ab.find(".QuickColor").click(F)}ag.call(w,av.color.mode);G.active.bind(aj);e.isFunction(ad)&&G.active.bind(ad);G.current.bind(ap);if(aG.expandable){w.icon=az.parents(".Icon:first");aq=w.icon.find(".Color:first").css({backgroundColor:aB&&"#"+aB||"transparent"});r=w.icon.find(".Alpha:first");t.call(w,r,n.clientPath+"bar-opacity.png");Y.call(w,r,Math.precision(((255-(aJ!=null?aJ.a:0))*100)/255,4));C=w.icon.find(".Image:first").css({backgroundImage:"url('"+n.clientPath+n.picker.file+"')"}).bind("click",af);if(aG.bindToInput&&aG.updateInputColor){aG.input.css({backgroundColor:aB&&"#"+aB||"transparent",color:aJ==null||aJ.v>75?"#000000":"#ffffff"})}u=aD.find(".Move:first").bind("mousedown",S);G.active.bind(H)}else{V.call(w)}},ak=function(){R.find("td.Radio input").unbind("click",A);an.unbind("click",Z);X.unbind("click",q);ah.unbind("click",m);if(av.window.expandable){C.unbind("click",af);u.unbind("mousedown",S);w.icon=null}R.find(".QuickColor").unbind("click",F);l=null;s=null;au=null;at=null;ar=null;P=null;O=null;N=null;M=null;L=null;K=null;D.destroy();D=null;U.destroy();U=null;aw.destroy();aw=null;E=null;an=null;ah=null;X=null;ab=null;ae=null;ax=null;ad=null;R.html("");for(i=0;i<c.length;i++){if(c[i]==w){c.splice(i,1)}}},n=av.images,aa=av.localization,G={active:(typeof(av.color.active)).toString().toLowerCase()=="string"?new f({ahex:!av.window.alphaSupport&&av.color.active?av.color.active.substring(0,6)+"ff":av.color.active}):new f({ahex:!av.window.alphaSupport&&av.color.active.val("ahex")?av.color.active.val("ahex").substring(0,6)+"ff":av.color.active.val("ahex")}),current:(typeof(av.color.active)).toString().toLowerCase()=="string"?new f({ahex:!av.window.alphaSupport&&av.color.active?av.color.active.substring(0,6)+"ff":av.color.active}):new f({ahex:!av.window.alphaSupport&&av.color.active.val("ahex")?av.color.active.val("ahex").substring(0,6)+"ff":av.color.active.val("ahex")}),quickList:av.color.quickList};e.extend(true,w,{commitCallback:ae,liveCallback:ad,cancelCallback:ax,color:G,show:V,hide:ao,destroy:ak});c.push(w);setTimeout(function(){o.call(w)},0)})};e.fn.jPicker.defaults={window:{title:null,effects:{type:"slide",speed:{show:"slow",hide:"fast"}},position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true,alphaSupport:false,alphaPrecision:0,updateInputColor:true},color:{mode:"h",active:new f({ahex:"#ffcc00ff"}),quickList:[new f({h:360,s:33,v:100}),new f({h:360,s:66,v:100}),new f({h:360,s:100,v:100}),new f({h:360,s:100,v:75}),new f({h:360,s:100,v:50}),new f({h:180,s:0,v:100}),new f({h:30,s:33,v:100}),new f({h:30,s:66,v:100}),new f({h:30,s:100,v:100}),new f({h:30,s:100,v:75}),new f({h:30,s:100,v:50}),new f({h:180,s:0,v:90}),new f({h:60,s:33,v:100}),new f({h:60,s:66,v:100}),new f({h:60,s:100,v:100}),new f({h:60,s:100,v:75}),new f({h:60,s:100,v:50}),new f({h:180,s:0,v:80}),new f({h:90,s:33,v:100}),new f({h:90,s:66,v:100}),new f({h:90,s:100,v:100}),new f({h:90,s:100,v:75}),new f({h:90,s:100,v:50}),new f({h:180,s:0,v:70}),new f({h:120,s:33,v:100}),new f({h:120,s:66,v:100}),new f({h:120,s:100,v:100}),new f({h:120,s:100,v:75}),new f({h:120,s:100,v:50}),new f({h:180,s:0,v:60}),new f({h:150,s:33,v:100}),new f({h:150,s:66,v:100}),new f({h:150,s:100,v:100}),new f({h:150,s:100,v:75}),new f({h:150,s:100,v:50}),new f({h:180,s:0,v:50}),new f({h:180,s:33,v:100}),new f({h:180,s:66,v:100}),new f({h:180,s:100,v:100}),new f({h:180,s:100,v:75}),new f({h:180,s:100,v:50}),new f({h:180,s:0,v:40}),new f({h:210,s:33,v:100}),new f({h:210,s:66,v:100}),new f({h:210,s:100,v:100}),new f({h:210,s:100,v:75}),new f({h:210,s:100,v:50}),new f({h:180,s:0,v:30}),new f({h:240,s:33,v:100}),new f({h:240,s:66,v:100}),new f({h:240,s:100,v:100}),new f({h:240,s:100,v:75}),new f({h:240,s:100,v:50}),new f({h:180,s:0,v:20}),new f({h:270,s:33,v:100}),new f({h:270,s:66,v:100}),new f({h:270,s:100,v:100}),new f({h:270,s:100,v:75}),new f({h:270,s:100,v:50}),new f({h:180,s:0,v:10}),new f({h:300,s:33,v:100}),new f({h:300,s:66,v:100}),new f({h:300,s:100,v:100}),new f({h:300,s:100,v:75}),new f({h:300,s:100,v:50}),new f({h:180,s:0,v:0}),new f({h:330,s:33,v:100}),new f({h:330,s:66,v:100}),new f({h:330,s:100,v:100}),new f({h:330,s:100,v:75}),new f({h:330,s:100,v:50}),new f()]},images:{clientPath:"/jPicker/images/",colorMap:{width:256,height:256,arrow:{file:"mappoint.gif",width:15,height:15}},colorBar:{width:20,height:256,arrow:{file:"rangearrows.gif",width:20,height:7}},picker:{file:"picker.gif",width:25,height:24}},localization:{text:{title:"Drag Markers To Pick A Color",newColor:"new",currentColor:"current",ok:"OK",cancel:"Cancel"},tooltips:{colors:{newColor:"New Color - Press “OK” To Commit",currentColor:"Click To Revert To Original Color"},buttons:{ok:"Commit To This Color Selection",cancel:"Cancel And Revert To Original Color"},hue:{radio:"Set To “Hue” Color Mode",textbox:"Enter A “Hue” Value (0-360°)"},saturation:{radio:"Set To “Saturation” Color Mode",textbox:"Enter A “Saturation” Value (0-100%)"},value:{radio:"Set To “Value” Color Mode",textbox:"Enter A “Value” Value (0-100%)"},red:{radio:"Set To “Red” Color Mode",textbox:"Enter A “Red” Value (0-255)"},green:{radio:"Set To “Green” Color Mode",textbox:"Enter A “Green” Value (0-255)"},blue:{radio:"Set To “Blue” Color Mode",textbox:"Enter A “Blue” Value (0-255)"},alpha:{radio:"Set To “Alpha” Color Mode",textbox:"Enter A “Alpha” Value (0-100)"},hex:{textbox:"Enter A “Hex” Color Value (#000000-#ffffff)",alpha:"Enter A “Alpha” Value (#00-#ff)"}}}}})(jQuery,"1.1.6"); \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/jquery-1.4.4.min.js b/htdocs/includes/jquery/plugins/jpicker/jquery-1.4.4.min.js new file mode 100755 index 0000000000000000000000000000000000000000..8f3ca2e2daf435edb66e57a0b8681aeda957c865 --- /dev/null +++ b/htdocs/includes/jquery/plugins/jpicker/jquery-1.4.4.min.js @@ -0,0 +1,167 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| +h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; +if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], +z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, +s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= +s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| +[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, +false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, +a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= +c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, +a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", +colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== +1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), +l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, +"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= +a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= +w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, +Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= +c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; +var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== +"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, +xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, +a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= +1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== +"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); +c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, +[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); +return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== +B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, +POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== +i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= +i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, +"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== +"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; +for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), +i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; +c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, +not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, +"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= +c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, +b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): +this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", +d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, +d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== +"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| +1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== +b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& +h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; +for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= +parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", +height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= +f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, +"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php index 20c7f697e976434d54bd95112d0b6cfead3ecedd..21b7e04ac37b621e47e159204e5ccbeca14ba59a 100644 --- a/htdocs/lib/agenda.lib.php +++ b/htdocs/lib/agenda.lib.php @@ -55,7 +55,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print '<input type="hidden" name="month" value="'.$month.'">'; print '<input type="hidden" name="day" value="'.$day.'">'; print '<input type="hidden" name="showbirthday" value="'.$showbirthday.'">'; - print '<table class="border" width="100%">'; + print '<table class="nobordernopadding" width="100%">'; if ($canedit || $conf->projet->enabled) { print '<tr><td nowrap="nowrap">'; diff --git a/htdocs/lib/lib_colorpicker.js b/htdocs/lib/lib_colorpicker.js deleted file mode 100644 index 1074068f1cfa0a69f19ef24453c897b517cf0af1..0000000000000000000000000000000000000000 --- a/htdocs/lib/lib_colorpicker.js +++ /dev/null @@ -1,264 +0,0 @@ -// \file htdocs/lib/lib_colorpicker.js -// \brief File with javascript function to output a color picker -// \version $Revision$ - -StringBuilder = function() -{ - this.arrStr = new Array(); - this.Append = function( inVAL ) - { - this.arrStr[this.arrStr.length] = inVAL; - } - this.toString = function() - { - return this.arrStr.join(''); - } - this.Init = function() - { - this.arrStr = null; - this.arrStr = new Array(); - } -} - -var objSB = new StringBuilder(); - -var arrGray = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); -var arrSafe = new Array('00','33','66','99','CC','FF'); -var arrSys = [['D4D0C8', 'ActiveBorder'],['0A246A', 'ActiveCaption'],['808080', 'AppWorkspace'],['3A6EA5', 'Background'],['D4D0C8', 'ButtonFace'],['FFFFFF', 'ButtonHighlight'],['808080', 'ButtonShadow'],['000000', 'ButtonText'],['FFFFFF', 'CaptionText'],['808080', 'GrayText'],['0A246A', 'Highlight'],['FFFFFF', 'HighlightText'],['D4D0C8', 'InactiveBorder'],['0A246A', 'InactiveCaption'],['D4D0C8', 'InactiveCaptionText'],['FFFFE1', 'InfoBackground'],['000000', 'InfoText'],['D4D0C8', 'Menu'],['000000', 'MenuText'],['D4D0C8', 'Scrollbar'],['404040', 'ThreedDarkShadow'],['D4D0C8', 'ThreedFace'],['FFFFFF', 'ThreedHighlight'],['D4D0C8', 'ThreedLightShadow'],['808080', 'ThreedShadow'],['FFFFFF', 'Window'],['000000', 'WindowFrame'],['000000', 'WindowText']]; -var arrName = [['FF0000', 'red'],['FFFF00', 'yellow'],['00FF00', 'lime'],['00FFFF', 'cyan'],['0000FF', 'blue'],['FF00FF', 'magenta'],['FFFFFF', 'white'],['F5F5F5', 'whitesmoke'],['DCDCDC', 'gainsboro'],['D3D3D3', 'lightgrey'],['C0C0C0', 'silver'],['A9A9A9', 'darkgray'],['808080', 'gray'],['696969', 'dimgray'],['000000', 'black'],['2F4F4F', 'darkslategray'],['708090', 'slategray'],['778899', 'lightslategray'],['4682B4', 'steelblue'],['4169E1', 'royalblue'],['6495ED', 'cornflowerblue'],['B0C4DE', 'lightsteelblue'],['7B68EE', 'mediumslateblue'],['6A5ACD', 'slateblue'],['483D8B', 'darkslateblue'],['191970', 'midnightblue'],['000080', 'navy'],['00008B', 'darkblue'],['0000CD', 'mediumblue'],['1E90FF', 'dodgerblue'],['00BFFF', 'deepskyblue'],['87CEFA', 'lightskyblue'],['87CEEB', 'skyblue'],['ADD8E6', 'lightblue'],['B0E0E6', 'powderblue'],['F0FFFF', 'azure'],['E0FFFF', 'lightcyan'],['AFEEEE', 'paleturquoise'],['48D1CC', 'mediumturquoise'],['20B2AA', 'lightseagreen'],['008B8B', 'darkcyan'],['008080', 'teal'],['5F9EA0', 'cadetblue'],['00CED1', 'darkturquoise'],['00FFFF', 'aqua'],['40E0D0', 'turquoise'],['7FFFD4', 'aquamarine'],['66CDAA', 'mediumaquamarine'],['8FBC8F', 'darkseagreen'],['3CB371', 'mediumseagreen'],['2E8B57', 'seagreen'],['006400', 'darkgreen'],['008000', 'green'],['228B22', 'forestgreen'],['32CD32', 'limegreen'],['00FF00', 'lime'],['7FFF00', 'chartreuse'],['7CFC00', 'lawngreen'],['ADFF2F', 'greenyellow'],['98FB98', 'palegreen'],['90EE90', 'lightgreen'],['00FF7F', 'springgreen'],['00FA9A', 'mediumspringgreen'],['556B2F', 'darkolivegreen'],['6B8E23', 'olivedrab'],['808000', 'olive'],['BDB76B', 'darkkhaki'],['B8860B', 'darkgoldenrod'],['DAA520', 'goldenrod'],['FFD700', 'gold'],['F0E68C', 'khaki'],['EEE8AA', 'palegoldenrod'],['FFEBCD', 'blanchedalmond'],['FFE4B5', 'moccasin'],['F5DEB3', 'wheat'],['FFDEAD', 'navajowhite'],['DEB887', 'burlywood'],['D2B48C', 'tan'],['BC8F8F', 'rosybrown'],['A0522D', 'sienna'],['8B4513', 'saddlebrown'],['D2691E', 'chocolate'],['CD853F', 'peru'],['F4A460', 'sandybrown'],['8B0000', 'darkred'],['800000', 'maroon'],['A52A2A', 'brown'],['B22222', 'firebrick'],['CD5C5C', 'indianred'],['F08080', 'lightcoral'],['FA8072', 'salmon'],['E9967A', 'darksalmon'],['FFA07A', 'lightsalmon'],['FF7F50', 'coral'],['FF6347', 'tomato'],['FF8C00', 'darkorange'],['FFA500', 'orange'],['FF4500', 'orangered'],['DC143C', 'crimson'],['FF0000', 'red'],['FF1493', 'deeppink'],['FF00FF', 'fuchsia'],['FF69B4', 'hotpink'],['FFB6C1', 'lightpink'],['FFC0CB', 'pink'],['DB7093', 'palevioletred'],['C71585', 'mediumvioletred'],['800080', 'purple'],['8B008B', 'darkmagenta'],['9370DB', 'mediumpurple'],['8A2BE2', 'blueviolet'],['4B0082', 'indigo'],['9400D3', 'darkviolet'],['9932CC', 'darkorchid'],['BA55D3', 'mediumorchid'],['DA70D6', 'orchid'],['EE82EE', 'violet'],['DDA0DD', 'plum'],['D8BFD8', 'thistle'],['E6E6FA', 'lavender'],['F8F8FF', 'ghostwhite'],['F0F8FF', 'aliceblue'],['F5FFFA', 'mintcream'],['F0FFF0', 'honeydew'],['FAFAD2', 'lightgoldenrodyellow'],['FFFACD', 'lemonchiffon'],['FFF8DC', 'cornsilk'],['FFFFE0', 'lightyellow'],['FFFFF0', 'ivory'],['FFFAF0', 'floralwhite'],['FAF0E6', 'linen'],['FDF5E6', 'oldlace'],['FAEBD7', 'antiquewhite'],['FFE4C4', 'bisque'],['FFDAB9', 'peachpuff'],['FFEFD5', 'papayawhip'],['FFF5EE', 'seashell'],['FFF0F5', 'lavenderblush'],['FFE4E1', 'mistyrose'],['FFFAFA', 'snow']]; - -var intTdDisp = intTblDisp = 0; -var i = j = k = 0; -var objCurrent = objGray = objSafe = objSys = objName = objLegend = objPreview = objSelected = objPreviewTxt = objSelectedTxt = objGlobal = null; -var strColor = '', strColorTxt = '', strCurrent = ''; - -fctTblFeed = function() -{ - if (intTdDisp != 16) { - for (i = intTdDisp; i < 16; i++) { - objSB.Append('<td class="tdColor"><a class="none" href="#"> </a></td>'); - intTblDisp++; - } - } - if (intTblDisp != 256) { - for (i = intTblDisp; i < 256; i++) { - if (i % 16 == 0) {objSB.Append('</tr><tr>');} - objSB.Append('<td class="tdColor"><a class="none" href="#"> </a></td>'); - } - } -} - -fctIsInSys = function(strColor) -{ - var strOut = ''; - for (ii = 0; ii < arrSys.length; ii++) { - if (arrSys[ii][0] == strColor) {strOut = arrSys[ii][1]; break;} - } - return strOut; -} - -fctIsInName = function(strColor) -{ - var strOut = ''; - for (ii = 0; ii < arrName.length; ii++) { - if (arrName[ii][0] == strColor) {strOut = arrName[ii][1]; break;} - } - return strOut; -} - -fctOver = function(strColor, strTxt) -{ - objPreview.style.backgroundColor = strColor; - objPreviewTxt.innerHTML = strColor + '<br>' + strTxt; -} - -fctOut = function() -{ - objPreview.style.backgroundColor = ''; - objPreviewTxt.innerHTML = ''; -} - -fctSetColor = function(strColor, strTxt) -{ - strCurrent = strColor; - objSelected.style.backgroundColor = strColor; - objSelectedTxt.innerHTML = strColor + '<br>' + strTxt; -} - -fctSelect = function(strArr, strTxt) -{ - objLegend.innerHTML = ' ' + strTxt + ' '; - objGray.style.display = (strArr == 'Gray') ? 'block' : 'none'; - objSafe.style.display = (strArr == 'Safe') ? 'block' : 'none'; - objSys.style.display = (strArr == 'Sys') ? 'block' : 'none'; - objName.style.display = (strArr == 'Name') ? 'block' : 'none'; -} - -fctHide = function() -{ - fctReset(); - objGlobal.style.display = 'none'; - objCurrent = null; -} - -fctReset = function() -{ - objSelected.style.backgroundColor = ''; - objSelectedTxt.innerHTML = ''; - strCurrent = ''; -} - -fctOk = function() -{ - objCurrent.value = strCurrent.toUpperCase(); - fctHide(); -} - -fctShow = function(objForm) -{ - if (objForm) { - objCurrent = objForm; - if (objForm.value + '' != '') { - strColor = objForm.value.replace('#', ''); - strColorTxt = '' + fctIsInName(strColor); - if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} - fctSetColor('#' + strColor, strColorTxt) - } else { - fctReset(); - } - fctSelect('Safe', 'Safety'); - } - if (objCurrent) { - var w = h = t = l = 0; - if (self.innerHeight) { - w = self.innerWidth; - h = self.innerHeight; - } else if (document.documentElement && document.documentElement.clientHeight) { - w = document.documentElement.clientWidth; - h = document.documentElement.clientHeight; - } else if (document.body) { - w = document.body.clientWidth; - h = document.body.clientHeight; - } - if (self.pageYOffset) { - l = self.pageXOffset; - t = self.pageYOffset; - } else if (document.documentElement && document.documentElement.scrollTop) { - l = document.documentElement.scrollLeft; - t = document.documentElement.scrollTop; - } else if (document.body) { - l = document.body.scrollLeft; - t = document.body.scrollTop; - } - if (objGlobal.style.display != 'block') {objGlobal.style.display = 'block';} - objGlobal.style.top = parseInt(((h - objGlobal.offsetHeight) / 2) + t, 10) + 'px'; - objGlobal.style.left = parseInt(((w - objGlobal.offsetWidth) / 2) + l, 10) + 'px'; - } -} - -fctLoad = function() -{ - var objDiv = document.createElement('DIV'); - objDiv.id = 'objCP'; - objDiv.style.display = 'inline'; - document.body.appendChild(objDiv); - objDiv.innerHTML = objSB.toString(); - objPreview = document.getElementById('objPreview'); - objSelected = document.getElementById('objSelected'); - objPreviewTxt = document.getElementById('objPreviewTxt'); - objSelectedTxt = document.getElementById('objSelectedTxt'); - objGlobal = document.getElementById('tblGlobal'); - objGray = document.getElementById('tblGray'); - objSafe = document.getElementById('tblSafe'); - objSys = document.getElementById('tblSys'); - objName = document.getElementById('tblName'); - objLegend = document.getElementById('objLegend'); - fctSelect('Name', 'Named'); -} - -objSB.Append('<table id="tblGlobal" class="tblGlobal" border="0" cellpadding="0" cellspacing="0"><tr><td class="tdContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'); -//objSB.Append('<td width="24%" align="center"><input type="button" value="Named" class="btnPalette" onClick="fctSelect(\'Name\', \'Named\');"></td>'); -objSB.Append('<td width="33%" align="center"><input type="button" value="Safety" class="btnPalette" onClick="fctSelect(\'Safe\', \'Safety\');"></td>'); -objSB.Append('<td width="34%" align="center"><input type="button" value="System" class="btnPalette" onClick="fctSelect(\'Sys\', \'System\');"></td>'); -objSB.Append('<td width="33%" align="center"><input type="button" value="Grayscale" class="btnPalette" onClick="fctSelect(\'Gray\', \'Grayscale\');"></td>'); -objSB.Append('</tr></table></td></tr><tr><td class="tdContainer"><fieldset><legend align="top" id="objLegend"></legend><table id="tblContainer" class="tblContainer" border="0" cellpadding="0" cellspacing="0"><tr><td class="tdContainer">'); - -objSB.Append('<table id="tblGray" class="tblColor" border="0" cellpadding="0" cellspacing="0"><tr>'); -for (i = 0; i < arrGray.length; i++) { - for (j = 0; j < arrGray.length; j++) { - strColor = '' + arrGray[i] + arrGray[j] + arrGray[i] + arrGray[j] + arrGray[i] + arrGray[j]; - strColorTxt = '' + fctIsInName(strColor); - if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} - objSB.Append('<td class="tdColor"><a class="color" href="javascript:fctSetColor(\'#' + strColor + '\', \'' + strColorTxt + '\');" style="background-color:#' + strColor + ';" onMouseOver="fctOver(\'#' + strColor + '\', \'' + strColorTxt + '\');" onMouseOut="fctOut();"> </a></td>'); - intTdDisp++; - intTblDisp++; - } - if (i < arrGray.length - 1) { - objSB.Append('</tr><tr>'); - intTdDisp = 0; - } -} -fctTblFeed(); -objSB.Append('</tr></table>'); -intTdDisp = intTblDisp = 0; - -objSB.Append('<table id="tblSafe" class="tblColor" border="0" cellpadding="0" cellspacing="0"><tr>'); -for (i = 0; i < arrSafe.length; i++) { - for (j = 0; j < arrSafe.length; j++) { - for (k = 0; k < arrSafe.length; k++) { - if (intTblDisp % 16 == 0 && intTdDisp != 0) { - objSB.Append('</tr><tr>'); - intTdDisp = 0; - } - strColor = '' + arrSafe[i] + arrSafe[j] + arrSafe[k]; - strColorTxt = '' + fctIsInName(strColor); - if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} - objSB.Append('<td class="tdColor"><a class="color" href="javascript:fctSetColor(\'#' + strColor + '\', \'' + strColorTxt + '\');" style="background-color:#' + strColor + ';" onMouseOver="fctOver(\'#' + strColor + '\', \'' + strColorTxt + '\');" onMouseOut="fctOut();"> </a></td>'); - intTdDisp++; - intTblDisp++; - } - } -} -fctTblFeed(); -objSB.Append('</tr></table>'); -intTdDisp = intTblDisp = 0; - -objSB.Append('<table id="tblSys" class="tblColor" border="0" cellpadding="0" cellspacing="0"><tr>'); -for (i = 0; i < arrSys.length; i++) { - if (intTblDisp % 16 == 0 && intTdDisp != 0) { - objSB.Append('</tr><tr>'); - intTdDisp = 0; - } - strColor = '' + arrSys[i][0]; - strColorTxt = '' + arrSys[i][1]; - objSB.Append('<td class="tdColor"><a class="color" href="javascript:fctSetColor(\'#' + strColor + '\', \'' + strColorTxt + '\');" style="background-color:#' + strColor + ';" onMouseOver="fctOver(\'#' + strColor + '\', \'' + strColorTxt + '\');" onMouseOut="fctOut();"> </a></td>'); - intTdDisp++; - intTblDisp++; -} -fctTblFeed(); -objSB.Append('</tr></table>'); -intTdDisp = intTblDisp = 0; - -objSB.Append('<table id="tblName" class="tblColor" border="0" cellpadding="0" cellspacing="0"><tr>'); -for (i = 0; i < arrName.length; i++) { - if (intTblDisp % 16 == 0 && intTdDisp != 0) { - objSB.Append('</tr><tr>'); - intTdDisp = 0; - } - strColor = '' + arrName[i][0]; - strColorTxt = '' + arrName[i][1]; - objSB.Append('<td class="tdColor"><a class="color" href="javascript:fctSetColor(\'#' + strColor + '\', \'' + strColorTxt + '\');" style="background-color:#' + strColor + ';" onMouseOver="fctOver(\'#' + strColor + '\', \'' + strColorTxt + '\');" onMouseOut="fctOut();"> </a></td>'); - intTdDisp++; - intTblDisp++; -} -fctTblFeed(); -objSB.Append('</tr></table></td></tr></table></fieldset></td></tr><tr><td class="tdContainer">'); -objSB.Append('<table border="0" cellpadding="0" cellspacing="0" width="100%">'); -objSB.Append('<tr><td class="tdDisplay" id="objPreview"> </td><td class="tdDisplay" id="objSelected"> </td></tr>'); -objSB.Append('<tr><td class="tdDisplayTxt" id="objPreviewTxt" valign="top"> </td><td class="tdDisplayTxt" id="objSelectedTxt" valign="top"> </td></tr>'); -objSB.Append('</table></td></tr><tr><td class="tdContainer">'); -objSB.Append('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'); -objSB.Append('<td width="50%" align="center"><input type="button" value="Cancel" class="btnColor" onClick="fctHide();"></td>'); -//objSB.Append('<td width="34%" align="center"><input type="button" value="Reset" class="btnColor" onClick="fctReset();"></td>'); -objSB.Append('<td width="50%" align="center"><input type="button" value="Ok" class="btnColor" onClick="fctOk();"></td>'); -objSB.Append('</tr></table></td></tr></table>'); \ No newline at end of file