function document_complete() {
	jQuery.expr[':'].Contains = function(a,i,m){
		return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
	};
	if (typeof console == "object") log = console.log; else log = function() {};
	Array.prototype.has=function(v,i){
		for (var j=0;j<this.length;j++){
			if (this[j]==v) return (!i ? true : j);
		}
		return false;
	}
	$('a').query({'page':true}).addClass('current');
	$('li').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	$('.js_email').each(function(i) {
		text = $(this).attr('rel').split('').reverse().join('');
		$(this).html('<a href="mailto:'+text+'">'+text+'</a>')
	});
	$('#pagination').each(function() {
		$(this).attr('data-items', $(this).parent().find($(this).attr('data-item')).size());
		if (Number($(this).attr('data-items')) > Number($(this).attr('data-items-per-page'))) {
			$(this).append('<a class="previous" rel="-1">'+$(this).attr('data-previous')+'</a>').append('<a class="next" rel="+1">'+$(this).attr('data-next')+'</a>');
			var slice_index = (Number($(this).attr('data-page')) - 1) * Number($(this).attr('data-items-per-page'));
			$(this).parent().find($(this).attr('data-item')).hide().slice(slice_index, slice_index + Number($(this).attr('data-items-per-page'))).show();
		}
	}).children('.previous, .next').click(function() {
		var new_page = Number($(this).parent('#pagination').attr('data-page')) + Number($(this).attr('rel'));
		if (new_page > 0 && new_page <= Number($(this).parent('#pagination').attr('data-items')) / Number($(this).parent('#pagination').attr('data-items-per-page'))) {
			$(this).parent('#pagination').attr('data-page', new_page)
			var slice_index = (Number($(this).parent('#pagination').attr('data-page')) - 1) * Number($(this).parent('#pagination').attr('data-items-per-page'));
			$(this).parent('#pagination').parent().find($(this).parent('#pagination').attr('data-item')).hide().slice(slice_index, slice_index + Number($(this).parent('#pagination').attr('data-items-per-page'))).show();
		}
	});
	$('#navigation a').each(function(i) {
		if ($(this).attr('href').match(/laperouselorne\.com\.au/gi) == null && $(this).attr('href').match(/^http/gi) != null) {
			$(this).attr('target','_blank');
		}
	});
}
function runtwitter() {
	$('.twittList').cycle({
		fx: 'fade',
		timeout: 6000,
		speedIn: 1000,
		speedOut: 2000
	});
	$('#twitter').show();
}
$(document).ready(function() {
	$('a.lightbox').each(function(i) {
		$(this).attr('rel','prettyPhoto[set]');
	});
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});
	$.Juitter.start({
		searchType:"fromUser",
		searchObject:"LaPerouseLorne",
		live:"live-15",
		placeHolder:"twitter",
		total:1,
		openExternalLinks:"newWindow",
		loadMSG:"Loading Tweets",
		nameUser:"simple"
	});
	//setTimeout("runtwitter();",2000);
});
