//		click_for_movie.js
//		This javascript handles showing a "click for movie" box
//		which then can be clicked to show a movie.

var movies = Array();

function clickForMovie( info )
{
	id = movies.length;
	movies.push(info);

	document.writeln('<div class="movie_frame" onClick="clickedForMovie(' + id + ');" id="movie_' + id + '" style="width: ' + info.width + 'px;">');
	document.writeln('<div style="clicktoplay">Click to play movie</div></div>');
	
	document.writeln("<style type='text/css'> #movie_" + id + " { " + info.style + "} </style>");
	
}

function clickedForMovie( id )
{
	info = movies[id];
	e = document.getElementById('movie_' + id);
	e.innerHTML = '<embed src="' + info.baseURL + '" width="' + info.width + '" height="' + info.height + '" autoplay="true" align="center"><br />Click to play again';
}

document.writeln("<style type='text/css'>");
document.writeln(".movie_frame { border: 1px solid #6A63C3; padding: 10px; background-color: #222; text-align: center; font-size: smaller; margin: 10px; }");
document.writeln(".movie_frame:hover { border-color: #fff; }");
document.writeln(".movie_frame embed { border: 1px solid #000; }");
document.writeln("</style>");