
// '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_4_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_4_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_4_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;
	

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// TABBY STACK BY http://www.doobox.co.uk XXXXXXX
// COPYRIGHT@2010 MR JG SIMPSON, TRADING AS DOOBOX
// ALL RIGHTS RESERVED XXXXXXXXXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

/*
PIE: CSS3 rendering for IE
Version 1.0beta4
http://css3pie.com
Dual-licensed for use under the Apache License Version 2.0 or the General Public License (GPL) Version 2.
*/


$(document).ready(function() {

if(typeof String.prototype.trim !== 'function') {
			String.prototype.trim = function() {
			return this.replace(/^\s+|\s+$/, '');
			}
		}
       
      var stacks_in_4_page0thiscat;
      var stacks_in_4_page0catTrimed;
	$("#stacks_in_4_page0 .stacks_in_4_page0dootabcontainer").each(function() {
		stacks_in_4_page0thiscat = $(".stacks_in_4_page0doocat .stacks_in_4_page0tabname", this).text().trim();
		var stacks_in_4_page0thiscatArray = stacks_in_4_page0thiscat.split(',') 
		var stacks_in_4_page0doothis = $(this);
		
		$.each(stacks_in_4_page0thiscatArray, function(index, catname) {
		stacks_in_4_page0catTrimed = catname.replace(/[^a-z0-9]/gi,"");
		$(stacks_in_4_page0doothis).addClass(stacks_in_4_page0catTrimed);
		var stacks_in_4_page0isCatFound = $("#stacks_in_4_page0tabpicker").html().search(catname);
		if(stacks_in_4_page0isCatFound == -1){
		$("#stacks_in_4_page0tabpicker").append('<a href="#" id="'+stacks_in_4_page0catTrimed+'" class="stacks_in_4_page0doofilter">'+catname+'</a> ');
		}
		});
	});


       

   
   $(".stacks_in_4_page0doofilter").click(function(){
        var thisFilter = $(this).attr("id");
        var filterboxheight = $("#stacks_in_4_page0").height();
        $(".stacks_in_4_page0overalltabcontainer").css("min-height",filterboxheight);
        $(".stacks_in_4_page0dootabcontainer").slideUp();
        $("."+ thisFilter).slideDown('slow', function() {
        	 $(".stacks_in_4_page0overalltabcontainer").animate({"min-height":"10px"},"slow");
 		 });
        $("#stacks_in_4_page0tabpicker a").removeClass("stacks_in_4_page0current");
        $(this).addClass("stacks_in_4_page0current");
        return false;
   });
   

   $("#stacks_in_4_page0tabpicker a:first-child").addClass("stacks_in_4_page0current");


});



// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// END DOOBOX TABBY STACK XXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	return stack;
})(stacks.stacks_in_4_page0);


// Javascript for stacks_in_25_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_25_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_25_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;
	
// imagelist Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {


if("no" == "yes"){
var thefirstsource = $( "#stacks_in_25_page0:first-child img" ).attr("src");
$( "#stacks_in_25_page0 .listIcon .centered_image" ).each(function(){
$(this).html('<img width="128" height="128" src="' + thefirstsource + '" />');
});
}

else{

$("#stacks_in_25_page0 .listIcon").each(function(){
if(!$(this).find("img").attr("src")){
$(this).html('<img width="128" height="128" src="index_files/imagelistimages/tick.png" />');
}
});

}

$( "#stacks_in_25_page0 li" ).css("list-style-type", "none");
});

	return stack;
})(stacks.stacks_in_25_page0);


// Javascript for stacks_in_48_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_48_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_48_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;
	
// imagelist Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {


if("no" == "yes"){
var thefirstsource = $( "#stacks_in_48_page0:first-child img" ).attr("src");
$( "#stacks_in_48_page0 .listIcon .centered_image" ).each(function(){
$(this).html('<img width="128" height="128" src="' + thefirstsource + '" />');
});
}

else{

$("#stacks_in_48_page0 .listIcon").each(function(){
if(!$(this).find("img").attr("src")){
$(this).html('<img width="128" height="128" src="index_files/imagelistimages/tick.png" />');
}
});

}

$( "#stacks_in_48_page0 li" ).css("list-style-type", "none");
});

	return stack;
})(stacks.stacks_in_48_page0);


// Javascript for stacks_in_76_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_76_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_76_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;
	
// imagelist Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {


if("no" == "yes"){
var thefirstsource = $( "#stacks_in_76_page0:first-child img" ).attr("src");
$( "#stacks_in_76_page0 .listIcon .centered_image" ).each(function(){
$(this).html('<img width="128" height="128" src="' + thefirstsource + '" />');
});
}

else{

$("#stacks_in_76_page0 .listIcon").each(function(){
if(!$(this).find("img").attr("src")){
$(this).html('<img width="128" height="128" src="index_files/imagelistimages/tick.png" />');
}
});

}

$( "#stacks_in_76_page0 li" ).css("list-style-type", "none");
});

	return stack;
})(stacks.stacks_in_76_page0);


// Javascript for stacks_in_95_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_95_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_95_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;
	
// imagelist Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {


