
// '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_1210_page18
// ---------------------------------------------------------------------

// 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_1210_page18 = {};

// 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_1210_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* cleanGallery D&D Stack developed by RWExtras http://rwextras.com */
/*******************************************************************************
 jquery.mb.components
 Copyright (c) 2001-2009. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy
 email: info@pupunzi.com
 site: http://pupunzi.com
 Licences: MIT, GPL
 ******************************************************************************/

/*
 * Name:jquery.mb.containerPlus
 * Version: 1.5.5
 */

(function($){

  jQuery.preloadBgnds = function(){
    for(var i = 0; i<arguments.length; i++){
      jQuery("<img>").attr("src", arguments[i]);
    }
  };

  jQuery.fn.mbGallery = function(NewOptions){
    return this.each(function() {
      $(this).hide();
      var galleryId = !this.id ? Math.floor(Math.random() * 100): this.id;
      var origGallery = this;
      if (origGallery.initialized) return;
      origGallery.initialized=true;
      $(origGallery).find("img").each( function(){if($(this).attr("src")) $(this).attr("srcx",$(this).attr("src"));});
      $(origGallery).find("img").removeAttr("src");
      var gallery = $(this).clone();
      gallery.attr("id","gall_"+galleryId);
      galleryId=gallery.attr("id");

      var closeThumbStrip,actualImg,actualThumb,thumbUnsel,thumbOver,thumbs,full,imgDesc;
      var opt = $.extend({}, $.fn.mbGallery.defaults, NewOptions);
      $.preloadBgnds(
              opt.iconFolder+"/thumb.gif",
              opt.iconFolder+"/play.gif",
              opt.iconFolder+"/loaded.gif",
              opt.iconFolder+"/separator.gif",
              opt.iconFolder+"/next.gif",
              opt.iconFolder+"/prev.gif"
 //           opt.iconFolder+"/close.gif"
              );

      opt.thumbsBorder = opt.thumbsBorder + "px solid";
      var thumbSel = {
        thumbSel:{border: opt.thumbsBorder, borderColor: opt.thumbSelectColor},
        thumbUnsel:{border: opt.thumbsBorder, borderColor: opt.thumbStripColor},
        thumbOver:{border: opt.thumbsBorder, borderColor: opt.thumbOverColor}
      };
      $.extend(opt, thumbSel);
      if(opt.slideTimer < 2000)
        opt.slideTimer = 2000;

      thumbUnsel = opt.thumbUnsel;
      thumbOver = opt.thumbOver;

      // GETTING THE ELEMENTS FOR THE GALLERY FROM THE PAGE
      thumbs = gallery.find(opt.thumbnailSelector);
      full = gallery.find(opt.imageSelector);

      imgDesc = gallery.find(opt.descSelector);
      imgDesc.find("img").each(function(){$(this).attr("src",$(this).attr("srcx"));});
      gallery.empty();
      thumbs.each(function(){$(this).attr("src",$(this).attr("srcx"));});
      full.each(function(){$(this).attr("src",$(this).attr("srcx"));});

      if(opt.startFrom == "random")
        opt.startFrom = Math.floor(Math.random() * full.length);

      function preloadImg(i) {
        $(thumbloading).find("img").attr("src", ""+opt.iconFolder+"/loader.gif");
        var IMG_URL = $(full [i]).attr("src");
        var IMGOBJ = new Image();
        IMGOBJ.onload = function()
        {
          $(thumbloading).find("img").attr("src", ""+opt.iconFolder+"/loaded.gif");
          changePhoto(i);
        };
        IMGOBJ.onerror = function()
        {
          alert("can't load " + IMG_URL);
        };
        IMGOBJ.src = IMG_URL;
      }

      var thumbPos = "";
      function setThumbPos(w) {
        var pos=0;
        switch(opt.thumbStripPos){
          case "left":
            pos= 0;
            break;
          case "center":
            pos=((w / 2) -(opt.thumbStripWidth / 2));
            break;
          case "right":
            pos=(w - opt.thumbStripWidth);
            break;
          default:
            pos= 0;
            break;
        }
        return pos;
      };

      thumbPos = setThumbPos(opt.galleryWidth);

      if(opt.containment=="")
        $("body").append("<div  id='mbg_"+galleryId+"'><div class='mbMask' id='mbMask_"+galleryId+"'></div><table id='tbl_"+galleryId+"'  cellpadding='0' cellspacing='0' height='"+opt.galleryHeight+"'><tr><td id ='gallery_"+galleryId+"' class='mbGallery'></td></tr></table></div>");
      else{
        $("#"+opt.containment).find(".gallery").remove();
        origGallery.initialized=false;        
        $("#"+opt.containment).append("<div class='gallery' id='mbg_"+galleryId+"'><div class='mbMask' id='mbMask_"+galleryId+"'></div><table id='tbl_"+galleryId+"'  cellpadding='0' cellspacing='0' height='"+opt.galleryHeight+"'><tr><td id ='gallery_"+galleryId+"' class='mbGallery'></td></tr></table></div>");
      }

      var galleryContainer= $("#tbl_"+galleryId).find('#gallery_'+galleryId);
      $(galleryContainer).css(
      {
        border: opt.galleryFrameBorder + "px solid " + opt.galleryFrameColor,
		borderRadius: 3+"px",
        background: opt.galleryColor
      });
      $(galleryContainer).append(gallery);

      // CREATE THE GALLERY STRUCTURE FOR FULLSIZE IMAGES
      $(gallery).append("<div class='FullImg'></div>");
      var fullImageArea =  $(gallery).find(".FullImg");

      var headerH = opt.labelHeight > 0 ? opt.labelHeight: opt.galleryFrameBorder;

      // thumbnail container
      $(galleryContainer).prepend("<div class='thumbBox'></div>");
      var thumbBox = $(galleryContainer).find(" .thumbBox");

      //thumbnail navigator
      $(thumbBox).prepend("<div class='header'>" +
                          "<table cellpadding='0' cellspacing='0' width='250'><tr>" +
                          "<td class='thumbWinBtn pointer' > </td>" +
                          "<td class='spacer' > </td>" +
                          "<td class='slideShow pointer' > </td>" +
                          "<td class='spacer' > </td>" +
                          "<td class='prev pointer' > </td>" +
                          "<td class='next pointer' > </td>" +
                          "<td class='spacer' > </td>" +
                          "<td class='loader'> </td>" +
                          "<td class='indexLabel' nowrap> </td>" +
                          "</tr></table>" +
                          "</div>");
      var header = $(thumbBox).find(".header");

      var thumbWinBtn = $(header).find(".thumbWinBtn");
      $(thumbWinBtn).append("<img src='"+opt.iconFolder+"/thumb.gif' class='thumbIco'>");

      var slideShow = $(header).find(".slideShow");
      $(slideShow).append("<img src='"+opt.iconFolder+"/play.gif' class='slideIco'>");

      var thumbloading = $(header).find(".loader");
      $(thumbloading).append("<img src='"+opt.iconFolder+"/loaded.gif'>");

      var spacer = $(header).find(".spacer");
      $(spacer).append("<img src='"+opt.iconFolder+"/separator.gif'>");

      var next = $(header).find(".next");
      $(next).append("<img src='"+opt.iconFolder+"/next.gif'>");

      var prev = $(header).find(".prev");
      $(prev).append("<img src='"+opt.iconFolder+"/prev.gif'>");

      var close = $(header).find(".close");
      $(close).append("<img src='"+opt.iconFolder+"/close.gif' alt='close'>");

      var indexLabel = $(thumbBox).find(" .indexLabel").html((opt.startFrom + 1) + "/<b>" + full.length + "</b>");

      //Thumbnails
      $(thumbBox).append("<div class='ThumbImg'></div>");
      var thumbImages = $(thumbBox).find(" .ThumbImg");
      $(thumbImages).prepend($(thumbs));


      $(thumbBox).append("<div class='descriptionBox'></div>");
      var descriptionBox= $(galleryContainer).find(".descriptionBox");

      if(opt.containment=="")
        $("#mbg_"+galleryId).css({
          position:"fixed",
          bottom:0,
          left:0,
          width:"100%",
          height:"100%",
          display:"none"
        });
      else
        $("#mbg_"+galleryId).css({
          position:"relative",
          width:"100%",
          height:"100%",
          display:"none"
        });

      $("#mbMask_"+galleryId).css({
        opacity: opt.maskOpacity,
        background: opt.maskBgnd,
        display:"none"
      });


      $("#tbl_"+galleryId).css({
        margin:"auto",
        top:opt.galleryTop,
        position:"relative"
      });


      $(descriptionBox).css(
      {
        position:"absolute",
        padding:10, fontSize: '12'+'px', lineHeight: '12'+'px',
        zIndex:0,
        width:opt.thumbStripWidth - 20
      });


      gallery.css(
      {
        width: opt.galleryWidth,
        height: opt.galleryHeight,
        overflow: "hidden"
      });

      $(thumbs).css(
      {
        width: opt.thumbHeight,
        height: "", //height: $.browser.msie?opt.thumbHeight:""
        padding:"0px",
        border:"1px solid "+opt.labelColor,
        cursor:"pointer"
      });

      $(thumbBox).css(
      {
        textAlign:"left",
        zIndex:1000,
        marginTop:"-" + (headerH + opt.galleryFrameBorder + 2) + "px", // was 0
        position:"absolute",
        width: opt.thumbStripWidth + "px",
        marginLeft: thumbPos + "px",
        zIndex:8888
      });

      $(thumbImages).css(
      {
        opacity: 1.0, //opt.headerOpacity
        backgroundColor:opt.thumbStripColor,
        border:"5px solid "+ opt.labelColor,
		marginTop: 10 + 2 + "px"
      });

      $(header).css(
      {
        opacity:opt.headerOpacity,
        textAlign:"left",
        color:opt.labelTextColor,
        padding:"0px",
        border:"0px",
        height:headerH
      });

      $(header).find("td").css(
      {
        background:opt.labelColorDisactive,
        padding:"2px",
        paddingRight:"11px",
        paddingBottom:"0",
        height:headerH,
        color:opt.labelTextColor,
        fontFamily:"Verdana, Arial",
        fontSize:opt.labelTextSize
      });

      $(".pointer").css({cursor:"pointer"});

      jQuery.fn.extend({
        getW:function() {
          var ow = $(this).width();
          if(opt.galleryMaxWidth > 0 && ow > opt.galleryMaxWidth) {
            $(this).attr("width", opt.galleryMaxWidth);
            ow = opt.galleryMaxWidth;
          }
          return ow;
        },
        getH:function() {
          var oh = $(this).height();
          if(opt.galleryMaxHeight > 0 && oh > opt.galleryMaxHeight) {
            $(this).attr("height", opt.galleryMaxHeight);
            oh = $(this).attr("height");
          }
          return oh;
        },
        getDim:function(){
          $(this).removeAttr("width");
          $(this).removeAttr("height");
          var oh = $(this).height();
          var noh = $(this).height();
          var ow = $(this).width();
          var now=$(this).width();
          var wh=opt.containment==""?$(window).height():$("#"+opt.containment).innerHeight();
          var ww=opt.containment==""?$(window).width():$("#"+opt.containment).innerWidth();
		  var dblborder = opt.galleryFrameBorder *2 + 5;
          if (opt.galleryMaxHeight>0 && oh>opt.galleryMaxHeight){noh=opt.galleryMaxHeight;}
          if (opt.galleryMaxWidth>0 && ow>opt.galleryMaxWidth){now=opt.galleryMaxWidth;}

          if (noh+opt.galleryTop>=wh){
            noh= wh-opt.galleryTop-dblborder;
            $(this).attr("height", noh);
            now=(noh*ow)/oh;
          }
          if (now+dblborder>=ww){
            now= ww-dblborder;
            $(this).attr("width", now);
            noh=(now*oh)/ow;
          }
          return [noh,now];
        }
      });
      function changePhoto(i) {
        $(descriptionBox).fadeTo(opt.fadeTime, 0);
        $(fullImageArea).fadeTo(opt.fadeTime, 0, function() {
          //replacing the image
          $(fullImageArea).html(full [i]);
          $(descriptionBox).html(imgDesc[i]);
          //showing the new image
          setTimeout(function() {
            $(fullImageArea).fadeTo(opt.fadeTime, 1);
            $(descriptionBox).fadeTo(opt.fadeTime, .8);
          }, opt.fadeTime);
          // if autosize option resize the image frame
          if(opt.autoSize) {
            //if a maxWith is set resize the image width
            var w = $(full [i]).getDim()[1];
            var h = $(full [i]).getDim()[0];
            //resize frame
            gallery.animate(
            {
              height: h,
              width: w
            }, opt.fadeTime);
            //if the thumbstrip has no width set the width according ti the frame width
            if(opt.thumbStripWidth == opt.galleryWidth) {
              $(thumbBox).animate(
              {
                width: full[i].offsetWidth
              },opt.fadeTime);
            } else {
              // if the thumbstrip has a width reposition it according to the image width
              var l = setThumbPos($(full[i]).width());
              $(thumbBox).animate(
              {
                marginLeft: l
              }, opt.fadeTime);
            }
          }
        });
        //redefine the indexLabels
        $(actualThumb).css(thumbUnsel);
        actualImg = full[i];
        actualThumb = thumbs[i];
        $(actualThumb).css(opt.thumbSel);
        $(indexLabel).html((i +1)+ "/<b>" + full.length + "</b>");
      }
      thumbs.each(function(i) {
        $(this).click(function() {
          x = i;
          stopShow();
          preloadImg(i);
          x++;
        });
      });
      gallery.show();

      // EVENTS
      var hideTumb, thumbOpen, headerMO;
      $(thumbWinBtn).click(function() {
        if( !thumbOpen) {
          $(thumbImages).slideDown(500);
          thumbOpen = true;
        } else {
          $(thumbImages).slideUp(500);
          thumbOpen = false;
        }
        stopShow();
      });

      $(fullImageArea).click(function() {
        stopShow();
      });
      $(fullImageArea).bind("dblclick",function() {
        startShow();
      });
      $(thumbBox).mouseover(function() {
        clearTimeout(hideTumb);
        clearTimeout(headerMO);
        $(header).find("td").css({opacity:opt.headerOpacity, background: opt.labelColor});
        clearTimeout(closeThumbStrip);
      });

      $(thumbBox).mouseout(function() {
        headerMO=setTimeout(function(){
          $(header).find("td").css({opacity:opt.headerOpacity, background: opt.labelColor});
        },100);
        hideTumb = setTimeout(function() {
          $(thumbImages).slideUp(500);
          thumbOpen = false;
        }, 1000);
      });
      $(thumbs).mouseover(function() {
        if(this != actualThumb) {
          $(this).css(thumbOver);
        }
      });
      $(thumbs).mouseout(function() {
        if(this != actualThumb) {
          $(this).css(thumbUnsel);
        }
      });
      $(slideShow).click(function() {
        startSlide = ! startSlide;
        if(startSlide) {
          startShow();
        } else {
          stopShow();}
      });
      var goOn;
      $(next).click( function() {
        stopShow();
        clearTimeout(goOn);
        x += 1;
        goOn = setTimeout(function() {
          if(x >= full.length) x = 0;
          preloadImg(x);
        }, 200);
      });
      $(prev).click( function() {
        stopShow();
        clearTimeout(goOn);
        x -= 1;
        goOn = setTimeout(function() {
          if(x < 0) x = full.length - 1;
          preloadImg(x);
        }, 200);
      });

      $("#mbMask_"+galleryId).click( function() {
        stopShow();
        origGallery.initialized=false;
          $(this).fadeOut("slow",function(){
            $("#mbg_"+galleryId).slideUp("slow", function(){$("#mbg_"+galleryId).remove();});
          });
      });

      actualImg = full [opt.startFrom];
      $(thumbs).css(thumbUnsel);
      actualThumb = thumbs [opt.startFrom];
      $(actualThumb).css(thumbSel);
      closeThumbStrip = setTimeout(function() {
        $(thumbImages).hide(500);
      }, 2000);
      var slideShowTimer,
              x = opt.startFrom,
              startSlide = opt.autoSlide;

      function startShow() {
        $(slideShow).find("img").attr("src", opt.iconFolder+"/stop.gif");
        if(x == full.length)
          x = 0;
        preloadImg(x);
        slideShowTimer = setTimeout(startShow, opt.slideTimer);
        x ++;
      };
      function stopShow() {
        clearTimeout(slideShowTimer);
        $(slideShow).find("img").attr("src", opt.iconFolder+"/play.gif");
        startSlide = false;
      }

      if(startSlide) {
        setTimeout(startShow, opt.startTimer);
      } else {
        setTimeout(function() {
          preloadImg(opt.startFrom);
        }, opt.startTimer);
      }
      if (opt.containment==""){
        $("#mbg_"+galleryId).mb_bringToFront().slideDown("slow",function(){
          $("#mbMask_"+galleryId).fadeIn("slow");
        });
      }else{
        $("#mbg_"+galleryId).mb_bringToFront().fadeIn("slow",function(){
//          $("#mbMask_"+galleryId).fadeIn("slow");
        });
      };
    });
  };

	$.fn.mbGallery.defaults = {
	    containment:"body",
	    galleryTop:40,
	    galleryWidth: 50,
	    galleryHeight: 50,
	    galleryMaxWidth: 0,
	    galleryMaxHeight: 0,
	    galleryColor: "#333",
	    galleryFrameBorder: 12,
	    galleryFrameColor: "#fff",
	    maskOpacity:.5,
	    maskBgnd:"transparent",

	    startFrom: "random",
	    headerOpacity: 0.8,
	    thumbsBorder: 4,
	    thumbHeight: 60,
	    thumbStripWidth:250,
	    thumbStripColor: "#333333",
	    thumbStripPos: "right",
	    thumbSelectColor: "black",
	    thumbOverColor: "#cccccc",
	    imageSelector: ".imgFull",
	    thumbnailSelector: ".imgThumb",
	    descSelector: ".imgDesc",
	    descriptionWidth:300,

	    labelColor: "#333",
	    labelColorDisactive: "#333",
	    labelTextColor: "#fff",
	    labelTextSize: "11px",
	    labelHeight: 20,

	    iconFolder: "elements/white",
	    fadeTime: 500,
	    autoSlide: true,
	    slideTimer: 6000,
	    autoSize: true,
	    startTimer:0
	};

  jQuery.fn.mb_bringToFront= function(){
    var zi=10;
    $('*').each(function() {
      if($(this).css("position")=="absolute"){
        var cur = parseInt($(this).css('zIndex'));
        zi = cur > zi ? parseInt($(this).css('zIndex')) : zi;
      }
    });
    $(this).css('zIndex',zi+=1);
    return $(this);
  };

})(jQuery);

