/* Author: Steven Tan

*/
$(document).ready(function() {
	
	var testimonialsLength = testimonials.length;
	var html;
	var start = 0;
	var end = 1;

	// menu
	$(".submenu").hide();
	$(".menu li")
		.mouseenter(function() {
			$(this).find(".submenu").slideDown("fast");
		})
		.mouseleave(function() {
			$(this).find(".submenu").slideUp("fast");
		});
		
	// HOME
	if ($(".menu .home").hasClass("selected")) {
		$("#callToAction").hide();
		showTestimonial(start, end);
		setTimeout(function() {
			$("#callToAction").fadeIn(1000);
		}, 1000);
		
		// show first two
		setInterval(function() {
			if (start == 0) {
				start = 2;
				end = 3;
			} else {
				start = 0;
				end = 1;
			}
			showTestimonial(start, end);
		}, 30000);
	}
});

function showTestimonial(start, end) {	
	var $first = $(".testimonial.first");
	var $second = $(".testimonial.second");
	
	$first.find("blockquote").fadeOut('fast', function() {
		$(this).html(testimonials[start].quote).fadeIn(1000);
	});
	$first.find(".name").fadeOut('fast', function() {
		$(this).html(testimonials[start].name).fadeIn("fast");
	});
	$first.find(".title").fadeOut('fast', function() {
		$(this).html(testimonials[start].title).fadeIn("fast");
	});
	$first.find(".address").fadeOut('fast', function() {
		$(this).html(testimonials[start].address).fadeIn("fast");
	});

	$second.find("blockquote").fadeOut('fast', function() {
		$(this).html(testimonials[[end]].quote).fadeIn(1000);
	});
	$second.find(".name").fadeOut('fast', function() {
		$(this).html(testimonials[[end]].name).fadeIn("fast");
	});
	$second.find(".title").fadeOut('fast', function() {
		$(this).html(testimonials[end].title).fadeIn("fast");
	});
	$second.find(".address").fadeOut('fast', function() {
		$(this).html(testimonials[[end]].address).fadeIn("fast");
	});

}


/* testimonials */
var testimonials = [
	{
		quote: "Managing a complex of 132 apartments plus a 160 room hotel is not easy.  Particularly when the building is ageing.  Sentinel’s knowledge of our building and understanding of its complexities has eased the burden for our Committee.  We would recommend Sentinel to any Owners Corporation that seeks a personal management style.",
		name: "Haydn Grant",
		title: "Chairman",
		address: "131 Lonsdale Street Melbourne"
	},
	{
		quote: "28 Southgate is a 15 story apartment building, incorporating 111 apartments of varying sizes, occupied from 1995.  It was originally built in the sixties for Mobil Oil and used as their headquarters in Australia.<br /><br /> Sentinel Strata Services was elected as our managers in 2000. The association has been very good and led us through some challenges but generally good times.<br /> We look forward to a fruitful relationship in the future.",
		name: "Inge Johnston",
		title: "Chairman - Committee of Management",
		address: "28 Southgate Avenue Southbank"
	},
	{
		quote: "Since appointing Sentinel in mid-2002 our building has undergone various major projects, including the upgrading of lifts and refurbishment of the exterior.  <br /><br />Sentinel has effectively managed these projects as well as the day to day running of our mixed use Owners Corporation building during that time.",
		name: "Tony Wood",
		title: "Chairman",
		address: "Lansdowne House Owners Corporation<br/>182-184 Victoria Parade East Melbourne"
	},
	{
		quote: "Being an apartment owner in a building and dealing with issues with an Owners Corporation is not normally a difficult situation.  However, being an owner of an apartment in a building that is different to all others throws up many complicated situations. <br /><br />Until we employed the services of Sentinel Strata Services Pty Ltd, we always seemed to have many issues, all of which were quite complicated.<br /><br />Whilst our building will always “be different”, and we will always have “different” issues to other buildings, Sentinel Strata Services Pty Ltd has unravelled many of these issues for us which now enables us to reside in a building free of concerns.<br /><br />Thank you to the team from Sentinel Strata Services Pty Ltd.  Life is so much easier!!!",
		name: "Sue Herrald",
		title: "",
		address: "Montague St South Melbourne"
	}
]





















