/* J. Klemm */
/* 04/09/10 */

/* number of items to rotate */
totalItems = 4;

/* number of properties for each item */
itemProperties = 8;


 var item = new Array(totalItems);

   for (x=0; x<=(totalItems - 1); x++){
      item[x]=new Array(itemProperties);
   }


/* set up the content on first load */
function initVideos(){
/*

array items:
0- the linkable name of the item
1- the header text to display over the video when it's playing
2- HTML to place in the main div when the item is selected -- this should (most likely) be the object call to load the flash video
3- testimonial HTML
4- The teaser image to display
5- The mouseover teaser image
6- The title to put above the thumbnails
7- HTML for Teaser text


*/

   item[0][0] = "overview";
   item[0][1] = "Learning Tree AnyWare: A Revolution in Live, Online Training";
   item[0][2] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="309" id="overview_ca" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="flv/overview_ca.swf" /><param name="quality" value="high" /><param name="ShowMenu" value="false" /><param name="bgcolor" value="#ffffff" />	<embed src="flv/overview_ca.swf" quality="high" bgcolor="#ffffff" width="480" height="308" name="overview_ca" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
   item[0][3] = "<span class=\"quote\">\"Attending the Learning Tree AnyWare course online turned out to be one of the best training experiences I have ever had and provided me with valuable and challenging materials. Furthermore, I didn't have to hassle with traveling out of town and was able to eliminate those travel costs for my company!\"</span><p class=\"attribution\">&ndash; Frankie Sciullo<br />Software Engineer</p>";
   item[0][4] = "images/anyware/video_thumbs/video_overview_thumb.jpg";
   item[0][5] = "images/anyware/video_thumbs/video_overview_thumb-over.jpg";
   item[0][6] = "Learning Tree AnyWare: A Revolution in Live, Online Training";
   item[0][7] = "As an online participant, you'll experience the same live, instructor-led interaction as you would get in a Learning Tree classroom.";

   item[1][0] = "collaboration";
   item[1][1] = "Collaboration and Interaction: Keeps You Engaged and Motivated";
   item[1][2] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="308" id="collaboration_ca" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="flv/collaboration_ca.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="flv/collaboration_ca.swf" quality="high" bgcolor="#ffffff" width="480" height="308" name="collaboration_ca" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
   item[1][3] = "<span class=\"quote\">\"Attending the Learning Tree AnyWare course online turned out to be one of the best training experiences I have ever had and provided me with valuable and challenging materials. Furthermore, I didn't have to hassle with traveling out of town and was able to eliminate those travel costs for my company!\"</span><p class=\"attribution\">&ndash; Frankie Sciullo<br />Software Engineer</p>";
   item[1][4] = "images/anyware/video_thumbs/video_collaboration_thumb.jpg";
   item[1][5] = "images/anyware/video_thumbs/video_collaboration_thumb-over.jpg";
   item[1][6] = "Collaboration and Interaction: <br /> Keeps You Engaged and Motivated";
   item[1][7] = "With AnyWare, online participants see and hear their instructor and classmates and communicate with them over the integrated VoIP audio channel as well as via text chat.";


   item[2][0] = "hands_on";
   item[2][1] = "Experience Hands-On Exercises in Real Time";
   item[2][2] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="308" id="hands_on_ca" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="flv/hands_on_ca.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="flv/hands_on_ca.swf" quality="high" bgcolor="#ffffff" width="480" height="308" name="hands_on_ca" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
   item[2][3] = "<span class=\"quote\">\"Attending the Learning Tree AnyWare course online turned out to be one of the best training experiences I have ever had and provided me with valuable and challenging materials. Furthermore, I didn't have to hassle with traveling out of town and was able to eliminate those travel costs for my company!\"</span><p class=\"attribution\">&ndash; Frankie Sciullo<br />Software Engineer</p>";
   item[2][4] = "images/anyware/video_thumbs/video_hands_on_thumb.jpg";
   item[2][5] = "images/anyware/video_thumbs/video_hands_on_thumb-over.jpg";
   item[2][6] = "Experience Hands-On<br />Exercises in Real Time";
   item[2][7] = "Participate in class discussions, Q&A and breakout sessions, and perform every hands-on exercise by remotely controlling a dedicated in-class PC.";

   item[3][0] = "tech_support";
   item[3][1] = "Easy Setup and Live Technical Support";
   item[3][2] = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="308" id="tech_support_ca" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="flv/tech_support_ca.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="flv/tech_support_ca.swf" quality="high" bgcolor="#ffffff" width="480" height="308" name="tech_support_ca" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
   item[3][3] = "<span class=\"quote\">\"Attending the Learning Tree AnyWare course online turned out to be one of the best training experiences I have ever had and provided me with valuable and challenging materials. Furthermore, I didn't have to hassle with traveling out of town and was able to eliminate those travel costs for my company!\"</span><p class=\"attribution\">&ndash; Frankie Sciullo<br />Software Engineer</p>";
   item[3][4] = "images/anyware/video_thumbs/video_tech_support_thumb.jpg";
   item[3][5] = "images/anyware/video_thumbs/video_tech_support_thumb-over.jpg";
   item[3][6] = "Easy Setup and<br />Live Technical Support";
   item[3][7] = "Our expert support staff guides you through the easy setup process. During class, you'll receive live, immediate technical support and customer service, if needed.";


   for (x=0; x<totalItems; x++) {
      setrollover(item[x][5],item[x][0]);
   }

   document.getElementById("phone").innerHTML="1-888-THE-TREE";
   document.getElementById("learnMore").innerHTML="Learn More";

   refreshList();
}


/* pass the next item in line */
function getNextItem() {

	return item[1][0];

}


/* update array by name */
function rotateByName(itemName) {
   totItems = totalItems;
   for (x=1; x<=(totItems - 1); x++) {
      if (item[x][0] == itemName) {
	rotateItems(x);
	}
   }
}


/* update the array based on the clicked item */
function rotateItems(clicked)
{
   totItems = totalItems;
   totProps = itemProperties;

   var play = new Array(totProps);
   
   for (x=0; x<=(totProps - 1); x++){
      play[x] = item[clicked][x];
   }

   /* move down everything after the clicked item */
   for (x=clicked; x<(totItems - 1);x++) {
      for (y=0; y<=(totProps-1); y++) {
         item[x][y] = item[x+1][y];
      }
   }

   /* move previously playing object to end of line */
   for (y=0; y<=(totProps-1); y++) {
      item[totItems-1][y] = item[0][y];
   }

   /* update the playing video */
   for (x=0; x<=(totProps-1); x++){
      item[0][x] = play[x];
   }
   refreshList();
}



/* write to screen */
function refreshList()
{
   totItems = totalItems;
   document.getElementById("header").innerHTML = item[0][1];
   document.getElementById("video1").innerHTML = item[0][2];
   document.getElementById("testimonial").innerHTML=item[0][3];
   for (x=1; x<totItems; x++){
      elemName = "video" + (x + 1);
      document.getElementById(elemName).innerHTML = '<h3>' + item[x][6] + '</h3><br /><br /><a href="javascript:rotateItems(' + x + ');" onMouseOver="rollover(\'' + item[x][0] + '\')"  onMouseOut="rollout(\'' + item[x][0] + '\')"><img src="' + item[x][4] + '" border="0" name="' + item[x][0] + '"></a><br /><br />' + item[x][7];
   }
}
