function checkAllocation() {
	var strShowBox = document.getElementById("Donation_Allocation").value;
	if (strShowBox == "Faith Partner") { 
		document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "none";
		document.getElementById("FAITH_PARTNER").style.display = "";
	} else {
		document.getElementById("FAITH_PARTNER").style.display = "none";
	}
	if (strShowBox == "Service Areas") { 
		document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "none";
		document.getElementById("SERVICE_AREAS").style.display = "";
	} else {
		document.getElementById("SERVICE_AREAS").style.display = "none";
	}	
	if (strShowBox == "Special Builds") { 
		document.getElementById("SPECIAL_BUILDS").style.display = "";
		
		var strValueB = document.getElementById("SPECIAL_BUILDS_SELECT").value;
	
		if (strValueB == "Builders Blitz") {
			document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "";
		} else {
			document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "none";
		}
		
	} else {
		document.getElementById("SPECIAL_BUILDS").style.display = "none";
	}
	if (strShowBox == "Tribute") { 
		document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "none";
		document.getElementById("TRIBUTE").style.display = "";
		document.getElementById("TRIBUTE_DETAILS").style.display = "";
	} else {
		document.getElementById("TRIBUTE").style.display = "none";
		document.getElementById("TRIBUTE_DETAILS").style.display = "none";
	}
}

function checkBuilds() {
	var strValueA = document.getElementById("Donation_Allocation").value;
	var strValueB = document.getElementById("SPECIAL_BUILDS_SELECT").value;
	
	if (strValueA == "Special Builds" && strValueB == "Builders Blitz") {
		document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "";
	} else {
		document.getElementById("SPECIAL_BUILDS_BLITZ").style.display = "none";
	}
}

function checkAmount() {
	var strAmount = document.getElementById("Donation_Amount").value;
	if (strAmount == "other") {
		document.getElementById("Donation_Amount_Other").style.display = "";
	} else {
		document.getElementById("Donation_Amount_Other").style.display = "none";
	}
}


function more(id,idshow) { 
	document.getElementById(id).innerHTML = "(<a href=\"#less\" onclick=\"less('" + id + "','" + idshow + "');\">less</a>)";
	document.getElementById(idshow).style.display = "inline";
}
function less(id,idshow) {
	document.getElementById(id).innerHTML = "(<a href=\"#more\" onclick=\"more('" + id + "','" + idshow + "');\">more</a>)";
	document.getElementById(idshow).style.display = "none";
}
	
function emailPage(url) {
	mail_str = "mailto:?subject=Habitat for Humanity of Omaha"
	mail_str += "&body=I thought you might be interested in a page on the Habitat for Humanity of Omaha website."
	mail_str += "You can view it at:\n\t http://www.habitatomaha.org" + url;
	location.href = mail_str;
}

function opacityChange(opacity, thediv, theimage) {
	var object = document.getElementById(thediv).style;
	if (opacity == 100) {
		object.opacity = 0;
		object.MozOpacity = 0;
		object.KhtmlOpacity = 0;
		object.filter = "alpha(opacity=0)";
		document.getElementById(theimage).style.backgroundImage = "url(" + document.getElementById(thediv).src + ")";
	}
	else {
		object.opacity = (opacity/100);
		object.MozOpacity = (opacity/100);
		object.KhtmlOpacity = (opacity/100);
		object.filter = "alpha(opacity=" + opacity + ")";
	}
}


function imageFade(thediv, theimage, imageloc, time) {
	var speed = Math.round(time / 10);
	var timer = 0;
	opacityChange(0, theimage);
	document.getElementById(theimage).src = imageloc;
	for(i = 0; i <= 100; i++) {
		setTimeout("opacityChange(" + i + ",'" + theimage + "','" + thediv + "')",(timer * speed));
		timer++;
	}
}

var slideCache = new Array();

function RunSlideShow(thediv,theimage,imageFiles,displaySecs) {
	var imageSeparator = imageFiles.indexOf(";");
	var nextImage = imageFiles.substring(0,imageSeparator);
	imageFade(thediv,theimage,nextImage,100);
	var nextImages= imageFiles.substring(imageSeparator+1,imageFiles.length)+ ';' + nextImage;
	setTimeout("RunSlideShow('"+thediv+"','"+theimage+"','"+nextImages+"',"+displaySecs+")",displaySecs*1000);

	imageSeparator = nextImages.indexOf(";");
	nextImage = nextImages.substring(0,imageSeparator);
	if (slideCache[nextImage] == null) {
		slideCache[nextImage] = new Image;
		slideCache[nextImage].src = nextImage;
	}
}