var ajax = false;
var debug = false;
var _noLoad = false;
var _noieFix = false;
setTimeout(function() {
	if (typeof(jQuery) == 'undefined') {
		var content = document.getElementById("pageTitle");
		content.innerHTML = "<span style='color:#b01544;font-size:14px'>I'm sorry but we seem to be having problems loading active content. You may experience limited functionality on some pages.</span>"; 
	}.0
},10000);

$(document).ready(function() {
	if (ajax) {
		$.getScript("/resource/js/ajax");
	} else {
		pageTasks();
	}
	if (debug) {
		$.getScript("/resource/js/debug");
	}
});



//  Called after normal or AJAX page load
function pageTasks() {
	$('a.email').nospam();
	
	$('a').click(function() {
    	if (_noLoad) {
    		$('#loading').hide();
    		_noLoad = false;
    	} else {
    		$('#loading').show();
    	}
    });
	
	$(".thumbnail img").hover(function(){
		$(this).fadeTo("fast", 0.8);
	},function(){
		$(this).fadeTo("fast", 1.0);
	});

	$('.thumbnail a img').load(function () {
	    $(this).parent().parent()
	    	.fadeTo(1000, 1)
	    	.removeClass('hide');
    });
	
	$(window).load(function() {
		$('#loading').fadeOut().hideFix();
	});
}  