// JavaScript Document

var current = 0;

function swapimg( show ){

	var piece = new Array();
	var title = new Array();
//	var size = new Array();
//	var meta = new Array();


	piece[0] = 'gal_product/full/full-wood_insulation.jpg';
	title[0] = '';

	piece[1] = 'gal_product/full/full-wind_turbine.jpg';
	title[1] = '';

	piece[2] = 'gal_product/full/full-weiland-chairs.jpg';
	title[2] = '';

	piece[3] = 'gal_product/full/full-teliris.jpg';
	title[3] = '';

	piece[4] = 'gal_product/full/full-radon-reg.jpg';
	title[4] = '';

	piece[5] = 'gal_product/full/full-media_center.jpg';
	title[5] = '';

	piece[6] = 'gal_product/full/full-truck-gen.jpg';
	title[6] = '';

	piece[7] = 'gal_product/full/full-lures.jpg';
	title[7] = '';

	piece[8] = 'gal_product/full/full-knackknife.jpg';
	title[8] = '';

	piece[9] = 'gal_product/full/full-hard_drives.jpg';
	title[9] = '';

	piece[10] = 'gal_product/full/full-irish_coffee.jpg';
	title[10] = '';

	piece[11] = 'gal_product/full/full-deltafaucet1.jpg';
	title[11] = '';

	piece[12] = 'gal_product/full/full-appliances.jpg';
	title[12] = '';

	piece[13] = 'gal_product/full/full-computer_equip.jpg';
	title[13] = '';

	piece[14] = 'gal_product/full/full-cleanroom.jpg';
	title[14] = '';

	piece[15] = 'gal_product/full/full-cars-suburbs.jpg';
	title[15] = '';

	piece[16] = 'gal_product/full/full-bbq-pit.jpg';
	title[16] = '';

	piece[17] = 'gal_product/full/full-boat_cutaway.jpg';
	title[17] = '';
	
	

	document.getElementById( 'featured' ).src = piece[show];
	document.getElementById( 'featured' ).alt = title[show];
//	document.getElementById( 'featuretitle' ).innerHTML = title[show];

	for( i = 0; i < meta.length; i++ ){
		document.getElementById( 'item' + i ).style.opacity = '.5';
	}
	document.getElementById( 'item' + ( show ) ).style.opacity = '.99';
	
	current = ( show );
	
	if ( current == 0 ){
		document.getElementById( 'previous' ).style.display = 'none';
	}
	else{
		document.getElementById( 'previous' ).style.display = '';
	}
	if ( current == (meta.length - 1) ){
		document.getElementById( 'next' ).style.display = 'none';
	}
	else{
		document.getElementById( 'next' ).style.display = '';
	}
}


function next(){
	working = current;
	swapimg( working + 1 );
}

function previous(){
	working = current;
	swapimg( working - 1 );
}
