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

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

// 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_1_page6 = (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() {

function styleit()
{
	for(var t = 0; t < document.styleSheets.length; t++)
	{
		var theRules = new Array();
		theRules = document.styleSheets[t].rules;

		for(var i = 0; i < theRules.length; i++)
		{
		
			var allR = theRules[i].style.CCborderRadius    || 0;
			var tR   = theRules[i].style.CCborderRadiusTR  || allR;
			var tL   = theRules[i].style.CCborderRadiusTL  || allR;
			var bR   = theRules[i].style.CCborderRadiusBR  || allR;
			var bL   = theRules[i].style.CCborderRadiusBL  || allR;

			if (allR || tR || tR || bR || bL)
			{
				var s = theRules[i].selectorText;
				
				var settings = {					
					tl: { radius: makeInt(tL) },
					tr: { radius: makeInt(tR) },
					bl: { radius: makeInt(bL) },
					br: { radius: makeInt(bR) },
					antiAlias: true,
					autoPad: true,
					validTags: ["div"]
				};
				
				$(s).corner(settings); 

			}
		}
	}
}

// static class function to determine if the sheet is worth parsing
function opera_contains_border_radius(sheetnumber) {
  return /border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(sheetnumber).ownerNode.text);
}

function makeInt(num) {
	var re = new RegExp('([0-9]*)');
	var i = 0;
	if(isNaN(num)) {
		var a = re.exec(num);
		if(!isNaN(parseInt(a[1]))) {
			i = a[1];
		}
	}
	else {
		i = num;
	}	
	return i;
}

