var heights = { 0: {
					title: 'Short',
					src: 'img/height-short.jpg'
				},
				1: {
					title: 'Tall',
					src: 'img/height-tall.jpg'
				}};

var backs = { 0: {
				title: '2-Slat',
				src: 'img/back-2-slat.jpg'
			},
			1: {
				title: 'Spreading',
				src: 'img/back-spreading.jpg'
			},
			2: {
				title: '4-Equal',
				src: 'img/back-4-equal.jpg'
			},
			3: {
				title: '4-Tight',
				src: 'img/back-4-tight.jpg'
			}};
var backs_current = 0;

var arms = { 0: {
				title: 'Narrow-High',
				src: 'img/arm-narrow-high.jpg'
			},
			1: {
				title: 'Narrow-Mid',
				src: 'img/arm-narrow-mid.jpg'
			},
			2: {
				title: 'Narrow-Down',
				src: 'img/arm-narrow-down.jpg'
			},
			3: {
				title: 'Wide-Up',
				src: 'img/arm-wide-up.jpg'
			},
			4: {
				title: 'Wide-Down',
				src: 'img/arm-wide-down.jpg'
			}};
var arms_current = 0;

var woods = { 0: {
				title: 'Walnut',
				src: 'img/wood-walnut.jpg'
			},
			1: {
				title: 'Cherry',
				src: 'img/wood-cherry.jpg'
			}};

var seats = { 0: {
				title: 'Leather',
				src: 'img/seat-leather.jpg'
			},
			1: {
				title: 'Wood',
				src: 'img/seat-wood.jpg'
			}};

var bases = { 0: {
				title: 'Rib',
				src: 'img/base-rib.jpg'
			},
			1: {
				title: 'Stringer',
				src: 'img/base-stringer.jpg'
			}};

// SHOW/HIDE OPTIONS POPUP WINDOW
function toggle_options_popup(elem) {
	$$('div.options_popup_visible').each(function(s) {
		s.removeClassName('options_popup_visible');
	});
	$(elem).addClassName('options_popup_visible');
}


function heights_nav(num) {
	$('heights_title').update('<div>'+heights[num]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'height\', \''+heights[num]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
	$('heights_src').src = heights[num]['src'];
//	$('heights_anchor').onclick = "select_option('height', '"+heights[num]['title'].toLowerCase()+"');";
	
	if (num == 1) $('heights_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="heights_nav(\'0\');"><img src="img/options_previous.png" border="0" /></a>');
	else if (num == 0)  $('heights_nav').update('<a class="options_next" href="javascript:void(0);" onclick="heights_nav(\'1\');"><img src="img/options_next.png" border="0" /></a>');
}

function woods_nav(num) {
	$('woods_title').update('<div>'+woods[num]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'wood\', \''+woods[num]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//	$('woods_title').update(woods[num]['title']);
	$('woods_src').src = woods[num]['src'];
	
	if (num == 1) $('woods_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="woods_nav(\'0\');"><img src="img/options_previous.png" border="0" /></a>');
	else if (num == 0)  $('woods_nav').update('<a class="options_next" href="javascript:void(0);" onclick="woods_nav(\'1\');"><img src="img/options_next.png" border="0" /></a>');
}

function seats_nav(num) {
	$('seats_title').update('<div>'+seats[num]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'seat\', \''+seats[num]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//	$('seats_title').update(seats[num]['title']);
	$('seats_src').src = seats[num]['src'];
	
	if (num == 1) $('seats_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="seats_nav(\'0\');"><img src="img/options_previous.png" border="0" /></a>');
	else if (num == 0)  $('seats_nav').update('<a class="options_next" href="javascript:void(0);" onclick="seats_nav(\'1\');"><img src="img/options_next.png" border="0" /></a>');
}

function bases_nav(num) {
	$('bases_title').update('<div>'+bases[num]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'base\', \''+bases[num]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//	$('bases_title').update(bases[num]['title']);
	$('bases_src').src = bases[num]['src'];
	
	if (num == 1) $('bases_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="bases_nav(\'0\');"><img src="img/options_previous.png" border="0" /></a>');
	else if (num == 0)  $('bases_nav').update('<a class="options_next" href="javascript:void(0);" onclick="bases_nav(\'1\');"><img src="img/options_next.png" border="0" /></a>');
}

function backs_nav(direction) {
	if (direction == "prev") {
		if (backs_current > 0) {
			backs_current -= 1;
			$('backs_title').update('<div>'+backs[backs_current]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'back\', \''+backs[backs_current]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//			$('backs_title').update(backs[backs_current]['title']);
			$('backs_src').src = backs[backs_current]['src'];
			
			if (backs_current == 0) $('backs_nav').update('<a class="options_next" href="javascript:void(0);" onclick="backs_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
			else $('backs_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="backs_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a> <a class="options_next" href="javascript:void(0);" onclick="backs_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
		}
	}
	else if (direction == "next") {
		if (backs_current < 3) {
			backs_current += 1;
			$('backs_title').update('<div>'+backs[backs_current]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'back\', \''+backs[backs_current]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//			$('backs_title').update(backs[backs_current]['title']);
			$('backs_src').src = backs[backs_current]['src'];
			
			if (backs_current == 3) $('backs_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="backs_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a>');
			else $('backs_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="backs_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a> <a class="options_next" href="javascript:void(0);" onclick="backs_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
		}
	}
}

function arms_nav(direction) {
	if (direction == "prev") {
		if (arms_current > 0) {
			arms_current -= 1;
			$('arms_title').update('<div>'+arms[arms_current]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'arm\', \''+arms[arms_current]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//			$('arms_title').update(arms[arms_current]['title']);
			$('arms_src').src = arms[arms_current]['src'];
			
			if (arms_current == 0) $('arms_nav').update('<a class="options_next" href="javascript:void(0);" onclick="arms_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
			else $('arms_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="arms_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a> <a class="options_next" href="javascript:void(0);" onclick="arms_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
		}
	}
	else if (direction == "next") {
		if (arms_current < 4) {
			arms_current += 1;
			$('arms_title').update('<div>'+arms[arms_current]['title']+'</div><a href="javascript:void(0);" onclick="select_option(\'arm\', \''+arms[arms_current]['title'].toLowerCase()+'\');" title="Select this design option in the design checklist"><img border="0" src="img/select.png" alt="Select" /></a>');
//			$('arms_title').update(arms[arms_current]['title']);
			$('arms_src').src = arms[arms_current]['src'];
			
			if (arms_current == 4) $('arms_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="arms_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a>');
			else $('arms_nav').update('<a class="options_prev" href="javascript:void(0);" onclick="arms_nav(\'prev\');"><img src="img/options_previous.png" border="0" /></a> <a class="options_next" href="javascript:void(0);" onclick="arms_nav(\'next\');"><img src="img/options_next.png" border="0" /></a>');
		}
	}
}

