if (Browser.Engine.trident) {
	new Asset.css('stylesheets/ie.css');
}

window.addEvent('domready', function() {
	var expanders = $$("img.active");
	var hiders = $$("div.expand");
	expanders.each(function(expander, i) {
		var mySlide = new Fx.Slide(hiders[i]);
		mySlide.hide();
		expander.addEvent('click', function() {
			mySlide.toggle();
		});
	});
	
	//Set Up Mortgage Calculator
	$('calc_form').addEvent('submit', function(e) {
		new Event(e).stop();
		var principle = $('principle').value.toInt();
		var rate = ($('rate').value.toFloat()/100)/12;
		var term = $('term').value.toInt()*12;
		var payment = [(principle*(Math.pow(1+rate,term)))*rate]/[Math.pow(1+rate,term)-1];
		$('payment').set('html', "$ " + payment.toFixed(2));
	});
	
	//Testimonies
	if ($('testimony')) {
		var testimonies = new Array("\"You are my hero and I will never forget what you have done to help me buy a home. Your services are above and beyond what I ever expected to find from someone in the real estate business, and I will refer anyone I know that is looking to buy a home to you with 100% confidence in your ability to help them.  Again, THANK YOU.\"<br/><br/>Thomas","\"When it comes to having a real estate agent, you are by far the best anyone could possibly ask for.  You have been there for us every step of the way and have exceeded our expectations in a Realtor.  Buying a home is a very big step and you have always been there to ease our worries, and for that I thank you.  From the bottom of our hearts we thank you for all that you have done for us.\"<br/><br/>Janene and David");
		$('testimony').set('html', testimonies[Math.floor(Math.random()*2)]);
	}
});
