$(document).ready(
function()
{
	var images = ["header-1.jpg","header-2.jpg","header-3.jpg","header-4.jpg"];
	var	imageTopMargin = "-182px"
	var container = $("body.home #breadcrumbs")
	if (container.length>0)
	{
		var quotes = [
			{quote: "AOCAP could be the springboard to change the perception of shared ownership and the participants in this event can make it happen!", name: "Eunice Yap", company: "VP Marketing Group RCIA"},
			{quote: "Revived a flagging interest in the shared ownership industry.", name: "David Thomas", company: "Beach Properties"},
			{quote: "A fantastic event that encapsulates the interest and enthusiasm in the growing Asian marketplace.", name: "Sharon Mattimoe", company: "Perspective International"},
			{quote: "If you plan to operate any form of shared ownership product in Asia - AOCAP is a must in your calendar", name: "Pete Jones", company: "Generator Systems"},
			{quote: "The networking was great.  My wallet couldn't hold the amount of new business card contact I'd collected!", name: "Piers Brown", company: "Fractional Life"},
			{quote: "Fractionals have never been considered to be part of our business future but we realize from this conference that it will have to be.", name: "Allan Mossop", company: "Phuket Island Property Services"},
			{quote: "Shared ownership is about fun.  The AOCAP conference embodied this whilst being most informative.", name: "Manny Testa", company: "Club Leisure Group"},
			{quote: "Forward thinking and informative with great opportunities.", name: "Shaun Lamont", company: "Club Leisure"},
			{quote: "Great for the newcomer to the alternative ownership world.  A very quick learning curve.", name: "Duncan Worthington", company: "Ensign Media"}
			]
		var quoteDiv = $("<div class='quote'></div>").appendTo(container).css({position:"absolute", marginTop: "-260px", width: "250px", left: "18px", opacity: 0 })
		var quoteText = $("<p></p>").appendTo(quoteDiv)
		var quoteName = $("<b></b>").appendTo(quoteDiv)
		var quoteCompany = $("<i></i>").appendTo(quoteDiv)
		var quoteIndex = 0	

		
		function setQuote()
		{
			//quoteText.text("\""+quotes[quoteIndex].quote+"\"")
			quoteText.html("“"+quotes[quoteIndex].quote+"”")
			quoteName.text(quotes[quoteIndex].name)
			quoteCompany.text(quotes[quoteIndex].company)	
			quoteDiv.animate({opacity:1},800);
		
			setTimeout( function()
			{
				quoteDiv.animate({opacity:0},800, function()
				{
					quoteIndex ++
					if (quoteIndex > quotes.length-1)
					{
						quoteIndex=0;
					}
					setQuote()
				}
				);
				
			},5000)
		}
		setQuote()
		imageTopMargin = "-275px"
		images = ["header-1-home.jpg","header-2-home.jpg","header-4-home.jpg","header-5-home.jpg"];
	}

		var imageElms = [];
		var imageIndex = 0	
		var container = $("#breadcrumbs");
		
		for (var c=0;c<images.length; c++)
		{
			imageElms.push($("<img />").attr("src", "_assets/client/css/default/images/" + images[c]).appendTo(container).css({position:"absolute", marginTop:imageTopMargin, marginLeft:"300px", opacity: 0}))
		}
		imageElms[0].css({opacity: 1})
		
		setTimeout( function()
		{
			nextImageIndex = imageIndex + 1
			if (nextImageIndex > images.length-1) 
			{
				nextImageIndex = 0;
			}
			imageElms[imageIndex].css({"z-index":1000}).animate({opacity: 0 },1000);
			imageElms[nextImageIndex].css({"z-index":0,opacity:1},1000);
			imageIndex = nextImageIndex
			setTimeout( arguments.callee, 4200 )
		},4200)	

})
