/*
*   jQuery Plugin colorBlend v4.0.1
*   Requires jQuery 1.3+ 
*   Copyright (c) 2007-2011 Aaron E. [jquery at happinessinmycheeks dot com] 
*   Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
*
*	@param: Object Array. Arguments need to be in object notation.
*	Returns: jQuery.
*
*	Options:	
*		param:			What css color option you wish to blend. 
*						Such as "background-color", "color", "border-left-color", "scrollbar-face-color" etc.
*						"All" works when calling an action.
*						(default: "background-color").
*		fps:			Frames per second (default: 60).
*		duration:		How long you want the animation to take in miliseconds. (default: 1000)
*		cycles:			How many times you want the object to blend. -1 = Infinite. (default: -1).
*		random:			Will transition from a random color to a random color. (default: false).
*						Note: Will change strobe to false.
*		strobe:			Will blend from the original color and back to the original color. (default: true).
*						Note: Cannot set to true if random is set to true.
*		colorList:		Now accepts an array of color strings! colorList can accept 3 or 6 digit hex colors, rgb and color names (#000000, #000, (255, 120, 00), "aliceblue"). 
*						Note: Also accepts "current", "random", "opposite", "transparent" (will attempt to match parent color), "parent".
*		alpha:			Opacity of element! accepts numerical array. (Default: [100, 100]). 
*						Note: Only works on "Opacity" param.
*		classList:		Accepts class strings, nust match exactly what's in style tag or css document. AND the Blend attribute must exists on style/link element.
*		isQueue:		Will queue up color aniimations for a paramater. 
*		action:			Allows pausing, stopping, resume, reversing and resetting the current param.
*						Note: If "all" is specified as param the action will take place on all blended params of the object.
*		preCallBack:	function to be called right before it animates an object. (Wont get called if object is resuming a pause)
*		postCallBack:	function to be called right after animation stops.
*		cycleCallBack:	function that gets called after a cycle and before the next (Will get called every time it cycles!);
*		apexCallBack:	function to be called right when animation reaches 100% or 0% (if strobing).
*		onQueueCallBack:function that gets called when a queue item is added;
*
*	Examples: 
*		$("body").colorBlend([{colorList:["black", "white"], param:"color"}]);
*		var myColors = [
*			{param:'color', colorList: ["white", "black"]},
*			{param:'opacity', alpha: [20,75]},
*			{param:'border-left-color', colorList: ["random", "black"]},
*			{param:'border-top-color', colorList: ["white", "black", "pink"]},
*			{param:'border-bottom-color', colorList: ["white", "tomato", "lime"]}
*		];
*		$("tr").colorBlend(myColors);
*		$("div").colorBlend("background-color", ["green", "blue", "red"], 5000);
*		$("span").colorBlend("color", "#ff9900, blue, #f3a, aliceblue");
*		$("p").colorBlend("opacity", [10, 30, 5, 90, 50], 15000);
*		$("input").colorBlend("background-color", "random", true);
*		$("div").colorBlend("pause", "backround-color");
*
*	colorPercent
*	Returns: hex color
*	Options: 
*		[]:			An array of colors.
*		percent:	A decimal number less than or equal to one and greater than or equal to zero.
*	Examples:
*		$.colorPercent(["blue", "green", "black", "#ff0000", [22, 142, 230], "#f90"], .86);
*		Returns: #5b91a1
*
*		var colors = ["aliceblue", "#00ff00", "#336699"];
*		$.colorPercent(colors, .43);
*		Returns: #21fe23;
*	
*	Release fixes:
*		3.0.0:
*			Another round of overhaul of code, made huge changes.
*		3.0.1:
*			Noticed siblings weren't getting the same treatment. fixed.
*		3.0.2:
*			Mathmatical logistics error in opacity, fixed.
*			Speed tweaks.
*		3.0.3:
*			Fixed a bug with strobe and color transitions. Dumb mistake on my part, didn't catch in initial testing.
*			Updated documentation.
*		3.0.4:
*			Fixed another bug in opacity.
*		3.0.5:
*			Refactored code using simple(r) math.
*			Made it simpler to call colorBlend, no longer needs a semi complex object.
*			Added colorPercent to base jQuery, takes in an array of colors and a percentage, will return blended color based on percent.
*		4.0.0:
*			Made some interface changes. Now can be called in a simpler manner and can take argument pairs, such as 
*			$("body").colorBlend("background-color", "random", "true", "fps", 35, "cycles", 4). 
*			First argument is the parameter you want to use and the following argument is the value.
*			Now accepts Classes and will traverse style tags and css documents with the Blend attribute.
*			<link rel="Stylesheet" href="style.css" Blend="true" /> and <style type="text/css" Blend="true">
*			The following functions will pre-load html/css with the Blend attribute. Recommended use on small files/sections only.
*			$.colorBlendStyleLoad() will load Html Style Tags.
*			$.colorBlendCssLoad() will load Css pages.
*			$.colorBlendLoad() will load html and css.
*			$("div").colorBlend([{ classList: [".class1",".class2"], duration: 2000, fps: 90, cycles: 1 }]);
*			Added more callBack locations: onQueueCallBack and apexCallBack. onQueueCallBack gets called when a parameter isQueue is true and something is queued. 
*			apexCallBack is called at the lowest position and highest position on strobe, and on high position when strobe is false.
*			$("div").colorBlend("background-color", ["lime", "white"], 2000);
*		4.0.1:
*			Bug fixes: When calling random in comma delimited string color list, it was being ignored.
*			Bug fixes: When calling action short cuts, if background-color wasn't used it would assign it.
*/