if("no" == "yes"){
var thefirstsource = $( "#stacks_in_95_page0:first-child img" ).attr("src");
$( "#stacks_in_95_page0 .listIcon .centered_image" ).each(function(){
$(this).html('<img width="128" height="128" src="' + thefirstsource + '" />');
});
}

else{

$("#stacks_in_95_page0 .listIcon").each(function(){
if(!$(this).find("img").attr("src")){
$(this).html('<img width="128" height="128" src="index_files/imagelistimages/tick.png" />');
}
});

}

$( "#stacks_in_95_page0 li" ).css("list-style-type", "none");
});

	return stack;
})(stacks.stacks_in_95_page0);


// Javascript for stacks_in_120_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_120_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_120_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;
	
//-- Like It Stack v1.1.0 by Joe Workman --//

/*  Tallest jQuery Plugin
 *	@author	nickf
 *	@date	2009-08-19
 *	@version 1.0 $Id: jquery.tallest.js 100 2009-08-19 00:40:09Z spadgos $
 */
jQuery(function($) {
	$.fn.tallest = function()       { return this._extremities({ 'aspect' : 'height', 'max' : true  })[0] };
	$.fn.tallestSize = function()   { return this._extremities({ 'aspect' : 'height', 'max' : true  })[1] };
	$.fn.shortest = function()      { return this._extremities({ 'aspect' : 'height', 'max' : false })[0] };
	$.fn.shortestSize = function()  { return this._extremities({ 'aspect' : 'height', 'max' : false })[1] };
	$.fn.widest = function()        { return this._extremities({ 'aspect' : 'width',  'max' : true  })[0] };
	$.fn.widestSize = function()    { return this._extremities({ 'aspect' : 'width',  'max' : true  })[1] };
	$.fn.thinnest = function()      { return this._extremities({ 'aspect' : 'width',  'max' : false })[0] };
	$.fn.thinnestSize = function()  { return this._extremities({ 'aspect' : 'width',  'max' : false })[1] };
	$.fn._extremities = function(options) {
		var defaults = {
			aspect : 'height', // or 'width'
			max : true	// or false to find the min
		};
		options = $.extend(defaults, options);
		if (this.length < 2) {
			return [this, this[options.aspect]()];
		}
		var bestIndex = 0,
			bestSize = this.eq(0)[options.aspect](),
			thisSize
		;
		for (var i = 1; i < this.length; ++i) {
			thisSize = this.eq(i)[options.aspect]();
			if ((options.max && thisSize > bestSize) || (!options.max && thisSize < bestSize)) {
				bestSize = thisSize;
				bestIndex = i;
			}
		}
		return [ this.eq(bestIndex), bestSize ];
	};
});
(function($){ 
    $.getScript = function(url, callback, cache){
    	$.ajax({
    			type: "GET",
    			url: url,
    			success: callback,
    			dataType: "script",
    			cache: true
    	});
    };
})(jQuery)

