function mover( i ) {
	var id = "left-nav-image-"+i;
	var el = document.getElementById( id );
	el.src = "images/lef-nav-icon.jpg";
}

function mout( i ) {
	var id = "left-nav-image-"+i;
	var el = document.getElementById( id );
	el.src = "images/lef-nav-icon-blank.jpg";
}

function left_menu_click_effect( index, el ) {
	var element = document.getElementById('openOrClose'+index);
	element.value = element.value == 0 ? 1 : 0;
	Effect.toggle( 'left-nav-sub-'+el, 'blind' );
}

function left_menu_click_effect_mt( index, el ) {
	var element = document.getElementById('openOrClose'+index);
	element.value = element.value == 0 ? 1 : 0;
}

function left_menu_click( goto, id, p, ref ) {
	document.leftMenu.action = goto;
	document.leftMenu.id.value = id;
	document.leftMenu.p.value = p;
	document.leftMenu.ref.value = ref;
	
	document.leftMenu.submit();
}

function gallery_popup( id ) {
	var wparam = "resizable=no,toolbar=no,menubar=no,scrollbars=no,width=" + 690 + ",height=" + 400;
	var address = "http://www.forever-care.com/gallery-popup.php?id="+id;
	var newwin = window.open(address, 'gallery', wparam);
	if (newwin) {
		newwin.focus();
	}
}

var activeThumb = 1;
function product_image_swap( image, id ) {
	document.getElementById('caption-'+activeThumb).style.display = 'none';
	document.getElementById('caption-'+id).style.display = 'block';
	activeThumb = id;
	document.getElementById('product-image').src = "data/products/images/"+image;
}

var material = new Object();
material['Wood'] = new Array("Poplar", "Pine", "Maple", "Oak", "Pecan", "Cherry", "Mahogany", "Other");
material['Metal'] = new Array("Steel", "Bronze", "Copper", "Stainless Steel", "Other");

function appendOptionLast( type ) {
	var elSel = document.getElementById( 'Material' );
	
	for( var i = 0; i < material[type].length; i++ ) {
		var elOptNew = document.createElement( 'option' );
		elOptNew.text = material[type][i];
		elOptNew.value = material[type][i];
		
		try {
			elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
		} catch(ex) {
			elSel.add(elOptNew); // IE only
		}
	}
}
	
function removeOptionLast() {
	var elSel = document.getElementById( 'Material' );
	while( elSel.length > 0 ) {
		elSel.remove( elSel.length - 1 );
	}
}

function flushValues(select_id ) {
	var elSel = document.getElementById( select_id );
	
	for( var i = 0; i < elSel.length; i++ ) {
		elSel[i].value = "";
	}
}