
// '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_15_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_15_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_15_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;
	
/* Flex EZ Button Stack by RWExtras v1.0.1 */
/* Copyright (C) 2011 by RWExtras (http://rwextras.com) */
jQuery(document).ready(function() {
var bg1 = $('<img />').attr('src', 'files/ez_sprites/bgsprite1.png');
var bg2 = $('<img />').attr('src', 'files/ez_sprites/bgsprite1.png');
var $ezlink = jQuery('.ezbutton_stacks_in_15_page0 .ez_middle a');
var $leftside = jQuery('.ezbutton_stacks_in_15_page0 .ez_left');
var $rightside = jQuery('.ezbutton_stacks_in_15_page0 .ez_right');
var $middle = jQuery('.ezbutton_stacks_in_15_page0 .ez_middle');
if($ezlink.length == 0 ) {
	jQuery('.ezbutton_stacks_in_15_page0 > span').wrapAll('<a href="#"></a>');
	$middle.html('Add link...');
	} else {
	$middle.html($ezlink.html());
	jQuery('.ezbutton_stacks_in_15_page0 > span').wrapAll($ezlink.html(''));
	$ezlink.remove();
}
switch ('center'){
case 'left':
jQuery('.ezbutton_stacks_in_15_page0').css('margin-left','0');
break;
case 'right':
jQuery('.ezbutton_stacks_in_15_page0').css('margin-right','0');
break;
default :
jQuery('.ezbutton_stacks_in_15_page0').css('margin','0 auto');
}
var $shift = ('round' == 'square')?22:0;
var $left = -$shift;
var $right = -$shift - 10;
var $bg_top = - (2 -1)*76;
var $hov_top = - (2 -1)*76;
var $bg_topm = $bg_top - 38;
var $hov_topm = $hov_top - 38;
jQuery('.ezbutton_stacks_in_15_page0 a > span').addClass('ezbg');
$middle.css({'width':150 - 20 + 'px','background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $bg_top + 'px'});
jQuery('.ezbutton_stacks_in_15_page0').fadeIn(5*200);
jQuery('.ezbutton_stacks_in_15_page0').hover(function(){
jQuery('.ezbutton_stacks_in_15_page0 a > span').removeClass('ezbg').addClass('ezhover');
$middle.css({'background-position': '0px ' + $hov_topm + 'px'});
$leftside.css({'background-position': $left + 'px ' + $hov_top + 'px'});
$rightside.css({'background-position': $right + 'px ' + $hov_top + 'px'});
},function(){
jQuery('.ezbutton_stacks_in_15_page0 a > span').removeClass('ezhover').addClass('ezbg');
$middle.css({'background-position': '0px ' + $bg_topm + 'px'});
$leftside.css({'background-position': $left + 'px '+ $bg_top + 'px'});
$rightside.css({'background-position': $right + 'px '+ $bg_top + 'px'});
});
});
/* End of Flex EZ Button Stack */
	return stack;
})(stacks.stacks_in_15_page0);



