function showPhoto(filename, caption, width, height) {
	photo = window.open('/communications/p.php?f=' + escape(filename) + '&t=' + escape(caption) + '&w=' + width + '&h=' + height, 'photo','width='+width+',height='+height+', directories=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no, left='+((screen.width-width)/2)+', top='+((screen.height-height)/2));
	photo.focus();
}

function openUpload(url) {
	upload = window.open(url,'upload','width=320,height=200');
	upload.focus();
}

function Random(x) {
	return Math.floor(x*Math.random())
}

function generatePassword(alertmessage) {
	passstring = '';
	for (i = 0; i < 7; i++) {
		if (Math.random() < 0.5) {
			charno = 97 + Random(25);
		} else {
			charno = 49 + Random(9);
		}
		passstring = passstring + String.fromCharCode(charno);
	}

	$('#password').value = passstring;
	alert(alertmessage);
}

function focusfirst() {
	var ff = $('#firstfield')

	if (ff)
		ff.focus();
}

$(document).ready(function() {
	focusfirst();

	$('a[rel="external"]').click(function() { window.open($(this).attr('href')); return false; });

	try
	{
		var pageTracker = _gat._getTracker("UA-8497592-1");
		pageTracker._trackPageview();
	}
	catch(err) { }
});

