// Slideshow
var current = 0;

// Content
var slides = ["location.jpg","bedroom.jpg","building.jpg","cafe.jpg","map.jpg","pool3.jpg","gym.jpg","pool2.jpg","pool3.jpg"];
var text = ['<h1>INSPIRING VIEWS</h1><br /><br />Oxygen boasts inspiring views over the Brisbane skyline, CBD cityscape and surrounding suburbs.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="apartments/">View Gallery</a>',
			'<h1>YOUR HOME AWAY FROM HOME</h1><br /><br />Comfortably furnished, Oxygen apartments offer a private &lsquo;home away from home&rsquo; feel whilst you&rsquo;re in Brisbane.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="apartments/">View Apartments</a>',
			'<h1>YOUR HOME AWAY FROM HOME</h1><br /><br />Comfortably furnished, Oxygen apartments offer a private &lsquo;home away from home&rsquo; feel whilst you&rsquo;re in Brisbane.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="apartments/">View Apartments</a>',
			'<h1>PRIME CBD LOCATION</h1><br /><br />A few minutes&rsquo; walk from the CBD, Oxygen gives immediate access to Brisbane&rsquo;s business centre, cultural locations & public transport.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="location/">View Location</a>',
			'<h1>PRIME CBD LOCATION</h1><br /><br />A few minutes&rsquo; walk from the CBD, Oxygen gives immediate access to Brisbane&rsquo;s business centre, cultural locations & public transport.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="location/">View Location</a>',
			'<h1>GREAT FACILITIES</h1><br /><br />Oxygen offers outdoor pool, gym, sauna and complementary parking for all guests.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="gallery/">View Gallery</a>',
			'<h1>GREAT FACILITIES</h1><br /><br />Oxygen offers outdoor pool, gym, sauna and complementary parking for all guests.<br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="gallery/">View Gallery</a>',
			'<h1>POSITIVE REVIEWS BY YOU</h1><br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="review/">View Reviews</a>',
			'<h1>POSITIVE REVIEWS BY YOU</h1><br /><br /><a style="text-decoration: none; color: #C30; font-weight: bold; text-size: 12px; text-transform: uppercase;" href="review/">View Reviews</a>'];

$("[id=reelimg]").html('<div id="reelac"><img src="' + generateImageURL(slides[current]) + '" alt="Reel Image 1" /></div>');
$("[id=reelcont]").html(text[current]);

// Define
var box = $("[id=reelac]");
var cbox = $("[id=reelcont]");

setTimeout("slideshow_nextImageT()", 7500);
function slideshow_nextImageT()
{
	slideshow_nextImage();
	setInterval("slideshow_nextImage()", 5000);
}
function slideshow_nextImage()
{
	box.fadeOut(500);
	
	// Next content
	if(text[current] != text[Number(current+1)])
	{
		// fade
		cbox.fadeOut(500);
	}
	
	var old = current;
	current ++;
	if(current >= slides.length) current = 0;
	
	setTimeout("slideshow_loadImage()", 500);
}

function slideshow_loadImage()
{
	box.html("<img src='" + generateImageURL(slides[current]) + "' alt='' />");
	cbox.html(text[current]);
	
	box.fadeIn(500);
	cbox.fadeIn(500);
}

function generateImageURL(inp)
{
	var st = dir + "image/lbox/" + inp;
	return st;
}

// Preload images
var st = "";
for(var i=0; i<slides.length; i++)
{
	st += '<img src="' + generateImageURL(slides[i]) + '" width="1" height="1" />';
}

var inv = $("[id=invisible]");
inv.html(st);
inv.fadeOut(1000);
