// venues.js
// To output common elements eg. Photos, maps...

// Photo filename is of the form: 'denefield_school_photo.jpg' (lowercase VenueName with '_')
// Photo must be 640 x 480 and _s must be 150 x 112
function venuePhoto(VenueName,AddName,PhotoText) {
	var t, alttxt;
	var filename = VenueName.toLowerCase().replace(/\s/g,'_') + '_photo';
	var fullname = VenueName;
	
	if (AddName > ' ') {fullname += ' ' + AddName;}
	alttxt = fullname + ' - Click to Enlarge...';
	
	t = '<div id="venuephoto">';
	t += '<a href="img/' + filename + '.jpg" onclick="';
	t += 'showImg(\'img/' + filename + '.jpg\',\'' + fullname + '\',\'' + PhotoText + '\',640,480);return false;">';
	t += '<img src="img/' + filename + '_s.jpg" width="150" height="112"';
	t += ' alt="' + alttxt + '" title="' + alttxt + '" border="1" /><br>';
	t += '<span class="smallfont">' + VenueName + '<br>Click to enlarge...</span></a>';
	t += '</div>';
	
	return t;
}

// Map filename is of the form: 'denefield_school[nnnn].jpg' (lowercase VenueName with '_')
// venueMap('Denefield School','1200_40pc','333','570','110');
// SubExt, SubSize - (optional) Create link to smaller version
// NB: Small map on page is assumed to be 300 x 300
function venueMap(VenueName,MainExt,MainSize,Source,SubExt,SubSize) {
	var t, alttxt;
	var filename = VenueName.toLowerCase().replace(/\s/g,'_');
	var alttxt = 'Map of ' + VenueName + ' - Click to Enlarge...';
	
	t = '<div id="venuemap">';
	t += '<a href="img/' + filename + MainExt + '.jpg" onClick="javascript:';
	t += 'return printReady(\'img/' + filename + MainExt + '.jpg\',\'' + VenueName + '\');">';
	t += '<img src="img/' + filename + '300.jpg" width="300" height="300"';
	t += ' alt="' + alttxt + '" title="' + alttxt + '" border="1" /></a><br />';
	t += '<span class="smallfont">From the ' + Source + ' - click to enlarge it. (' + MainSize + ' KB)';
	if (typeof(SubExt) != 'undefined') {
		t += '<br />[<a href="img/' + filename + SubExt + '.jpg" onClick="javascript:';
		t += 'return printReady(\'img/' + filename + SubExt + '.jpg\',\'' + VenueName + '\');">';
		t += 'Smaller - lower quality alternative (' + SubSize + ' KB)</a>]';
	}
	t += '</span></div>';
	
	return t;
}
