 function slideShow() {
    //Set the opacity of all images to 0
    $('#gallery a').css({ opacity: 0.0 });

    //Get the first image and display it (set it to full opacity)
    $('#gallery a:first').css({ opacity: 1.0 });

    setInterval('gallery()', 5000);
}

function gallery() {

    //if no IMGs have the show class, grab the first image
    var current = ($('#gallery a.show') ? $('#gallery a.show') : $('#gallery a:first'));

    //Get next image, if end of the slideshow, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().hasClass('caption')) ? $('#gallery a:first') : current.next()) : $('#gallery a:first'));

    //Get next image caption
    var caption = next.find('img').attr('rel');

    //Set the fade in effect for the next image, show class has higher z-index
    next.css({ opacity: 0.0 })
	.addClass('show')
	.animate({ opacity: 1.0 }, 1000);

    //Hide the current image
    current.animate({ opacity: 0.0 }, 1000)
	.removeClass('show');
}

// CHANGE TABS ON CUSTOMERS PAGE
function changeTab(tabId) {
	//REST ALL TABS AND BOXES
	for (i=1;i<6;i++) {
		tabName = "tab-" + i;
		$(tabName).style.background = "url('images/grey_strip.jpg') repeat-x scroll right top transparent";
		$(tabName).style.borderBottom = "solid #DDDDDD 1px";
		boxName = "box-" + i;
		$(boxName).style.display = "none";
	}
	
	// SET SELECTED TAB AND BOX STYLES
	tabName = "tab-" + tabId;
	$(tabName).style.background = "#FFFFFF";
	$(tabName).style.borderBottom = "solid #FFFFFF 1px";
	boxName = "box-" + tabId;
	$(boxName).style.display = "block";
}
	
