// JavaScript Document


// some variables to save
	var currentPosition;
	var currentVolume;
	var currentItem;

	// these functions are caught by the JavascriptView object of the player.
	function sendEvent(typ,prm) { thisMovie("mpl").sendEvent(typ,prm); };
	function getUpdate(typ,pr1,pr2,pid) {
		if(typ == "time") { currentPosition = pr1; }
		else if(typ == "volume") { currentVolume = pr1; }
		else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
		var id = document.getElementById(typ);
		id.innerHTML = typ+ ": "+Math.round(pr1);
		pr2 == undefined ? null: id.innerHTML += ", "+Math.round(pr2);
		if(pid != "null") {
			document.getElementById("pid").innerHTML = "(received from the player with id <i>"+pid+"</i>)";
		}
	};

	// These functions are caught by the feeder object of the player.
	function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
	function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
	function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
	function getItemData(idx) {
		var obj = thisMovie("mpl").itemData(idx);
		var nodes = "";
		var imagevar = "Image";
		var titlevar = "Title";
		var authorvar = "Number";
		var linkvar = "Description";
	
		for(var i in obj) {
	 		
		if (i == "title") { nodes += "<h1>"+obj[i]+"</h1>"; } 
		if (i == "link") { nodes += "<p>"+obj[i]+"</p>"; } 
		if (i == "image") { nodes += "<p>"+obj[i]+"</p>"; }
		//if (i == "author") { nodes += "<p>"+obj[i]+"</p>"; } 
		

		
	};
		document.getElementById("videoInfo").innerHTML = nodes;
	};

	// This is a javascript handler for the player and is always needed.
	function thisMovie(movieName) {
	    if(navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
	};



var plenty = new Array("Revitalization projects have made this city a model eco town and a tourist hot spot.","Plenty Magazine");

var ken = new Array("Chattanooga is a fine town. We visit there often. Very family friendly. Great place to have a meal or catch a ball game.","Ken - Atlanta, GA");

var adrienne = new Array("Chattanooga is a good city. It has lots of things to do. There are a lot of sights, as well as shopping. The art district is especially nice.","Adrienne - Michigan");

var maud = new Array("There are all kinds of things to do in Chattanooga, like Rock City, Ruby Falls, the Incline, the Children\'s Museum and of course, the Tennessee Aquarium. ","Maud - Atlanta, GA");

var betty = new Array("Chattanooga is a great place to visit. It\'s a very pretty town right on the Tennessee River with a large park with fountains, horse and buggy rides, many places to visit, good restaurants and very scenic.","Betty - Rising Fawn, GA");

var family = new Array("Chattanooga is one of the South\'s Top Five Family Vacation Destinations, one of the top 10 Best Vacation Cities in the country, and the city with the best friendly spirit.","Family Fun Magazine");

var southern = new Array("Chattanooga was voted a top 'Weekend Getaway with the Kids!' Chattanooga was third in the country, only 100 votes behind Orlando\'s #2 spot.","Southern Living Reader's Choice Awards");

var stella = new Array("Chattanooga is a very beautiful place to get out and relax and spend with your children. Not to mention the beautiful views from Look out Mountain!","Stella - Remlap, GA");

var sammy = new Array("Chattanooga is a city with more to do per square mile than any other city I know.","Sammy - Memphis, TN");

var todd = new Array("The Chattanooga area has a tremendous amount of civil war history, museums, the aquarium, great fishing as well as antique shopping.","Todd - Chattanooga, TN");

var melissa = new Array("Chattanooga has so much to see.  Very family oriented and we had a very relaxing and enjoyable trip.","Melissa - Maryville, TN");

var kristel = new Array("The historical sites and buildings are beautiful and there/'s a laid back atmosphere that seems to fill Chattanooga, even though it is a major tourist area.  It's a beautiful place to visit.","Kristel - Lakeland, FL");

var quotes = new Array(plenty, ken, adrienne, maud, betty, family, southern, stella, sammy, todd, melissa, kristel);
var rand_no = Math.floor(11.9*Math.random());
var myQuote = quotes[rand_no][0];
var mySource = quotes[rand_no][1];

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=245,height=220');");
}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=345,height=340');");
}
