
// construct home page main bg
function doHomeBG() {
	// home bg vars
	var homeImages = new Array();
	var mainBG = $("#mainBG");
	
	mainBG.css("opacity", 0.0);
	
	// get home images and push into array
	$.ajax({
		type: "GET", 
		url: "data/home.xml", 
		dataType: "xml", 
		success: function(xml) {
	
			// push all images into mainbg element
			$(xml).find("image").each(function(i) {
				var imageSrc = $(this).attr("src");
				var active = (i==0) ? " class=\"active\"" : "";
				var image = "<img src=\""+imageSrc+"\" height=\"660\" width=\"980\" alt=\"\""+active+" />";
				mainBG.append(image);
			});
			
			// add active class to first image in collection
			mainBG.find("image:first").addClass("active");
			
			// fade in bg 
			mainBG.fadeTo(1250, 1.0);
			
			// instantiate cycle(fade)
			mainBG.cycle({
				fx: "fade", 
				timeout: 8000, 
				sync: true
			});
			
		}
	});
	
	
}

