
// '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_699_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_699_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_699_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;
	
$(document).ready(function() {

if (navigator.userAgent.match(/MSIE/i) != null) {


jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	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;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		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];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};

var irbgimage = $("#stacks_in_699_page0 .stacks_in_699_page0imageroundr img").attr("src");
var irimagewidth = $("#stacks_in_699_page0 .stacks_in_699_page0imageroundr img").attr("width");
var irimageheight = $("#stacks_in_699_page0 .stacks_in_699_page0imageroundr img").attr("height");



var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_699_page0 .stacks_in_699_page0imageroundr").css({
	"width": irimagewidth + "px",
	"height": irimageheight + "px",
	"margin": "0 auto 0 auto",
	"background":"url("+irbgimage+")",
    "-webkit-border-radius" : "10px 10px 10px 10px",
    "-moz-border-radius" : "10px 10px 10px 10px",
    "border-radius" : "10px 10px 10px 10px"
    });
}
else{ 
$("#stacks_in_699_page0 .stacks_in_699_page0imageroundr img").css("visibility","hidden");

    $("#stacks_in_699_page0 .stacks_in_699_page0imageroundr").css({
    "width": irimagewidth + "px",
	"height": irimageheight + "px", 
    "margin": "0 auto 0 auto",
    "background":"url("+irbgimage+")",
    "-webkit-border-radius" : "10px 10px 10px 10px",
    "-moz-border-radius" : "10px 10px 10px 10px",
    "border-radius" : "10px 10px 10px 10px",
    "behavior":"url(" + yourfolder + "files/IRPIE.htc)", 
        "box-shadow" : "0px 5px 0px #000000 display:none;",
		        "-pie-box-shadow" : "0px 5px 0px #000000 display:none;"

	});
}

} // end if i.e. from the top if statment

});

	return stack;
})(stacks.stacks_in_699_page0);


// Javascript for stacks_in_701_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_701_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_701_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_701_page0thiscat;
      var stacks_in_701_page0catTrimed;
	$("#stacks_in_701_page0 .stacks_in_701_page0dootabcontainer").each(function() {
		stacks_in_701_page0thiscat = $(".stacks_in_701_page0doocat .stacks_in_701_page0tabname", this).text().trim();
		var stacks_in_701_page0thiscatArray = stacks_in_701_page0thiscat.split(',');
		var stacks_in_701_page0doothis = $(this);
		// stacks_in_701_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_701_page0thiscatArray, function(index, catname) {
		stacks_in_701_page0catTrimed = catname.trim().replace(/[^a-z0-9]/gi,"");
		$(stacks_in_701_page0doothis).addClass(stacks_in_701_page0catTrimed);

		if($("#" + stacks_in_701_page0catTrimed).length == 0){
		$("#stacks_in_701_page0tabpicker").append('<a href="#" id="'+stacks_in_701_page0catTrimed+'" class="stacks_in_701_page0doofilter">'+catname+'</a> ');
		}
		});
	});


       

   
   $(".stacks_in_701_page0doofilter").click(function(){
        var thisFilter = $(this).attr("id");
        var filterboxheight = $("#stacks_in_701_page0").height();
        $(".stacks_in_701_page0overalltabcontainer").css("min-height",filterboxheight);
        $(".stacks_in_701_page0dootabcontainer").slideUp();
        $("."+ thisFilter).slideDown('slow', function() {
        	 $(".stacks_in_701_page0overalltabcontainer").animate({"min-height":"10px"},"slow");
 		 });
        $("#stacks_in_701_page0tabpicker a").removeClass("stacks_in_701_page0current");
        $(this).addClass("stacks_in_701_page0current");
        return false;
   });
   

   $("#stacks_in_701_page0tabpicker a:first-child").addClass("stacks_in_701_page0current");


});



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



