/**
*
* INIT TWEENS
* 
* TWEEN CLASS:
* http://lowfat.iancoyle.com/resources/javascript/utilities.js.aspx
*
**/


var propTween;
var oneTween;
var delganyTween;
var brownstonesTween;
var townhomesTween;
var glasshouseTween;
var resalesTween;

var FTTween;
var FTContentTween;
var FTGalleryTween;
var FTActive=false;

var propArray = new Array("thepark","one","delgany","brownstones","townhomes","glasshouse","resales","rentals")
var activePropTween="none"

function initTweens(){

	
	/*
	for (var i=0;i<propArray.length;i++){
		document.getElementById(propArray[i]+"_content").style.top="10px"
		document.getElementById(propArray[i]+"_content").style.left="280px"
		eval(propArray[i]+"Tween = new JSTween('" + propArray[i] + "Tween','" + propArray[i] + "_content',5)")
	}
	
	toggleProperty("one")
	*/
	for (var i=0;i<propArray.length;i++){
		document.getElementById(propArray[i]+"_content").style.top="10px"
		document.getElementById(propArray[i]+"_content").style.left=(250*i+10) + "px" 
	}
	document.getElementById("properties_content").style.top="10px"
	document.getElementById("properties_content").style.left="0px"
	propTween = new JSTween("propTween","properties_content",5)
	
	document.getElementById("split_content_firsttime").style.height="140px"
	document.getElementById("split_content_firsttime").style.width="400px"
	FTTween = new JSTween("FTTween","split_content_firsttime",5)
	
	document.getElementById("split_img_wrapper_firsttime").style.height="140px"
	document.getElementById("split_img_wrapper_firsttime").style.width="240px"
	FTContentTween = new JSTween("FTContentTween","split_img_wrapper_firsttime",5)
	
	document.getElementById("firsttime_content").style.top="10px"
	document.getElementById("firsttime_content").style.left="10px"
	FTGalleryTween = new JSTween("FTGalleryTween","firsttime_content",5)

}
function getOffset(id){
	var o=0;
	for (var i=0;i<propArray.length;i++){
		if (propArray[i] == id) {o=i}}
	return (o)
}
function toggleProperty(id){
	if (id!=activePropTween){
		/*if (activePropTween!="none"){eval(activePropTween+"Tween").Move(10,-260)}
		
		activePropTween = id
		document.getElementById(activePropTween+"_content").style.left="280px"
		eval(activePropTween+"Tween").Move(10,10)
		*/
		
		propTween.Move(10,(getOffset(id)*250*(-1)))

		for (var i=0;i<propArray.length;i++){document.getElementById(propArray[i]+"_nav").style.color="#302b1e";}

		document.getElementById(id+"_nav").style.color="#ffffff";

	}
}

function toggleFirstTime(){
	if (FTActive!=true){
		FTActive=true
document.getElementById("FTH_close").style.display="block"
		FTTween.Resize(375,400)
		FTContentTween.Resize(375,400)
		
		initFirstTime()
		
	}else{
		FTActive=false
		var start = document.getElementById("firsttime_start")
		start.style.display="block";
	document.getElementById("FTH_close").style.display="none"
		document.getElementById("firsttime_content_js").innerHTML=""

		FTTween.Resize(140,400)
		FTContentTween.Resize(140,240)
	}
}

