// 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_medical/full/full-atherosclerosis.jpg';
	title[0] = '';

	piece[1] = 'gal_medical/full/full-blood_cirulation.jpg';
	title[1] = '';

	piece[2] = 'gal_medical/full/full-brain.jpg';
	title[2] = '';

	piece[3] = 'gal_medical/full/full-ear.jpg';
	title[3] = '';

	piece[4] = 'gal_medical/full/full-eye.jpg';
	title[4] = '';

	piece[5] = 'gal_medical/full/full-heart.jpg';
	title[5] = '';

	piece[6] = 'gal_medical/full/full-inflamed_artery.jpg';
	title[6] = '';

	piece[7] = 'gal_medical/full/full-lungs.jpg';
	title[7] = '';

	piece[8] = 'gal_medical/full/full-muscles.jpg';
	title[8] = '';

	piece[9] = 'gal_medical/full/full-nerves.jpg';
	title[9] = '';

	piece[10] = 'gal_medical/full/full-nose-mouth.jpg';
	title[10] = '';

	piece[11] = 'gal_medical/full/full-platelets.jpg';
	title[11] = '';

	piece[12] = 'gal_medical/full/full-respiratory_system.jpg';
	title[12] = '';

	piece[13] = 'gal_medical/full/full-skeletal_system.jpg';
	title[13] = '';

	piece[14] = 'gal_medical/full/full-skin.jpg';
	title[14] = '';

	piece[15] = 'gal_medical/full/full-stomach.jpg';
	title[15] = '';

	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 );
}
