// JavaScript Document
var idNum;
var theIdString;
var currentlyActive = 0;
var previouslyActive = 0;

var Activity = new Array();
Activity[0] = 0;
Activity[1] = 0;
Activity[2] = 0;
Activity[3] = 0;
Activity[4] = 0;
Activity[5] = 0;
Activity[6] = 0;
Activity[7] = 0;
Activity[8] = 0;

function checkId(idString){
	if(idString == "one") idNum = 1;
	else if(idString == "two") idNum = 2;
	else if(idString == "three") idNum = 3;
	else if(idString == "four") idNum = 4;
	else if(idString == "five") idNum = 5;
	else if(idString == "six") idNum = 6;
	else if(idString == "seven") idNum = 7;
	else if(idString == "eight") idNum = 8;
	
	return idNum;
	}

function idToString(idInt){
	if(idInt = 1) theIdString = "one";
	else if(idInt = 2) theIdString = "two";
	else if(idInt = 3) theIdString = "three";
	else if(idInt = 4) theIdString = "four";
	else if(idInt = 5) theIdString = "five";
	else if(idInt = 6) theIdString = "six";
	else if(idInt = 7) theIdString = "seven";
	else if(idInt = 8) theIdString = "eight";
	
	return theIdString;
	}

function squareOver(identity){
	document.getElementById(identity).src = "../images/conversations/"+identity+"-active.gif";
	document.getElementById("video-name").src = "../images/conversations/"+identity+"-name.gif";
	}
function squareOut(identity){
	var theID = checkId(identity);
	if (Activity[theID] < 1){
		document.getElementById(identity).src = "../images/conversations/"+identity+"-inactive.gif";
		document.getElementById("video-name").src = "../images/conversations/name-blank.gif";
		}
	}
	
function playVideo(identity){
		// load video
		document.getElementById('videoframe').src = "video-"+identity+".html";
		
		/*var currID = checkId(identity); // get integer value of identity
		currentlyActive = currID;
		alert(currentlyActive);
		var prevString = idToString(previouslyActive);
		alert(previouslyActive);
		squareOut(prevString);
					
			
		// make all other squares inactive
		/*for (var x=1; x<9;x++){
			var currString = idToString(x); // get string value of x
			if(Activity[x] > 0){
				// if  not currenlty clicked, call squareOut()
				squareOut(currString);
			}
			// set all to inactive
			Activity[x] = 0;
			}*/
			// reset current to active
		/*(Activity[currID] = 1;
		previouslyActive = currID;
		squareOver(currString);*/
	}