(function(q,a){function L(){return Math.ceil(999E3*Math.random()+1E3)}a.extend({metadata:{defaults:{type:"html5",name:"metadata",cre:/(\{.*\})/,single:"metadata"},setType:function(e,g){this.defaults.type=e;this.defaults.name=g},get:function(e,g){g=a.extend({},this.defaults,g);if(!g.single.length)g.single="metadata";var h=a.data(e,g.single);if(h)return h;h="{}";var i=function(r){if(typeof r!=="string")return r;return r=q.eval("("+r+")")};if(g.type==="html5"){var j={};a(e.attributes).each(function(){var r=
this.nodeName;if(r.match(/^data-/))r=r.replace(/^data-/,"");else return true;j[r]=i(this.nodeValue)})}else{if(g.type==="class"){var t=g.cre.exec(e.className);if(t)h=t[1]}else if(g.type==="elem"){if(!e.getElementsByTagName)return;t=e.getElementsByTagName(g.name);if(t.length)h=a.trim(t[0].innerHTML)}else if(e.getAttribute!==undefined)if(t=e.getAttribute(g.name))h=t;j=i(h.indexOf("{")<0?"{"+h+"}":h)}a.data(e,g.single,j);return j}}});a.fn.metadata=function(e){return a.metadata.get(this[0],e)};a.deferLoad=
function(e){a.isReady?e():a(q).load(e)};a.supportPosFixed=null;a.extend(a.support,{posFixed:function(){if(a.supportPosFixed===null){var e=false;if(document.createElement){var g=document.createElement("div");if(g&&g.style){g.style.width="1px";g.style.height="1px";g.style.position="fixed";g.style.top="10px";var h=document.body;if(h&&h.appendChild&&h.removeChild){h.appendChild(g);e=g.offsetTop===10;h.removeChild(g)}}}a.supportPosFixed=e}return a.supportPosFixed===true}});(function(){a.fn.bgIframe=a.fn.bgiframe=
function(e){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){e=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript://"},e||{});var g=function(i){return i&&i.constructor===Number?i+"px":i},h='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+e.src+'"style="display:block;position:absolute;z-index:-1;'+(e.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(e.top==="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth,0)||0)*-1)+'px')":
g(e.top))+";left:"+(e.left==="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth,0)||0)*-1)+'px')":g(e.left))+";width:"+(e.width==="auto"?"expression(this.parentNode.offsetWidth+'px')":g(e.width))+";height:"+(e.height==="auto"?"expression(this.parentNode.offsetHeight+'px')":g(e.height))+';"/>';return this.each(function(){a("> iframe.bgiframe",this).length===0&&this.insertBefore(document.createElement(h),this.firstChild)})}return this}})();a(function(){if(a.ui!==undefined&&a.ui.dialog!==
undefined){var e=a.ui.dialog.prototype._init;a.ui.dialog.prototype._init=function(){var g=this;e.apply(this,arguments);g.options.sticky&&a.support.posFixed()&&g.uiDialog.css({position:"fixed",top:"50%",left:"50%",margin:"-"+Math.round(g.uiDialog.outerHeight()/2)+"px 0 0 -"+Math.round(g.uiDialog.outerWidth()/2)+"px"})};a.ui.dialog.defaults.sticky=false}q.FCS!==undefined&&FCS.setBrowser()});a.msg=function(e,g){g=g||"notice";a("#fcs_msg").remove();a("<div>").attr({id:"fcs_msg","class":g,title:"Click to Close"}).html(e+
'<span class="ui-icon ui-icon-close"></span>').insertBefore(a("#page-content")).fadeIn("slow").click(function(){a(this).remove()}).animate({opacity:1},1E4).fadeOut("slow",function(){a(this).remove()})};a.trunc=function(e,g){return e.length>g?e.substr(0,g-1).replace(/\w+$/,"")+"...":e};(function(){function e(m,o,u){for(var b=0,c=m.length;b<c;b++)o.call(u,m[b],b)}function g(m,o){m.push.apply(m,o);return m}function h(m,o){a.extend(this,{ids:{},tags:{},listener:o,event:m});this.id=h.instances.push(this)}
var i={click:1,dblclick:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseout:1,keydown:1,keypress:1,keyup:1},j=a.event,t=j.special,r=function(m,o,u){return a.data(m,o+".indexer",u)},w=a.listen=function(m,o,u,b){if(i[m]){if(typeof o!=="object"){b=u;u=o;o=document}e(m.split(/\s+/),function(c){c=w.fixes[c]||c;c=r(o,c)||r(o,c,new h(c,o));c.append(u,b);c.start()})}};a.indexer=function(m){return r(document,m)};a.fn.indexer=function(m){return this[0]&&r(this[0],m)||null};a.extend(w,{regex:/^((?:\w*?|\*))(?:([#.])([\w\-]+))?$/,
fixes:{focus:"focusin",blur:"focusout"},cache:function(m){this.caching=m}});a.each(w.fixes,function(m,o){t[o]={setup:function(){if(a.browser.msie)return false;this.addEventListener(m,t[o].handler,true)},teardown:function(){if(a.browser.msie)return false;this.removeEventListener(m,t[o].handler,true)},handler:function(u){var b=arguments;b[0]=u=j.fix(u);u.type=o;return j.handle.apply(this,b)}}});a.fn.listen=function(m,o,u){return this.each(function(){w(m,this,o,u)})};h.instances=[];h.prototype={constructor:h,
handle:function(m){var o=m.stopPropagation;m.stopPropagation=function(){m.stopped=true;o.apply(this,arguments)};r(this,m.type).parse(m);m.stopPropagation=o;o=m.data=null},on:false,bubbles:false,start:function(){if(!this.on){j.add(this.listener,this.event,this.handle);this.on=true}},stop:function(){if(this.on){j.remove(this.listener,this.event,this.handle);this.on=false}},cache:function(m,o){return a.data(m,"listenCache_"+this.id,o)},parse:function(m){var o=m.data||m.target,u=arguments,b;if(!w.caching||
!(b=this.cache(o))){b=[];o.id&&this.ids[o.id]&&g(b,this.ids[o.id]);e([o.nodeName,"*"],function(c){var f=this.tags[c];f&&e((o.className+" *").split(" "),function(k){k&&f[k]&&g(b,f[k])})},this);w.caching&&this.cache(o,b)}b[0]&&e(b,function(c){if(c.apply(o,u)===false){m.preventDefault();m.stopPropagation()}});if(!m.stopped&&(o=o.parentNode)&&(o.nodeName==="A"||this.bubbles&&o!==this.listener)){m.data=o;this.parse(m)}b=u=o=null},append:function(m,o){e(m.split(/\s*,\s*/),function(u){var b=w.regex.exec(u);
if(!b)throw new SyntaxError('"'+u+'" is not a supported selector. --- THIS IS ON PURPOSE TO KEEP PERFORMANCE FROM DEGRADING. --- Use: #id, tag, .class or tag.class');u=b[2]==="#"&&b[3];var c=b[1].toUpperCase()||"*";b=b[3]||"*";if(u)(this.ids[u]||(this.ids[u]=[])).push(o);else if(c){c=this.tags[c]=this.tags[c]||{};(c[b]||(c[b]=[])).push(o)}},this)}};a(q).unload(function(){typeof h==="function"&&e(h.instances,function(m){m.stop();a.removeData(m.listener,m.event+".indexer");m.ids=m.names=m.listener=
null})})})();a.cookie=function(e,g,h){if(g!==undefined){h=h||{};if(g===null){g="";h.expires=-1}var i="";if(h.expires&&(typeof h.expires=="number"||h.expires.toUTCString)){if(typeof h.expires=="number"){i=new Date;i.setTime(i.getTime()+h.expires*24*60*60*1E3)}else i=h.expires;i="; expires="+i.toUTCString()}var j=h.path?"; path="+h.path:"/",t=h.domain?"; domain="+h.domain:"";h=h.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(g),i,j,t,h].join("")}else{g=null;if(document.cookie&&document.cookie!==
""){h=document.cookie.split(";");for(i=0;i<h.length;i++){j=a.trim(h[i]);if(j.substring(0,e.length+1)==e+"="){g=decodeURIComponent(j.substring(e.length+1));break}}}return g}};a.fn.extend({totalOffset:function(){var e=this[0],g=0,h=0;do{g+=e.offsetTop||0;h+=e.offsetLeft||0;e=e.offsetParent}while(e);return{left:h,top:g}}});(function(){function e(i){return i<10?"0"+i:i}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth())+"-"+e(this.getUTCDate())};var g=/["\\\x00-\x1f\x7f-\x9f]/g,
h={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};a.quoteString=function(i){if(g.test(i))return'"'+i.replace(g,function(j){var t=h[j];if(typeof t==="string")return t;t=j.charCodeAt();return"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16)})+'"';return'"'+i+'"'};a.toJSON=function(i){var j=typeof i;if(j==="undefined")return"undefined";else if(j==="number"||j==="boolean")return i+"";else if(i===null)return"null";if(j==="string")return a.quoteString(i);if(j===
"object"&&typeof i.toJSON==="function")return i.toJSON(true);var t=[];if(j!=="function"&&typeof i.length==="number"){for(var r=0;r<i.length;r++)t.push(a.toJSON(i[r]));return"["+t.join(",")+"]"}if(j==="function")throw new TypeError("Unable to convert object of type 'function' to json.");for(r in i)if(i.hasOwnProperty(r)){j=typeof r;if(j==="number")j='"'+r+'"';else if(j==="string")j=a.quoteString(r);else continue;var w=a.toJSON(i[r]);typeof w==="string"&&t.push(j+":"+w)}return"{"+t.join(",")+"}"};a.evalJSON=
function(i){return q.eval("("+i+")")};a.safeJSON=function(i){if(i===undefined||i.length===0)return{};var j=i;j=j.replace(/\\["\\\/bfnrtu]/g,"@");j=j.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");j=j.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(j))return a.evalJSON(i);else throw new SyntaxError("Error parsing JSON, source is not valid.");}})();a.fn.ihover=function(e,g){var h={sensitivity:7,interval:100,timeout:0};h=a.extend(h,g?{over:e,out:g}:e);var i,
j,t,r,w=function(u){i=u.pageX;j=u.pageY},m=function(u,b){b.ihover_t=clearTimeout(b.ihover_t);if(Math.abs(t-i)+Math.abs(r-j)<h.sensitivity){a(b).unbind("mousemove",w);b.ihover_s=1;return h.over.apply(b,[u])}else{t=i;r=j;b.ihover_t=setTimeout(function(){m(u,b)},h.interval)}},o=function(u,b){b.ihover_t=clearTimeout(b.ihover_t);b.ihover_s=0;return h.out.apply(b,[u])};e=function(u){for(var b=(u.type==="mouseover"?u.fromElement:u.toElement)||u.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(c){b=this}if(b===
this)return false;var f=jQuery.extend({},u),k=this;if(k.ihover_t)k.ihover_t=clearTimeout(k.ihover_t);if(u.type==="mouseover"){t=f.pageX;r=f.pageY;a(k).bind("mousemove",w);if(k.ihover_s!==1)k.ihover_t=setTimeout(function(){m(f,k)},h.interval)}else{a(k).unbind("mousemove",w);if(k.ihover_s===1)k.ihover_t=setTimeout(function(){o(f,k)},h.timeout)}};return this.mouseover(e).mouseout(e)};(function(){function e(){var i="";for(var j in this)if(typeof this[j]!="function")i+=j+'="'+this[j]+'" ';return i}function g(){var i=
[];for(var j in this)typeof this[j]!="function"&&i.push(j+"="+encodeURIComponent(this[j])+"&");return i.join("").replace(/&$/,"")}var h;h=a.fn.flash=function(i,j,t,r){var w=t||h.replace;j=h.copy(h.pluginOptions,j);if(!a.hasFlash(j.version))if(j.expressInstall&&a.hasFlash(6,0,65))var m={flashvars:{MMredirectURL:location,MMplayerType:"PlugIn",MMdoctitle:a("title").text()}};else if(j.update)w=r||h.update;else return this;i=h.copy(h.htmlOptions,m,i);return this.each(function(){var o=a(this);w.call(this,
h.copy(a.extend({},i,a.metadata?o.metadata():a.meta?o.data():{})))})};h.copy=function(){for(var i={},j={},t=0;t<arguments.length;t++){var r=arguments[t];if(r!==undefined){a.extend(i,r);r.flashvars!==undefined&&a.extend(j,r.flashvars)}}i.flashvars=j;return i};a.hasFlash=function(i,j,t){if(/hasFlash\=true/.test(location))return true;if(/hasFlash\=false/.test(location))return false;var r=a.hasFlash.playerVersion().match(/\d+/g);i=String([i,j,t]).match(/\d+/g)||String(h.pluginOptions.version).match(/\d+/g);
for(j=0;j<3;j++){r[j]=parseInt(r[j]||0,0);i[j]=parseInt(i[j]||0,0);if(r[j]<i[j])return false;if(r[j]>i[j])return true}return true};a.hasFlash.playerVersion=function(){try{try{var i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{i.AllowScriptAccess="always"}catch(j){return"6,0,0"}}catch(t){}return(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(r){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return(navigator.plugins["Shockwave Flash 2.0"]||
navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(w){}}return"0,0,0"};h.htmlOptions={height:240,width:320,flashvars:{},pluginspage:"http://www.adobe.com/go/getflashplayer",src:"#",type:"application/x-shockwave-flash",wmode:"transparent",quality:"best",allowScriptAccess:"always",allowFullScreen:"false",menu:false};h.pluginOptions={expressInstall:false,update:true,version:"9"};h.replace=function(i){this.innerHTML='<div class="alt">'+this.innerHTML+"</div>";
a(this).addClass("flash-replaced").prepend(h.transform(i))};h.update=function(){var i=String(location).split("?");i.splice(1,0,"?hasFlash=true&");i='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+i.join("")+'">Click here.</a></p>';this.innerHTML='<div class="alt">'+this.innerHTML+"</div>";a(this).addClass("flash-update").prepend(i)};h.transform=function(i){i.toString=e;if(i.flashvars)i.flashvars.toString=
g;return"<embed "+String(i)+" />"};q.attachEvent&&q.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})})();(function(){function e(b,c,f){if(b.cycleStop===undefined)b.cycleStop=0;if(c===undefined||c===null)c={};if(c.constructor==String){switch(c){case "stop":b.cycleStop++;b.cycleTimeout&&clearTimeout(b.cycleTimeout);b.cycleTimeout=0;a(b).removeData("cycle.opts");return false;case "pause":b.cyclePause=1;return false;case "resume":b.cyclePause=
0;if(f===true){c=a(b).data("cycle.opts");if(!c)return false;if(b.cycleTimeout){clearTimeout(b.cycleTimeout);b.cycleTimeout=0}r(c.elements,c,1,1)}return false;case "prev":case "next":b=a(b).data("cycle.opts");if(!b)return false;a.fn.cycle[c](b);return false;default:c={fx:c}}return c}else if(c.constructor==Number){var k=c;c=a(b).data("cycle.opts");if(!c)return false;if(k<0||k>=c.elements.length)return false;c.nextSlide=k;if(b.cycleTimeout){clearTimeout(b.cycleTimeout);b.cycleTimeout=0}if(typeof f==
"string")c.oneTimeFx=f;r(c.elements,c,1,k>=c.currSlide);return false}return c}function g(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter)try{b.style.removeAttribute("filter")}catch(f){}}function h(b,c,f,k,n){var d=a.extend({},a.fn.cycle.defaults,k||{},a.metadata?b.metadata():a.meta?b.data():{});if(d.autostop)d.countdown=d.autostopCount||f.length;var v=b[0];b.data("cycle.opts",d);d.$cont=b;d.stopCount=v.cycleStop;d.elements=f;d.before=d.before?[d.before]:[];d.after=d.after?[d.after]:[];d.after.unshift(function(){d.busy=
0});!a.support.opacity&&d.cleartype&&d.after.push(function(){g(this,d)});d.continuous&&d.after.push(function(){r(f,d,0,!d.rev)});i(d);!a.support.opacity&&d.cleartype&&!d.cleartypeNoBg&&u(c);b.css("position")=="static"&&b.css("position","relative");d.width&&b.width(d.width);d.height&&d.height!="auto"&&b.height(d.height);if(d.startingSlide)d.startingSlide=parseInt(d.startingSlide,0);if(d.random){d.randomMap=[];for(v=0;v<f.length;v++)d.randomMap.push(v);d.randomMap.sort(function(){return Math.random()-
0.5});d.randomIndex=0;d.startingSlide=d.randomMap[0]}else if(d.startingSlide>=f.length)d.startingSlide=0;d.currSlide=d.startingSlide=d.startingSlide||0;var s=d.startingSlide;c.css({position:"absolute",top:0,left:0}).hide().each(function(D){D=s?D>=s?f.length-(D-s):s-D:f.length-D;a(this).css("z-index",D)});a(f[s]).css("opacity",1).show();g(f[s],d);d.fit&&d.width&&c.width(d.width);d.fit&&d.height&&d.height!="auto"&&c.height(d.height);if(d.containerResize&&!b.innerHeight()){for(var C=v=0,G=0;G<f.length;G++){var z=
a(f[G]),A=z[0],F=z.outerWidth();z=z.outerHeight();if(!F)F=A.offsetWidth;if(!z)z=A.offsetHeight;v=F>v?F:v;C=z>C?z:C}v>0&&C>0&&b.css({width:v+"px",height:C+"px"})}d.pause&&b.hover(function(){this.cyclePause++},function(){this.cyclePause--});if(j(d)===false)return false;if(!d.multiFx){v=a.fn.cycle.transitions[d.fx];if(a.isFunction(v))v(b,c,d);else if(d.fx!="custom"&&!d.multiFx)return false}var B=false;k.requeueAttempts=k.requeueAttempts||0;c.each(function(){var D=a(this);this.cycleH=d.fit&&d.height?
d.height:D.height();this.cycleW=d.fit&&d.width?d.width:D.width();if(D.is("img")){D=a.browser.mozilla&&this.cycleW===34&&this.cycleH===19&&!this.complete;var I=a.browser.opera&&(this.cycleW===42&&this.cycleH===19||this.cycleW===37&&this.cycleH===17)&&!this.complete,J=this.cycleH===0&&this.cycleW===0&&!this.complete;if(a.browser.msie&&this.cycleW===28&&this.cycleH===30&&!this.complete||D||I||J)if(n.s&&d.requeueOnImageNotLoaded&&++k.requeueAttempts<100){setTimeout(function(){a(n.s,n.c).cycle(k)},d.requeueTimeout);
B=true;return false}}return true});if(B)return false;d.cssBefore=d.cssBefore||{};d.animIn=d.animIn||{};d.animOut=d.animOut||{};c.not(":eq("+s+")").css(d.cssBefore);d.cssFirst&&a(c[s]).css(d.cssFirst);if(d.timeout){d.timeout=parseInt(d.timeout,0);if(d.speed.constructor==String)d.speed=a.fx.speeds[d.speed]||parseInt(d.speed,0);for(d.sync||(d.speed/=2);d.timeout-d.speed<250;)d.timeout+=d.speed}if(d.easing)d.easeIn=d.easeOut=d.easing;if(!d.speedIn)d.speedIn=d.speed;if(!d.speedOut)d.speedOut=d.speed;d.slideCount=
f.length;d.currSlide=d.lastSlide=s;if(d.random){d.nextSlide=d.currSlide;if(++d.randomIndex==f.length)d.randomIndex=0;d.nextSlide=d.randomMap[d.randomIndex]}else d.nextSlide=d.startingSlide>=f.length-1?0:d.startingSlide+1;b=c[s];d.before.length&&d.before[0].apply(b,[b,b,d,true]);d.after.length>1&&d.after[1].apply(b,[b,b,d,true]);d.next&&a(d.next).bind(d.prevNextEvent,function(){return m(d,d.rev?-1:1)});d.prev&&a(d.prev).bind(d.prevNextEvent,function(){return m(d,d.rev?1:-1)});d.pager&&o(f,d);t(d,f);
return d}function i(b){b.original={before:[],after:[]};b.original.cssBefore=a.extend({},b.cssBefore);b.original.cssAfter=a.extend({},b.cssAfter);b.original.animIn=a.extend({},b.animIn);b.original.animOut=a.extend({},b.animOut);a.each(b.before,function(){b.original.before.push(this)});a.each(b.after,function(){b.original.after.push(this)})}function j(b){var c,f,k=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=true;b.fxs=b.fx.replace(/\s*/g,"").split(",");for(c=0;c<b.fxs.length;c++){var n=
b.fxs[c];f=k[n];if(!f||!k.hasOwnProperty(n)||!a.isFunction(f)){b.fxs.splice(c,1);c--}}if(!b.fxs.length)return false}else if(b.fx=="all"){b.multiFx=true;b.fxs=[];for(c in k)if(k.hasOwnProperty(c)){f=k[c];a.isFunction(f)&&b.fxs.push(c)}}if(b.multiFx&&b.randomizeEffects){f=Math.floor(Math.random()*20)+30;for(c=0;c<f;c++){k=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(k,1)[0])}}return true}function t(b,c){b.addSlide=function(f,k){f=a(f);var n=f[0];b.autostopCount||b.countdown++;c[k?
"unshift":"push"](n);if(b.els)b.els[k?"unshift":"push"](n);b.slideCount=c.length;f.css("position","absolute");f[k?"prependTo":"appendTo"](b.$cont);if(k){b.currSlide++;b.nextSlide++}!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg&&u(f);b.fit&&b.width&&f.width(b.width);b.fit&&b.height&&b.height!="auto"&&$slides.height(b.height);n.cycleH=b.fit&&b.height?b.height:f.height();n.cycleW=b.fit&&b.width?b.width:f.width();f.css(b.cssBefore);b.pager&&a.fn.cycle.createPagerAnchor(c.length-1,n,a(b.pager),c,b);
a.isFunction(b.onAddSlide)?b.onAddSlide(f):f.hide()}}function r(b,c,f,k){if(f&&c.busy&&c.manualTrump){a(b).stop(true,true);c.busy=false}if(!c.busy){var n=c.$cont[0],d=b[c.currSlide],v=b[c.nextSlide];if(!(n.cycleStop!=c.stopCount||n.cycleTimeout===0&&!f))if(!f&&!n.cyclePause&&(c.autostop&&--c.countdown<=0||c.nowrap&&!c.random&&c.nextSlide<c.currSlide))c.end&&c.end(c);else{if(f||!n.cyclePause){var s=c.fx;d.cycleH=d.cycleH||a(d).height();d.cycleW=d.cycleW||a(d).width();v.cycleH=v.cycleH||a(v).height();
v.cycleW=v.cycleW||a(v).width();if(c.multiFx){if(c.lastFx===undefined||++c.lastFx>=c.fxs.length)c.lastFx=0;s=c.fxs[c.lastFx];c.currFx=s}if(c.oneTimeFx){s=c.oneTimeFx;c.oneTimeFx=null}a.fn.cycle.resetState(c,s);c.before.length&&a.each(c.before,function(C,G){n.cycleStop==c.stopCount&&G.apply(v,[d,v,c,k])});s=function(){a.each(c.after,function(C,G){n.cycleStop==c.stopCount&&G.apply(v,[d,v,c,k])})};if(c.nextSlide!=c.currSlide){c.busy=1;if(c.fxFn)c.fxFn(d,v,c,s,k);else a.isFunction(a.fn.cycle[c.fx])?a.fn.cycle[c.fx](d,
v,c,s):a.fn.cycle.custom(d,v,c,s,f&&c.fastOnEvent)}c.lastSlide=c.currSlide;if(c.random){c.currSlide=c.nextSlide;if(++c.randomIndex==b.length)c.randomIndex=0;c.nextSlide=c.randomMap[c.randomIndex]}else{f=c.nextSlide+1==b.length;c.nextSlide=f?0:c.nextSlide+1;c.currSlide=f?b.length-1:c.nextSlide-1}c.pager&&a.fn.cycle.updateActivePagerLink(c.pager,c.currSlide)}f=0;if(c.timeout&&!c.continuous)f=w(d,v,c,k);else if(c.continuous&&n.cyclePause)f=10;if(f>0)n.cycleTimeout=setTimeout(function(){r(b,c,0,!c.rev)},
f)}}}function w(b,c,f,k){if(f.timeoutFn){b=f.timeoutFn(b,c,f,k);if(b!==false)return b}return f.timeout}function m(b,c){var f=b.elements,k=b.$cont[0],n=k.cycleTimeout;if(n){clearTimeout(n);k.cycleTimeout=0}if(b.random&&c<0){b.randomIndex--;if(--b.randomIndex==-2)b.randomIndex=f.length-2;else if(b.randomIndex==-1)b.randomIndex=f.length-1;b.nextSlide=b.randomMap[b.randomIndex]}else if(b.random){if(++b.randomIndex==f.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex]}else{b.nextSlide=b.currSlide+
c;if(b.nextSlide<0){if(b.nowrap)return false;b.nextSlide=f.length-1}else if(b.nextSlide>=f.length){if(b.nowrap)return false;b.nextSlide=0}}a.isFunction(b.prevNextClick)&&b.prevNextClick(c>0,b.nextSlide,f[b.nextSlide]);r(f,b,1,c>=0);return false}function o(b,c){var f=a(c.pager);a.each(b,function(k,n){a.fn.cycle.createPagerAnchor(k,n,f,b,c)});a.fn.cycle.updateActivePagerLink(c.pager,c.startingSlide)}function u(b){function c(k){k=parseInt(k,0).toString(16);return k.length<2?"0"+k:k}function f(k){for(;k&&
k.nodeName.toLowerCase()!="html";k=k.parentNode){var n=a.css(k,"background-color");if(n.indexOf("rgb")>=0){k=n.match(/\d+/g);return"#"+c(k[0])+c(k[1])+c(k[2])}if(n&&n!="transparent")return n}return"#ffffff"}b.each(function(){a(this).css("background-color",f(this))})}a.fn.cycle=function(b,c){var f={s:this.selector,c:this.context};if(this.length===0&&b!="stop"){if(!a.isReady&&f.s){a(function(){a(f.s,f.c).cycle(b,c)});return this}return this}return this.each(function(){var k=e(this,b,c);if(k!==false){this.cycleTimeout&&
clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var n=a(this),d=k.slideExpr?a(k.slideExpr,this):n.children(),v=d.get();if(!(v.length<2)){var s=h(n,d,v,k,f);if(s!==false)if(s.timeout||s.continuous)this.cycleTimeout=setTimeout(function(){r(v,s,0,!s.rev)},s.continuous?10:s.timeout+(s.delay||0))}}})};a.fn.cycle.resetState=function(b,c){c=c||b.fx;b.before=[];b.after=[];b.cssBefore=a.extend({},b.original.cssBefore);b.cssAfter=a.extend({},b.original.cssAfter);b.animIn=a.extend({},b.original.animIn);
b.animOut=a.extend({},b.original.animOut);b.fxFn=null;a.each(b.original.before,function(){b.before.push(this)});a.each(b.original.after,function(){b.after.push(this)});c=a.fn.cycle.transitions[c];a.isFunction(c)&&c(b.$cont,a(b.elements),b)};a.fn.cycle.updateActivePagerLink=function(b,c){a(b).find("a").removeClass("activeSlide").filter("a:eq("+c+")").addClass("activeSlide")};a.fn.cycle.next=function(b){m(b,b.rev?-1:1)};a.fn.cycle.prev=function(b){m(b,b.rev?1:-1)};a.fn.cycle.createPagerAnchor=function(b,
c,f,k,n){if(c=a.isFunction(n.pagerAnchorBuilder)?n.pagerAnchorBuilder(b,c):'<a href="#">'+(b+1)+"</a>"){var d=a(c);if(d.parents("body").length===0){var v=[];if(f.length>1){f.each(function(){var s=d.clone(true);a(this).append(s);v.push(s)});d=a(v)}else d.appendTo(f)}d.bind(n.pagerEvent,function(s){s.preventDefault();n.nextSlide=b;s=n.$cont[0];var C=s.cycleTimeout;if(C){clearTimeout(C);s.cycleTimeout=0}a.isFunction(n.pagerClick)&&n.pagerClick(n.nextSlide,k[n.nextSlide]);r(k,n,1,n.currSlide<b);return false});
n.pauseOnPagerHover&&d.hover(function(){n.$cont[0].cyclePause++},function(){n.$cont[0].cyclePause--})}};a.fn.cycle.hopsFromLast=function(b,c){var f=b.lastSlide,k=b.currSlide;return c?k>f?k-f:b.slideCount-f:k<f?f-k:f+b.slideCount-k};a.fn.cycle.commonReset=function(b,c,f,k,n,d){a(f.elements).not(b).hide();f.cssBefore.opacity=1;f.cssBefore.display="block";if(k!==false&&c.cycleW>0)f.cssBefore.width=c.cycleW;if(n!==false&&c.cycleH>0)f.cssBefore.height=c.cycleH;f.cssAfter=f.cssAfter||{};f.cssAfter.display=
"none";a(b).css("zIndex",f.slideCount+(d===true?1:0));a(c).css("zIndex",f.slideCount+(d===true?0:1))};a.fn.cycle.custom=function(b,c,f,k,n){var d=a(b),v=a(c),s=f.speedIn;b=f.speedOut;var C=f.easeIn;c=f.easeOut;v.css(f.cssBefore);if(n){s=typeof n=="number"?(b=n):(b=1);C=c=null}var G=function(){v.animate(f.animIn,s,C,k)};d.animate(f.animOut,b,c,function(){f.cssAfter&&d.css(f.cssAfter);f.sync||G()});f.sync&&G()};a.fn.cycle.transitions={fade:function(b,c,f){c.not(":eq("+f.currSlide+")").css("opacity",
0);f.before.push(function(k,n,d){a.fn.cycle.commonReset(k,n,d);d.cssBefore.opacity=0});f.animIn={opacity:1};f.animOut={opacity:0};f.cssBefore={top:0,left:0}},shuffle:function(b,c,f){b=b.css("overflow","visible").width();c.css({left:0,top:0});f.before.push(function(k,n,d){a.fn.cycle.commonReset(k,n,d,true,true,true)});f.speed/=2;f.random=0;f.shuffle=f.shuffle||{left:-b,top:15};f.els=[];for(b=0;b<c.length;b++)f.els.push(c[b]);for(c=0;c<f.currSlide;c++)f.els.push(f.els.shift());f.fxFn=function(k,n,d,
v,s){var C=s?a(k):a(n);a(n).css(d.cssBefore);var G=d.slideCount;C.animate(d.shuffle,d.speedIn,d.easeIn,function(){for(var z=a.fn.cycle.hopsFromLast(d,s),A=0;A<z;A++)s?d.els.push(d.els.shift()):d.els.unshift(d.els.pop());if(s){z=0;for(A=d.els.length;z<A;z++)a(d.els[z]).css("z-index",A-z+G)}else{z=a(k).css("z-index");C.css("z-index",parseInt(z,0)+1+G,0)}C.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(s?this:k).hide();v&&v()})})};f.cssBefore={display:"block",opacity:1,top:0,left:0}}};a.fn.cycle.ver=
function(){return"2.71"};a.fn.cycle.defaults={fx:"fade",timeout:4E3,timeoutFn:null,continuous:0,speed:1E3,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,
autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!a.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250}})();if(a.widget){a.widget("ui.placeholder",{_init:function(){var e=this,g=e.options,h=e.element,i=a.isFunction(g.placeholder)?g.placeholder.apply(e.element[0]):g.placeholder;if(a.browser.opera)g.animate=false;if(i){e.element.wrap("<span/>").parent().addClass("ui-placeholder-container clearfix").css("float",
e.element.css("float"));var j=e.label=a('<label for="'+h.attr("id")+'" unselectable="yes">'+i+"</label>").insertBefore(h);j.addClass("ui-placeholder-label").css({left:4,top:parseInt(h.css("borderTopWidth"),0)+parseInt(h.css("paddingTop"),0)}).bind("mousedown",function(){h.focus();return false});h.val()&&j.hide();h.bind("focus."+this.widgetName,function(){g.disabled||(g.animate?j.fadeOut("fast"):j.hide())}).bind("blur."+this.widgetName,function(){if(!g.disabled&&this.value.length===0)g.animate?j.fadeIn("fast"):
j.show()})}},destroy:function(){var e=this,g=e.element;g.data("placeholder")&&g.attr("placeholder",g.data("placeholder"));g.parent().replaceWith(g);e.label&&e.label.remove();a.widget.prototype.destroy.apply(e,arguments)}});a.extend(a.ui.placeholder,{version:"0.001",defaults:{placeholder:function(){var e=a(this),g=e.attr("placeholder");e.data("placeholder",g);e.removeAttr("placeholder");return g},animate:false}});a(function(e){e(":text,:password").placeholder()})}if(q.FCS_JS!==undefined){var H={expires:14,
path:"/"},K=null;q.FCS={_setupUI:function(){function e(l){a("#ui-dialog-title-"+l).html("Please Wait");a("#"+l).html(q._pwTemplate).dialog("open")}function g(l){var p=l%100;return l+(t[(p-20)%10]||t[p]||t[0])}function h(l){return l.replace(r,"")}function i(){var l=a("#product-type");return l.length>0?l.val():a("input[name='id']:checked").val()}function j(l){q._qvDIV="QuickView";q._qvBounds=null;q._qvHandle=null;q._qvJSON=null;q._qvTemplate=function(){var p=this;return'<div class="cont"><div class="photo"><a title="More Details about '+
h(p.title)+'" href="'+p.url+'"><img src="'+API.resizeImage(p.featured_image,"medium")+'" width="240" height="240" /></a></div><div class="desc">'+a.trunc(h(p.description),450)+'<b> <a title="More Details about '+h(p.title)+'" href="'+p.url+'">More Details</a></b><div class="pricecont"><span class="pricelabel">Price:</span> <b class="price">'+API.formatMoney(p.price_min)+'</b></div></div><div class="clear"></div></div>'};l=l?{"Add To Shopping Bag":function(){API.addItem(q._qvJSON.variants[0].id,1);
a(this).dialog("close")}}:null;a("<div></div>").attr({id:q._qvDIV}).appendTo("body").dialog({autoOpen:false,modal:true,draggable:false,resizable:false,width:600,height:350,open:function(){API.getProduct(q._qvHandle,function(p){q._qvJSON=p;a("#ui-dialog-title-"+q._qvDIV).html(p.title);a("#"+q._qvDIV).html(q._qvTemplate.apply(p))})},buttons:l})}var t=["th","st","nd","rd"],r=/(<([^>]+)>)/ig;q._acDIV="AddedToCart";q._acItem=null;q._acTemplate=function(){var l=this,p=q._acItem,y=a("#quantity").val()||
1;return'<div class="cont"><div><div class="g_2"><img src="'+API.resizeImage(p.image,"small")+'" width="100" height="100" /></div><div><b>'+p.title+"</b><br/><ul><li>Quantity: "+y+"</li><li>Price: "+API.formatMoney(p.price)+'</li></ul></div><div class="clear"></div><div class="ui-widget-content ui-corner-all cartsummary"><i class="leftf">Shopping Bag Summary</i><div class="cartsumtotal">Total Items in Bag: <b>'+l.item_count+"</b><br />Merchandise Subtotal: <b>"+API.formatMoney(l.total_price)+'</b><br /><span class="px10">(Subtotal does not include shipping or tax.)</span></div><div class="clear"></div></div></div><div class="clear"></div><div class="acbuttons"><div class="btn rightf"><button id="tocheckoutbtn" class="ui-priority-primary" type="button" title="View Your Shopping Bag">Shopping Bag</button></div><div class="btn leftf"><button id="stayherebtn" class="ui-priority-secondary" type="button" title="Continue Shopping">Continue Shopping</button></div></div></div>'};
q._pwTemplate=function(){return'<div style="margin:auto auto; width:100px; height:20px">Loading...</div>'};a.extend(API,{onError:function(l,p){a.msg("<h3>Sorry!</h3><b>We couldn't "+p+", please try again.</b><br /><br />If you keep seeing this message please give us a call at (888) 347-6802 so we can make sure you get what you need!","error")},onItemAdded:function(l){q._acItem=l;q._acItemAdded=true;API.getCart()},onCartUpdate:function(l){var p=a("#cartimg"),y=l.item_count;p.removeClass("sadbag happybag");
y===0?p.addClass("sadbag"):p.addClass("happybag");a("#cartcount").html(y);a("#carttext").html((y===1?"Item":"Items")+" in your bag!");q.FCS_C=l;a.ui!==undefined&&a.ui.dialog!==undefined&&e(q._acDIV);q._acItemAdded&&typeof K==="function"&&K();q._acItemAdded=false}});a.ui!==undefined&&a.ui.dialog!==undefined&&a("<div></div>").attr({id:q._acDIV}).appendTo("body").end().dialog({autoOpen:false,modal:true,draggable:false,resizable:false,width:600,height:255,open:function(){a("#ui-dialog-title-"+q._acDIV).html("You've just added the following to your shopping bag:");
a("#"+q._acDIV).html(q._acTemplate.apply(q.FCS_C));a("#stayherebtn").bind("click",function(){a("#"+q._acDIV).dialog("close")});a("#tocheckoutbtn").bind("click",function(){location.href="/cart"})}});switch(a("#page-content").attr("class")){case "t-index":var w=a("#showcase"),m=a("#t360"),o=a("#prod360"),u=a("#hotstuff");if(w.length&&w.cycle){w.cycle({delay:1500,timeout:4500,pager:"#showcasenav",pause:true,pagerEvent:"mouseover",fastOnEvent:true,pauseOnPagerHover:true,pagerAnchorBuilder:function(l){return"#showcasenav li:eq("+
l+") a"}});w=new Image;w.src=FCS.getAssetUrl("blank.gif");w='<img src="'+w.src+'" width="400" height="300" border="0" ';a("#ibombmap").html(w+'usemap="#bombmap" />');a("#icolormap").html(w+'usemap="#colormap" />');a("#icustommap").html(w+'usemap="#custommap" />')}if(a.hasFlash({version:9})){if(o.length&&o.flash){m.html("Spin Me Round Like a Record");o.one("click",function(){o.empty().flash({src:FCS.getAssetUrl("loader.swf"),width:260,height:260,flashvars:{u:FCS.getAssetUrl("360-gift-set.swf"),m:0}})}).html('<a href="javascript://" title="Try out a 360&deg; View"><img src="'+
FCS.getAssetUrl("try360.gif")+'" alt="Try out a 360&deg; View" width="260" height="260" /></a>')}u.length&&u.flash&&a.deferLoad(function(){u.flash({src:FCS.getAssetUrl("hotstuff.swf"),width:940,height:190,flashvars:{url:FCS.getAssetUrl(""),file:"hot"+FCS_JS+".xml"}})})}else{if(o){m.html("Hot Deal");o.html('<a href="/collections/bath-gift-sets/products/the-bees-knees" title="The Bees Knees Variety Bath Gift Set"><img src="'+FCS.getImgUrl("IMG_57_medium.jpeg")+'" alt="The Bees Knees Variety Bath Gift Set" width="240" height="240" /></a>')}a(".hotstuffdep").hide()}break;
case "t-collection":if(!a.fn.totalOffset)return;j(true);q._qvBtn=a("<div id='QuickViewBtn' class='fcs-button ui-state-default ui-corner-all'>Quick<b>Look</b></div>").attr({title:"Take a Quick Look"}).bind("click",function(){e(q._qvDIV);q._qvBtn.css({visibility:"hidden"})}).appendTo("body");a(".product-list").listen("mouseover",".quicklook",function(){q._qvHandle=this.id.substr(4);var l=a(this).totalOffset(),p=Math.round(l.left);l=Math.round(l.top);q._qvBounds={top:l+2,left:p+2,bottom:l+158,right:p+
158};q._qvBtn.css({top:l+100+"px",left:p+45+"px",visibility:"visible"})}).listen("mouseout",".quicklook",function(l){l&&q._qvBounds&&!FCS.isMouseOut(l.pageX,l.pageY,q._qvBounds)||q._qvBtn.css({visibility:"hidden"})});a.deferLoad(function(){if(a.hasFlash({version:8})){var l=a(".ytvid");l.length&&l.flash&&a(l).flash({},{},function(p){var y=a(this);y.before(a.fn.flash.transform(a.extend({},p,y.metadata().opt)));y.remove()})}});break;case "t-product.soap":a.hasFlash({version:9})?a("#personalized").flash({src:FCS.getAssetUrl("loader.swf"),
width:940,height:400,flashvars:{u:FCS.getAssetUrl("personalized.swf"),m:0,p:a.toJSON({j:FCS_Vars,x:FCS.getAssetUrl("personalized"+FCS_JS+".xml")})}}):a("#personalized").html("<b>You'll need flash (version 9 or greater) to use this awesome feature!</b><br>Don't feel like installing Flash? Just contact us at (888) 347-6802 or CustomerService@FortuneCookieSoap.com and we'll make sure you get what you need.");break;case "t-product.set":j();m=a("#gallery");var b=a("#giftset"),c={cancel:"a.ui-icon",revert:"invalid",
containment:"#createaset",helper:"clone",opacity:0.7,cursor:"move"},f=0;K=function(){a("li",b).remove();b.droppable("enable");f=0;k();a("#purchasebtn").html('Add to Bag<span class="fcs-icon ui-icon-bag"/>').removeClass("ui-state-disabled")};a("#purchasebtn").bind("click",function(){if(a(this).is(".ui-state-disabled"))return false;if(f!=6){a.msg("<h3>Your Personalized Set Needs 6 Cookies</h3>Currently there are "+f+" in your takeout box.");return false}var l={};a.each(a("img",b),function(x,E){x=E.id.substr(4);
if(l[x])l[x].x++;else l[x]={t:E.title,x:1}});var p=[],y=a.cookie("cart_attributes");if(y!==null)p=a.safeJSON(y);y={};y.c=l;y.v=i();y.u=L(y.v);p.push(y);a.cookie("cart_attributes",a.toJSON(p),H);API.addItem(y.v,a("#quantity").val());a(this).html('Please Wait...<span class="fcs-icon ui-icon-bag"/>').addClass("ui-state-disabled");return false});a("li",m).draggable(c);b.droppable({accept:"#gallery > li",activeClass:"ui-state-hover",hoverClass:"ui-state-highlight",tolerance:"touch",drop:function(l,p){n(p.draggable)}});
m.droppable({accept:"#giftset li",activeClass:"ui-state-hover",tolerance:"touch",drop:function(l,p){d(p.draggable)}});function k(){a("#itemcount").fadeOut("fast",function(){a(this).html(f>=6?"No":6-f).fadeIn()})}function n(l){if(!(f>=6)){l.clone().find("a.ui-icon-help").remove().end().find("a.ui-icon-circle-plus").remove().end().append('<a href="javascript://" title="Remove" class="ui-icon ui-icon-close">Remove</a>').appendTo(a("ul",b)).draggable(c);f++;k();f>=6&&b.droppable("disable")}}function d(l){l.remove();
f--;k();f<6&&b.droppable("enable")}a("#gallery").listen("click","a.ui-icon-help",function(l){q._qvHandle=l.target.id.substr(4);e(q._qvDIV);return false});a("ul.gallery").click(function(l){l=a(l.target);var p=l.parent();if(l.is("a.ui-icon-circle-plus"))n(p);else l.is("a.ui-icon-close")&&d(p);return false});break;case "t-product":a("#purchasebtn").bind("click",function(){API.addItem(i(),a("#quantity").val());return false});m=a("#madewith");w=a("#Contents");var v=function(l){if(variant=FCS_P.variants[l])if(variant.available){a("#purchase").removeClass("ui-state-disabled");
a("#purchasebtn").removeAttr("disabled");a("#product_price").html(API.formatMoney(variant.price))}else{a("#purchase").addClass("ui-state-disabled");a("#purchasebtn").attr("disabled","disabled");a("#product_price").text(variant.inventory_quantity===0?"Sold Out":"Unavailable")}};m.length>0&&w&&w.append(", "+m.attr("title"));if(!a("#product-variants").listen("click","li,input",function(){a("#product-variants li.ui-state-default").removeClass("ui-state-default");var l=a(this),p=null;if(l.is("li"))p=l.addClass("ui-state-default").children("input:radio").attr("checked",
"checked");else{l.parent().addClass("ui-state-default");p=l}v(p.attr("id").substr(1))}).listen("mouseover","li",function(){a(this).addClass("ui-state-hover")}).listen("mouseout","li",function(){a(this).removeClass("ui-state-hover")}))return;v(0);var s=null;m=a("#slides img");var C=function(){s&&a("#largerimg").html(q._pwTemplate).dialog("open");return false};a("#slides,#largerimglnk").bind("click",C);a("<div></div>").attr({id:"largerimg"}).appendTo("body").dialog({autoOpen:false,modal:true,draggable:false,
resizable:false,width:510,height:590,title:"Larger View",open:function(){a("#largerimg").html('<img src="'+API.resizeImage(s.src,"large")+'" width="480" height="480" />');setTimeout(function(){a("#slides").cycle("pause")},200)},close:function(){a("#slides").cycle("resume")},buttons:{Close:function(){a(this).dialog("close")}}});a("#slideshow").ihover(function(){a("#slides").cycle("pause")},function(){a("#slides").cycle("resume")});if(m.length>1)a("#slides").cycle({pager:"#thumbnav",pagerEvent:"mouseover",
fastOnEvent:true,pauseOnPagerHover:1,before:function(l,p){s=s?p:l},pagerAnchorBuilder:function(l){l="#thumbnav li:eq("+l+") a";a(l).bind("click",C);return l}});else if(m.length===1)s=m[0];a.deferLoad(function(){a("#slides img").each(function(){this.loaded||a(this).trigger("appear")})});a("#disclaimer").html("*These statements have not been evaluated by the FDA. This product is not intended to diagnose, treat, cure or prevent any disease.");break;case "t-cart":m=a.evalJSON(a.cookie("cart_attributes"));
a("div.basket-desc input[type=hidden]").val("");function G(){var l=a(this).parents("p").attr("id"),p=a(this).parents("div").attr("id"),y=a("#updates_"+l).val(),x=a.cookie("cart_attributes"),E;if(y==="1"){if(typeof x==="string"){E=a.evalJSON(x);if(typeof E==="object"){for(x=0;x<E.length;x++)if(E[x])if(E[x].v==l){E.splice(x,1);x--}a.cookie("cart_attributes",a.toJSON(E),H)}}}else{if(typeof x==="string"){E=a.evalJSON(x);if(typeof E==="object")for(x=0;x<E.length;x++)if(E[x])if(E[x].u==p){E.splice(x,1);
x--}}a.cookie("cart_attributes",a.toJSON(E),H)}a("#updates_"+l).val(y-1);a("#cartform").submit()}if(m){w={};for(var z=0;z<m.length;z++)if(!isNaN(m[z].u)){var A=[],F=m[z],B=F.c,D="";if(B.c1!==undefined){D="Soap";A.push('<li class="ui-helper-clearfix"><div class="leftf">1st Color: #'+B.c1+'</div><div class="customswatch" style="background-color:#'+B.c1+'"></div></li>');B.c2&&A.push('<li class="ui-helper-clearfix"><div class="leftf">2nd Color: #'+B.c2+'</div><div class="customswatch ui-helper-clearfix" style="background-color:#'+
B.c2+'"></div></li>');B.t1&&A.push("<li>Texture: "+unescape(B.t1)+"</li>");A.push("<li>1st Fragrance: "+unescape(B.s1)+"</li>");B.s2&&A.push("<li>2nd Fragrance: "+unescape(B.s2)+"</li>");A.push("<li>Custom Fortune: "+unescape(B.f)+"</li>")}else if(B){D="Gift Set";for(var I in B)if(B.hasOwnProperty(I)){var J=B[I];A.push("<li>"+J.x+") "+J.t+"</li>")}}if(w[F.v]!==undefined)w[F.v]++;else w[F.v]=1;A=A.join("");B=a('<a href="javascript://">Remove</a>');D=a('<div class="custom-section"></div>').html("<ul>"+
A+"</ul>").attr("id",F.u).prepend("<b>"+g(w[F.v])+" Personalized "+D+"</b>").append(B);a("#"+F.v).append(D);B.click(G);F=F.v;A=a("#"+F+" input").val()+" ["+A+"]";a("#"+F+" input").val(A)}}q.remove_item=function(l){a("#updates_"+l).val(0);var p=a.cookie("cart_attributes");if(typeof p==="string"){p=a.evalJSON(p);for(var y=p.length,x=0;x<y;x++)if(p[x])if(p[x].v==l){p.splice(x,1);x--}a.cookie("cart_attributes",a.toJSON(p),H)}a("#cartform").submit()};a.ui&&a("#DeliveryDate").datepicker();break}a.deferLoad(function(){q._qoptions=
{qacct:"p-datBFT4c5XbFI"};var l=document.createElement("script");l.type="text/javascript";l.async=true;l.src="http://edge.quantserve.com/quant.js";document.getElementsByTagName("head")[0].appendChild(l);a("#securityseal").css("backgroundImage","url(https://secure.trust-guard.com/seals/670/security/header/)")})},jkrt:"",url:location.href,isWholesale:document.domain.indexOf("fortunecookiesoapwholesale")>-1,init:function(){if(q.$){a.deferLoad(function(){a(".fcs-button:not(.ui-state-disabled)").hover(function(){a(this).addClass("ui-state-hover")},
function(){a(this).removeClass("ui-state-hover")});var e=[];a(document).keydown(function(g){if(e.length>50)e.length=0;e.push(g.keyCode);if(e.toString().indexOf("38,38,40,40,37,39,37,39,66,65")>=0){a(document).unbind("keydown",arguments.callee);a.getScript("http://www.cornify.com/js/cornify.js",function(){cornify_add();a(document).keydown(cornify_add)})}})});FCS._setupUI()}},addCustom:function(e){try{var g=[],h=a.cookie("cart_attributes");if(h!==null)g=a.safeJSON(h);var i=a.safeJSON(e);i.u=L(i.v);
g.push(i);a.cookie("cart_attributes",a.toJSON(g),H);API.addItem(i.v,1)}catch(j){API.onError(j,"add the item to your bag")}},setBrowser:function(){var e=navigator.userAgent.toLowerCase();a.browser.chrome=/chrome/.test(e);if(a.browser.msie){a("body").addClass("is_ie");a("body").addClass("is_ie"+a.browser.version.substring(0,1))}else if(a.browser.mozilla)if(e.indexOf("firefox")!=-1){a("body").addClass("is_ff");e=e.substring(e.indexOf("firefox/")+8);e=e.substring(0,1);a("body").addClass("is_ff"+e)}else a("body").addClass("is_mozilla");
else if(a.browser.chrome){a("body").addClass("is_chrome");e=e.substring(e.indexOf("chrome/")+7);e=e.substring(0,1);a("body").addClass("is_chrome"+e);a.browser.safari=false}else if(a.browser.safari){a("body").addClass("is_safari");e=e.substring(e.indexOf("version/")+8);e=e.substring(0,1);a("body").addClass("is_safari"+e)}else a.browser.opera&&a("body").addClass("is_opera")},getRelated:function(e,g){if(e.tags.length>0){a.each(g,function(){var j=this;j.h!=e.handle&&a.each(e.tags,function(){(","+j.t+
",").indexOf(","+this+",")!=-1&&j.r++})});g.sort(function(j,t){return t.r-j.r});var h=[],i=0;a.each(g,function(){var j=this;if(j.h!=e.handle){if(i>7||j.r<2)return false;h.push('<div class="g_2 '+(i===0?"g_a":i===7?"g_o":"")+'"><a href="/products/'+j.h+'" title="'+j.n+'"><img src="'+FCS.getImgUrl(j.i)+'" alt="'+j.n+'" width="100" height="100" /></a><a href="/products/'+j.h+'" title="'+j.n+'">'+j.n+"</a></div>");i++}});h.push('<div class="clear"></div>');a("#related").html(h.join(""))}},getHandle:function(){return FCS.url.replace(/http:\/\/(\w|\.)*(\/assets\/|\/products\/|\/collections\/)/,
"")},getFCSUrl:function(e,g){g=g||{};return"http://fortunecookiesoap.com/"+g.t+"/"+e},getAssetUrl:function(e){return FCS_AssetUrl[0]+e+"?"+FCS_AssetUrl[1]},getImgUrl:function(e,g){return FCS.getAssetUrl(e,g).replace("/assets/","/products/")},isMouseOut:function(e,g,h){return e<h.left||e>h.right||g<h.top||g>h.bottom},addWithin:function(e){q.location=e.href.replace("products","collections/"+FCS_Collection+"/products");return false}};q.API={onError:function(){},onCartUpdate:function(){},onItemAdded:function(){},
onNoteAdded:function(){},onProduct:function(){},onDebug:function(){},money_format:"${{amount}}",formatMoney:function(e,g,h){if(h&&e<100)return e+"&#162;";h="";var i=/\{\{\s*(\w+)\s*\}\}/;g=g||API.money_format;switch(g.match(i)[1]){case "amount":h=API.floatToString(e/100,2);break;case "amount_no_decimals":h=API.floatToString(e/100,0);break;case "amount_with_comma_separator":h=API.floatToString(e/100,2).replace(/\./,",");break}return g.replace(i,h)},resizeOldRegex:/_+(pico|icon|thumb|small|compact|medium|large|grande)\.(\w{2,4})/,
resizeRegex:/(.*\/[\w\-\_\.]+)\.(\w{2,4})/,resizeImage:function(e,g){if(typeof e!=="string")e=FCS.getAssetUrl("blank.gif");try{e=e.replace(API.resizeOldRegex,".$2");if(g=="original")return e;else{var h=e.match(API.resizeRegex);return h[1]+"_"+g+"."+h[2]}}catch(i){return e}},floatToString:function(e,g){e=e.toFixed(g).toString();return e.match(/^\.\d+/)?"0"+e:e},addItem:function(e,g,h,i){g=g||1;a.ajax(API.params({url:"/cart/add.js",data:{quantity:g,id:e},type:"POST",dataType:"json"},h||API.onItemAdded,
i||"add the item to your bag"))},addItemFromForm:function(){},getCart:function(e,g){a.ajax(API.params({url:"/cart.js",dataType:"json"},e||API.onCartUpdate,g||"check the contents of your bag"))},getProduct:function(e,g,h){a.ajax(API.params({url:"/products/"+e+".js",dataType:"json"},g||API.onProduct,h||"find the item you requested"))},changeItem:function(e,g,h,i){a.ajax(API.params({url:"/cart/change.js",data:{quantity:g,id:e},type:"POST",dataType:"json"},h||API.onCartUpdate,i||"update the item in your bag"))},
removeItem:function(e,g,h){API.changeItem(e,0,g,h||"remove an item from your bag")},clear:function(e,g){a.ajax(API.params({url:"/cart/clear.js",data:"",type:"POST",dataType:"json"},e||API.onCartUpdate,g||"empty your bag"))},updateCart:function(){},updateCartFromForm:function(){},params:function(e,g,h){return a.extend({beforeSend:function(i){i.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT")},success:function(i){try{(g||API.onDebug)(i,h)}catch(j){API.onError(j,h)}},error:function(i){try{i&&
i.responseText?API.onError(q.eval("("+i.responseText+")"),h):API.onError(i,h)}catch(j){API.onError(j,h)}}},e)}};FCS.init()}})(window,jQuery);