
// '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_26_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_26_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_26_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 ( 3 ) {
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 ( 1 ) {
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 ( 5 ) {
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 ( 0 ) {
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 ( 0 ) {
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 (0 != 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_26_page0);


// Javascript for stacks_in_10_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_10_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_10_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;
	

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// START DOOBOX HUNTER STACK XXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


$(document).ready(function(){

jQuery.url=function()
{var segments={};var parsed={};var options={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var parseUri=function()
{str=decodeURI(options.url);var m=options.parser[options.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[options.key[i]]=m[i]||"";}
uri[options.q.name]={};uri[options.key[12]].replace(options.q.parser,function($0,$1,$2){if($1){uri[options.q.name][$1]=$2;}});return uri;};var key=function(key)
{if(!parsed.length)
{setUp();}
if(key=="base")
{if(parsed.port!==null&&parsed.port!=="")
{return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";}
else
{return parsed.protocol+"://"+parsed.host+"/";}}
return(parsed[key]==="")?null:parsed[key];};var param=function(item)
{if(!parsed.length)
{setUp();}
return(parsed.queryKey[item]===null)?null:parsed.queryKey[item];};var setUp=function()
{parsed=parseUri();getSegments();};var getSegments=function()
{var p=parsed.path;segments=[];segments=parsed.path.length==1?{}:(p.charAt(p.length-1)=="/"?p.substring(1,p.length-1):path=p.substring(1)).split("/");};return{setMode:function(mode)
{strictMode=mode=="strict"?true:false;return this;},setUrl:function(newUri)
{options.url=newUri===undefined?window.location:newUri;setUp();return this;},segment:function(pos)
{if(!parsed.length)
{setUp();}
if(pos===undefined)
{return segments.length;}
return(segments[pos]===""||segments[pos]===undefined)?null:segments[pos];},attr:key,param:param};}();

var hunterQuery = jQuery.url.param('hunt');



if(typeof String.prototype.trim !== 'function') {
			String.prototype.trim = function() {
			return this.replace(/^\s+|\s+$/, '');
			}
		}
   
$.fn.stacks_in_10_page0shuffle = function() {

        var dooallElems = this.get(),
            getRandom = function(max) {
                return Math.floor(Math.random() * max);
            },
            shuffled = $.map(dooallElems, function(){
                var random = getRandom(dooallElems.length),
                    randEl = $(dooallElems[random]).clone(true)[0];
                dooallElems.splice(random, 1);
                return randEl;
            });
        
        this.each(function(i){
            $(this).replaceWith($(shuffled[i]));
        });
        
        return $(shuffled);
    };


 // xxxxxxxxx end the shuffle function if needed xxxxxxxxxxxx  

       
      var stacks_in_10_page0thiscat;
      var stacks_in_10_page0catTrimed;
	$("#stacks_in_10_page0 .stacks_in_10_page0doofiltercontainer").each(function() {
		stacks_in_10_page0thiscat = $(".stacks_in_10_page0doocat span", this).text().trim();
		var stacks_in_10_page0thiscatArray = stacks_in_10_page0thiscat.split(',');
		var stacks_in_10_page0doothis = $(this);
		// stacks_in_10_page0thiscatArray now holds this instance of cats and any multi cats in this section
		// next we loop through each pulled cat from this section, each cat is in a var named catname.
		$.each(stacks_in_10_page0thiscatArray, function(index, catname) {
		stacks_in_10_page0catTrimed = catname.trim().replace(/[^a-z0-9]/gi,"");
		$(stacks_in_10_page0doothis).addClass(stacks_in_10_page0catTrimed);

		if($("#" + stacks_in_10_page0catTrimed).length == 0){
		$(".stacks_in_10_page0catpicker").append('- <a href="#" id="'+stacks_in_10_page0catTrimed+'" class="stacks_in_10_page0doofilter">'+catname+'</a> ');
		}
		});
	});


       
   $("#stacks_in_10_page0allcat").click(function(){
       $(".stacks_in_10_page0doofiltercontainer").slideDown();
       $(".stacks_in_10_page0catpicker a").removeClass("stacks_in_10_page0current");
       $(this).addClass("stacks_in_10_page0current");
       return false;
   });
   
   
   
   $(".stacks_in_10_page0doofilter").click(function(){
        var thisFilter = $(this).attr("id");
        var filterboxheight = $("#stacks_in_10_page0").height();
        $("#stacks_in_10_page0").css("min-height",filterboxheight);
        $(".stacks_in_10_page0doofiltercontainer").slideUp();
        $("."+ thisFilter).slideDown('slow', function() {
        	 $("#stacks_in_10_page0").animate({"min-height":"10px"},"slow");
 		 });
        $(".stacks_in_10_page0catpicker a").removeClass("stacks_in_10_page0current");
        $(this).addClass("stacks_in_10_page0current");
        return false;
   });
   
   
   
    function openincat()
  {
  	var thisCategory = "Panda Coins";
  	if(hunterQuery != null){var thisCategory = hunterQuery};
  	thisCategory = thisCategory.replace(/[^a-z0-9]/gi,"");
  	var searchforcat = "#" + thisCategory;
  	var searchforcattrimmed = searchforcat.replace(/ +/g,"");

  	
   if ($(searchforcattrimmed).length ) {

		if(thisCategory == "View All"){
  			thisCategory = "stacks_in_10_page0allcat";
  			$(".stacks_in_10_page0doofiltercontainer").show();
  		}
  		else{
  			$(".stacks_in_10_page0doofiltercontainer").hide();
       	 $("."+ thisCategory).show();
       	 $(".stacks_in_10_page0catpicker a").removeClass("stacks_in_10_page0current");
       	 $("#stacks_in_10_page0% #"+thisCategory).addClass("stacks_in_10_page0current");
  		}

   }	
 
   }
   
   
   

   openincat();
	

   


});



// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// END DOOBOX HUNTER STACK XXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	return stack;
})(stacks.stacks_in_10_page0);


// Javascript for stacks_in_236_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_236_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_236_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;
	
// Image Safe v1.2.0 by Joe Workman
$(document).ready(function() {
	var bg_border_style = $('#stacks_in_236_page0').css('border-bottom-style');
	if (bg_border_style) { 
		var bg_border_color = $('#stacks_in_236_page0').css('border-bottom-color');
		var bg_border_top = $('#stacks_in_236_page0').css('border-top-width');
		var bg_border_right = $('#stacks_in_236_page0').css('border-right-width');
		var bg_border_bottom = $('#stacks_in_236_page0').css('border-bottom-width');
		var bg_border_left = $('#stacks_in_236_page0').css('border-left-width');
		$('#stacks_in_236_page0').css({'border-width':0});	
		$('#protected_stacks_in_236_page0').css({'border-style':bg_border_style,
								 'border-color':bg_border_color,
								 'border-top-width':bg_border_top,
								 'border-right-width':bg_border_right,
								 'border-bottom-width':bg_border_bottom,	
								 'border-left-width':bg_border_left
		});	
	}
	var img_height = $('#protected_stacks_in_236_page0 img').height();
	var img_width = $('#protected_stacks_in_236_page0 img').width();
	$('#protected_stacks_in_236_page0').height(img_height);
	$('#protected_stacks_in_236_page0').width(img_width);
	$('#protected_stacks_in_236_page0 a').height(img_height);

	var image_src = $("#protected_stacks_in_236_page0 img").attr("src");
	$("#protected_stacks_in_236_page0").css({'background-image':'url(' + image_src + ')'});
	$("#product_image_stacks_in_236_page0").height($("#protected_stacks_in_236_page0 img").height());
	$("#protected_stacks_in_236_page0").width($("#protected_stacks_in_236_page0 img").width());
	$("#protected_stacks_in_236_page0 img").remove();
	
	if ('block' == 'block') {
        $('img').each(function(index) {
            $(this).hide();
            $(this).wrap('<div id="image_safe_'+ index +'" />');
            $('#image_safe_'+ index ).height($(this).height());
            $('#image_safe_'+ index ).width($(this).width());
            $('#image_safe_'+ index ).css({'background-image':'url(' + $(this).attr('src') + ')'});       
            $('.centered_image #image_safe_'+ index ).css({'margin':'0 auto'});       
            $(this).remove();
        });
	}
});
// End Image Safe
	return stack;
})(stacks.stacks_in_236_page0);



