﻿	$(document).ready(function() {
		var imgWrapper = $('#toparea > a img');
		// only show the first image, hide the rest
		imgWrapper.hide().filter(':first').show();
		
		$('ul.sub li a').click(function () {
		
			// check if this item doesn't have class "current"
			// if it has class "current" it must not execute the script again
			if (this.className.indexOf('current') == -1){
				imgWrapper.hide();
				imgWrapper.filter(this.hash).fadeIn(500);
				$('ul.sub li a').removeClass('current');
				$(this).addClass('current');
			}
			return false;
		});
	});