(function(s){var m="4.0.1",g=["play","start","stop","pause","resume","reverse","reset"],u=["param","colorlist","action","alpha","fps","duration","random","strobe","cycles","queue","classlist","precallback","postcallback","cyclecallback","apexcallback","onqueuecallback"],y=[],h=[],E=[];s.extend(s.expr[":"],{blendingParam:function(G,F,J,L){var K=J[3],H=s(G),I=y[G.uniqueID];return(H.is(":hasBlend('"+K+"')")&&I[K].internals.animating)},blendableParam:function(G,F,J,L){var K=J[3],H=s(G),I=y[G.uniqueID];return H.is(":blendingParam('"+K+"')")?(I[K].isQueue&&I[K].cycles>-1):true},paramMyBlend:function(H,J,I,M){var K=I[3].split(","),N=s(H),L=K[0],F=K[1],G=y[H.uniqueID];return(N.is(":hasBlend('"+F+"')")&&G[F].blendId===L)},hasBlend:function(G,F,I,K){var J=I[3],H=y[G.uniqueID];return !w(H)&&!w(H[J])},blending:function(G,F,I,J){var H=y[G.uniqueID];if(!w(H)){for(param in H){if(!w(H[param])&&!H[param].internals.animating){continue}return true}}return false},uniqueIDAssigned:function(G,F,I,K){var H=G.uniqueID;if(w(H)){var J=new Object();J.uniqueID=f();s.extend(G,J)}return true}});s.extend({colorPercent:function(){if(a(arguments[0])&&!(!arguments[1])&&!isNaN(arguments[1])){return j(arguments[0],arguments[1])}},colorBlendStyleLoad:function(){d()},colorBlendCssLoad:function(){c()},colorBlendLoad:function(){d();c()}});s.fn.colorBlend=function(I){if(arguments.length>=2){if(typeof(arguments[0])=="string"&&((typeof(arguments[1])=="string"&&arguments[1].indexOf(",")>-1)||a(arguments[1]))){var H=a(arguments[1])?arguments[1]:arguments[1].toString().split(",");I=arguments[0].toLowerCase()=="classlist"?[{classList:H}]:arguments[0].toLowerCase()=="opacity"?[{param:arguments[0],alpha:H}]:[{param:arguments[0],colorList:H}];if(!(!arguments[2])){if(!isNaN(parseInt(arguments[2]))){I[0].duration=parseInt(arguments[2])}I=s.extend(I,J(I,arguments,2))}}if(typeof(arguments[0])=="string"&&(arguments[0].indexOf(",")==-1||!a(arguments[0]))&&((typeof(arguments[1])=="string"&&(arguments[1].indexOf(",")==-1)||!a(arguments[1])))){var O=s.inArray(arguments[0].toLowerCase(),g);if(O>-1){L(arguments[1],this,g[O])}else{I=[{param:arguments[0]}];I=s.extend(I,J(I,arguments,1))}}}if(!I){I=[{}]}var S={fps:60,duration:1000,param:"background-color",cycles:-1,colorList:["current","opposite"],alpha:[],action:"",random:false,strobe:true,isQueue:true,cycleCallBack:function(){},preCallBack:function(){},postCallBack:function(){},apexCallBack:function(){},onQueueCallBack:function(){}},X={currentCycle:0,pos:0,frames:0,delay:0,step:1,tId:0,animating:false,isPOrS:false,pct:function(){return(this.pos/this.frames)},next:V},U={classList:[]},Y=[];function G(aa,ab){var ac=[],Z=f();ab.blendId=Z;Y=[];s.each(aa,function(ah,ae){var ag=s.extend({},S,ae),ad=s.inArray(ag.action.toLowerCase(),g),aj=ag.param.toLowerCase(),ai=s.extend({},S,U,ae);if(aj!=="all"&&ai.classList.length<=1){Y.push(aj)}if(ad>-1){L(aj,ab,g[ad]);return true}if(aj==="opacity"){ag.colorList=[];ag.random=false}ag.blendId=Z;ag.parent=ab;ag.queue=[];ag.internals=s.extend({},X);if(ai.classList.length>1){s.colorBlendLoad();ag.classList=ag.colorList=[];var af=t(ai.classList);s.each(af,function(ak,al){if(s.inArray(af[ak].param,ac)==-1){Y.push(af[ak].param);ac[af[ak].param]=K(s.extend({},ag,af[ak]))}})}else{if(s.inArray(aj,ac)==-1){ac[aj]=K(ag)}}});M(ab,ac)}function J(aa,ac,Z){for(var ab=Z;ab<=ac.length;ab++){if(typeof(ac[ab])=="string"){if(s.inArray(ac[ab].toLowerCase(),u)>-1&&((ab+1)<=ac.length&&(!(!ac[ab+1])||R(ac[ab+1])))){var ad=ac[ab+1];switch(ac[ab].toLowerCase()){case"alpha":aa[0].alpha=ad;break;case"classList":aa[0].classList=ad;break;case"colorlist":aa[0].colorList=ad;break;case"param":aa[0].param=ad;break;case"action":aa[0].action=ad;break;case"fps":aa[0].fps=parseInt(ad);break;case"duration":aa[0].duration=parseInt(ad);break;case"random":aa[0].random=T(ad);break;case"cycles":aa[0].cycles=parseInt(ad);break;case"strobe":aa[0].strobe=T(ad);break;case"queue":aa[0].isQueue=T(ad);break;case"postcallback":if(typeof(ad)=="function"){aa[0].postCallBack=ad}break;case"precallback":if(typeof(ad)=="function"){aa[0].preCallBack=ad}break;case"cyclecallback":if(typeof(ad)=="function"){aa[0].cycleCallBack=ad}break;case"onqueuecallback":if(typeof(ad)=="function"){aa[0].onQueueCallBack=ad}break;case"apexcallback":if(typeof(ad)=="function"){aa[0].apexCallBack=ad}break}}}}return aa}function T(Z){return R(Z)?typeof(Z)=="string"?Z.toLowerCase()=="true":Z?true:false:false}function R(Z){return typeof(Z)=="boolean"?true:typeof(Z)=="string"?Z.match(/(true|false)/gi)?true:false:false}function Q(aa,Z,ab){if(w(y[Z])){y[Z]=[]}y[Z][ab]=aa}function N(ab,aa){var Z=s.extend(true,{},aa);Z.parent=s(ab);Z.internals.opts=Z;return Z}function M(aa,Z){s.each(Y,function(ac,ab){var ae=aa.filter(":not(:hasBlend('"+ab+"'))");ae.each(function(ag,af){Q(N(af,Z[ab]),af.uniqueID,ab)});if(ae.size()<aa.size()){var ad=aa.not(ae).filter(":blendingParam('"+ab+"')");ad.filter(":blendableParam('"+ab+"')").each(function(ag,af){y[af.uniqueID][ab].queue.push(N(af,Z[ab]))});aa.not(ae).not(ad).each(function(ag,af){Q(N(af,Z[ab]),af.uniqueID,ab)})}})}function L(ac,ab,aa){if(ac.toLowerCase()==="all"||ab.is(":hasBlend('"+ac+"')")){var Z=ac.toLowerCase()==="all"?":blending":":hasBlend('"+ac+"')";ab.filter(Z).each(function(af,ad){for(cPrm in y[ad.uniqueID]){var ae=y[ad.uniqueID][cPrm];if(!w(ae)&&(cPrm===ac||ac==="all")){switch(s.trim(aa.toLowerCase())){case"pause":case"stop":ae.internals.tId=clearTimeout(ae.internals.tId);ae.internals.isPOrS=true;if(aa.toLowerCase()==="stop"){ae.internals.animating=false}break;case"reverse":ae.internals.step=-1*ae.internals.step;break;case"reset":ae.internals.step=1;ae.internals.currentCycle=ae.cycles>-1?ae.cycles:0;ae.internals.pos=0;break;case"start":case"play":case"resume":if(ae.internals.isPOrS){ae.internals.isPOrS=false;ae.internals.animating=true;ae.internals.next()}break}}}})}}function P(Z){Z.parent.filter(":paramMyBlend('"+Z.blendId+","+Z.param+"')").each(function(ab,aa){if(!w(y[aa.uniqueID])){var ac=true;y[aa.uniqueID][Z.param]=null;for(sObj in y[aa.uniqueID]){if(w(y[aa.uniqueID][sObj])){continue}ac=false}if(ac){y[aa.uniqueID]=null}}})}function W(aa){aa.apexCallBack();if(aa.cycles>-1&&aa.internals.pos<=0){aa.internals.currentCycle-=aa.internals.currentCycle!=0?1:0;if(aa.internals.currentCycle==0){aa.internals.tId=clearTimeout(aa.internals.tId);aa.cycleCallBack();if(a(aa.queue)&&aa.queue.length>0){var Z=aa.queue.concat();Z.splice(0,1);aa=s.extend(aa,aa.queue.shift());aa.queue=Z.concat();aa.internals.animating=true;aa.onQueueCallBack()}else{aa.internals.animating=false;aa.internals.isPOrS=false;aa.postCallBack();P(aa)}}}}function V(Z){var Z=!w(Z)?Z:!w(this.opts)?this.opts:null;if(Z!=null){if(Z.internals.animating&&!Z.internals.isPOrS){Z.parent.css(Z.param,e(Z));Z.internals.pos+=Z.internals.step;if(Z.internals.pos>Z.internals.frames||Z.internals.pos<0){if(Z.random&&Z.param.toLowerCase()!=="opacity"){Z.colorList=[Z.colorList[Z.colorList.length-1],i()]}if(Z.strobe){Z.internals.step=-1*Z.internals.step;Z.internals.pos+=Z.internals.step;W(Z)}else{if(Z.internals.pos>Z.internals.frames){Z.internals.pos=0;W(Z)}}}if(Z.internals.animating&&!Z.internals.isPOrS){Z.internals.tId=setTimeout(function(){V(Z)},Z.internals.delay)}}}}function K(ab){if(!ab.internals.animating){if(s.trim(ab.param.toLowerCase())!=="opacity"){if(ab.colorList.length==1){ab.colorList.push("opposite")}if(ab.random){ab.strobe=false;ab.colorList=[i(),i()]}else{s.each(ab.colorList,function(ad,ac){switch(s.trim(ac.toLowerCase())){case"current":ab.colorList[ad]=ab.parent.css(ab.param)==="transparent"?k(ab.parent,ab.param):ab.parent.css(ab.param);break;case"parent":case"transparent":ab.colorList[ad]=k(ab.parent,ab.param);break;case"opposite":ab.colorList[ad]=l(B(k(ab.parent,ab.param)));break;case"random":ab.colorList[ad]=i();break}})}}var aa=Math.floor(1000/ab.fps),Z=Math.ceil(ab.duration/aa);ab.internals.currentCycle=ab.cycles>-1?ab.cycles:0;ab.internals.frames=ab.strobe?Math.floor(Z/2):Z;ab.internals.delay=aa;return ab}}function F(Z){if(Z.is(":uniqueIDAssigned")&&s.inArray(I,g)==-1){G(I,Z);if(!w(Z.blendId)){s.each(Y,function(ab,aa){Z.filter(":paramMyBlend('"+Z.blendId+","+aa+"')").each(function(ad,ac){var ae=y[ac.uniqueID][aa];ae.preCallBack();ae.internals.animating=true;ae.internals.next()})})}}return Z}return F(this)};function n(H,F){var G=F;s.each(H,function(J,I){G=G.split(I).join("")});return G}function x(H,G){var F=null;s.each(H,function(J,I){if(I.selector==G){F=I;return false}});return F}function c(){if(!w(E)&&E.length<=0){E=r()}}function d(){if(!w(h)&&h.length<=0){h=C()}}function v(H,F){var G=-1;s.each(H,function(J,I){if(H[J].param==F){G=J;return false}});return G}function t(F){var G=[];s.each(F,function(J,H){var I=x(h,H);if(I==null){I=x(E,H)}s.each(I.blendObj,function(M,K){var L=I.blendObj[M];if(L!=null&&!w(L.color)){var N=v(G,L.param);if(N==-1||G.length==0){G.push({param:L.param,colorList:[]});G[G.length-1].colorList.push(L.color)}else{G[N].colorList.push(L.color)}}})});return G}function q(I){var H=/(?:([\w\-\.\s#]*)[^}]*})/gim,K,N=0,O=[];while(K=H.exec(I)){var F=/(?:[^:;{\w]*(?:([\w\-]*color):([^;]+)(?:;|})))/gim,L=s.trim(K[1]),J,G={selector:L,blendObj:[],index:N};while(J=F.exec(K[0])){var M={param:J[1].toLowerCase(),color:s.trim(n(['"',"'"],J[2]))};G.blendObj.push(M)}O.push(G);N++}return O}function C(){var F=[],G=s("style[Blend]");G.each(function(I,H){var J=q(s(this).html());s.each(J,function(L,K){F.push(K)})});return F}function r(){var G=s("link[href$='.css'][Blend]"),F=[];G.each(function(J,I){var K=s(this),H=K.attr("href");s.ajax(H,{dataType:"text",async:false,success:function(M){var L=q(M);s.each(L,function(O,N){F.push(N)})}})});return F}var p={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370DB",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"DB7093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"};function l(J){J=B(J).split("#").join("").split("");var I="0123456789abcdef",H=I.split("").reverse().join(""),G;for(var F=0;F<J.length;F++){G=I.indexOf(J[F]);J[F]=H.substring(G,G+1)}return"#"+J.join("")}function D(H,G,F){return"#"+(1<<24|(H<<16)|(G<<8)|(F<<0)).toString(16).substring(1)}function o(H){var G=[];if(w(H)){return"0, 0, 0"}H=H.split("#").join("");for(var F=0;F<3;F++){G.push(parseInt(H.substr(F*2,2),16))}return G.join(", ")}function A(G){var F;if(G&&G.constructor==Array&&G.length==3){return G}if(F=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(G)){return[parseInt(F[1]),parseInt(F[2]),parseInt(F[3])]}if(F=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(G)){return[parseFloat(F[1])*2.55,parseFloat(F[2])*2.55,parseFloat(F[3])*2.55]}if(F=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(G)){return[parseInt(F[1].toString(),16),parseInt(F[2].toString(),16),parseInt(F[3].toString(),16)]}if(F=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(G)){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)]}return o(p[s.trim(G).toLowerCase()]).split(",")}function B(G){var F=A(G);return D(parseInt(F[0]),parseInt(F[1]),parseInt(F[2]))}function e(F){return(F.param.toLowerCase()==="opacity")?z(F.alpha,F.internals.pct()):j(F.colorList,F.internals.pct())}function z(L,K){var G=((L.length-1)*K),J=Math.floor(G),M=(G-J),H=1-M,I=L[J],F=K==1?L[J]:L[J+1];return Math.min(100,Math.max(0,Math.floor(I*(H)+F*(M))))*0.01}function j(M,O){var H=((M.length-1)*O),F=Math.floor(H),L=(H-F),I=1-L,N=[0,0,0],G=A(M[F]),J=O==1?A(M[F]):A(M[F+1]);for(var K=0;K<3;K++){N[K]=Math.floor(parseInt(G[K])*(I)+parseInt(J[K])*(L))}return D(N[0],N[1],N[2])}function k(H,G){var F="#ffffff";s(H).parents().each(function(){var I=s(this).css(G);if(I!="transparent"&&I!=""){F=I;return false}});return F}function i(){var H=[],F;for(var G=0;G<3;G++){F=b(0,255).toString(16);H[H.length]=(F.length==1?"0"+F:F)}return"#"+H.join("")}function f(){var G=[];for(var F=0;F<7;F++){G.push(b(0,15).toString(16))}return G.join("")}function b(G,F){return Math.floor(Math.random()*(F-G+1))+G}function a(F){return F.constructor==Array}function w(F){return typeof(F)=="undefined"?true:F==null?true:false}})(jQuery);