var FirstTimeHere = new Array(
	{
		iTitle: "Millennium Bridge", 
		iImage: "01_bridge.jpg", 
		iCopy:  "Millennium Bridge, built in 2000, carries pedestrians from The Plaza at Riverfront Park to downtown."
	},
	{
		iTitle: "Millennium Bridge from Commons Park", 
		iImage: "02_bridge.jpg", 
		iCopy:  "The Plaza at Riverfront Park offers dramatic views of Millennium Bridge and the Denver skyline at night."
	},
	{
		iTitle: "Commons Park", 
		iImage: "03_Park.jpg", 
		iCopy:  "Who needs a front yard when you’ve got Commons Park, Confluence Park, and Cuernavaca Park?  Over 88 acres of open space and 135 miles of biking and running trials are just out the front door."
	},
	{
		iTitle: "The South Platte", 
		iImage: "04_river.jpg", 
		iCopy:  "Bordered by Cherry Creek and the South Platte River, residents of Riverfront Park enjoy all the splendors of the outdoors without having to leave the city. "
	},
	{
		iTitle: "The Plaza at Riverfront Park", 
		iImage: "04_nightlife.jpg", 
		iCopy:  "Active, vibrant, comfortable and friendly.  Life on The Plaza anchors the community and provides convenient services such as dry cleaning, a wine shop, and a pet store."
	},
	{
		iTitle: "Riverfront Park Wine + Fashion", 
		iImage: "05_lookatme.jpg", 
		iCopy:  "The Riverfront Park Wine + Fashion Series is one of summer’s hottest events. Once a month, from June to September, a wine region is featured and paired with a sunset fashion show, lite bites, and hip music."
	},
	{
		iTitle: "Zengo", 
		iImage: "06_zengo.jpg", 
		iCopy:  "Award winning Zengo restaurant offers creative cuisine on The Plaza.  Along with spectacular flavors, Zengo is a great place to meet up with friends for drinks."
	},
	{
		iTitle: "Ink! Coffee", 
		iImage: "07_ink.jpg", 
		iCopy:  "Get your morning jolt, a fresh bagel, and free wireless on The Plaza at Ink! Coffee.  Surf and sip at this neighborhood hangout."
	},
	{
		iTitle: "Museum of Contemporary Art | Denver", 
		iImage: "08_mca.jpg", 
		iCopy:  "The new Museum of Contemporary Art | Denver, presently under construction, aims to support rather than define the art within. The facility will be a community hub for the art-minded and free thinking."
	},
	{
		iTitle: "Invesco Field at Mile High", 
		iImage: "09_invesco.jpg", 
		iCopy:  "There’s no denying it.  Denver is a sports town.  Just 15 minutes on foot along the Platte River trail takes you directly to Invesco Field at Mile High."
	},
	{
		iTitle: "Coors Field", 
		iImage: "10_coors.jpg", 
		iCopy:  "Game day is almost every day in downtown Denver, with over 5 professional sports teams calling downtown home.  Coors Field is only a 10 minute walk through LoDo."
	},
	{
		iTitle: "Pepsi Center", 
		iImage: "11_nuggets.jpg", 
		iCopy:  "Get to the Pepsi Center for a Nuggets or Avs game in 10 minutes.  No parking hassle, no bottleneck after the game.  Walk over, and walk home.  Simple."
	},
	{
		iTitle: "Platte Street Shopping District", 
		iImage: "12_savory.jpg", 
		iCopy:  "Hip shopping is just across the Platte River on Platte Street – a hub for independent businesses.   A spice shop, English tea room, wine bar, men’s salon, outfitter, sushi, and more."
	},
	{
		iTitle: "Union Station", 
		iImage: "12_union.jpg", 
		iCopy:  "Where walking can’t take you neighboring Union Station can.  FasTracks, Denver’s progressive intermodal transportation initiative, is just a few years from completion, and only two blocks away."
	},
	{
		iTitle: "Historic LoDo", 
		iImage: "13_historic.jpg", 
		iCopy:  "Historic LoDo and the hum of the city are as close as a couple hundred steps.  Restaurants, boutiques, galleries, clubs, and more."
	},
	{
		iTitle: "A Brilliant Skyline", 
		iImage: "17_skyline.jpg", 
		iCopy:  "A knockout Denver skyline brings new meaning to the term 'nighty night.'"
	},
	{
		iTitle: "The Rockies", 
		iImage: "18_rockies.jpg", 
		iCopy:  "Big sky, and snow capped mountains are yours just to the west."
	},
	/*{
		iTitle: "ONE Riverfront", 
		iImage: "21_ONe.jpg", 
		iCopy:  "Perfectly proportioned townhomes and simply stated lofts make ONE Riverfront an uncomplicated place to call home."
	},
	{
		iTitle: "The Brownstones", 
		iImage: "22_Browns.jpg", 
		iCopy:  "Luxurious homes, with three levels of living, a three car garage, gourmet kitchens, elevators, and the highest level of customization."
	},
	{
		iTitle: "The Townhomes", 
		iImage: "23_Townhomes.jpg", 
		iCopy:  "Perfectly named.  Homes.  In town.  Hip and quaint, along Cherry Creek, private entrances and two car garages.  Cozy and efficient."
	},
	{
		iTitle: "Glass House", 
		iImage: "24_glass.jpg", 
		iCopy:  "The sky is the limit in this hip high-rise with floor-to-ceiling windows, an 8th story pool, 6,000 square foot health club, firepit, and the best views in Denver."
	},
	{
		iTitle: "Creekside Flats", 
		iImage: "25_creek.jpg", 
		iCopy:  "Intimate and contemporary flats along Cherry Creek.  Warm, modern and comfortable homes on a tree-lined street."
	},
	{
		iTitle: "Park Place Lofts", 
		iImage: "27_park.jpg", 
		iCopy:  "Dramatic lofts and penthouses at the foot of Millennium Bridge and just steps to LoDo."
	},
	{
		iTitle: "Promenade Lofts", 
		iImage: "28_Promenade.jpg", 
		iCopy:  "Modern residences in the heart of it all.  Conveniently located on The Plaza at Riverfront Park."
	},
	{
		iTitle: "Riverfront Tower", 
		iImage: "29_riverfront.jpg", 
		iCopy:  "Luxurious and traditional with the look and feel of larger homes in the suburbs. But the location on The Plaza provides a convenience that is simply unmatched."
	},
	{
		iTitle: "The Delgany", 
		iImage: "30_delgany.jpg", 
		iCopy:  "Modern, light and bright.  Along Cherry Creek with a private, flower-filled courtyard."
	},*/
{
		iTitle: "instructions", 
		iImage: "instructions.jpg", 
		iCopy:  ""
	}

)

