	var currentOpacity=0;

	function showNextImage()
	{
		if(currentImageNumber!=maxImageNumber && currentImageNumber != 1)
		{
			setTimeout("document.getElementById('slideshow"+currentImageNumber+"').style.opacity=0;",3000);
			setTimeout("document.getElementById('slideshow"+currentImageNumber+"').style.filter='alpha(opacity=0)';",3000);
		}
		if(currentImageNumber==1)
		{
			currentImageNumber=maxImageNumber;
			element="slideshow1";
			opacity=0;
		}
		else
		{
			currentImageNumber--;
			element="slideshow"+currentImageNumber;
			opacity=1;
		}
		if(Modernizr.csstransitions)
		{
			document.getElementById(element).style.opacity=opacity;
		}
		else
		{
			animateOpacity(element,opacity,1);
		}
		setTimeout("showNextImage()",5000);
	}

	function animateOpacity(id, opacityTo, seconds)
	{
		//needs update for working with IE's style.filter=alpha(opacity=X);
		if(seconds>0)
		{
			var frames=24;
			interval=seconds/(seconds*frames);
			newSeconds=seconds-interval;
			element=document.getElementById(id);
			opacityDiff=currentOpacity-opacityTo;
			opacityIncrement=opacityDiff/(opacityDiff*frames);
			(opacityDiff<0)?newOpacity=(currentOpacity*1)+opacityIncrement:newOpacity=(currentOpacity*1)-opacityIncrement;
			ieOpacity=newOpacity*100;
//alert("current = "+currentOpacity+"new = "+newOpacity+"; ie = "+ieOpacity);
//return;
			element.style.opacity=newOpacity;
			element.style.filter="alpha(opacity="+ieOpacity+")";
			currentOpacity=newOpacity;
			setTimeout("animateOpacity('"+id+"', "+opacityTo+", "+newSeconds+")",interval);
		}
		else
		{
			document.getElementById(id).style.opacity=opacityTo;
			currentOpacity=0;
		}
	}
;
/* Modernizr custom build of 1.7: opacity | csstransitions */
window.Modernizr=function(a,b,c){function G(){}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.csstransitions=function(){return F("transitionProperty")};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document);
			function updateIframe()
			{
				document.getElementById("giving-iframe-div").style.display="block";
				givingFrame=document.getElementById('giving-iframe');
				givingFrame.src="about:blank"; //givingFrame.src=""; //
				//givingFrame.height=150;
				//alert("http://micah.macpractice.net/sbs/sites/all/themes/sbs/php/iframe_get.php?org="+document.getElementById("matching_INPUT_ORGNAME").value);
				setTimeout("givingFrame.src='/sites/all/themes/sbs/php/iframe_get.php?org="+document.getElementById("matching_INPUT_ORGNAME").value+"'",10);
				doIframe();
			}

			function updateBodyClass()
			{
				giftType=document.getElementById("gift_type").value;
				document.getElementById("form-body").className=giftType;
				if(giftType=="one-time")
					document.getElementById("next_button").value = "Next";
				else
					document.getElementById("next_button").value = "Submit";
			}

			function  selectTextBox(item)
			{
				if(item.checked)
				{
					document.getElementById(item.name+"_text").focus();
				}
			}

function doIframe(){
	o = document.getElementsByTagName('iframe');
	for(i=0;i<o.length;i++){
		if (/\bautoHeight\b/.test(o[i].className)){
			setHeight(o[i]);
			addEvent(o[i],'load', doIframe);
		}
	}
}

function setHeight(e){
	if(e.contentDocument){
		e.height = e.contentDocument.body.offsetHeight + 35;
	} else {
		e.height = e.contentWindow.document.body.scrollHeight;
	}
}

function addEvent(obj, evType, fn){
	if(obj.addEventListener)
	{
	obj.addEventListener(evType, fn,false);
	return true;
	} else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
	return r;
	} else {
	return false;
	}
}
;
	function showSubMenu(id)
	{
		item=document.getElementById("item-"+id);
		disclosureDiv=document.getElementById(id+"-disclosure");
		if(item.className.indexOf("closed")==-1)
		{
			item.className="expanded closed";
			disclosureDiv.innerHTML="+";
		}
		else
		{
			item.className="expanded opened";
			disclosureDiv.innerHTML="-";
		}
	};

