function main() {
	$("a[class*='external']").click(function() {
		window.open(this.href);
		return false;
	});
	
	$('#imagearea ul').css('display', 'block');
	$('#imagenavigator').css('display', 'block');
	$('#infopanel').css('display', 'block');
	
	$('#imagearea').cycle({
		slideExpr:			'ul',
		fx:					'scrollDown',
		speed:				300,
		timeout:			0,
		before:				onBeforeSlide,
		after:				onAfterSlide,
		pager:				'#nav',
		pagerAnchorBuilder:	function(idx, slide) {
			//return '#nav li:eq(' + idx + ') a';
			return '#nav .thumbrow li:eq(' + idx + ') a';
		}
	});	
	function onBeforeSlide(curr, next, opts) {
		(jQuery.support.opacity) ? $('#infopanel').fadeOut('fast') : $('#infopanel').hide();
	}
	function onAfterSlide(curr, next, opts) {
		$('#infopanel #ip_center div.textframe').empty();
		//alert(opts.currSlide); //Index
		//alert(curr.firstChild.firstChild.src); //src of images
		var info = $('#nav li:eq(' + opts.currSlide + ') a img').attr('longdesc');
		$('#infopanel #ip_center div.textframe').html(info);
		(jQuery.support.opacity) ? $('#infopanel').fadeIn('fast') : $('#infopanel').show();
	}
	
	//prev next thumbnails
	$('#imagenavigator #nav').cycle({
		fx:					'scrollHorz',
		speed:				300,
		timeout:			0,
		prev:				'#prev_btn',
		next:				'#next_btn'
	});
}
