// <![CDATA[
$(document).ready(function() {
	// Break out of frames.
	if (self.location != top.location) {
		top.location = self.location;
	}

	// Search query box.
	$('#header input[type="text"]').focus(function() {
		if ($(this).attr('value') == 'Search') {
			$(this).attr('value', '');
		}
	}).blur(function() {
		if ($(this).attr('value') == '') {
			$(this).attr('value', 'Search');
		}
	});

	// Lightbox.
	var domain = document.location.protocol + '//' + document.domain;

	$('a[rel*=lightbox]').lightBox({
		imageLoading:	domain + '/i/lightbox/ico-loading.gif',
		imageBtnPrev:	domain + '/i/lightbox/blank.gif',
		imageBtnNext:	domain + '/i/lightbox/blank.gif',
		imageBtnClose:	domain + '/i/lightbox/btn-close.gif',
		imageBlank:		domain + '/i/lightbox/blank.gif'
	});

	// External links.
	$('a[rel*=external]').attr('target', '_blank');
});

// Image loader.
$.fn.image = function(src, f) {
	return this.each(function() {
		var i = new Image();
		i.src = src;
		i.onload = f;
		return;
	});
}
// ]]>