

// Loads up the various functions we are going to use
$(document).ready(function(){
	
	popup('a[rel*=screenshot]');
	
	$(".lavaLampWithImage").lavaLamp({
		fx: "easeOutBack", 
		speed: 700
	});
	$('a[rel*=facebox]').facebox()
});


function clickFire(h) {
	$(document).trigger('close.facebox');
	
};


//Manages all of the popup windows using facebox
function popup(Elem) {
	$(Elem).click(function(){
		var theUrl = this.href.split("#")
		var addr = (theUrl[0] + " #" + theUrl[1] + " > *");
	
		var c = $("<div id='" + theUrl[1] + "'><div  style='text-align:center;'><img src='images/common/facebox/loading.gif' /></div></div>");
	    $(c).load(addr, function(){
		$.facebox(c);
	    });
		
		return false;
	});
};






