/* -------------------------------------------------------------------
	file Information
	
	File name:      				shared.js
	Created:   					    2011
	Last update:				    2011-07-07
	by Author script Info:	共有javascript
	
	Author:									OSM by image graff
	Author URI: 						http://osm.main.jp/work

------------------------------------------------------------------- */
/* -----------------------------------------------------------
Table of Contents

* on load				site-id
								nav
								smooth scroll
										
* function			preLoad
								changeColor

* plugin body		[jquery.easing.1.3.js]
								[jquery.icolor.js(min)]
----------------------------------------------------------- */

/* -------------------------------------------------------------------
	IE判別
------------------------------------------------------------------- */
var ie = (function(){
    var undef, v = 3, div = document.createElement('div');
    while (
        div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->',
        div.getElementsByTagName('i')[0]
    );
    return v> 4 ? v : undef;
}());

/* -------------------------------------------------------------------
	on load
------------------------------------------------------------------- */
$(function(){

	//header--------------------------------------------------------------
	//site-id ----------------------------------------
	if (ie <= 7) {
		$(id).click(function() { location.href = "../index.html"; });
	}
	$(id).append('<span class="on"></span>');
	$(id).parent().append('<span class="'+arrow+'"></span>');
	$(id).hover(function() {
		$('span.'+arrow,$(this).parent()).stop().animate({ top: afterNavY },{duration: 400,easing:"easeOutElastic"});
		$(this).children('span.caption').stop(true,true).fadeIn('fast');
		$(this).children('span.on').stop(true,true).fadeIn('slow');
	},function() {
		$('span.'+arrow,$(this).parent()).stop().animate({ top: originNavY },{duration: 400,easing:"easeInOutExpo"});
		$(this).children('span.caption').stop(true,true).fadeOut('fast');
		$(this).children('span.on').stop(true,true).fadeOut('fast');
   });
	
	//nav --------------------------------------------
	$(nav).append('<span class="'+arrow+'"></span>');
	$(nav+' a').hover(function() {
		$('span.'+arrow,$(this).parent()).stop().animate({ top: afterY },{duration: 400,easing:"easeOutElastic"});
		$(this).children().stop(true,true).fadeIn('fast');
	},function() {
		$('span.'+arrow,$(this).parent()).stop().animate({ top: originY },{duration: 400,easing:"easeInOutExpo"});
		$(this).children().stop(true,true).fadeOut('fast');
	});
	
	//smooth scroll--------------------------------------------------------
	$('a[href*=#p-]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				jQuery('html,body').animate({ scrollTop: targetOffset },{duration: 1500,easing:"easeOutExpo"});
				return false;
			}
		}
	});
	
});

/* ---------------------------------
	target element setting
------------------------------------ */
//header--------------------------------------------------------------
//site-id ------------------------------------------
var arrow ='arrow';//下から出てくる三角矢印のclass名
var id = 'div#header p#site-id > a';
var originNavY = '100px';
var afterNavY = '87px';
//nav ----------------------------------------------
var nav = 'div#header ol li';
var originY = '59px';
var afterY = '46px';

/* -------------------------------------------------------------------
	function
------------------------------------------------------------------- */
(function() {
	
	//preLoad-----------------------------------------------------------------
	preLoad=function(){
  var d=document; if(d.images){ if(!d.preL) d.preL=new Array();
    var i,j=d.preL.length,a=preLoad.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.preL[j]=new Image; d.preL[j++].src=a[i];}}
	}

	//changeColor (use jQuery plugin [jquery.icolor.js])-----------------------
	changeColor=function(a,b,c,d){
		a.live("mouseover", function(){
			if(ie <= 7){
				$(this).css('backgroundColor',b);
			}									
			$(this).stop().animate({ backgroundColor: c}, 500);
		});
		a.live("mouseout", function(){
			if(ie <= 7){
				$(this).css('backgroundColor',c);
			}
			$(this).stop().animate({ backgroundColor: b }, 500);
		});
	};
	
})();