(function($) { 

	$(function(){
		if ($.browser.msie) {	
			styleit();
		} else if ($.browser.opera) {

      		for (t = 0; t < document.styleSheets.length; ++t) {

        		if (opera_contains_border_radius(t)) {

					var txt = document.styleSheets.item(t).ownerNode.text;
					txt = txt.replace(/\/\*(\n|\r|.)*?\*\//g, ''); // strip comments
					// this pattern extracts all border-radius-containing rulesets
					// matches will be:
					// [0] = the whole lot
					// [1] = the selector text
					// [2] = all the rule text between braces
					// [3] = top/bottom and left/right parts if present (only if webkit/CSS3)
					// [4] = top|bottom
					// [5] = left|right
					// .. but 3..5 are useless as they're only the first match.
					var pat = new RegExp("^([\\w.#][\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}", "mg");
					var matches;
					while ((matches = pat.exec(txt)) !== null) {
						var pat2 = new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)", "g");
						var submatches;
						while ((submatches = pat2.exec(matches[2])) !== null) {
						    if (submatches[1] !== "z-") {
						    	var tL,tR,bL,bR, tLu,tRu,bLu,bRu;					    							  
								if (!submatches[3]) { // no corner specified
									tL = tR = bL = bR = parseInt(submatches[5]);
									//tLu = tRu = bLu = bRu = submatches[6];
								}
								else { // corner specified
									propname = submatches[3].charAt(0) + submatches[4].charAt(0);
									this[propname + 'R'] = parseInt(submatches[5]);
									//this[propname + 'u'] = submatches[6];
								}
								var settings = {					
									tl: { radius: tL },
									tr: { radius: tR },
									bl: { radius: bL },
									br: { radius: bR }
								};	
								$(matches[1]).corner(settings);
						    }
						}
					}
				}
   			}
   		}
	});	
	
	$.fn.corner = function(options) {

		var settings = {
		  tl: { radius: 8 },
		  tr: { radius: 8 },
		  bl: { radius: 8 },
		  br: { radius: 8 },
		  antiAlias: true,
		  autoPad: true,
		  validTags: ["div"] 
		};
		if ( options && typeof(options) != 'string' )
			$.extend(settings, options);
	            
		return this.each(function() {
			if (!$(this).is('.hasCorners')) {
				applyCorners(this, settings);				
			}			
		}); 

  		// Apply the corners to the passed object!
		function applyCorners(box,settings)
		{
				
			// Setup Globals
			var $$ 						= $(box);
			this.topContainer 			= null;
			this.bottomContainer 		= null;
			this.shell            		= null;
			this.masterCorners 			= new Array();
			this.contentDIV 				= null;
		
			// Get CSS of box and define vars
			
			// Background + box colour
			this.x_bgi 				= $$.css("backgroundImage");																// Background Image
			this.x_bgi				= (x_bgi != "none" && x_bgi!="initial") ? x_bgi : "";
			this.x_bgr 				= $$.css("backgroundRepeat");																// Background repeat
			this.x_bgposX			= strip_px($$.css("backgroundPositionX")) ? strip_px($$.css("backgroundPositionX")) : 0; 	// Background position
			this.x_bgposY			= strip_px($$.css("backgroundPositionY")) ? strip_px($$.css("backgroundPositionY")) : 0; 	// Background position
			this.x_bgc 				= format_colour($$.css("backgroundColor"));													// Background Colour
			
			// Dimensions + positioning
			var x_height 			= $$.css("height");		 					// Height
			
			if(typeof x_height == 'undefined') x_height = 'auto';
			
			this.x_height       	= parseInt(((x_height != "" && x_height != "auto" && x_height.indexOf("%") == -1)? x_height.substring(0, x_height.indexOf("px")) : box.offsetHeight));
					
			if($.browser.msie && $.browser.version==6)
			{
				this.x_width	 		= strip_px(box.offsetWidth); 
			} 
			else 
			{
				this.x_width	 		= strip_px($$.parent().css('width')); 
			}		

			this.xp_height      	= strip_px($$.parent().css("height")) ? strip_px($$.css("height")) : 'auto';				// Parent height
			
			// Borders
			this.x_bw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0; 				// Border width
			
			// Different widths messed up borders
			this.x_bbw		     	= strip_px($$.css("borderBottomWidth")) ? strip_px($$.css("borderBottomWidth")) : 0; 		// Bottom Border width
			this.x_tbw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0; 				// Top Border width
			this.x_lbw		     	= strip_px($$.css("borderLeftWidth")) ? strip_px($$.css("borderLeftWidth")) : 0; 			// Left Border width
			this.x_rbw		     	= strip_px($$.css("borderRightWidth")) ? strip_px($$.css("borderRightWidth")) : 0; 			// Right Border width
			
			/*this.x_bbw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0;
			this.x_tbw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0;
			this.x_lbw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0;
			this.x_rbw		     	= strip_px($$.css("borderTopWidth")) ? strip_px($$.css("borderTopWidth")) : 0;*/
			
			
			this.x_bc		     	= format_colour($$.css("borderTopColor")); 													// Border colour
			this.x_bbc		     	= format_colour($$.css("borderBottomColor")); 												// Bottom Border colour
			this.x_tbc		     	= format_colour($$.css("borderTopColor")); 													// Top Border colour
			this.x_lbc		     	= format_colour($$.css("borderLeftColor")); 												// Left Border colour
			this.x_rbc		     	= format_colour($$.css("borderRightColor")); 												// Right Border colour
			this.borderString    	= this.x_bw + "px" + " solid " + this.x_bc;
      		this.borderStringB   	= this.x_bbw + "px" + " solid " + this.x_bbc;
      		this.borderStringR    	= this.x_rbw + "px" + " solid " + this.x_bc;
      		this.borderStringL   	= this.x_lbw + "px" + " solid " + this.x_bbc;
						
			// Padding
			this.x_pad		      	= strip_px($$.css("paddingTop"));															// Padding
			this.x_tpad	 			= strip_px($$.css("paddingTop"));															// Padding top
			this.x_bpad 			= strip_px($$.css("paddingBottom"));														// Padding Bottom
			this.x_lpad			 	= strip_px($$.css("paddingLeft"));															// Padding Left		
			this.x_rpad			 	= strip_px($$.css("paddingRight"));															// Padding Right
			this.topPaddingP     	= strip_px($$.parent().css("paddingTop"));													// Parent top padding
			this.bottomPaddingP  	= strip_px($$.parent().css("paddingBottom"));												// Parent bottom padding
			
			// Margins
			this.x_tmargin	 		= strip_px($$.css("marginTop"));														// Margin top
			this.x_bmargin 			= strip_px($$.css("marginBottom"));														// Margin Bottom
		
			// Calc Radius
			this.topMaxRadius = Math.max(settings.tl ? settings.tl.radius : 0, settings.tr ? settings.tr.radius : 0);
			this.botMaxRadius = Math.max(settings.bl ? settings.bl.radius : 0, settings.br ? settings.br.radius : 0);
			
			// Add styles and class		
			$$.addClass('hasCorners').css({
				"padding":				"0", 
				"border":				"none",
				"backgroundColor":		"transparent", 
				"backgroundImage":		"none", 
				'overflow':				"visible"
			});
		
			if(box.style.position != "absolute") $$.css("position","relative");

       		$$.attr("id","ccoriginaldiv");

			// Ok we add an inner div to actually put things into this will allow us to keep the height			
			var newMainContainer = document.createElement("div");
			
			$(newMainContainer).css({"padding" : "0", width: '100%' }).attr('id','ccshell');			

       		//this.shell = $$.append(newMainContainer);
       		this.shell = newMainContainer;
       		
      		//this.x_width = strip_px($(this.shell).css('width'));

			/*
			Create top and bottom containers.
			These will be used as a parent for the corners and bars.
			*/
			for(var t = 0; t < 2; t++)
			{
				switch(t)
				{
					// Top
					case 0:
					
						// Only build top bar if a top corner is to be draw
						if(settings.tl || settings.tr)
						{
							var newMainContainer = document.createElement("div");
							
							$(newMainContainer).css({
								width: '100%',
								"font-size":		"1px", 
								overflow:			"hidden", 
								position:			"absolute", 
								height:				topMaxRadius + "px",
								top:				0 - topMaxRadius + "px",
								"marginLeft" :			- parseInt( this.x_lbw + this.x_lpad) + "px",
								"marginRight" :			- parseInt( this.x_rbw + this.x_rpad) + "px"
							}).attr('id','cctopcontainer');
							
							if($.browser.msie && $.browser.version==6) {
								$(newMainContainer).css({   	
									"paddingLeft" :			Math.abs(parseInt( this.x_lbw + this.x_lpad)) + "px",
									"paddingRight" :		Math.abs(parseInt( this.x_rbw + this.x_rpad)) + "px"
						        });
					        }
          
							this.topContainer = this.shell.appendChild(newMainContainer);

						}
					break;
					
					// Bottom
					case 1:
					
						// Only build bottom bar if a bottom corner is to be draw
						if(settings.bl || settings.br)
						{							
							var newMainContainer = document.createElement("div");
							
							$(newMainContainer).css({ 
								width: '100%',
								"font-size":		"1px", 
								"overflow":			"hidden", 
								"position":			"absolute", 
								height:				botMaxRadius + "px",
								bottom:				0 - botMaxRadius  + "px",
								"marginLeft" :			- parseInt( this.x_lbw + this.x_lpad) + "px",
								"marginRight" :			- parseInt( this.x_rbw + this.x_rpad) + "px"
							}).attr('id','ccbottomcontainer');
							
							if($.browser.msie && $.browser.version==6) {
								$(newMainContainer).css({   	
									"paddingLeft" :			Math.abs(parseInt( this.x_lbw + this.x_lpad)) + "px",
									"paddingRight" :		Math.abs(parseInt( this.x_rbw + this.x_rpad)) + "px"
						        });
					        }
							
							this.bottomContainer = this.shell.appendChild(newMainContainer);	
						}
					break;
				}
			}


			// Create array of available corners
			var corners = ["tr", "tl", "br", "bl"];
			/*
			Loop for each corner
			*/
			for(var i in corners)
			{
				if(i > -1 < 4)
				{
					// Get current corner type from array
					var cc = corners[i];
					// Has the user requested the currentCorner be round?
					// Code to apply correct color to top or bottom
					if(cc == "tr" || cc == "tl")
					{
						var bwidth=this.x_bw;
						var bcolor=this.x_bc;
					} else {
						var bwidth=this.x_bbw;
						var bcolor=this.x_bbc;
					}
					
					// Yes, we need to create a new corner
					var newCorner = document.createElement("div");
					
					$(newCorner).css({
						position:"absolute",
						"font-size":"1px", 
						overflow:"hidden"
					}).height(settings[cc].radius + "px").width(settings[cc].radius + "px");
					
					// THE FOLLOWING BLOCK OF CODE CREATES A ROUNDED CORNER
					// ---------------------------------------------------- TOP
					// Get border radius
					var borderRadius = parseInt(settings[cc].radius - bwidth);
					// Cycle the x-axis
					for(var intx = 0, j = settings[cc].radius; intx < j; intx++)
					{
                      // Calculate the value of y1 which identifies the pixels inside the border
                      if((intx +1) >= borderRadius)
                        var y1 = -1;
                      else
                        var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx+1), 2))) - 1);
                      // Only calculate y2 and y3 if there is a border defined
                      if(borderRadius != j)
                      {
                          if((intx) >= borderRadius)
                            var y2 = -1;
                          else
                            var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius,2) - Math.pow(intx, 2)));
                           if((intx+1) >= j)
                            var y3 = -1;
                           else
                            var y3 = (Math.floor(Math.sqrt(Math.pow(j ,2) - Math.pow((intx+1), 2))) - 1);
                      }
                      // Calculate y4
                      if((intx) >= j)
                        var y4 = -1;
                      else
                        var y4 = Math.ceil(Math.sqrt(Math.pow(j ,2) - Math.pow(intx, 2)));
                      // Draw bar on inside of the border with foreground colour
                      
                      if(y1 > -1) drawPixel(intx, 0, this.x_bgc, 100, (y1+1), newCorner, -1, settings[cc].radius, 0, this.x_bgi, this.x_width, this.x_height, this.x_bw, this.x_bgr);
                      // Only draw border/foreground antialiased pixels and border if there is a border defined
                      if(borderRadius != j)
                      {
                          // Cycle the y-axis
                          for(var inty = (y1 + 1); inty < y2; inty++)
                          {
                              // Draw anti-alias pixels
                              if(settings.antiAlias)
                              {
                                  // For each of the pixels that need anti aliasing between the foreground and border colour draw single pixel divs
                                  if(this.x_bgi != "")
                                  {
										var borderFract = (pixelFraction(intx, inty, borderRadius) * 100);
										if(borderFract < 30)
										{
											drawPixel(intx, inty, bcolor, 100, 1, newCorner, 0, settings[cc].radius, 0, this.x_bgi, this.x_width, this.x_height, bwidth, this.x_bgr);
										}
										else
										{
											drawPixel(intx, inty, bcolor, 100, 1, newCorner, -1, settings[cc].radius, 0, this.x_bgi, this.x_width, this.x_height, bwidth, this.x_bgr);
                                  		}
                                  	}
                                  	else
                                  	{
                                      	var pixelcolour = BlendColour(this.x_bgc, bcolor, pixelFraction(intx, inty, borderRadius));
                                     	drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, settings[cc].radius, 0, this.x_bgi, this.x_width, this.x_height, bwidth, this.x_bgr);
                                  	}
                              }
                          }
                          // Draw bar for the border
                          if(settings.antiAlias)
                          {
                              if(y3 >= y2)
                              {
                                 if (y2 == -1) y2 = 0;
                                 drawPixel(intx, y2, bcolor, 100, (y3 - y2 + 1), newCorner, 0, 0, 1, this.x_bgi, this.x_width, this.x_height, bwidth, this.x_bgr);
                              }
                          }
                          else
                          {
                              if(y3 >= y1)
                              {
                                  drawPixel(intx, (y1 + 1), bcolor, 100, (y3 - y1), newCorner, 0, 0, 1, this.x_bgi, this.x_width, this.x_height, bwidth, this.x_bgr);
                              }
                          }
                          // Set the colour for the outside curve
                          var outsideColour = bcolor;
                      }
                      else
                      {
                          // Set the colour for the outside curve
                          var outsideColour = this.x_bgc;
                          var y3 = y1;
                      }
                      // Draw aa pixels?
                      if(settings.antiAlias)
                      {
                          // Cycle the y-axis and draw the anti aliased pixels on the outside of the curve
                          for(var inty = (y3 + 1); inty < y4; inty++)
                          {
                              // For each of the pixels that need anti aliasing between the foreground/border colour & background draw single pixel divs
                              drawPixel(intx, inty, outsideColour, (pixelFraction(intx, inty , j) * 100), 1, newCorner, ((bwidth > 0)? 0 : -1), settings[cc].radius, 0, this.x_bgi, this.x_width, this.x_height, bwidth);
                          }
                      }
                  }
                  // END OF CORNER CREATION
                  // ---------------------------------------------------- END
                  
                  // We now need to store the current corner in the masterConers array
                  masterCorners[settings[cc].radius] = $(newCorner).clone();

                  /*
                  Now we have a new corner we need to reposition all the pixels unless
                  the current corner is the bottom right.
                  */
                  // Loop through all children (pixel bars)
                  for(var t = 0, k = newCorner.childNodes.length; t < k; t++)
                  {
                      // Get current pixel bar
                      var pixelBar = newCorner.childNodes[t];
                      
                      // Get current top and left properties
                      var pixelBarTop    = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px")));
                      var pixelBarLeft   = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px")));
                      var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px")));
                     
                      // Reposition pixels
                      if(cc == "tl" || cc == "bl"){
                          pixelBar.style.left = settings[cc].radius -pixelBarLeft -1 + "px"; // Left
                      }
                      if(cc == "tr" || cc == "tl"){
                          pixelBar.style.top =  settings[cc].radius -pixelBarHeight -pixelBarTop + "px"; // Top
                      }
                      pixelBar.style.backgroundRepeat = this.x_bgr;

                      switch(cc)
                      {
                          case "tr":
 								
 								if($.browser.msie && $.browser.version==6) var offset = this.x_lpad + this.x_rpad + this.x_lbw + this.x_rbw;
 								else var offset = 0;
 								
                                pixelBar.style.backgroundPosition  = parseInt( this.x_bgposX - Math.abs( this.x_rbw - this.x_lbw + (this.x_width - settings[cc].radius + this.x_rbw) + pixelBarLeft) - settings.bl.radius - this.x_bw - settings.br.radius - this.x_bw) + offset + "px " + parseInt( this.x_bgposY - Math.abs(settings[cc].radius -pixelBarHeight -pixelBarTop - this.x_bw)) + "px";

                              break;
                          case "tl":
                              pixelBar.style.backgroundPosition = parseInt( this.x_bgposX - Math.abs((settings[cc].radius -pixelBarLeft -1)  - this.x_lbw)) + "px " + parseInt( this.x_bgposY - Math.abs(settings[cc].radius -pixelBarHeight -pixelBarTop - this.x_bw)) + "px";
                              break;
                          case "bl":

                                  pixelBar.style.backgroundPosition = parseInt( this.x_bgposX - Math.abs((settings[cc].radius -pixelBarLeft -1) - this.x_lbw )) + "px " + parseInt( this.x_bgposY - Math.abs(( this.x_height + (this.x_bw+this.x_tpad+this.x_bpad) - settings[cc].radius + pixelBarTop))) + "px";
              
                              break;
                          case "br":
								  // Added - settings.bl.radius - this.x_bw - settings.br.radius - this.x_bw to this and tr to offset background image due to neg margins.
								  if($.browser.msie && $.browser.version==6) var offset = this.x_lpad + this.x_rpad + this.x_lbw + this.x_rbw;
 									else var offset = 0;
 								
                                  pixelBar.style.backgroundPosition = parseInt( this.x_bgposX - Math.abs( this.x_rbw - this.x_lbw + (this.x_width - settings[cc].radius + this.x_rbw) + pixelBarLeft) - settings.bl.radius - this.x_bw - settings.br.radius - this.x_bw) + offset + "px " + parseInt( this.x_bgposY - Math.abs(( this.x_height + (this.x_bw+this.x_tpad+this.x_bpad) - settings[cc].radius + pixelBarTop))) + "px";
                      
                              break;
                      }
                  }

                  // Position the container
                  switch(cc)
                  {


                      case "tl":
                        if(newCorner.style.position == "absolute") newCorner.style.top  = "0px";
                        if(newCorner.style.position == "absolute") newCorner.style.left = "0px";
                        if(this.topContainer) temp= this.topContainer.appendChild(newCorner);
						$(temp).attr("id","cctl");


                        break;
                      case "tr":
                        if(newCorner.style.position == "absolute") newCorner.style.top  = "0px";
                        if(newCorner.style.position == "absolute") newCorner.style.right = "0px";
                        if(this.topContainer) temp= this.topContainer.appendChild(newCorner);
						$(temp).attr("id","cctr");

                        break;
                      case "bl":
                        if(newCorner.style.position == "absolute") newCorner.style.bottom  = "0px";
                        if(newCorner.style.position == "absolute") newCorner.style.left = "0px";
						if(this.bottomContainer) temp= this.bottomContainer.appendChild(newCorner);
						$(temp).attr("id","ccbl");

                        break;
                      case "br":
                        if(newCorner.style.position == "absolute") newCorner.style.bottom   = "0px";
                        if(newCorner.style.position == "absolute") newCorner.style.right = "0px";
						if(this.bottomContainer) temp= this.bottomContainer.appendChild(newCorner);
						$(temp).attr("id","ccbr");

                        break;
                  }

              }
          }



          /*
          The last thing to do is draw the rest of the filler DIVs.
          We only need to create a filler DIVs when two corners have
          diffrent radiuses in either the top or bottom container.
          */

          // Find out which corner has the bigger radius and get the difference amount
          var radiusDiff = new Array();
          radiusDiff["t"] = Math.abs(settings.tl.radius - settings.tr.radius);
          radiusDiff["b"] = Math.abs(settings.bl.radius - settings.br.radius);

          for(z in radiusDiff)
          {
              // FIX for prototype lib
              if(z == "t" || z == "b")
              {
                  if(radiusDiff[z])
                  {
                      // Get the type of corner that is the smaller one
                      var smallerCornerType = ((settings[z + "l"].radius < settings[z + "r"].radius)? z +"l" : z +"r");

                      // First we need to create a DIV for the space under the smaller corner
                      var newFiller = document.createElement("DIV");
                      newFiller.style.height = radiusDiff[z] + "px";
                      newFiller.style.width  =  settings[smallerCornerType].radius + "px";
                      newFiller.style.position = "absolute";
                      newFiller.style.fontSize = "1px";
                      newFiller.style.overflow = "hidden";
                      newFiller.style.backgroundColor = this.x_bgc;
                      //newFiller.style.backgroundColor = get_random_color();

                      // Position filler
                      switch(smallerCornerType)
                      {
                          case "tl":
                              newFiller.style.bottom = "0px";
                              newFiller.style.left   = "0px";
                              newFiller.style.borderLeft = this.borderString;
                              temp=this.topContainer.appendChild(newFiller);
temp.id="cctlfiller";

                              break;

                          case "tr":
                              newFiller.style.bottom = "0px";
                              newFiller.style.right  = "0px";
                              newFiller.style.borderRight = this.borderString;
                              temp=this.topContainer.appendChild(newFiller);
temp.id="cctrfiller";

                              break;

                          case "bl":
                              newFiller.style.top    = "0px";
                              newFiller.style.left   = "0px";
                              newFiller.style.borderLeft = this.borderStringB;
                              temp=this.bottomContainer.appendChild(newFiller);
temp.id="ccblfiller";

                              break;

                          case "br":
                              newFiller.style.top    = "0px";
                              newFiller.style.right  = "0px";
                              newFiller.style.borderRight = this.borderStringB;
                              temp=this.bottomContainer.appendChild(newFiller);
temp.id="ccbrfiller";

                              break;
                      }
                  }














                  // Create the bar to fill the gap between each corner horizontally
                  var newFillerBar = document.createElement("div");
                  newFillerBar.style.position = "relative";
                  newFillerBar.style.fontSize = "1px";
                  newFillerBar.style.overflow = "hidden";
                  newFillerBar.style.backgroundColor = this.x_bgc;
                  newFillerBar.style.backgroundImage = this.x_bgi;
                  newFillerBar.style.backgroundRepeat= this.x_bgr;


                  switch(z)
                  {
                      case "t":
                          // Top Bar
                          if(this.topContainer)
                          {
                              // Edit by Asger Hallas: Check if settings.xx.radius is not false
                              if(settings.tl.radius && settings.tr.radius)
                              {
                                  newFillerBar.style.height      = 100 + topMaxRadius - this.x_tbw + "px";
                                  newFillerBar.style.marginLeft  = settings.tl.radius - this.x_lbw + this.x_rbw + "px";
                                  newFillerBar.style.marginRight = settings.tr.radius - this.x_lbw + this.x_rbw + "px";
                                  newFillerBar.style.borderTop   = this.borderString;                                 
                                   
                                  if(this.x_bgi != "")
                                    newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX - (topMaxRadius - this.x_lbw )) + "px " + parseInt( this.x_bgposY ) + "px";
                                    //newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX - (topMaxRadius - this.x_lbw)) + "px " + parseInt( this.x_bgposY ) + "px";
                                    
									if($.browser.msie && $.browser.version==6) {
										$(newFillerBar).css({   	
											"marginLeft" :		- parseInt( this.x_lbw + this.x_lpad - settings.tl.radius ) + "px",
											"marginRight" :		- parseInt( this.x_rbw + this.x_rpad - settings.tr.radius ) + "px"
										});
										 if(this.x_bgi != "")
                                    		newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX + this.x_lbw - (topMaxRadius )) + "px " + parseInt( this.x_bgposY ) + "px";
					       			}

								
                                  temp=this.topContainer.appendChild(newFillerBar);
								  $(temp).attr("id","cctopmiddlefiller");

                                  // Repos the boxes background image
                                  $(this.shell).css("backgroundPosition", parseInt( this.x_bgposX ) + "px " + parseInt( this.x_bgposY - (topMaxRadius - this.x_lbw)) + "px");
                              }
                          }
                          break;
                      case "b":
                          if(this.bottomContainer)
                          {
                              // Edit by Asger Hallas: Check if settings.xx.radius is not false
                              if(settings.bl.radius && settings.br.radius)
                              {
                                  // Bottom Bar
                                  newFillerBar.style.height     = botMaxRadius - this.x_bbw + "px";
                                  newFillerBar.style.marginLeft   = settings.bl.radius - this.x_lbw + this.x_rbw + "px";
                                  newFillerBar.style.marginRight  = settings.br.radius - this.x_lbw + this.x_rbw + "px";
                                  newFillerBar.style.borderBottom = this.borderStringB;
                                  if(this.x_bgi != "")
                                    newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX - (botMaxRadius - this.x_lbw )) + "px " + parseInt( this.x_bgposY - (this.x_height + this.x_tpad + this.x_bbw + this.x_bpad - botMaxRadius )) + "px";
                                    //newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX - (botMaxRadius  - this.x_lbw )) + "px " + parseInt( this.x_bgposY - (this.x_height + this.x_tpad + this.x_bw + this.x_bpad - botMaxRadius )) + "px";
                                  
                                  if($.browser.msie && $.browser.version==6) {
										$(newFillerBar).css({   	
											"marginLeft" :		- parseInt( this.x_lbw + this.x_lpad - settings.bl.radius ) + "px",
											"marginRight" :		- parseInt( this.x_rbw + this.x_rpad - settings.br.radius ) + "px"
										});
										
										if(this.x_bgi != "")
                                    		newFillerBar.style.backgroundPosition  = parseInt( this.x_bgposX - (botMaxRadius - this.x_lbw)) + "px " + parseInt( this.x_bgposY - (this.x_height + this.x_tpad + this.x_bbw + this.x_bpad - botMaxRadius )) + "px";
					       			}
					       			
                                  temp=this.bottomContainer.appendChild(newFillerBar);
$(temp).attr("id","ccbottommiddlefiller");

                              }
                          }
                          break;
                  }
              }
          }


          // Create content container
          var contentContainer = document.createElement("div");
          var pd = 0;
          // Set contentContainer's properties
        //  contentContainer.style.position = "absolute";
          contentContainer.className      = "autoPadDiv";
          // Get padding amounts
          var topPadding = Math.abs( this.x_bw  + this.x_pad);
          var botPadding = Math.abs( this.x_bbw + this.x_bpad);
          
          // Apply top padding
          if(topMaxRadius < this.boxPadding)
            {
             contentContainer.style.paddingTop = Math.abs(parseInt( pd + topPadding)) + "px";
            } 
            else
            {
            contentContainer.style.paddingTop = "0";
          }
          
          // Apply Bottom padding
          if(botMaxRadius < this.x_pad)
            {contentContainer.style.paddingBottom = Math.abs(parseInt(botPadding - botMaxRadius)) + "px";} else
            {contentContainer.style.paddingBottom = "0";}
          
          // Content container must fill vertically to show the border
          $(contentContainer).css({   	
			"marginLeft" :			- parseInt( this.x_lbw + this.x_lpad) + "px",
			"marginRight" :			- parseInt( this.x_rbw + this.x_rpad) + "px",			
			"marginTop" :			"-" + Math.abs(parseInt( this.x_tbw + (this.x_tpad - topMaxRadius))) + "px",
			"marginBottom" :		"-" + Math.abs(parseInt( this.x_bbw + (this.x_bpad - botMaxRadius))) + "px",
			"border-left" :				this.borderStringL,
			"border-right" :			this.borderStringR,
			"border-top" :				this.borderString,
			"border-bottom" :			this.borderStringB,
			"borderTopWidth" :		"0",
			"borderBottomWidth" :	"0",
			"height" : 				"100%",
			"width" : "100%",
			"paddingLeft" :			Math.abs(parseInt( this.x_lpad)) + "px",
			"paddingRight" :		Math.abs(parseInt( this.x_rpad)) + "px",
			"paddingTop" :			Math.abs(parseInt( this.x_tbw + (this.x_tpad - topMaxRadius))) + "px",
			"paddingBottom" :   	Math.abs(parseInt( this.x_bbw + (this.x_bpad - botMaxRadius))) + "px"
          });
          
          // Origional container has background image
          $$.css({            
          	"paddingLeft" :			Math.abs(parseInt( this.x_lbw + this.x_lpad)) + "px",
			"paddingRight" :		Math.abs(parseInt( this.x_rbw + this.x_rpad)) + "px",
			"paddingTop" :			Math.abs(parseInt( this.x_tbw + (this.x_tpad - topMaxRadius))) + "px",
			"paddingBottom" :      	Math.abs(parseInt( this.x_bbw + (this.x_bpad - botMaxRadius))) + "px",
			"backgroundColor" : 	this.x_bgc,
			"backgroundImage" :		this.x_bgi,
			"backgroundPosition" : 	this.x_bw + 'px -' + Math.abs(parseInt(topMaxRadius - this.x_bw )) + "px",
			'margin-top':			0, 
		  	'margin-bottom':		0
          });
          
          //'margin-top':			parseInt(this.x_tmargin + topMaxRadius) + "px", 
		  //'margin-bottom':		parseInt(this.x_bmargin + botMaxRadius) + "px"
         
          // IE does not like an empty box; without this it won't show the contentContainer
          if ($$.html() == "") $$.html('&nbsp;');
                    
          // Append contentContainer
          $$.wrapInner(contentContainer);          
          $$.prepend(this.shell);
          
          // Wrapper to make margins work correctly
          var wrapper = document.createElement("div");
          
          $(wrapper).css({            
			'margin-top':			parseInt(this.x_tmargin) + "px", 
			'margin-bottom':		parseInt(this.x_bmargin) + "px",
			'padding-top':			topMaxRadius + "px", 
			'padding-bottom':		botMaxRadius + "px",
			'overflow': 'hidden'
          }).addClass('ccwrapper');
          
          $$.wrap(wrapper);
                   
          // Because of this method of doing the corners we have magins above and below; the following prevents margin collapsing.
          $$.after('<div class="clear" style="height:0;line-height:0px;">&nbsp;</div>');
      }		
		
		/*
		This function draws the pixels
		*/	
		function drawPixel( intx, inty, colour, transAmount, height, newCorner, image, cornerRadius, isBorder, bgImage, x_width, x_height, x_bw, repeat ) {
			
			//var $$ = $(box);			
			
		    var pixel = document.createElement("div");
		    
		    $(pixel).css({	
		    	"height" :			height, 
		    	"width" :			"1px", 
		    	"position" :		"absolute", 
		    	"font-size" :		"1px", 
		    	"overflow" :		"hidden",
		    	"top" :				inty + "px",
		    	"left" :			intx + "px",
		    	"background-color" :colour
		    });
		    
		    // Max Top Radius
		    var topMaxRadius = Math.max(settings.tl ? settings.tl.radius : 0, settings.tr ? settings.tr.radius : 0);
		    
		    // Dont apply background image to border pixels
			if(image == -1 && bgImage !="")
			{
				$(pixel).css({
					"background-position":"-" + Math.abs(x_width - (cornerRadius - intx) + x_bw) + "px -" + Math.abs((x_height + topMaxRadius + inty) -x_bw) + "px",
					"background-image":bgImage,
					"background-repeat":repeat					 
				});
			}
			else
			{
				if (!isBorder) $(pixel).addClass('hasBackgroundColor');
			}		    
		    if (transAmount != 100)
		    	$(pixel).css({opacity: (transAmount/100) });

		    newCorner.appendChild(pixel);
		};		
				
		
		// Utilities
		function BlendColour(Col1, Col2, Col1Fraction) 
		{
			
			var red1 = parseInt(Col1.substr(1,2),16);
			var green1 = parseInt(Col1.substr(3,2),16);
			var blue1 = parseInt(Col1.substr(5,2),16);
			var red2 = parseInt(Col2.substr(1,2),16);
			var green2 = parseInt(Col2.substr(3,2),16);
			var blue2 = parseInt(Col2.substr(5,2),16);
			
			if(Col1Fraction > 1 || Col1Fraction < 0) Col1Fraction = 1;
			
			var endRed = Math.round((red1 * Col1Fraction) + (red2 * (1 - Col1Fraction)));
			if(endRed > 255) endRed = 255;
			if(endRed < 0) endRed = 0;
			
			var endGreen = Math.round((green1 * Col1Fraction) + (green2 * (1 - Col1Fraction)));
			if(endGreen > 255) endGreen = 255;
			if(endGreen < 0) endGreen = 0;
			
			var endBlue = Math.round((blue1 * Col1Fraction) + (blue2 * (1 - Col1Fraction)));
			if(endBlue > 255) endBlue = 255;
			if(endBlue < 0) endBlue = 0;
			
			return "#" + IntToHex(endRed)+ IntToHex(endGreen)+ IntToHex(endBlue);
			
		}
	
		function IntToHex(strNum) 
		{			
			rem = strNum % 16;
			base = Math.floor(strNum / 16);
			
			baseS = MakeHex(base);
			remS = MakeHex(rem);
			
			return baseS + '' + remS;
		}
	
		function MakeHex(x)
		{
		  if((x >= 0) && (x <= 9))
		  {
		      return x;
		  }
		  else
		  {
		      switch(x)
		      {
		          case 10: return "A";
		          case 11: return "B";
		          case 12: return "C";
		          case 13: return "D";
		          case 14: return "E";
		          case 15: return "F";
		      }
		  }
		}
	
		/*
		For a pixel cut by the line determines the fraction of the pixel on the 'inside' of the
		line.  Returns a number between 0 and 1
		*/
		function pixelFraction(x, y, r)
		{
			var pixelfraction = 0;
			
			/*
			determine the co-ordinates of the two points on the perimeter of the pixel that the
			circle crosses
			*/
			var xvalues = new Array(1);
			var yvalues = new Array(1);
			var point = 0;
			var whatsides = "";
			
			// x + 0 = Left
			var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x,2)));
			
			if ((intersect >= y) && (intersect < (y+1)))
			{
				whatsides = "Left";
				xvalues[point] = 0;
				yvalues[point] = intersect - y;
				point =  point + 1;
			}
			// y + 1 = Top
			var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y+1,2)));
			
			if ((intersect >= x) && (intersect < (x+1)))
			{
				whatsides = whatsides + "Top";
				xvalues[point] = intersect - x;
				yvalues[point] = 1;
				point = point + 1;
			}
			// x + 1 = Right
			var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x+1,2)));
			
			if ((intersect >= y) && (intersect < (y+1)))
			{
				whatsides = whatsides + "Right";
				xvalues[point] = 1;
				yvalues[point] = intersect - y;
				point =  point + 1;
			}
			// y + 0 = Bottom
			var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y,2)));
			
			if ((intersect >= x) && (intersect < (x+1)))
			{
				whatsides = whatsides + "Bottom";
				xvalues[point] = intersect - x;
				yvalues[point] = 0;
			}
			
			/*
			depending on which sides of the perimeter of the pixel the circle crosses calculate the
			fraction of the pixel inside the circle
			*/
			switch (whatsides)
			{
			      case "LeftRight":
			      pixelfraction = Math.min(yvalues[0],yvalues[1]) + ((Math.max(yvalues[0],yvalues[1]) - Math.min(yvalues[0],yvalues[1]))/2);
			      break;
			
			      case "TopRight":
			      pixelfraction = 1-(((1-xvalues[0])*(1-yvalues[1]))/2);
			      break;
			
			      case "TopBottom":
			      pixelfraction = Math.min(xvalues[0],xvalues[1]) + ((Math.max(xvalues[0],xvalues[1]) - Math.min(xvalues[0],xvalues[1]))/2);
			      break;
			
			      case "LeftBottom":
			      pixelfraction = (yvalues[0]*xvalues[1])/2;
			      break;
			
			      default:
			      pixelfraction = 1;
			}
			
			return pixelfraction;
		}
  
  
		// This function converts CSS rgb(x, x, x) to hexadecimal
		function rgb2Hex(rgbColour)
		{
			try{
			
				// Get array of RGB values
				var rgbArray = rgb2Array(rgbColour);
				
				// Get RGB values
				var red   = parseInt(rgbArray[0]);
				var green = parseInt(rgbArray[1]);
				var blue  = parseInt(rgbArray[2]);
				
				// Build hex colour code
				var hexColour = "#" + IntToHex(red) + IntToHex(green) + IntToHex(blue);
			}
			catch(e){			
				alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");
			}
			
			return hexColour;
		}
		
		// Returns an array of rbg values
		function rgb2Array(rgbColour)
		{
			// Remove rgb()
			var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")"));
			
			// Split RGB into array
			var rgbArray = rgbValues.split(", ");
			
			return rgbArray;
		}	

		// Formats colours
		function format_colour(colour)
		{
			var returnColour = "#ffffff";
			
			// Make sure colour is set and not transparent
			if(colour != "" && colour != "transparent")
			{
				// RGB Value?
				if(colour.substr(0, 3) == "rgb" && colour.substr(0, 4) != "rgba")
				{
				  // Get HEX aquiv.
				  returnColour = rgb2Hex(colour);
				}
				else if(colour.length == 4)
				{
				  // 3 chr colour code add remainder
				  returnColour = "#" + colour.substring(1, 2) + colour.substring(1, 2) + colour.substring(2, 3) + colour.substring(2, 3) + colour.substring(3, 4) + colour.substring(3, 4);
				}
				else
				{
				  // Normal valid hex colour
				  returnColour = colour;
				}
			}
			
			return returnColour;
		}
		
		// Removes 'px' from string
		function strip_px(value) 
		{
			if (typeof(value)!='string') return value;
			return parseInt((( value != "auto" && value.indexOf("%") == -1 && value != "" && value.indexOf("px") !== -1)? Math.round(value.slice(0, value.indexOf("px"))) : 0))
		}
			
	};
})(jQuery);


