// preload images
function preload() {
	var preloadedimages=new Array();
	for (i=0;i<pictures.length;i++){
	preloadedimages[i]=new Image();
	preloadedimages[i].src=pictures[i];
	}
}

// go next
function backward(){
	if (which>0){
	which--;
	document.images.galleryItem.src=pictures[which];
	}
}

// go back
function forward(){
	if (which<pictures.length-1){
	which++;
	document.images.galleryItem.src=pictures[which];
	}
}

// set cross-browser variable
dd=document;NS=(dd.layers)?1:0;IE=(dd.all)?1:0;DOM=(dd.getElementById)?1:0;

// make object visible
function showlr(L){
if (NS)ob=dd.layers[''+L+''];else if (IE)ob=dd.all[''+L+''];else if (DOM)ob=dd.getElementById(''+L+'')
if (!NS)obs=ob.style
	if (NS)ob.visibility='show';else obs.visibility='visible'}

// make object hidden
function hidelr(L){
//if (NS)ob=dd.layers[''+L+''];else if (IE)ob=dd.all[''+L+''];else if (DOM)ob=dd.getElementById(''+L+'')
if (NS)ob=dd.L;else if (IE)ob=dd.all[''+L+''];else if (DOM)ob=dd.getElementById(''+L+'')
if (!NS)obs=ob.style;
// !!! alert ('ob: '+ob); *** * * * * * * * * 
	if (NS)ob.visibility='hidden';else obs.visibility='hidden'}

// make layers hidden
function hidelayers(){
hidelr('aboutDiv'); hidelr('interiorDiv'); hidelr('finishesDiv'); hidelr('colorDiv'); hidelr('contactDiv')
//if (NS)ob=dd.layers;else if (IE)ob=dd.all;else if (DOM)ob=dd.getElementById;
//alert (ob.length);
//for (i=2;i<ob.length-1;i++){
//	if (NS)ob[i].visibility='hide';else ob[i].style.visibility='hidden'}
}
//alert ('NS-'+NS+'IE-'+IE+'DOM-'+DOM)