jQuery(document).ready(function($){
	$('#gstacks_in_1210_page18 img.imageStyle').removeClass('imageStyle').addClass('imgFull').removeAttr('width').removeAttr('height');
	$('#gstacks_in_1210_page18 img.imgFull').clone().removeClass('imgFull').addClass('imgThumb').removeAttr('width').removeAttr('height').appendTo('#gstacks_in_1210_page18');

	$.fn.mbGallery.defaults={
            galleryWidth: 50,
            galleryHeight: 50,
            galleryMaxWidth: 0,
            galleryColor: "#FFFFFF",galleryColor: "transparent",
            galleryFrameBorder: 10,
            galleryFrameColor: "#FFFFFF",
            maskOpacity:.5,
            maskBgnd:"#000",

            startFrom: "random",
            headerOpacity: 0.7,
            thumbsBorder: 2,
            thumbHeight: 50,
            thumbStripWidth:250,
            thumbStripColor: "#333333",
            thumbStripPos: "left",
            thumbSelectColor: "#FFFFFF",
            thumbOverColor: "#ffffff",
            imageSelector: ".imgFull",
            thumbnailSelector: ".imgThumb",
            descSelector: ".imgDesc",
            descriptionWidth:300,

            labelColor: "#333",
            labelColorDisactive: "#333",
            labelTextColor: "#fff",
            labelTextSize: "11px",
            labelHeight: 20,

            iconFolder: "files/cgimages/color",
            autoSlide: true,
            autoSize: true,
            startTimer:0,
            slideTimer: 6000,
            fadeTime: 800
          };
			$('#gstacks_in_1210_page18').mbGallery({containment:'galleryPlacestacks_in_1210_page18'});
});

	return stack;
})(stacks.stacks_in_1210_page18);


