	 $(document).ready(function(){

	    myHeight = $("body").height() - 62 - 113;
		if($('div#content').height() < myHeight) {
			$('div#content').height(myHeight);
			$('div#contentinner').height(myHeight);
		}
					$(".lightbox").lightbox({
			    fitToScreen: true,
			    imageClickClose: false
		    });

		setInterval("slides()", 4000);

			$('img#top_two').wait().mouseout(function () {
				$('div#prod_sub').hide();
			});			
		
			$('div#prod_sub').mouseover(function () {
				$('div#prod_sub').show();
			});	
		
			$('div#prod_sub').mouseout(function () {
				$('div#prod_sub').hide();
			});		
		
	 });

$.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };	 
	 
	 function slides() {

	 	currentSlide = "div#themainimage_" + this_frame++;

		if(this_frame == pic_quantity)
			this_frame = 0;

		nextSlide = "div#themainimage_" + this_frame;

		$(currentSlide).fadeOut("slow");
		$(nextSlide).fadeIn("slow");

	 }