// start call

var $j = jQuery.noConflict(); 
  $j(function(){ 
  
  settings = {
          tl: { radius: '20' },
          tr: { radius: '20' },
          bl: { radius: '20' },
          br: { radius: '20' },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
      }

  $j('#stacks_in_1_page6 .myBox').corner(settings);
  
  });
  });
	return stack;
})(stacks.stacks_in_1_page6);


// Javascript for stacks_in_27_page6
// ---------------------------------------------------------------------

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

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/**
 * Tabs - jQuery plugin for accessible, unobtrusive tabs
 * @requires jQuery v1.1.1
 *
 * http://stilbuero.de/tabs/
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 2.7.4
 */

(function($) { // block scope

$.extend({
    tabs: {
        remoteCount: 0 // TODO in Tabs 3 this is going to be more cleanly in one single namespace
    }
});

/**
 * Create an accessible, unobtrusive tab interface based on a particular HTML structure.
 *
 * The underlying HTML has to look like this:
 *
 * <div id="container">
 *     <ul>
 *         <li><a href="#fragment-1">Section 1</a></li>
 *         <li><a href="#fragment-2">Section 2</a></li>
 *         <li><a href="#fragment-3">Section 3</a></li>
 *     </ul>
 *     <div id="fragment-1">
 *
 *     </div>
 *     <div id="fragment-2">
 *
 *     </div>
 *     <div id="fragment-3">
 *
 *     </div>
 * </div>
 *
 * Each anchor in the unordered list points directly to a section below represented by one of the
 * divs (the URI in the anchor's href attribute refers to the fragment with the corresponding id).
 * Because such HTML structure is fully functional on its own, e.g. without JavaScript, the tab
 * interface is accessible and unobtrusive.
 *
 * A tab is also bookmarkable via hash in the URL. Use the History/Remote plugin (Tabs will
 * auto-detect its presence) to fix the back (and forward) button.
 *
 * @example $('#container').tabs();
 * @desc Create a basic tab interface.
 * @example $('#container').tabs(2);
 * @desc Create a basic tab interface with the second tab initially activated.
 * @example $('#container').tabs({disabled: [3, 4]});
 * @desc Create a tab interface with the third and fourth tab being disabled.
 * @example $('#container').tabs({fxSlide: true});
 * @desc Create a tab interface that uses slide down/up animations for showing/hiding tab
 *       content upon tab switching.
 *
 * @param Number initial An integer specifying the position of the tab (no zero-based index) that
 *                       gets activated at first (on page load). Two alternative ways to specify
 *                       the active tab will overrule this argument. First a li element
 *                       (representing one single tab) belonging to the selected tab class, e.g.
 *                       set the selected tab class (default: "tabs-selected", see option
 *                       selectedClass) for one of the unordered li elements in the HTML source.
 *                       In addition if a fragment identifier/hash in the URL of the page refers
 *                       to the id of a tab container of a tab interface the corresponding tab will
 *                       be activated and both the initial argument as well as an eventually
 *                       declared class attribute will be overruled. Defaults to 1 if omitted.
 * @param Object settings An object literal containing key/value pairs to provide optional settings.
 * @option Array<Number> disabled An array containing the position of the tabs (no zero-based index)
 *                                that should be disabled on initialization. Default value: null.
 *                                A tab can also be disabled by simply adding the disabling class
 *                                (default: "tabs-disabled", see option disabledClass) to the li
 *                                element representing that particular tab.
 * @option Boolean bookmarkable Boolean flag indicating if support for bookmarking and history (via
 *                              changing hash in the URL of the browser) is enabled. Default value:
 *                              false, unless the History/Remote plugin is included. In that case the
 *                              default value becomes true. @see $.ajaxHistory.initialize
 * @option Boolean remote Boolean flag indicating that tab content has to be loaded remotely from
 *                        the url given in the href attribute of the tab menu anchor elements.
 * @option String spinner The content of this string is shown in a tab while remote content is loading.
 *                        Insert plain text as well as an img here. To turn off this notification
 *                        pass an empty string or null. Default: "Loading&#8230;".
 * @option String hashPrefix A String that is used for constructing the hash the link's href attribute
 *                           of a remote tab gets altered to, such as "#remote-1".
 *                           Default value: "remote-tab-".
 * @option Boolean fxFade Boolean flag indicating whether fade in/out animations are used for tab
 *                        switching. Can be combined with fxSlide. Will overrule fxShow/fxHide.
 *                        Default value: false.
 * @option Boolean fxSlide Boolean flag indicating whether slide down/up animations are used for tab
 *                         switching. Can be combined with fxFade. Will overrule fxShow/fxHide.
 *                         Default value: false.
 * @option String|Number fxSpeed A string representing one of the three predefined speeds ("slow",
 *                               "normal", or "fast") or the number of milliseconds (e.g. 1000) to
 *                               run an animation. Default value: "normal".
 * @option Object fxShow An object literal of the form jQuery's animate function expects for making
 *                       your own, custom animation to reveal a tab upon tab switch. Unlike fxFade
 *                       or fxSlide this animation is independent from an optional hide animation.
 *                       Default value: null. @see animate
 * @option Object fxHide An object literal of the form jQuery's animate function expects for making
 *                       your own, custom animation to hide a tab upon tab switch. Unlike fxFade
 *                       or fxSlide this animation is independent from an optional show animation.
 *                       Default value: null. @see animate
 * @option String|Number fxShowSpeed A string representing one of the three predefined speeds
 *                                   ("slow", "normal", or "fast") or the number of milliseconds
 *                                   (e.g. 1000) to run the animation specified in fxShow.
 *                                   Default value: fxSpeed.
 * @option String|Number fxHideSpeed A string representing one of the three predefined speeds
 *                                   ("slow", "normal", or "fast") or the number of milliseconds
 *                                   (e.g. 1000) to run the animation specified in fxHide.
 *                                   Default value: fxSpeed.
 * @option Boolean fxAutoHeight Boolean flag that if set to true causes all tab heights
 *                              to be constant (being the height of the tallest tab).
 *                              Default value: false.
 * @option Function onClick A function to be invoked upon tab switch, immediatly after a tab has
 *                          been clicked, e.g. before the other's tab content gets hidden. The
 *                          function gets passed three arguments: the first one is the clicked
 *                          tab (e.g. an anchor element), the second one is the DOM element
 *                          containing the content of the clicked tab (e.g. the div), the third
 *                          argument is the one of the tab that gets hidden. If this callback
 *                          returns false, the tab switch is canceled (use to disallow tab
 *                          switching for the reason of a failed form validation for example).
 *                          Default value: null.
 * @option Function onHide A function to be invoked upon tab switch, immediatly after one tab's
 *                         content got hidden (with or without an animation) and right before the
 *                         next tab is revealed. The function gets passed three arguments: the
 *                         first one is the clicked tab (e.g. an anchor element), the second one
 *                         is the DOM element containing the content of the clicked tab, (e.g. the
 *                         div), the third argument is the one of the tab that gets hidden.
 *                         Default value: null.
 * @option Function onShow A function to be invoked upon tab switch. This function is invoked
 *                         after the new tab has been revealed, e.g. after the switch is completed.
 *                         The function gets passed three arguments: the first one is the clicked
 *                         tab (e.g. an anchor element), the second one is the DOM element
 *                         containing the content of the clicked tab, (e.g. the div), the third
 *                         argument is the one of the tab that gets hidden. Default value: null.
 * @option String navClass A CSS class that is used to identify the tabs unordered list by class if
 *                         the required HTML structure differs from the default one.
 *                         Default value: "tabs-nav".
 * @option String selectedClass The CSS class attached to the li element representing the
 *                              currently selected (active) tab. Default value: "tabs-selected".
 * @option String disabledClass The CSS class attached to the li element representing a disabled
 *                              tab. Default value: "tabs-disabled".
 * @option String containerClass A CSS class that is used to identify tab containers by class if
 *                               the required HTML structure differs from the default one.
 *                               Default value: "tabs-container".
 * @option String hideClass The CSS class used for hiding inactive tabs. A class is used instead
 *                          of "display: none" in the style attribute to maintain control over
 *                          visibility in other media types than screen, most notably print.
 *                          Default value: "tabs-hide".
 * @option String loadingClass The CSS class used for indicating that an Ajax tab is currently
 *                             loading, for example by showing a spinner.
 *                             Default value: "tabs-loading".
 * @option String tabStruct @deprecated A CSS selector or basic XPath expression reflecting a
 *                          nested HTML structure that is different from the default single div
 *                          structure (one div with an id inside the overall container holds one
 *                          tab's content). If for instance an additional div is required to wrap
 *                          up the several tab containers such a structure is expressed by "div>div".
 *                          Default value: "div".
 * @type jQuery
 *
 * @name tabs
 * @cat Plugins/Tabs
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
$.fn.tabs = function(initial, settings) {

    // settings
    if (typeof initial == 'object') settings = initial; // no initial tab given but a settings object
    settings = $.extend({
        initial: (initial && typeof initial == 'number' && initial > 0) ? --initial : 0,
        disabled: null,
        bookmarkable: $.ajaxHistory ? true : false,
        remote: false,
        spinner: 'Loading&#8230;',
        hashPrefix: 'remote-tab-',
        fxFade: null,
        fxSlide: null,
        fxShow: null,
        fxHide: null,
        fxSpeed: 'normal',
        fxShowSpeed: null,
        fxHideSpeed: null,
        fxAutoHeight: false,
        onClick: null,
        onHide: null,
        onShow: null,
        navClass: 'tabs-nav',
        selectedClass: 'tabs-selected',
        disabledClass: 'tabs-disabled',
        containerClass: 'tabs-container',
        hideClass: 'tabs-hide',
        loadingClass: 'tabs-loading',
        tabStruct: 'div'
    }, settings || {});

    $.browser.msie6 = $.browser.msie && ($.browser.version && $.browser.version < 7 || /MSIE 6.0/.test(navigator.userAgent)); // do not check for 6.0 alone, userAgent in Windows Vista has "Windows NT 6.0"

    // helper to prevent scroll to fragment
    function unFocus() {
        scrollTo(0, 0);
    }

    // initialize tabs
    return this.each(function() {

        // remember wrapper for later
        var container = this;

        // setup nav
        var nav = $('ul.' + settings.navClass, container);
        nav = nav.size() && nav || $('>ul:eq(0)', container); // fallback to default structure
        var tabs = $('a', nav);

        // prepare remote tabs
        if (settings.remote) {
            tabs.each(function() {
                var id = settings.hashPrefix + (++$.tabs.remoteCount), hash = '#' + id, url = this.href;
                this.href = hash;
                $('<div id="' + id + '" class="' + settings.containerClass + '"></div>').appendTo(container);

                $(this).bind('loadRemoteTab', function(e, callback) {
                    var $$ = $(this).addClass(settings.loadingClass), span = $('span', this)[0], tabTitle = span.innerHTML;
                    if (settings.spinner) {
                        // TODO if spinner is image
                        span.innerHTML = '<em>' + settings.spinner + '</em>'; // WARNING: html(...) crashes Safari with jQuery 1.1.2
                    }
                    setTimeout(function() { // Timeout is again required in IE, "wait" for id being restored
                        $(hash).load(url, function() {
                            if (settings.spinner) {
                                span.innerHTML = tabTitle; // WARNING: html(...) crashes Safari with jQuery 1.1.2
                            }
                            $$.removeClass(settings.loadingClass);
                            callback && callback();
                        });
                    }, 0);
                });

            });
        }

        // set up containers
        var containers = $('div.' + settings.containerClass, container);
        containers = containers.size() && containers || $('>' + settings.tabStruct, container); // fallback to default structure

        // attach classes for styling if not present
        nav.is('.' + settings.navClass) || nav.addClass(settings.navClass);
        containers.each(function() {
            var $$ = $(this);
            $$.is('.' + settings.containerClass) || $$.addClass(settings.containerClass);
        });

        // try to retrieve active tab from class in HTML
        var hasSelectedClass = $('li', nav).index( $('li.' + settings.selectedClass, nav)[0] );
        if (hasSelectedClass >= 0) {
           settings.initial = hasSelectedClass;
        }

        // try to retrieve active tab from hash in url, will override class in HTML
        if (location.hash) {
            tabs.each(function(i) {
                if (this.hash == location.hash) {
                    settings.initial = i;
                    // prevent page scroll to fragment
                    if (($.browser.msie || $.browser.opera) && !settings.remote) {
                        var toShow = $(location.hash);
                        var toShowId = toShow.attr('id');
                        toShow.attr('id', '');
                        setTimeout(function() {
                            toShow.attr('id', toShowId); // restore id
                        }, 500);
                    }
                    unFocus();
                    return false; // break
                }
            });
        }
        if ($.browser.msie) {
            unFocus(); // fix IE focussing bottom of the page for some unknown reason
        }

        // highlight tab accordingly
        containers.filter(':eq(' + settings.initial + ')').show().end().not(':eq(' + settings.initial + ')').addClass(settings.hideClass);
        $('li', nav).removeClass(settings.selectedClass).eq(settings.initial).addClass(settings.selectedClass); // we need to remove classes eventually if hash takes precedence over class
        // trigger load of initial tab
        tabs.eq(settings.initial).trigger('loadRemoteTab').end();

        // setup auto height
        if (settings.fxAutoHeight) {
            // helper
            var _setAutoHeight = function(reset) {
                // get tab heights in top to bottom ordered array
                var heights = $.map(containers.get(), function(el) {
                    var h, jq = $(el);
                    if (reset) {
                        if ($.browser.msie6) {
                            el.style.removeExpression('behaviour');
                            el.style.height = '';
                            el.minHeight = null;
                        }
                        h = jq.css({'min-height': ''}).height(); // use jQuery's height() to get hidden element values
                    } else {
                        h = jq.height(); // use jQuery's height() to get hidden element values
                    }
                    return h;
                }).sort(function(a, b) {
                    return b - a;
                });
                if ($.browser.msie6) {
                    containers.each(function() {
                        this.minHeight = heights[0] + 'px';
                        this.style.setExpression('behaviour', 'this.style.height = this.minHeight ? this.minHeight : "1px"'); // using an expression to not make print styles useless
                    });
                } else {
                    containers.css({'min-height': heights[0] + 'px'});
                }
            };
            // call once for initialization
            _setAutoHeight();
            // trigger auto height adjustment if needed
            var cachedWidth = container.offsetWidth;
            var cachedHeight = container.offsetHeight;
            var watchFontSize = $('#tabs-watch-font-size').get(0) || $('<span id="tabs-watch-font-size">M</span>').css({display: 'block', position: 'absolute', visibility: 'hidden'}).appendTo(document.body).get(0);
            var cachedFontSize = watchFontSize.offsetHeight;
            setInterval(function() {
                var currentWidth = container.offsetWidth;
                var currentHeight = container.offsetHeight;
                var currentFontSize = watchFontSize.offsetHeight;
                if (currentHeight > cachedHeight || currentWidth != cachedWidth || currentFontSize != cachedFontSize) {
                    _setAutoHeight((currentWidth > cachedWidth || currentFontSize < cachedFontSize)); // if heights gets smaller reset min-height
                    cachedWidth = currentWidth;
                    cachedHeight = currentHeight;
                    cachedFontSize = currentFontSize;
                }
            }, 50);
        }

        // setup animations
        var showAnim = {}, hideAnim = {}, showSpeed = settings.fxShowSpeed || settings.fxSpeed, hideSpeed = settings.fxHideSpeed || settings.fxSpeed;
        if (settings.fxSlide || settings.fxFade) {
            if (settings.fxSlide) {
                showAnim['height'] = 'show';
                hideAnim['height'] = 'hide';
            }
            if (settings.fxFade) {
                showAnim['opacity'] = 'show';
                hideAnim['opacity'] = 'hide';
            }
        } else {
            if (settings.fxShow) {
                showAnim = settings.fxShow;
            } else { // use some kind of animation to prevent browser scrolling to the tab
                showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
                showSpeed = 1; // as little as 1 is sufficient
            }
            if (settings.fxHide) {
                hideAnim = settings.fxHide;
            } else { // use some kind of animation to prevent browser scrolling to the tab
                hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
                hideSpeed = 1; // as little as 1 is sufficient
            }
        }

        // callbacks
        var onClick = settings.onClick, onHide = settings.onHide, onShow = settings.onShow;

        // attach activateTab event, required for activating a tab programmatically
        tabs.bind('triggerTab', function() {

            // if the tab is already selected or disabled or animation is still running stop here
            var li = $(this).parents('li:eq(0)');
            if (container.locked || li.is('.' + settings.selectedClass) || li.is('.' + settings.disabledClass)) {
                return false;
            }

            var hash = this.hash;

            if ($.browser.msie) {

                $(this).trigger('click');
                if (settings.bookmarkable) {
                    $.ajaxHistory.update(hash);
                    location.hash = hash.replace('#', '');
                }

            } else if ($.browser.safari) {

                // Simply setting location.hash puts Safari into the eternal load state... ugh! Submit a form instead.
                var tempForm = $('<form action="' + hash + '"><div><input type="submit" value="h" /></div></form>').get(0); // no need to append it to the body
                tempForm.submit(); // does not trigger the form's submit event...
                $(this).trigger('click'); // ...thus do stuff here
                if (settings.bookmarkable) {
                    $.ajaxHistory.update(hash);
                }

            } else {

                if (settings.bookmarkable) {
                    location.hash = hash.replace('#', '');
                } else {
                    $(this).trigger('click');
                }

            }

        });

        // attach disable event, required for disabling a tab
        tabs.bind('disableTab', function() {
            var li = $(this).parents('li:eq(0)');
            if ($.browser.safari) { /* fix opacity of tab after disabling in Safari... */
                li.animate({ opacity: 0 }, 1, function() {
                   li.css({opacity: ''});
                });
            }
            li.addClass(settings.disabledClass);

        });

        // disabled from settings
        if (settings.disabled && settings.disabled.length) {
            for (var i = 0, k = settings.disabled.length; i < k; i++) {
                tabs.eq(--settings.disabled[i]).trigger('disableTab').end();
            }
        };

        // attach enable event, required for reenabling a tab
        tabs.bind('enableTab', function() {
            var li = $(this).parents('li:eq(0)');
            li.removeClass(settings.disabledClass);
            if ($.browser.safari) { /* fix disappearing tab after enabling in Safari... */
                li.animate({ opacity: 1 }, 1, function() {
                    li.css({opacity: ''});
                });
            }
        });

        // attach click event
        tabs.bind('click', function(e) {

            var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
            var clicked = this, li = $(this).parents('li:eq(0)'), toShow = $(this.hash), toHide = containers.filter(':visible');

            // if animation is still running, tab is selected or disabled or onClick callback returns false stop here
            // check if onClick returns false last so that it is not executed for a disabled tab
            if (container['locked'] || li.is('.' + settings.selectedClass) || li.is('.' + settings.disabledClass) || typeof onClick == 'function' && onClick(this, toShow[0], toHide[0]) === false) {
                this.blur();
                return false;
            }

            container['locked'] = true;

            // show new tab
            if (toShow.size()) {

                // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
                if ($.browser.msie && settings.bookmarkable) {
                    var toShowId = this.hash.replace('#', '');
                    toShow.attr('id', '');
                    setTimeout(function() {
                        toShow.attr('id', toShowId); // restore id
                    }, 0);
                }

                var resetCSS = { display: '', overflow: '', height: '' };
                if (!$.browser.msie) { // not in IE to prevent ClearType font issue
                    resetCSS['opacity'] = '';
                }
                
                // switch tab, animation prevents browser scrolling to the fragment
                function switchTab() {
                    if (settings.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
                        $.ajaxHistory.update(clicked.hash);
                    }
                    toHide.animate(hideAnim, hideSpeed, function() { //
                        $(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);
                        toHide.addClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.                        
                        if (typeof onHide == 'function') {
                            onHide(clicked, toShow[0], toHide[0]);
                        }
                        if (!(settings.fxSlide || settings.fxFade || settings.fxShow)) {
                            toShow.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab containers
                        }
                        toShow.animate(showAnim, showSpeed, function() {
                            toShow.removeClass(settings.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
                            if ($.browser.msie) {
                                toHide[0].style.filter = '';
                                toShow[0].style.filter = '';
                            }
                            if (typeof onShow == 'function') {
                                onShow(clicked, toShow[0], toHide[0]);
                            }
                            container['locked'] = null;
                        });
                    });
                }

                if (!settings.remote) {
                    switchTab();
                } else {
                    $(clicked).trigger('loadRemoteTab', [switchTab]);
                }

            } else {
                alert('There is no such container.');
            }

            // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
            var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
            var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
            setTimeout(function() {
                window.scrollTo(scrollX, scrollY);
            }, 0);

            this.blur(); // prevent IE from keeping other link focussed when using the back button

            return settings.bookmarkable && !!trueClick; // convert undefined to Boolean for IE

        });

        // enable history support if bookmarking and history is turned on
        if (settings.bookmarkable) {
            $.ajaxHistory.initialize(function() {
                tabs.eq(settings.initial).trigger('click').end();
            });
        }

    });

};