// Javascript for stacks_in_1225_page18
// ---------------------------------------------------------------------

// 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_1225_page18 = {};

// 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_1225_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1225_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1225_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1225_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1225_page18);


// Javascript for stacks_in_1235_page18
// ---------------------------------------------------------------------

// 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_1235_page18 = {};

// 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_1235_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1235_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1235_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1235_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1235_page18);


// Javascript for stacks_in_1241_page18
// ---------------------------------------------------------------------

// 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_1241_page18 = {};

// 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_1241_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1241_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1241_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1241_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1241_page18);


// Javascript for stacks_in_1249_page18
// ---------------------------------------------------------------------

// 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_1249_page18 = {};

// 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_1249_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1249_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1249_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1249_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1249_page18);


// Javascript for stacks_in_1255_page18
// ---------------------------------------------------------------------

// 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_1255_page18 = {};

// 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_1255_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1255_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1255_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1255_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1255_page18);


// Javascript for stacks_in_1261_page18
// ---------------------------------------------------------------------

// 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_1261_page18 = {};

// 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_1261_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1261_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1261_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1261_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1261_page18);


// Javascript for stacks_in_1268_page18
// ---------------------------------------------------------------------

// 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_1268_page18 = {};

// 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_1268_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1268_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1268_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1268_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1268_page18);


