var catalogue = null;
var catalogue_images = new Array();
swfobject.registerObject('gallery', '9.0.28', '_swf/expressInstall.swf');
var url = location.protocol + '//' + location.host + location.pathname;

$(document).ready(function(){
	$('a[rel="external"]').click(function() {
		return !window.open( $(this).attr('href') );
	});
	$('ul.catalogue li img').each(function() {
		var src = $(this).attr('src');
		if(catalogue == null) catalogue = src.substring(src.lastIndexOf('/')+1,src.lastIndexOf('_'));
		var index = src.substring(src.lastIndexOf('_')+1,src.lastIndexOf('s.'));
		var catalogue_image = new Image();
		catalogue_image.src = '_img/catalogue/'+catalogue+'_'+index+'.jpg';
		catalogue_images.push(catalogue_image);
		return true;
	}).mouseover( function() {
		var src = $(this).attr('src');
		var index = src.substring(src.lastIndexOf('_')+1,src.lastIndexOf('s.'));
		$('#catalogue img').attr('src',catalogue_images[Number(index)-1].src);
	});
});

function doFocus() {
	window.focus();
}

function doAlert(s) {
	alert(s);
}