if (document.images) {
    img1 = new Image();
    img1.src = "./gfx/tab-bg-o.png";
	img2 = new Image();
    img2.src = "./gfx/tab-first-o.png";
	img3 = new Image();
    img3.src = "./gfx/tab-last-o.png";
	img4 = new Image();
    img4.src = "./gfx/calc-button_off.png";
	img5 = new Image();
    img5.src = "./gfx/calc-button_on.png";
}
jQuery.noConflict();

function menuShow(elem, prop) {
	jQuery("#"+elem).show();
}

function menuHide(elem, prop) {
	jQuery("#"+elem).hide();
}

function loanCalculate() {
	new Ajax.Request('summary.php', { 
		method: 'get',
		parameters: { amount: $F('amount'), length: $F('length'), interest: $F('annual_interest'), periodicity: $F('periodicity') },
		onSuccess: function(transport) {
			var summary = $('summary');
			summary.replace(transport.responseText);
		}
	});

	new Ajax.Request('payments.php', { 
		method: 'get',
		parameters: { amount: $F('amount'), length: $F('length'), interest: $F('annual_interest'), periodicity: $F('periodicity') },
		onSuccess: function(transport) {
			var payments = $('payments');
			payments.replace(transport.responseText);
		}
	});
}