// Javascript for stacks_in_1276_page18
// ---------------------------------------------------------------------

// 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_1276_page18 = {};

// 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_1276_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1276_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1276_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1276_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1276_page18);


// Javascript for stacks_in_1288_page18
// ---------------------------------------------------------------------

// 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_1288_page18 = {};

// 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_1288_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1288_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1288_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1288_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1288_page18);


// Javascript for stacks_in_1303_page18
// ---------------------------------------------------------------------

// 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_1303_page18 = {};

// 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_1303_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1303_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1303_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1303_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1303_page18);


// Javascript for stacks_in_1315_page18
// ---------------------------------------------------------------------

// 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_1315_page18 = {};

// 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_1315_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1315_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1315_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1315_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1315_page18);


// Javascript for stacks_in_1330_page18
// ---------------------------------------------------------------------

// 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_1330_page18 = {};

// 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_1330_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1330_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1330_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1330_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1330_page18);


// Javascript for stacks_in_1342_page18
// ---------------------------------------------------------------------

// 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_1342_page18 = {};

// 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_1342_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1342_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1342_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1342_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1342_page18);


// Javascript for stacks_in_1357_page18
// ---------------------------------------------------------------------

// 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_1357_page18 = {};

// 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_1357_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1357_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1357_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1357_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1357_page18);


