function bgload(Image) {
	jQuery("#caption").hide();
	jQuery("#mainText").show();
	bgstretch(Image);
}

function bgstretch(Image) {
	jQuery("#backstretch").fadeOut(200);
	jQuery("#backstretch").remove();
	//jQuery("#backstretch").remove();
	jQuery.backstretch(Image, {speed: 150} );
	return false;
}

function bgnav(Image) {
	jQuery("#mainText").hide();
	bgstretch(Image);
	jQuery("#leftnav").css('min-width', '245px !important').width('245px');
	jQuery("#caption").fadeIn();
	return false;
}

function fixbox() {
	jQuery("#leftnav").toggleClass('wideBox');
	return false;
}


function bgcaption(Image,Caption,Page) {
	jQuery("#mainText").hide();
	bgstretch(Image);
	jQuery("#leftnav").css('min-width', '245px !important').width('245px');

	var HTML	= '';
	if (Caption) {
		HTML += '<h1>'+Caption+'</h1>';
	}
	if (Page) {
		HTML += '<p><a href="'+Page+'.html">&laquo;&nbsp;Previous Page</a></p>';
	}
	//jQuery("#caption").html(HTML).fadeIn();
	jQuery("#captionContent").html(HTML);
	jQuery("#caption").fadeIn();
	return false;

	// obsolete
	//HTML = '<p>Picture:<br><br>'+Caption+'<br><br><a href="savannah-wedding-elope.html">Go Back</a></p>';
	//HTML += '<br><br><a href="index.html">Return to Home Page</a></p>';
}

function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        (new Image()).src = this;
        // Alternatively you could use:
        // $('<img/>')[0].src = this;
    });
}


