﻿// JScript File
Event.observe(window, "load", window_onLoad);

var currentVideo = "videoEmbed1";
var currentVideoDesc = "videoDesc1";
var HiddenClassName = 'Hidden';
var SelectedClassName = 'SelectedVideo';

swfobject.embedSWF('http://www.youtube.com/v/EEpqZDlJSYw&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;fmt=18&amp;enablejsapi=1&amp;playerapiid=ytplayer0&amp;showinfo=0', 'video1', 410, 245, "8", null, null, { allowFullScreen: "true", allowScriptAccess: "always" }, { id: "videoEmbed1" });

function window_onLoad(event) 
{
    $('geekLatestTechTalksSectionContent').removeClassName(HiddenClassName);
}

function changeCurrentVideo(urlPart, newDescId)
{
	if (newDescId != currentVideoDesc)
    {
		$(currentVideoDesc).removeClassName(SelectedClassName);
		$(newDescId).addClassName(SelectedClassName);
        
		var url = "http://www.youtube.com/v/" + urlPart + "&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;fmt=18&amp;enablejsapi=1&amp;playerapiid=ytplayer0&amp;showinfo=0";	
		swfobject.embedSWF(url, 'videoEmbed1', 410, 245, "8", null, null, { allowFullScreen: "true", allowScriptAccess: "always" }, { id: "videoEmbed1" });		
        
        currentVideoDesc = newDescId;
        setTimeout('startVideo()', 2000); 
	}
}

function startVideo() 
{
    var oVideo = $(currentVideo);       
    try 
    {
        oVideo.playVideo();
    }
    catch (eException) 
    {
        try
        {
            oVideo.viddlerOpen();
        }
        catch (exception)
        {
        }
    }
}