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

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

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/* TableBildr Stack by RWExtras v.1.1.0 */
/* Copyright (c) 2011 Mauricio Sabene RWExtras (http://rwextras.com) */
function $addStripes() {$('#stacks_in_43_page0 table.tablebildr tr:odd').addClass("alt")};
function $removeStripes() {$('#stacks_in_43_page0 table.tablebildr tr').removeClass("alt")};
jQuery(document).ready(function($){
$('<table class="tablebildr"><tbody></tbody></table>').insertBefore('#temptablestacks_in_43_page0');
var $rowdata = "";var $currbg='';var $currtxt='';
var $index = 0;
var $maxrows = 1;
var $maxcols = 1;
var $cellcontent = "";
var $emptycell = '<p style="text-align:center;">Empty cell: Please add content</p>';
var $cells = $('#temptablestacks_in_43_page0 > div.stacks_out');
for(var i = 0; i < $maxrows; i++) {
	$rowdata = '<tr class="tb_row'+ i + '">';
	for(var j = 0; j < $maxcols; j++) {
		var $currentcell = $cells.eq($index).html();
		if($currentcell == null) {
		$cellcontent = $emptycell }
		else {
		var $currentID = $cells.eq($index).attr('id');
		$cellcontent = '<div id="' + $currentID +'" class="stacks_out">' + $currentcell + '</div><div class="stacks_clearer"></div>';
		}
		$rowdata = $rowdata + '<td class="tb_row'+ i + ' tb_col'+ j +'">' + $cellcontent + '</td>';
		$index = $index + 1;
		}
	$rowdata = $rowdata + '</tr>';
	$($rowdata).appendTo('#stacks_in_43_page0 table.tablebildr');
	}
var $cornercell = $('#stacks_in_43_page0 table.tablebildr tbody tr td.tb_row0.tb_col0 .stacks_in span');
var $headerfontcolor = $cornercell.css('color');
var $headerfontsize = $cornercell.css('font-size');
if ('hideheader' == 'showheader'){
	$('#stacks_in_43_page0 table.tablebildr tbody tr.tb_row0 td').css({'background-color':'#CCCCCC', 'font-weight':'bold','text-align':'center','color':$headerfontcolor,'font-size':$headerfontsize});
}
if ('hideheadercol' == 'showheadercol'){
	$('#stacks_in_43_page0 table.tablebildr tbody td[class$="tb_col0"]').css({'background-color':'#CCCCCC', 'font-weight':'bold','text-align':'left','color':$headerfontcolor,'font-size':$headerfontsize});
}
if(false == true) {$addStripes();}
if(true == true) {$('#stacks_in_43_page0 table.tablebildr tr').hover(function() {$removeStripes(); $(this).addClass('over');}, function() {$(this).removeClass('over'); if(false == true){$addStripes();};});}
if(false == true) {$('#stacks_in_43_page0 table.tablebildr td').hover(function() {$removeStripes(); var $colx = $(this).attr('class'); $colx = $colx.split(' '); $('#stacks_in_43_page0 table.tablebildr td.'+$colx[1]).addClass('overc');}, function() {$('#stacks_in_43_page0 table.tablebildr td').removeClass('overc');if(false == true){$addStripes();}});}
if(false == true) { var $hilitecolor = (true == true || false == true)?'hilite':'hilite2'; $('#stacks_in_43_page0 table.tablebildr td').hover(function() {$(this).addClass($hilitecolor);}, function() {$(this).removeClass($hilitecolor);});};
$('#temptablestacks_in_43_page0').remove();
});

	return stack;
})(stacks.stacks_in_43_page0);


// Javascript for stacks_in_50_page0
// ---------------------------------------------------------------------

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

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
//(function (jsp) {
//jsp.topZIndex = function (selector) {
//        return Math.max(0, Math.max.apply(null, jsp.map(jsp(selector || ".SPactive *"), 
//                function (v) {
//                        return parseInt(jsp(v).css("z-index")) || null;
//                }
//        )));
//};

//jsp.fn.topZIndex = function (opt) {
//        if (this.length === 0) {
//                return this;
//        }
//       opt = jsp.extend({increment: 1, selector: ".SPactive *"}, opt);
//        var zmax = jsp.topZIndex(opt.selector), inc = opt.increment;
//        return this.each(function () {
//                jsp(this).css("z-index", zmax += inc);
//        });
//	};
//})(jQuery);

var jsp = jQuery.noConflict();
(function (jQuery) {
	jsp.fn.SPbutton_stacks_in_50_page0 = function (options) 
	{
		jsp(this).html('<div id="SPbutton_stacks_in_50_page0"></div><div id="SPBlock_stacks_in_50_page0"></div>');
		//jsp(this).addClass('SPactive');
		jsp('div#SPbutton_stacks_in_50_page0').toggle(function () 
		{
			//
			closePanels();

			//jsp("#SPBlock_stacks_in_50_page0").topZIndex( { increment: 5 } );
			//jsp("#SPbutton_stacks_in_50_page0").topZIndex( { increment: 5 } );
			jsp(this).animate({"marginLeft": "-=3px"},"fast");
			jsp('#SPBlock_stacks_in_50_page0').animate({"marginLeft": "-=0px"},"fast");
			jsp(this).animate({"marginLeft": "+=330px"},"slow");
			jsp('#SPBlock_stacks_in_50_page0').animate({"marginLeft": "+=330px"},"slow");
						
			// Make active
			jsp(this).addClass('activeslp');
		},
		function () 
		{
			jsp('#SPBlock_stacks_in_50_page0').animate({"marginLeft": "-=330px"},"slow");
			jsp(this).animate({"marginLeft": "-=330px"},"slow").animate({"marginLeft": "+=3px"},"fast");
			// active
			jsp(this).removeClass('activeslp');
		});//toggle
	}
})(jQuery);

	jQuery(function() {
		jsp('body').append('<div id="SlidingPanel_stacks_in_50_page0"></div>');
		jsp('#SlidingPanel_stacks_in_50_page0').SPbutton_stacks_in_50_page0();
		jsp('#SPBlock_stacks_in_50_page0').html( jsp('#SlidingPanelContent_stacks_in_50_page0').html() );
		jsp('#SPbutton_stacks_in_50_page0').html( jsp('#button_stacks_in_50_page0').html() );
		jsp('#SlidingPanelContent_stacks_in_50_page0').remove();
		jsp('#button_stacks_in_50_page0').remove();
		var oldwidth = jsp('#SPBlock_stacks_in_50_page0').width();
		var newwidth = oldwidth - 3;
		jsp('#SPBlock_stacks_in_50_page0').width( newwidth ); 
	});
		
	function closePanels() {
		jsp("div[id^='SPbutton']").each(function(){
			if( jsp(this).hasClass('activeslp') )
			{
				jsp(this).click();
			}
		});
	}
	return stack;
})(stacks.stacks_in_50_page0);



