
// '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_59_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_59_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_59_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;
	
var $myMenu = jQuery.noConflict(); 

$myMenu(document).ready(function() {
	$myMenu('.nimblehost_myMenuOuterWrapper_stacks_in_59_page0 script').remove();
	$myMenu('.nimblehost_myMenuOuterWrapper_stacks_in_59_page0').appendTo('body');
	
	$myMenu(".nimblehost_myMenu_stacks_in_59_page0 ul ul").parent().addClass("ddarrow");
	$myMenu(".nimblehost_myMenu_stacks_in_59_page0 ul ul").parent().append("<span class=\"childIndicator\"></span>");

	var myMenuOffset = $myMenu('.nimblehost_myMenuInnerWrapper_stacks_in_59_page0').offset();
	var myMenuPosition = (myMenuOffset.left / $myMenu(window).width()) * 100;
	
	if (myMenuPosition > 50) {
		var subMenuOffset = $myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul').width();
		$myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul ul').css({left: 'auto', right: subMenuOffset + 'px'});
		$myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul li a').css({paddingLeft: '15px'});
		$myMenu(window).load(function(){
			$myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul li.ddarrow .childIndicator').css({right: 'auto', left: '2px', backgroundImage: 'url(files/ddarrowLeft.png)'});
		});
	}
	
	var myMenuLinkHeight = $myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul li').height();
	$myMenu(window).load(function(){
		$myMenu('.nimblehost_myMenu_stacks_in_59_page0 ul li.ddarrow .childIndicator').css({height: myMenuLinkHeight + 'px', top: '0'});
	});
});

	return stack;
})(stacks.stacks_in_59_page0);



