function toggleImage(theImage) {
	if ((document.getElementById(theImage).src).indexOf("-on") > 0) {
		document.getElementById(theImage).src = "images/" + theImage + ".gif";
	} else {
		document.getElementById(theImage).src = "images/" + theImage + "-on.gif";
	}
}

function toggleDetails(theImage) {
	if ((document.getElementById(theImage).src).indexOf("-on") > 0) {
		document.getElementById(theImage).src = "images/" + theImage + ".gif";
	} else {
		document.getElementById(theImage).src = "images/" + theImage + "-on.gif";
		if (theImage == 'subnav_restaurants' || theImage == 'subnav_entertainment') {
			document.getElementById('details').src = "images/details_restaurants.gif";
		} else if (theImage == 'subnav_retail' || theImage == 'subnav_florists') {
			document.getElementById('details').src = "images/details_retail.gif";
		} else if (theImage == 'subnav_salons' || theImage == 'subnav_fitness' || theImage == 'subnav_health') {
			document.getElementById('details').src = "images/details_salons.gif";
		} else if (theImage == 'subnav_libraries' || theImage == 'subnav_petcare' || theImage == 'subnav_services') {
			document.getElementById('details').src = "images/details_libaries.gif";
		}
	}
}

function toggleDescriptions(theImage) {
	if (theImage == 'subnav_samuel_withporch') {
		if ((document.getElementById('subnav_samuel').src).indexOf("-on") > 0) {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel.gif";
		} else {
			document.getElementById('subnav_samuel').src = "images/" + theImage + "-on.gif";
		}
	} else if (theImage == 'subnav_samuel_withoutporch') {
		if ((document.getElementById('subnav_samuel').src).indexOf("-on") > 0) {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel.gif";
		} else {
			document.getElementById('subnav_samuel').src = "images/" + theImage + "-on.gif";
		}

	} else if (theImage == 'subnav_samuel_withporch_page') {
		if ((document.getElementById('subnav_samuel').src).indexOf("both") > 0) {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel_withoutporch-on.gif";
		} else {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel_both-on.gif";
		}
		
	} else if (theImage == 'subnav_samuel_withoutporch_page') {
		if ((document.getElementById('subnav_samuel').src).indexOf("both") > 0) {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel_withporch-on.gif";
		} else {
			document.getElementById('subnav_samuel').src = "images/subnav_samuel_both-on.gif";
		}		

	} else {
		if ((document.getElementById(theImage).src).indexOf("-on") > 0) {
			document.getElementById(theImage).src = "images/" + theImage + ".gif";
		} else {
			document.getElementById(theImage).src = "images/" + theImage + "-on.gif";
		}
	}
}

function toggleSpecifications(theImage) {
	document.getElementById('subnav_exterior').src = "images/subnav_exterior.gif"; 
	document.getElementById('subnav_interior').src = "images/subnav_interior.gif"; 
	document.getElementById('subnav_kitchen').src = "images/subnav_kitchen.gif"; 
	document.getElementById('subnav_laundry').src = "images/subnav_laundry.gif"; 
	document.getElementById('subnav_bathrooms').src = "images/subnav_bathrooms.gif"; 
	document.getElementById('subnav_comfort').src = "images/subnav_comfort.gif"; 
	document.getElementById('subnav_design').src = "images/subnav_design.gif"; 
	document.getElementById(theImage).src = "images/" + theImage + "-on.gif";
	document.getElementById('details').src = "images/details_" + theImage.substring(7) + ".gif";
}

function toggleNumbers(theNumber) {
	if (theNumber == '0') {
		document.getElementById('number_clear').src = "images/number_clear.gif";
	} else {
		document.getElementById('number_clear').src = "images/number_" + theNumber + ".gif";
	}
}

function preloadNavigation() {
   var theImages = new Array(
	'images/nav_theproject-on.gif', 
	'images/nav_homedescriptions-on.gif', 
	'images/nav_ourneighborhood-on.gif', 
	'images/nav_specifications-on.gif', 
	'images/nav_contactus-on.gif');

	preloadImages(theImages);
}

function preloadDescriptions() {
   var theImages = new Array(
	'images/subnav_sitemap-on.gif',
	'images/subnav_dillman-on.gif',
	'images/subnav_hannah-on.gif',
	'images/subnav_raphael-on.gif',
	'images/subnav_flora-on.gif',
	'images/subnav_samuel_withporch-on.gif',
	'images/subnav_samuel_withoutporch-on.gif',
	'images/subnav_samuel_both-on.gif',
	'images/subnav_walker-on.gif',
	'images/subnav_bushmanor_north-on.gif',
	'images/subnav_bushmanor_south-on.gif');

	preloadImages(theImages);
}

function preloadNumbers() {
   var theImages = new Array(
	'images/number_1531.gif',
	'images/number_1535.gif',
	'images/number_1539.gif',
	'images/number_1540.gif',
	'images/number_1544.gif',
	'images/number_1548.gif',
	'images/number_1550.gif',
	'images/number_1551.gif',
	'images/number_1555.gif',
	'images/number_1558.gif',
	'images/number_1559.gif',
	'images/number_1560.gif',
	'images/number_1564.gif',
	'images/number_1568.gif',
	'images/number_1570.gif',
	'images/number_1574.gif',
	'images/number_1578.gif',
	'images/number_1990.gif',
	'images/number_1994.gif',
	'images/number_1998.gif',
	'images/number_2020.gif',
	'images/number_2024.gif',
	'images/number_2028.gif');

	preloadImages(theImages);
}


function preloadOurNeighborhood() {
   var theImages = new Array(
	'images/subtitle_ourneighborhood-on.gif', 
	'images/subnav_restaurants-on.gif', 
	'images/subnav_retail-on.gif', 
	'images/subnav_florists-on.gif', 
	'images/subnav_salons-on.gif', 
	'images/subnav_fitness-on.gif', 
	'images/subnav_health-on.gif', 
	'images/subnav_libraries-on.gif', 
	'images/subnav_petcare-on.gif', 
	'images/subnav_services-on.gif');

	preloadImages(theImages);
}

function preloadSpecifications() {
   var theImages = new Array(
	'images/subnav_exterior-on.gif', 
	'images/subnav_interior-on.gif', 
	'images/subnav_kitchen-on.gif', 
	'images/subnav_laundry-on.gif', 
	'images/subnav_bathrooms-on.gif', 
	'images/subnav_comfort-on.gif', 
	'images/subnav_design-on.gif');

	preloadImages(theImages);
}


function preloadImages(theImages)  {
   for(i = 0; i < theImages.length; i++)  {
      var theImage = new Image();
      theImage.src = theImages[i];
   }
}


// 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] = 'images/footer2.jpg'
theImages[1] = 'images/footer1.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]+'">');
}
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=600,left = 440,top = 225');");
	}


    if (document.images)
    {
      preload_image = new Image(25,25); 
      preload_image.src="images/loader.gif"; 
    }

  