var activeFTImage = 0;
function initFirstTime(){
	var start = document.getElementById("firsttime_start")
	start.style.display="none";
	
	var wrapper = document.getElementById("firsttime_content_js")
var _html=""	
_html +='<ul id="FTGallery">'
	for (var i=0;i<FirstTimeHere.length;i++){
		
if (FirstTimeHere[i].iTitle=="instructions"){

		_html += '<li>'
		_html += '<img src="http://blog.riverfrontpark.com/images/home/FTH/' + FirstTimeHere[i].iImage + '" alt="" style="border:0px" />'
		_html += '</li>'


}else{
		_html += '<li>'
		_html += '<img src="http://blog.riverfrontpark.com/images/home/FTH/' + FirstTimeHere[i].iImage + '" alt="" />'
		_html += '<p>'
		_html += '<span class="title">' + FirstTimeHere[i].iTitle + '</span>'
		_html += FirstTimeHere[i].iCopy
		
/*if (i<FirstTimeHere.length-1){
			_html += ' <a href="javascript:nextFTImage()">next >></a></p>'
		}else{
			_html += ' <a href="javascript:toggleFirstTime()">close >></a></p>'
		}

_html += '<ul class="FTH_nav_wrapper"><li><a href="javascript:prevFTImage()">&lt;&lt;prev</a></li><li><a href="javascript:nextFTImage()">next &gt;&gt</a></li></ul>'
		_html += '</li>'
*/
		_html += '<br /><a href="javascript:prevFTImage()">&lt;&lt;prev</a> &nbsp;&nbsp;&nbsp;<a href="javascript:nextFTImage()">next &gt;&gt</a></li>'

}		
	}
	_html += '</ul>'

	wrapper.innerHTML = _html
	document.getElementById("firsttime_content").style.top="10px"
	document.getElementById("firsttime_content").style.left="10px"
activeFTImage =0;
	wrapper.style.display="block";

}
function nextFTImage(){
	activeFTImage++
	if (activeFTImage==FirstTimeHere.length) {activeFTImage=0}
	FTGalleryTween.Move((activeFTImage*400*-1)+10,10)
	
}

function prevFTImage(){
	activeFTImage--
	if (activeFTImage==-1) {activeFTImage=0}
	FTGalleryTween.Move((activeFTImage*400*-1)+10,10)
	
}
