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

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

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	


// start doobox scrren lift jquery code

$(document).ready(function() {
 
 // Image Sources
	var images = $("#stacks_in_39_page15 .DooScreenShow *").find("img");
    var imagearray = jQuery.makeArray(images);
    var max = $(imagearray).length;
    var i = 0;
    var delay = 5 * 1000;
    var auto = 1;

if (auto == 0) {   
    $('#stacks_in_39_page15 .dooScreenContainer1').bind('click', function() {

        $('#stacks_in_39_page15 .spacer').slideDown('slow', function() {
        $('#stacks_in_39_page15 .dooScreenContainer1 .centered_image img').remove();
        $('#stacks_in_39_page15 .dooScreenContainer1 .centered_image').append(imagearray[i]);
        });

            $('#stacks_in_39_page15 .spacer').slideUp('slow', function() {
                // some method here if i need it
            });
        i++; 
        if (i >= max) {i = 0;}
    });
}
    
  
    


if (auto == 1) {
setInterval(function() {

        
        $('#stacks_in_39_page15 .spacer').slideDown('slow', function() {
        $('#stacks_in_39_page15 .dooScreenContainer1 .centered_image img').remove();
        $('#stacks_in_39_page15 .dooScreenContainer1 .centered_image').append(imagearray[i]);
        });

            $('#stacks_in_39_page15 .spacer').slideUp('slow', function() {
                // some method here if i need it
            });
        i++; 
        if (i >= max) {i = 0;}
        
 
}, delay); 
}
    
    
    
});    

// end doobox scrren lift jquery code


	return stack;
})(stacks.stacks_in_39_page15);



