
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_254_page1
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_254_page1 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_254_page1 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

/*
 * Sticky Buttons By WeaverAddons.com
 * Version 1.1.0
 *
 * Visit http://www.weaveraddons.com for more information on how to use this stack in RapidWeaver.
 *
 */

/*
 * DC jQuery Slick 2.1 - jQuery Slick
 * Copyright (c) 2011 Design Chemical
 * 	http://www.designchemical.com
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 */

(function(b){function j(j,a,i){b.each(a,function(a,b){var t="-webkit-border-"+b+"-radius",k="-moz-border-radius-"+b.replace(/\-/g,""),c={};c[t]=c[k]=c["border-"+b+"-radius"]=i+"px";j.css(c)})}b.fn.dcSlick=function(q){var a={classWrapper:"dc-slick",classContent:"dc-slick-content",idWrapper:"dc-slick-"+b(this).index(),location:"left",align:"top",offset:"100px",speed:"slow",tabText:"Click",classTab:"slick-tab",classOpen:"slick-open",classClose:"slick-close",classToggle:"slick-toggle",autoClose:true,
autoOpen:false,centerTab:false,tabWidth:"auto",tabRounded:0,opacity:100,onLoad:function(){},beforeOpen:function(){},beforeClose:function(){}},q=b.extend(a,q),i=this;return i.each(function(){function r(){b("."+t).css({zIndex:1E4});d.css({zIndex:10001});a.location=="bottom"&&d.animate({marginBottom:"-=5px"},"fast").animate({marginBottom:0},a.speed);a.location=="top"&&d.animate({marginTop:"-=5px"},"fast").animate({marginTop:0},a.speed);a.location=="left"&&d.animate({marginLeft:"-=5px"},"fast").animate({marginLeft:0},
a.speed);a.location=="right"&&d.animate({marginRight:"-=5px"},"fast").animate({marginRight:0},a.speed);d.addClass("active");a.beforeOpen.call(this)}function s(){if(d.hasClass("active")){var b={marginBottom:"-"+n};switch(a.location){case "top":b={marginTop:"-"+n};break;case "left":b={marginLeft:"-"+p};break;case "right":b={marginRight:"-"+p}}d.removeClass("active").animate(b,a.speed)}a.beforeClose.call(this)}var t=a.classWrapper,k=i.html();i.css("float","left");i.width();i.empty();if(a.location.match(/left|right/i)&&
!a.align.match(/top|bottom/i))a.align="top";a.tabOffset?a.tabOffset.match(/\%|px/i)||(a.tabOffset+="px"):a.tabOffset="0px";a.offset?a.offset.match(/\%|px/i)||(a.offset+="px"):a.offset="0px";if(a.boxSize.match(/x/i)){var c=a.boxSize.split("x");a.boxWidth=b.trim(c[0]);if(c[1]&&c[1]!="auto")a.boxHeight=b.trim(c[1])}else a.boxWidth=a.boxSize;if(a.tabSize.match(/x/i)){if(c=a.tabSize.split("x"),a.tabWidth=b.trim(c[0]),c[1]&&c[1]!="auto")a.tabHeight=b.trim(c[1])}else a.tabWidth=a.tabSize;a.boxWidth&&a.boxWidth!=
"auto"&&!a.boxWidth.match(/\%|px/i)&&(a.boxWidth+="px");a.boxHeight&&a.boxHeight!="auto"&&!a.boxHeight.match(/\%|px/i)&&(a.boxHeight+="px");a.tabWidth&&a.tabWidth!="auto"&&!a.tabWidth.match(/\%|px/i)&&(a.tabWidth+="px");a.tabHeight&&a.tabHeight!="auto"&&!a.tabHeight.match(/\%|px/i)&&(a.tabHeight+="px");if(a.tabWidth=="100%")a.tabOffset="0px";if(a.tabText.match(/\.(jpe?g|png|gif)/i)){a.classTab+="-image";var c=a.tabText.match(/(.*\.(?:jpe?g|png|gif)\)?\%?)/i),e=a.tabText.match(/([0-9]+)\s*x\s*([0-9]+)/i);
e?(tabImageWidth=b.trim(e[1]),tabImageHeight=b.trim(e[2])):tabImageHeight=tabImageWidth=50;var f=' style="background:url('+c[1]+") no-repeat;height:"+tabImageHeight+"px;;width:"+tabImageWidth+'px;border:none !important;padding:0 !important;"',l=""}else f="",a.tabWidth&&a.tabWidth!="0px"&&a.tabWidth!="auto"&&(f+="width:"+a.tabWidth+";"),a.tabWidth&&a.tabWidth!="auto"&&(f+="text-align:center;"),a.tabHeight&&(a.tabHeight=="100%"?f+="top:0;bottom:0;":a.tabHeight&&a.tabHeight!="0px"&&a.tabHeight!="auto"&&
(f+="height:"+a.tabHeight+";"),f+="margin:auto 0"),f&&(f=' style="'+f+'"'),l=a.tabText;c=e="";a.tabLink&&(i.find(".stacks_clearer").length<=1&&i.find(".stacks_out").length<1?e=" onclick=\"window.location='"+a.tabLink+"';return false;\"":c=" onclick=\"window.location='"+a.tabLink+'\';return false;" style="cursor:pointer !important;"');l='<div class="'+a.classTab+'"'+f+e+"><div>"+l+"</div></div>";b(this).hide();f=a.idWrapper;k='<div id="'+f+'" class="'+t+'">'+l+'<div class="'+a.classContent+'"'+c+">"+
k+"</div></div>";b("body").append(k);var d=b("#"+f),k=b("."+a.classTab,d);k.css({position:"absolute"});c=b("."+a.classOpen);f=b("."+a.classClose);l=b("."+a.classToggle);(e=a.tabText.match(/([0-9]+)\s*x\s*([0-9]+)/i))?(tabImageWidth=e[1],tabImageHeight=e[2]):tabImageHeight=tabImageWidth=50;e=b("."+a.classContent,d);a.boxWidth=="100%"?(d.css({left:0,right:0}),e.css("width","100%"),a.offset="0px"):a.boxWidth.match(/\%/)?(d.css("width",a.boxWidth),e.css("width","100%")):e.css("width",a.boxWidth);a.boxHeight&&
(a.boxHeight=="100%"?(e.css({top:0,bottom:0}),d.css("width","100%")):a.boxHeight.match(/\%/)?(d.css("height",a.boxHeight),e.css("height","100%")):e.css("height",a.boxHeight));var e=a.boxWidth.match(/\%/)?a.location=="top"||a.location=="bottom"?(parseInt(b("body").css("margin-top"))||0)+(parseInt(b("body").css("margin-bottom"))||0):(parseInt(b("body").css("margin-left"))||0)+(parseInt(b("body").css("margin-right"))||0):0,q=d.height();d.css("float","left");var p=d.outerWidth()+e/2-a.borderSize+"px";
d.css("float","none");var u=d.outerHeight(),v=u-q,n=u-a.borderSize+"px",w=b(window).height();(function(c){var e=b("."+a.classContent,c);b(c).addClass(a.location).addClass("align-"+a.align).css({position:"fixed",zIndex:1E4});d.css("border-top-width");d.css("border-right-width");d.css("border-bottom-width");d.css("border-left-width");var f=b("."+a.classTab,d),h=f.outerWidth(true),i=f.outerHeight(true),k=e.height(),l=e.width(),m=e.outerHeight(true)-k,g=w-i;u>g&&(k=g-v-m,n=g+"px");e.css({height:k+"px"});
a.opacity<100&&e.css({opacity:a.opacity/100+" !important;",filter:"alpha(opacity="+a.opacity+") !important;"});if(f.hasClass("slick-tab-image")){var o=a.borderSize;a.tabRounded=0}else o=a.borderSize;m={};g={};if(a.location=="left"){g={marginRight:"-"+(h+o)+"px"};if(a.tabWidth!="100%")if(a.centerTab)g.top=k/2-i/2+"px";else if(a.tabOffset!="0px")g.top=a.tabOffset;m=a.align=="bottom"?{marginLeft:"-"+p,bottom:a.offset}:{marginLeft:"-"+p,top:a.offset};a.tabRounded&&(j(f,["bottom-right","top-right"],a.tabRounded),
h=a.tabOffset=="0px"&&!a.centerTab?["bottom-right"]:["bottom-right","top-right"],j(e,h,a.tabRounded),j(b(c),h,a.tabRounded+a.borderSize))}else if(a.location=="right"){g={marginLeft:"-"+(h+o)+"px"};if(a.tabWidth!="100%")if(a.centerTab)g.top=k/2-i/2+"px";else if(a.tabOffset!="0px")g.top=a.tabOffset;m=a.align=="bottom"?{marginRight:"-"+p,bottom:a.offset}:{marginRight:"-"+p,top:a.offset};a.tabRounded&&(j(f,["top-left","bottom-left"],a.tabRounded),h=a.tabOffset=="0px"&&!a.centerTab?["bottom-left"]:["top-left",
"bottom-left"],j(e,h,a.tabRounded),j(b(c),h,a.tabRounded+a.borderSize))}else if(a.location=="top"){if(a.align=="left"){if(m={marginTop:"-"+n,left:a.offset},g={marginBottom:"-"+(i+o)+"px",left:0},a.tabWidth!="100%")if(a.centerTab)g.left=l/2-h/2+"px";else if(a.tabOffset!="0px")g.left=a.tabOffset}else if(m={marginTop:"-"+n,right:a.offset},g={marginBottom:"-"+(i+o)+"px",right:0},a.tabWidth!="100%")if(a.centerTab)g.right=l/2-h/2+"px";else if(a.tabOffset!="0px")g.right=a.tabOffset;a.tabRounded&&(j(f,["bottom-left",
"bottom-right"],a.tabRounded),h=a.tabOffset=="0px"&&!a.centerTab?a.align=="left"?["bottom-right"]:["bottom-left"]:["bottom-left","bottom-right"],a.tabWidth!="100%"&&(j(e,h,a.tabRounded),j(b(c),h,a.tabRounded+a.borderSize)))}else if(a.location=="bottom"){if(a.align=="left"){if(m={marginBottom:"-"+n,left:a.offset},g={marginTop:"-"+(i+o)+"px",left:0},a.tabWidth!="100%")if(a.centerTab)g.left=l/2-h/2+"px";else if(a.tabOffset!="0px")g.left=a.tabOffset}else if(m={marginBottom:"-"+n,right:a.offset},g={marginTop:"-"+
(i+o)+"px",right:0},a.tabWidth!="100%")if(a.centerTab)g.right=l/2-h/2+"px";else if(a.tabOffset!="0px")g.right=a.tabOffset;a.tabRounded&&(j(f,["top-left","top-right"],a.tabRounded),h=a.tabOffset=="0px"&&!a.centerTab?a.align=="left"?["top-right"]:["top-left"]:["top-left","top-right"],a.tabWidth!="100%"&&(j(e,h,a.tabRounded),j(b(c),h,a.tabRounded+a.borderSize)))}b(c).css(m);f.css(g);a.onLoad.call(this)})(d);a.autoClose==true&&b("body").mouseup(function(c){d.hasClass("active")&&(b(c.target).parents("#"+
a.idWrapper).length||!b(c.target).hasClass(a.classOpen)&&!b(c.target).hasClass(a.classToggle)&&s())});k.click(function(){d.hasClass("active")?s():r()});b(c).click(function(a){r();a.preventDefault()});b(f).click(function(a){d.hasClass("active")&&s();a.preventDefault()});b(l).click(function(a){d.hasClass("active")?s():r();a.preventDefault()});a.autoOpen==true&&r()})}})(jQuery);

$(document).ready(function(){
 	var isIE6 = ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined));

	if (!isIE6) {
		$('#stacks_in_254_page1container').dcSlick({location: $.trim('right').toLowerCase(),
									 align: $.trim('right').toLowerCase(),
									 boxBackground: '#232323',
									 boxSize: $.trim('303').toLowerCase(),
									 tabSize: $.trim('auto').toLowerCase(),
									 speed: 400, 
									 borderSize: 3,
									 offset: '174', 
									 tabOffset: '0',
									 autoOpen: false,
									 autoClose: true, 
									 centerTab: false,
									 tabText: ('CLICK ME'.match(/\.(jpe?g|png|gif)/) ? $('#stacks_in_254_page1containertabimage').html() : 'CLICK ME'),
									 tabLink: $.trim(''),
									 tabRounded: 0, 
									 opacity: 100,
								 	 classOpen: 'sticky-stacks_in_254_page1-open',
									 classClose: 'sticky-stacks_in_254_page1-close',
									 classToggle: 'sticky-stacks_in_254_page1-toggle',
									 idWrapper: 'dc-slick-stacks_in_254_page1'});
	}
});

	return stack;
})(stacks.stacks_in_254_page1);