// Javascript for stacks_in_1369_page18
// ---------------------------------------------------------------------

// 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_1369_page18 = {};

// 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_1369_page18 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_1369_page18 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_1369_page18").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_1369_page18").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_1369_page18);


// Javascript for stacks_in_0_page18
// ---------------------------------------------------------------------

// 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_0_page18 = {};

// 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_0_page18 = (function(stack) {

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

//-- Elevator Stack v1.0.0 by Joe Workman --//
/* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing  */
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;
	}
});
/* UItoTop jQuery Plugin 1.1 - http://www.mattvarone.com/web-design/uitotop-jquery-plugin */
(function($){
	$.fn.UItoTop = function(options) {

 		var defaults = {
			text: 'To Top',
			min: 200,
			inDelay:600,
			outDelay:400,
  			containerID: 'toTop',
			containerHoverID: 'toTopHover',
			scrollSpeed: 1200,
			easingType: 'linear'
 		};

 		var settings = $.extend(defaults, options);
		var containerIDhash = '#' + settings.containerID;
		var containerHoverIDHash = '#'+settings.containerHoverID;
		
		$('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
		$(containerIDhash).hide().click(function(){
			$('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
			$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
			return false;
		})
		.prepend('<span id="'+settings.containerHoverID+'"></span>')
		.hover(function() {
				$(containerHoverIDHash, this).stop().animate({
					'opacity': 1
				}, 600, 'linear');
			}, function() { 
				$(containerHoverIDHash, this).stop().animate({
					'opacity': 0
				}, 700, 'linear');
			});
					
		$(window).scroll(function() {
			var sd = $(window).scrollTop();
			if(typeof document.body.style.maxHeight === "undefined") {
				$(containerIDhash).css({
					'position': 'absolute',
					'top': $(window).scrollTop() + $(window).height() - 50
				});
			}
			if ( sd > settings.min ) 
				$(containerIDhash).fadeIn(settings.inDelay);
			else 
				$(containerIDhash).fadeOut(settings.Outdelay);
		});
};
})(jQuery);

$(document).ready(function() {	
    $().UItoTop({ easingType:'easeOutQuart', scrollSpeed:1200, min:200 });		
});
//-- End Elevator Stack --//

	return stack;
})(stacks.stacks_in_0_page18);



