var IE4,Nav4,Nav6;
//NS6 = (document.getElementById&&!document.all);
//IE = (document.all);
//NS = (navigator.appName=='Netscape' && navigator.appVersion.charAt(0)=='4');

if (navigator.appVersion.charAt(0) == "4") {
	if (navigator.appName.indexOf("Explorer") >= 0) {
		IE4 = true;
	} else {
		Nav4 = true;
	}
} else if (navigator.appVersion.charAt(0) > "4") {
	Nav6 = true;
}

function divProp(id, property, value) {
	if (Nav6) {
		var styleObject = document.getElementById(id);
		styleObject = styleObject.style;
		styleObject[property] = value;
    }
    else if (Nav4) { document[id][property] = value; }
	else if (IE4) { document.all[id].style[property] = value; }
}


function showHide(galleryName,picture) {
	for (n=0;n<galleryName.length;n++) {
		divProp(galleryName[n],'display','none');
	}
	divProp(picture,'display','inline');
}

function gallery(picSet,picName) {
	// build arrays //
	housePics = new Array('house','kitchen','cupboard','stairs','shower','storage','studio','studio2');
	constructionPics = new Array('culvert','siding','flyAsh','footings','insulation');
	materialsPics = new Array('solar','sunTracking','siding','decking','flooring','carpet','subFlooring','nosing','collector');
	
	akoiPics = new Array('east','cross','north');
	northTrailPics = new Array('bridge','back');
	alohaPics = new Array('exterior','interior');
	pruittPics = new Array('exterior','interior');
	thomasPics = new Array('front','back');
	burnettPics = new Array('exterior','straw','walls');
	susannaPics = new Array('exterior','floorplan','construction','weaving','lattice');
	alGhatLibPics = new Array('library','front','exterior');
	alGhatLadiesPics = new Array('arial','exteriorFront','library','interior');
	
	// filter sets //
	if (picSet == 'house') galleryName = housePics;
	if (picSet == 'construction') galleryName = constructionPics;
	if (picSet == 'materials') galleryName = materialsPics;
	
	if (picSet == 'akoi') galleryName = akoiPics;
	if (picSet == 'northTrail') galleryName = northTrailPics;
	if (picSet == 'aloha') galleryName = alohaPics;
	if (picSet == 'pruitt') galleryName = pruittPics;
	if (picSet == 'thomas') galleryName = thomasPics;
	if (picSet == 'burnett') galleryName = burnettPics;
	if (picSet == 'susanna') galleryName = susannaPics;
	if (picSet == 'alGhatLib') galleryName = alGhatLibPics;
	if (picSet == 'alGhatLadies') galleryName = alGhatLadiesPics;
	
	// do teh do //
	showHide(galleryName,picName);
}

/*
To use this script, call from a mouseover or click or other action...
Pass the id/name of the div, the stylesheet property you want to change, and the value

<a href="#" onMouseOver="divSwap('myDiv','display','inline')">rollOver</a>
*/