/* -------------------------------------------------------------------
	jquery.easing.1.3.js
------------------------------------------------------------------- */
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright c 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright c 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
 
 /* -------------------------------------------------------------------
	jquery.icolor.js(min)
------------------------------------------------------------------- */
/**
 * jQuery.iColor - jQuery Plugin
 *
 * Under The MIT License
 * Copyright (c) 2010 Iwasaki. (http://d.hatena.ne.jp/ja9/)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Version: 1.0 beta
 * Revision: $Rev$
 * Date: $Date$
 */
(function(d){var c={black:{r:0,g:0,b:0,type:"RGB"},navy:{r:0,g:0,b:128,type:"RGB"},darkblue:{r:0,g:0,b:139,type:"RGB"},mediumblue:{r:0,g:0,b:205,type:"RGB"},blue:{r:0,g:0,b:255,type:"RGB"},darkgreen:{r:0,g:100,b:0,type:"RGB"},green:{r:0,g:128,b:0,type:"RGB"},teal:{r:0,g:128,b:128,type:"RGB"},darkcyan:{r:0,g:139,b:139,type:"RGB"},deepskyblue:{r:0,g:191,b:255,type:"RGB"},darkturquoise:{r:0,g:206,b:209,type:"RGB"},mediumspringgreen:{r:0,g:250,b:154,type:"RGB"},lime:{r:0,g:255,b:0,type:"RGB"},springgreen:{r:0,g:255,b:127,type:"RGB"},"aqua, cyan":{r:0,g:255,b:255,type:"RGB"},midnightblue:{r:25,g:25,b:112,type:"RGB"},dodgerblue:{r:30,g:144,b:255,type:"RGB"},lightseagreen:{r:32,g:178,b:170,type:"RGB"},forestgreen:{r:34,g:139,b:34,type:"RGB"},seagreen:{r:46,g:139,b:87,type:"RGB"},darkslategray:{r:47,g:79,b:79,type:"RGB"},darkslategrey:{r:47,g:79,b:79,type:"RGB"},limegreen:{r:50,g:205,b:50,type:"RGB"},mediumseagreen:{r:60,g:179,b:113,type:"RGB"},turquoise:{r:64,g:224,b:208,type:"RGB"},royalblue:{r:65,g:105,b:225,type:"RGB"},steelblue:{r:70,g:130,b:180,type:"RGB"},darkslateblue:{r:72,g:61,b:139,type:"RGB"},mediumturquoise:{r:72,g:209,b:204,type:"RGB"},indigo:{r:75,g:0,b:130,type:"RGB"},darkolivegreen:{r:85,g:107,b:47,type:"RGB"},cadetblue:{r:95,g:158,b:160,type:"RGB"},cornflowerblue:{r:100,g:149,b:237,type:"RGB"},mediumaquamarine:{r:102,g:205,b:170,type:"RGB"},dimgray:{r:105,g:105,b:105,type:"RGB"},dimgrey:{r:105,g:105,b:105,type:"RGB"},slateblue:{r:106,g:90,b:205,type:"RGB"},olivedrab:{r:107,g:142,b:35,type:"RGB"},slategray:{r:112,g:128,b:144,type:"RGB"},slategrey:{r:112,g:128,b:144,type:"RGB"},lightslategray:{r:119,g:136,b:153,type:"RGB"},lightslategrey:{r:119,g:136,b:153,type:"RGB"},mediumslateblue:{r:123,g:104,b:238,type:"RGB"},lawngreen:{r:124,g:252,b:0,type:"RGB"},chartreuse:{r:127,g:255,b:0,type:"RGB"},aquamarine:{r:127,g:255,b:212,type:"RGB"},maroon:{r:128,g:0,b:0,type:"RGB"},purple:{r:128,g:0,b:128,type:"RGB"},olive:{r:128,g:128,b:0,type:"RGB"},gray:{r:128,g:128,b:128,type:"RGB"},grey:{r:128,g:128,b:128,type:"RGB"},skyblue:{r:135,g:206,b:235,type:"RGB"},lightskyblue:{r:135,g:206,b:250,type:"RGB"},blueviolet:{r:138,g:43,b:226,type:"RGB"},darkred:{r:139,g:0,b:0,type:"RGB"},darkmagenta:{r:139,g:0,b:139,type:"RGB"},saddlebrown:{r:139,g:69,b:19,type:"RGB"},darkseagreen:{r:143,g:188,b:143,type:"RGB"},lightgreen:{r:144,g:238,b:144,type:"RGB"},mediumpurple:{r:147,g:112,b:219,type:"RGB"},darkviolet:{r:148,g:0,b:211,type:"RGB"},palegreen:{r:152,g:251,b:152,type:"RGB"},darkorchid:{r:153,g:50,b:204,type:"RGB"},yellowgreen:{r:154,g:205,b:50,type:"RGB"},sienna:{r:160,g:82,b:45,type:"RGB"},brown:{r:165,g:42,b:42,type:"RGB"},darkgray:{r:169,g:169,b:169,type:"RGB"},darkgrey:{r:169,g:169,b:169,type:"RGB"},lightblue:{r:173,g:216,b:230,type:"RGB"},greenyellow:{r:173,g:255,b:47,type:"RGB"},paleturquoise:{r:175,g:238,b:238,type:"RGB"},lightsteelblue:{r:176,g:196,b:222,type:"RGB"},powderblue:{r:176,g:224,b:230,type:"RGB"},firebrick:{r:178,g:34,b:34,type:"RGB"},darkgoldenrod:{r:184,g:134,b:11,type:"RGB"},mediumorchid:{r:186,g:85,b:211,type:"RGB"},rosybrown:{r:188,g:143,b:143,type:"RGB"},darkkhaki:{r:189,g:183,b:107,type:"RGB"},silver:{r:192,g:192,b:192,type:"RGB"},mediumvioletred:{r:199,g:21,b:133,type:"RGB"},indianred:{r:205,g:92,b:92,type:"RGB"},peru:{r:205,g:133,b:63,type:"RGB"},chocolate:{r:210,g:105,b:30,type:"RGB"},tan:{r:210,g:180,b:140,type:"RGB"},lightgray:{r:211,g:211,b:211,type:"RGB"},lightgrey:{r:211,g:211,b:211,type:"RGB"},thistle:{r:216,g:191,b:216,type:"RGB"},orchid:{r:218,g:112,b:214,type:"RGB"},goldenrod:{r:218,g:165,b:32,type:"RGB"},palevioletred:{r:219,g:112,b:147,type:"RGB"},crimson:{r:220,g:20,b:60,type:"RGB"},gainsboro:{r:220,g:220,b:220,type:"RGB"},plum:{r:221,g:160,b:221,type:"RGB"},burlywood:{r:222,g:184,b:135,type:"RGB"},lightcyan:{r:224,g:255,b:255,type:"RGB"},lavender:{r:230,g:230,b:250,type:"RGB"},darksalmon:{r:233,g:150,b:122,type:"RGB"},violet:{r:238,g:130,b:238,type:"RGB"},palegoldenrod:{r:238,g:232,b:170,type:"RGB"},lightcoral:{r:240,g:128,b:128,type:"RGB"},khaki:{r:240,g:230,b:140,type:"RGB"},aliceblue:{r:240,g:248,b:255,type:"RGB"},honeydew:{r:240,g:255,b:240,type:"RGB"},azure:{r:240,g:255,b:255,type:"RGB"},sandybrown:{r:244,g:164,b:96,type:"RGB"},wheat:{r:245,g:222,b:179,type:"RGB"},beige:{r:245,g:245,b:220,type:"RGB"},whitesmoke:{r:245,g:245,b:245,type:"RGB"},mintcream:{r:245,g:255,b:250,type:"RGB"},ghostwhite:{r:248,g:248,b:255,type:"RGB"},salmon:{r:250,g:128,b:114,type:"RGB"},antiquewhite:{r:250,g:235,b:215,type:"RGB"},linen:{r:250,g:240,b:230,type:"RGB"},lightgoldenrodyellow:{r:250,g:250,b:210,type:"RGB"},oldlace:{r:253,g:245,b:230,type:"RGB"},red:{r:255,g:0,b:0,type:"RGB"},fuchsia:{r:255,g:0,b:255,type:"RGB"},magenta:{r:255,g:0,b:255,type:"RGB"},deeppink:{r:255,g:20,b:147,type:"RGB"},orangered:{r:255,g:69,b:0,type:"RGB"},tomato:{r:255,g:99,b:71,type:"RGB"},hotpink:{r:255,g:105,b:180,type:"RGB"},coral:{r:255,g:127,b:80,type:"RGB"},darkorange:{r:255,g:140,b:0,type:"RGB"},lightsalmon:{r:255,g:160,b:122,type:"RGB"},orange:{r:255,g:165,b:0,type:"RGB"},lightpink:{r:255,g:182,b:193,type:"RGB"},pink:{r:255,g:192,b:203,type:"RGB"},gold:{r:255,g:215,b:0,type:"RGB"},peachpuff:{r:255,g:218,b:185,type:"RGB"},navajowhite:{r:255,g:222,b:173,type:"RGB"},moccasin:{r:255,g:228,b:181,type:"RGB"},bisque:{r:255,g:228,b:196,type:"RGB"},mistyrose:{r:255,g:228,b:225,type:"RGB"},blanchedalmond:{r:255,g:235,b:205,type:"RGB"},papayawhip:{r:255,g:239,b:213,type:"RGB"},lavenderblush:{r:255,g:240,b:245,type:"RGB"},seashell:{r:255,g:245,b:238,type:"RGB"},cornsilk:{r:255,g:248,b:220,type:"RGB"},lemonchiffon:{r:255,g:250,b:205,type:"RGB"},floralwhite:{r:255,g:250,b:240,type:"RGB"},snow:{r:255,g:250,b:250,type:"RGB"},yellow:{r:255,g:255,b:0,type:"RGB"},lightyellow:{r:255,g:255,b:224,type:"RGB"},ivory:{r:255,g:255,b:240,type:"RGB"},white:{r:255,g:255,b:255,type:"RGB"}},b=function(g,f,j,i,h){return new b.fn.init(g,f,j,i,h)},a={RGBtoHSV:function(e,j,k,m){var i,o,n;e=e/255;j=j/255;k=k/255;var l=Math.max(Math.max(e,j),k),f=Math.min(Math.min(e,j),k);if(l==f){i=0}else{if(l==e){i=60*(j-k)/(l-f)+0}else{if(l==j){i=(60*(k-e)/(l-f))+120}else{i=(60*(e-j)/(l-f))+240}}}while(i<0){i+=360}o=(l==0)?0:(l-f)/l;n=l;return(typeof(m)=="undefined")?b({h:i,s:o,v:n,type:"HSV"}):b({h:i,s:o,v:n,a:m,type:"HSVA"})},HSVtoRGB:function(m,z,x,w){var e,n,u;while(m<0){m+=360}m=m%360;if(z==0){x=x*255;return(typeof(w)=="undefined")?b({r:x,g:x,b:x,type:"RGB"}):b({r:x,g:x,b:x,a:w,type:"RGBA"})}var l=Math.floor(m/60)%6,o=(m/60)-l,k=x*(1-z),j=x*(1-o*z),y=x*(1-(1-o)*z);switch(l){case 0:e=x;n=y;u=k;break;case 1:e=j;n=x;u=k;break;case 2:e=k;n=x;u=y;break;case 3:e=k;n=j;u=x;break;case 4:e=y;n=k;u=x;break;case 5:e=x;n=k;u=j;break}return(typeof(w)=="undefined")?b({r:e*255,g:n*255,b:u*255,type:"RGB"}):b({r:e*255,g:n*255,b:u*255,a:w,type:"RGBA"})},RGBtoHLS:function(e,k,m,o){var j,f,p;e=e/255;k=k/255;m=m/255;var n=Math.max(Math.max(e,k),m),i=Math.min(Math.min(e,k),m);if(n==i){j=0}else{if(n==e){j=60*(k-m)/(n-i)+0}else{if(n==k){j=(60*(m-e)/(n-i))+120}else{j=(60*(e-k)/(n-i))+240}}}while(j<0){j+=360}f=(n+i)/2;if(n==i){p=0}else{p=(f<0.5)?(n-i)/(n+i):(n-i)/(2-n-i)}return(typeof(o)=="undefined")?b({h:j,l:f,s:p,type:"HLS"}):b({h:j,l:f,s:p,a:o,type:"HLSA"})},HLStoRGB:function(j,f,q,n){var e,k,m;while(j<0){j+=360}j=j%360;if(q==0){f=f*255;return(typeof(n)=="undefined")?b({r:f,g:f,b:f,type:"RGB"}):b({r:f,g:f,b:f,a:n,type:"RGBA"})}var o=(f<0.5)?f*(1+q):f+q-f*q,p=f*2-o,i;i=j+120;if(i>360){i=i-360}if(i<60){e=(p+(o-p)*i/60)}else{if(i<180){e=o}else{if(i<240){e=p+(o-p)*(240-i)/60}else{e=p}}}i=j;if(i<60){k=p+(o-p)*i/60}else{if(i<180){k=o}else{if(i<240){k=p+(o-p)*(240-i)/60}else{k=p}}}i=j-120;if(i<0){i=i+360}if(i<60){m=p+(o-p)*i/60}else{if(i<180){m=o}else{if(i<240){m=p+(o-p)*(240-i)/60}else{m=p}}}return(typeof(n)=="undefined")?b({r:e*255,g:k*255,b:m*255,type:"RGB"}):b({r:e*255,g:k*255,b:m*255,a:n,type:"RGBA"})},range:function(i,f,e,g){i=i||"";f=f||255;if(typeof i!="number"){i=i.replace(/\s/g,"");if(!isNaN(i)){i=Number(i)}else{if(i.charAt(i.length-1)=="%"&&!isNaN(i.substr(0,i.length-1))){var h=Number(i.substr(0,i.length-1))/100;i=f*h}else{i=0}}}if(g){i=Math.round(i)}if(e){while(i<0){i=i+f}i=i%f}if(i<0){return 0}else{if(i>f){return f}}return i}};b.fn=b.prototype=d.extend(b.prototype,{init:function(p,o,n,l,k){var j;if(f(p)&&f(o)&&f(n)){j=[p,o,n];if(f(l)){j.push(l);this.type=m(k,true)}else{this.type=m(l)}}else{if(Object.prototype.toString.call(p)=="[object Array]"){j=p;this.type=m(o,(p.length>=4))}else{if(Object.prototype.toString.call(p)=="[object Object]"){this.type=m(p.type||o);j=[p[this.type.charAt(0).toLowerCase()],p[this.type.charAt(1).toLowerCase()],p[this.type.charAt(2).toLowerCase()]];if(this.type.length>=4||typeof(p.a)!="undefined"){j.push(p.a)}}else{p=p.replace(/\s/g,"").toLowerCase();if(p.charAt(0)=="#"&&!p.substr(1).match(/[^0-9a-f]/)){p=p.substr(1);this.type=m("RGB");switch(p.length){case 3:p=p.charAt(0)+p.charAt(0)+p.charAt(1)+p.charAt(1)+p.charAt(2)+p.charAt(2);case 6:j=[parseInt(p.substr(0,2),16),parseInt(p.substr(2,2),16),parseInt(p.substr(4,2),16)];break}}else{if(!!p.match(/^(rgb|hsl)a?\([0-9.]+%?,[0-9.]+%?,[0-9.]+%?(,[0-9.]+%?)?\)/)){var g=p.indexOf("(");this.type=m(p.substr(0,g));j=p.substr(g+1,p.indexOf(")")-g-1).split(",")}else{if(Object.prototype.toString.call(c[p])=="[object Object]"){return b(c[p])}else{this.type=m("RGB")}}}}}}for(var h=0;h<this.type.length;h++){var g=j[h];switch(this.type[h]){case"R":case"G":case"B":g=a.range(g,255);break;case"H":g=a.range(g,360,true);break;case"L":case"S":case"V":case"A":g=a.range(g,1);break}this[this.type.charAt(h).toLowerCase()]=g}return this;function f(e){if(typeof e=="number"){return true}if(typeof e!="string"){return false}e=e.replace(/\s/g,"");if(e==""){return false}if(!isNaN(e)){return true}return(e.charAt(e.length-1)=="%"&&!isNaN(e.substr(0,e.length-1)))}function m(i,e){i=i||"";switch(i.toUpperCase()){case"HLS":case"HSL":case"HSV":case"RGB":case"HLSA":case"HSLA":case"HSVA":case"RGBA":return i.toUpperCase();break;default:return(e)?"RGBA":"RGB";break}}},getStr:function(j){var h,e=[];var f=(window.navigator.userAgent.toLowerCase().indexOf("msie")>=0);j=(j||"#xxx").toLowerCase();switch(j.substr(0,3)){case"rgb":h=this.toRGB();if(j.indexOf("%")>0){e.push(a.range((h.r/255)*100,100,false,true)+"%");e.push(a.range((h.g/255)*100,100,false,true)+"%");e.push(a.range((h.b/255)*100,100,false,true)+"%")}else{e.push(a.range(h.r,255,false,true));e.push(a.range(h.g,255,false,true));e.push(a.range(h.b,255,false,true))}if(!f&&(typeof h.a=="number"||(typeof h.a=="string"&&h.a!=""))){e.push(a.range(h.a,1));return"rgba("+e.join(", ")+")"}return"rgb("+e.join(", ")+")";break;case"hsl":h=this.toHSL();e.push(a.range(h.h,360,true,true));e.push(a.range(h.s*100,100,false,true)+"%");e.push(a.range(h.l*100,100,false,true)+"%");if(typeof h.a=="number"||(typeof h.a=="string"&&h.a!="")){e.push(a.range(h.a,1));return"hsla("+e.join(", ")+")"}return"hsl("+e.join(", ")+")";break;case"#":case"#xx":default:var k="";h=this.toRGB();e.push(a.range(h.r,255,false,true).toString(16));e.push(a.range(h.g,255,false,true).toString(16));e.push(a.range(h.b,255,false,true).toString(16));for(var g=0;g<e.length;g++){k+=(e[g].length==1)?"0"+e[g]:e[g]}if(j.length<=4&&k.charAt(0)==k.charAt(1)&&k.charAt(2)==k.charAt(3)&&k.charAt(4)==k.charAt(5)){k=k.charAt(0)+k.charAt(2)+k.charAt(4)}return"#"+k;break}},to:function(f){var g=this.type.toUpperCase().substr(0,3);f=f.toUpperCase().substr(0,3);if(g==f){return b(this)}switch(f){case"RGB":if(g=="HSV"){return a.HSVtoRGB(this.h,this.s,this.v,this.a)}else{if(g=="HLS"||g=="HSL"){return a.HLStoRGB(this.h,this.l,this.s,this.a)}}break;case"HSV":return a.RGBtoHSV(this.toRGB().r,this.toRGB().g,this.toRGB().b,this.toRGB().a);break;case"HLS":case"HSL":var e=a.RGBtoHLS(this.toRGB().r,this.toRGB().g,this.toRGB().b,this.toRGB().a);if(f=="HLS"){return e}return(typeof(e.a)=="undefined")?b({h:e.h,s:e.s,l:e.l,type:"HSL"}):b({h:e.h,s:e.s,l:e.l,a:e.a,type:"HSLA"});break}return this},toRGB:function(){return this.to("RGB")},toRGBA:function(){return this.to("RGB")},toHSV:function(){return this.to("HSV")},toHSVA:function(){return this.to("HSV")},toHSL:function(){return this.to("HSL")},toHSLA:function(){return this.to("HSL")},toHLS:function(){return this.to("HLS")},toHLSA:function(){return this.to("HLS")},change:function(f,h,g){g=(g||this.type).toUpperCase().substr(0,3);h=h||0;f=f.charAt(0).toUpperCase();switch(g){case"RGB":case"HSV":case"HLS":case"HSL":if(g.indexOf(f)>=0){break}default:switch(f){case"R":case"G":case"B":g="RGB";break;case"V":g="HSV";break;case"H":case"L":case"S":g="HLS";break}break}var e=this.to(g);if(typeof(e[f.toLowerCase()])!="undefined"){if(typeof h=="number"){e[f.toLowerCase()]=h}else{if(typeof h=="string"){h=h.replace(/\s/g,"");if(h.indexOf("+=")==0){e[f.toLowerCase()]+=Number(h.substr(2))}else{if(h.indexOf("-=")==0){e[f.toLowerCase()]-=Number(h.substr(2))}else{e[f.toLowerCase()]=Number(h)}}}else{return this}}return e.to(this.type)}return this}});b.fn.init.prototype=b.fn;d.iColor=b;d.fn.getColor=function(e){var g=d(this).eq(0),f=g.css(e);if(f==""||f=="transparent"||f=="inherit"||f=="currentcolor"){if(g.is("html, body")||g.parent().size()==0){return false}if(f=="transparent"&&e!="background-color"){return g.getColor("background-color")}else{if(f=="currentcolor"&&e!="color"){return g.getColor("color")}}return g.parent().eq(0).getColor(e)}return b(f)};d.each(["color","backgroundColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],function(f,e){d.fx.step[e]=function(h){if(h.state==0||!h.end.type){h.start=d(h.elem).getColor(e).toRGB();if(Object.prototype.toString.call(h.end)=="[object Object]"){var g=h.start;d.each(["r","g","b","v","l","s","a"],function(j,k){if(typeof(h.end[k])!="undefined"){g=g.change(k,h.end[k],h.end.mode)}});if(typeof(h.end.h)=="undefined"){h.end=g.toRGB()}else{g=g.toHLS();if(typeof h.end.h=="number"){g.h=h.end.h}else{if(typeof h.end.h=="string"){h.end.h=h.end.h.replace(/\s/g,"");if(h.end.h.indexOf("+=")==0){g.h+=Number(h.end.h.substr(2))}else{if(h.end.h.indexOf("-=")==0){g.h-=Number(h.end.h.substr(2))}else{g.h=Number(h.end.h)}}}}h.start=h.start.toHLS();h.end=g}}else{h.end=b(h.end).toRGB()}if(typeof(h.start.a)=="undefined"){h.start.a=1}if(typeof(h.end.a)=="undefined"){h.end.a=h.start.a}}if(h.end.type.substr(0,3)=="HLS"){h.elem.style[e]=b({h:h.pos*(h.end.h-h.start.h)+h.start.h,l:h.pos*(h.end.l-h.start.l)+h.start.l,s:h.pos*(h.end.s-h.start.s)+h.start.s,a:h.pos*(h.end.a-h.start.a)+h.start.a,type:"HLSA"}).getStr("rgb")}else{h.elem.style[e]=b({r:h.pos*(h.end.r-h.start.r)+h.start.r,g:h.pos*(h.end.g-h.start.g)+h.start.g,b:h.pos*(h.end.b-h.start.b)+h.start.b,a:h.pos*(h.end.a-h.start.a)+h.start.a,type:"RGBA"}).getStr("rgb")}}})})(jQuery);