/**
 * Activate a tab programmatically with the given position (no zero-based index)
 * or its id, e.g. the URL's fragment identifier/hash representing a tab, as if the tab
 * itself were clicked.
 *
 * @example $('#container').triggerTab(2);
 * @desc Activate the second tab of the tab interface contained in <div id="container">.
 * @example $('#container').triggerTab(1);
 * @desc Activate the first tab of the tab interface contained in <div id="container">.
 * @example $('#container').triggerTab();
 * @desc Activate the first tab of the tab interface contained in <div id="container">.
 * @example $('#container').triggerTab('fragment-2');
 * @desc Activate a tab via its URL fragment identifier representation.
 *
 * @param String|Number tab Either a string that matches the id of the tab (the URL's
 *                          fragment identifier/hash representing a tab) or an integer
 *                          specifying the position of the tab (no zero-based index) to
 *                          be activated. If this parameter is omitted, the first tab
 *                          will be activated.
 * @type jQuery
 *
 * @name triggerTab
 * @cat Plugins/Tabs
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Disable a tab, so that clicking it has no effect.
 *
 * @example $('#container').disableTab(2);
 * @desc Disable the second tab of the tab interface contained in <div id="container">.
 *
 * @param String|Number tab Either a string that matches the id of the tab (the URL's
 *                          fragment identifier/hash representing a tab) or an integer
 *                          specifying the position of the tab (no zero-based index) to
 *                          be disabled. If this parameter is omitted, the first tab
 *                          will be disabled.
 * @type jQuery
 *
 * @name disableTab
 * @cat Plugins/Tabs
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Enable a tab that has been disabled.
 *
 * @example $('#container').enableTab(2);
 * @desc Enable the second tab of the tab interface contained in <div id="container">.
 *
 * @param String|Number tab Either a string that matches the id of the tab (the URL's
 *                          fragment identifier/hash representing a tab) or an integer
 *                          specifying the position of the tab (no zero-based index) to
 *                          be enabled. If this parameter is omitted, the first tab
 *                          will be enabled.
 * @type jQuery
 *
 * @name enableTab
 * @cat Plugins/Tabs
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

var tabEvents = ['triggerTab', 'disableTab', 'enableTab'];
for (var i = 0; i < tabEvents.length; i++) {
    $.fn[tabEvents[i]] = (function(tabEvent) {
        return function(tab) {
            return this.each(function() {
                var nav = $('#stacks_in_27_page6 ul.tabs-nav' , this);
                nav = nav.size() && nav || $('>ul:eq(0)', this); // fallback to default structure
                var a;
                if (!tab || typeof tab == 'number') {
                    a = $('li a', nav).eq((tab && tab > 0 && tab - 1 || 0)); // fall back to 0
                } else if (typeof tab == 'string') {
                    a = $('li a[@href$="#' + tab + '"]', nav);
                }
                a.trigger(tabEvent);
            });
        };
    })(tabEvents[i]);
}

/**
 * Get the position of the currently selected tab (no zero-based index).
 *
 * @example $('#container').activeTab();
 * @desc Get the position of the currently selected tab of an interface
 * contained in <div id="container">.
 *
 * @type Number
 *
 * @name activeTab
 * @cat Plugins/Tabs
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

$.fn.activeTab = function() {
    var selectedTabs = [];
    this.each(function() {
        var nav = $('#stacks_in_27_page6 ul.tabs-nav' , this);
        nav = nav.size() && nav || $('>ul:eq(0)', this); //fallback to default structure
        var lis = $('li', nav);
        selectedTabs.push(lis.index( lis.filter('.tabs-selected')[0] ) + 1);
    });
    return selectedTabs[0];
};

$(function() {
$('#stacks_in_27_page6 .container-1').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-2').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-3').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-4').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-5').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-6').tabs({ fxFade: true, fxSpeed: 'fast' });
$('#stacks_in_27_page6 .container-7').tabs({ fxFade: true, fxSpeed: 'fast' });
});


})(jQuery);
	return stack;
})(stacks.stacks_in_27_page6);


// Javascript for stacks_in_44_page6
// ---------------------------------------------------------------------

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

// 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_44_page6 = (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= 'Donate';
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_44_page6 .teleportMe").html();


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

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



