function showHide(state,elemID) {
	if ((document.all) && document.all[elemID]) {
		// alert('in ie4 or above');
		if (state == 'show' && document.all(elemID)) document.all[elemID].style.display = 'block';
		else if (state == 'hide' && document.all(elemID)) document.all[elemID].style.display = 'none';
		} // end if document.all is recognized
	else {
		if (document.getElementById(elemID)) {
			// Netscape 6 & IE5, access the text's ID, then use the property innerHTML
			// alert('getElementById');
			if (state == 'show' && document.getElementById(elemID)) document.getElementById(elemID).style.display = 'block';
			else if (state == 'hide' && document.getElementById(elemID)) document.getElementById(elemID).style.display = 'none';
		} // end if getElementById is recognized	
	}
	return;
	
}



// MAIN NAV DROPDOWNS

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;





// RANDOM IMAGES - INTERIOR

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Set up the image files to be used.
var theImages = new Array(); // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'img/banner-1.jpg';
theImages[1] = 'img/banner-2.jpg';
// do not edit anything below this line

var j = 0;
var p = theImages.length;
var preBuffer = new Array();
for (i = 0; i < p; i++){
   preBuffer[i] = new Image();
   preBuffer[i].src = theImages[i];
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" id="banner" alt="American Association of Homes and Services for the Aging">');
}
function showGoogleImage(){
document.write('<img src="http:\/\/aahsadev.beaconfire.us\/'+theImages[whichImage]+'" id="banner" alt="American Association of Homes and Services for the Aging">');
}

//  End -->



// RANDOM IMAGES - HOMEPAGE

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
// Set up the image files to be used.
var theImagesHome = new Array(); // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImagesHome[0] = 'img/home-hero1.jpg';
theImagesHome[1] = 'img/home-hero2.jpg';
// do not edit anything below this line

var j = 0;
var p = theImagesHome.length;
var preBuffer = new Array();
for (i = 0; i < p; i++){
   preBuffer[i] = new Image();
   preBuffer[i].src = theImagesHome[i];
}
var whichImageHome = Math.round(Math.random()*(p-1));
function showImageHome(){
document.write('<img src="'+theImagesHome[whichImage]+'" class="home-hero" alt="American Association of Homes and Services for the Aging">');
}


// HEADER IMAGE - IFAS
function showImageIfas(){
document.write('<img src="img/banner-ifas.jpg" id="banner" alt="American Association of Homes and Services for the Aging">');
}


// AJAX CALL FOR SIGNUP
    function signupUser() {
        var url = 'signup.aspx?signup='+$F('email');
        var ajax = new Ajax.Request(url,
                { 
                onComplete: function(transport){
                    showHide('show','signup-thanks-cover'); 
                    }
                }
            );
    }


// AJAX CALL FOR SIGNUP - Google
    function signupUserG() {
        var url = 'http://aahsadev.beaconfire.us/signup.aspx?signup='+$F('email');
        var ajax = new Ajax.Request(url,
                { 
                onComplete: function(transport){
                    showHide('show','signup-thanks-cover'); 
                    }
                }
            );
    }


//  End -->