$(document).ready(function() {	
    
// Twitter Buttons
switch ( 2 ) {
case 1:
	$('#like_twitter1 a').attr('data-count', 'vertical');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 2:
    $('#like_twitter2 a').attr('data-count', 'horizontal');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 3:
    $('#like_twitter3 a').attr('data-count', 'none');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
default:
    // Do Nothing
}
// Google Buttons
switch ( 4 ) {
case 1:
	$('#like_google1 .like_google').html('<g:plusone size="small" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 2:
	$('#like_google2 .like_google').html('<g:plusone size="small" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 3:
	$('#like_google3 .like_google').html('<g:plusone size="medium" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 4:
	$('#like_google4 .like_google').html('<g:plusone size="medium" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 5:
	$('#like_google5 .like_google').html('<g:plusone size="standard" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 6:
	$('#like_google6 .like_google').html('<g:plusone size="standard" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 7:
	$('#like_google7 .like_google').html('<g:plusone size="tall" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
default:
    // Do Nothing
}

// Facebook Buttons
switch ( 2 ) {
case 1:
    $('#like_facebook1 .like_facebook').html('<fb:like show_faces="false" width="280"></fb:like>');
    break;
case 2:
    $('#like_facebook2 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50"></fb:like>');
    break;
case 3:
    $('#like_facebook3 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50"></fb:like>');
    break;
case 4:
    $('#like_facebook4 .like_facebook').html('<fb:like show_faces="false" width="450" action="recommend"></fb:like>');
    break;
case 5:
    $('#like_facebook5 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
case 6:
    $('#like_facebook6 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
default:
    // Do Nothing
}
// Digg Buttons
switch ( 3 ) {
case 1:
    $('#like_digg1 a').addClass('DiggWide');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 2:
    $('#like_digg2 a').addClass('DiggMedium');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 3:
    $('#like_digg3 a').addClass('DiggCompact');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 4:
    $('#like_digg4 a').addClass('DiggIcon');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
default:
    // Do Nothing
}
// LinkedIn Buttons
switch ( 2 ) {
case 1:
    $('#like_linkedin1').html('<script type="in/share" data-counter="top"></script>');
    $.getScript('http://platform.linkedin.com/in.js');
    break;
case 2:
	$('#like_linkedin2').html('<script type="in/share" data-counter="right"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
case 3:
	$('#like_linkedin3').html('<script type="in/share"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
default:
    // Do Nothing
}
// Evernote Button
if (2 != 0) {
    $.getScript('http://static.evernote.com/noteit.js');
}
//Email Button
$('.like_email a').attr('href','mailto:?subject=Check out this webpage&body='+location.href);
// Make all buttons have the same height and display it
// $('.like_button_wrapper').height( $('.like_button').tallest().height() );
});

//-- End Like It Stack --//
	return stack;
})(stacks.stacks_in_120_page0);


// Javascript for stacks_in_133_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_133_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_133_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_133_page0 = function (options) 
	{
		jsp(this).html('<div id="SPbutton_stacks_in_133_page0"></div><div id="SPBlock_stacks_in_133_page0"></div>');
		//jsp(this).addClass('SPactive');
		jsp('div#SPbutton_stacks_in_133_page0').toggle(function () 
		{
			//
			//closePanels();
					
			//jsp("#SPBlock_stacks_in_133_page0").topZIndex( { increment: 5 } );
			//jsp("#SPbutton_stacks_in_133_page0").topZIndex( { increment: 5 } );
			jsp(this).animate({"marginTop": "-=2px"},"fast");
			jsp('#SPBlock_stacks_in_133_page0').animate({"marginTop": "-=0px"},"fast");
			jsp(this).animate({"marginTop": "+=300px"},"slow");
			jsp('#SPBlock_stacks_in_133_page0').animate({"marginTop": "+=300px"},"slow");
						
			// Make active
			//jsp(this).addClass('activeslp');
		},
		function () 
		{
			jsp('#SPBlock_stacks_in_133_page0').animate({"marginTop": "-=300px"},"slow");
			jsp(this).animate({"marginTop": "-=300px"},"slow").animate({"marginTop": "+=2px"},"fast");
			// active
			//jsp(this).removeClass('activeslp');
		});//toggle
	}
})(jQuery);

	jQuery(function(){
		jsp('body').append('<div id="SlidingPanel_stacks_in_133_page0"></div>');
		jsp('#SlidingPanel_stacks_in_133_page0').SPbutton_stacks_in_133_page0();
		jsp('#SPBlock_stacks_in_133_page0').html( jsp('#SlidingPanelContent_stacks_in_133_page0').html() );
		jsp('#SPbutton_stacks_in_133_page0').html( jsp('#button_stacks_in_133_page0').html() );
		jsp('#SlidingPanelContent_stacks_in_133_page0').remove();
		jsp('#button_stacks_in_133_page0').remove();
		var oldheight = jsp('#SPBlock_stacks_in_133_page0').height();
		var newheight = oldheight - 2;
		jsp('#SPBlock_stacks_in_133_page0').height( newheight ); 
	});
	
//	function closePanels() {
//		jsp("div[id^='SPbutton']").each(function(){
//			if( jsp(this).hasClass('activeslp') )
//			{
//				jsp(this).click();
//			}
//		});
//	}
	return stack;
})(stacks.stacks_in_133_page0);


// Javascript for stacks_in_155_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_155_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_155_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;
	

  

  jQuery(document).ready(function($){

function findPlainTextExceptInLinks(element, substring, callback) {
    for (var childi= element.childNodes.length; childi-->0;) {
        var child= element.childNodes[childi];
        if (child.nodeType===1) {
            if (child.tagName.toLowerCase()!=='a')
                findPlainTextExceptInLinks(child, substring, callback);
        } else if (child.nodeType===3) {
            var index= child.data.length;
            while (true) {
                index= child.data.lastIndexOf(substring, index);
                if (index===-1)
                    break;
                callback.call(window, child, index)
            }
        }
    }
}

var substring= 'TeleportMe';
findPlainTextExceptInLinks(document.body, substring, function(node, index) {
    node.splitText(index+substring.length);
    var span= document.createElement('span');
    span.className = "teleportHere";
    span.appendChild(node.splitText(index));
    node.parentNode.insertBefore(span, node.nextSibling);
});


var injectionStack = $("#stacks_in_155_page0 .teleportMe").html();


$(".teleportHere").replaceWith(injectionStack);
$("#stacks_in_155_page0 .teleportMe").hide();

});
	return stack;
})(stacks.stacks_in_155_page0);


// Javascript for stacks_in_177_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_177_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_177_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;
	
// Lightbox v2.1.1 by Joe Workman
$(document).ready(function() {
	if ('noncompliant' == 'noncompliant') {
    	var img_height = $('#compliant_paylog img').height();
    	var img_width = $('#compliant_paylog img').width();
    	var image_src = $("#compliant_paylog img").attr("src");

    	$('#compliant_paylog').height(img_height);
    	$('#compliant_paylog').width(img_width);
    	$('#compliant_paylog a').height(img_height);
    	$("#compliant_paylog").css({'background-image':'url(' + image_src + ')'});
    	$("#compliant_paylog div").remove();
	}
});
// End Lightbox
	return stack;
})(stacks.stacks_in_177_page0);



