/* Author: Aric Camarata */

$(document).ready(function() {
});

/* Modal boxes for site
 * Using Simple Modal JS Plugin
 */

$(document).ready(function(){
	$("#signup_link").click(function(){
		$('#modal').load('/modal/signup');
		$('#modal').modal();
		modalResize(430,320);
	});
	$("#login_link").click(function(){
		$('#modal').load('/modal/login');
		$('#modal').modal();
		modalResize(200,320);
	});
	$("#logout_link").click(function(){
		$('#modal').load('/modal/logout');
		$('#modal').modal();
		modalResize(110,200);
	});
	$("#recover_link").live("click", function(){
		$('#modal').load('/modal/recover');
		$('#modal').modal();
		modalResize(170,320);
	});
	$("#change_link").live("click", function(){
		$('#modal').load('/modal/change');
		$('#modal').modal();
		modalResize(210,320);
	});
});

function modalResize(h,w) {
	var height = $(window).height(); var width = $(window).width();
	newposleft = (width / 2) - (w / 2); newpostop = (height / 2) - (h / 2);
	$('#simplemodal-container').css("left",newposleft+"px");
	$('#simplemodal-container').css("top",newpostop+"px");
	$('#simplemodal-container').css("width",w+"px");
	$('#simplemodal-container').css("height",h+"px");
}
