
/* **************************************************************************
 *  embedplayer.js: javascript routines for embedding Jaguar movies.
 *  (c) 1997-2005 by Catalla Systems, Inc.
 *  All Rights Reserved.
 * *********************************************************************** */
var jaguarPath = "http://pb.vblogcentral.com/users/stevegarfield/45%20Wine%20Country/";
var thumbUrl = "http://pb.vlogcentral.com/movies/8286.jpg";
var msWidth = "320";
var msHeight = "240";

var defaultPopWidth = 510;
var defaultPopHeight = 350;
var widthAddition = 20;
var heightAddition = 80;
var minWidth = 320;
var minHeight = 120;

var isNav4 = (document.layers) ? true : false;
var hasEmbeddedMovie = false;

//
// Show the URL embedded within the document.  Width and height are dimensions
// that are used in the iframe tag.
//
function showEmbedded ( url, fallbackText, width, height )
{
	hasEmbeddedMovie = true;
	if ( isNav4 )
	{
		document.write( '<center><ilayer width="' + width + '" height="' + height
					+ '" visibility="show" background-color="transparent" src="' 
					+ url
					+ '</ilayer></center>' );
	}
	else
	{
		document.write( '<center><iframe width="' + width + '" height="' + height + '" src="'
					+ url
					+ '" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"'
					+ ' allowtransparency="true" scrolling="no" bordercolor="#000000">'
					+ fallbackText
					+ '</iframe></center>' );
	}
}

//
// Returns an image tag to display a movie set's thumbnail. Be sure to use the
// movie set's full path name, and use encoding for any non-standard characters.
// For example, showThumbnail( "pets/My+cat" )
//
function getThumbnailTag ( ) 
{ 
	var val = '<img src="' + thumbUrl + '" border="0" />';
	return val;
} 

//
// Returns <a> and <img> tags to put a movie set's thumbnail into an HTML 
// page, with a link to play the movie. Be sure to use the movie set's full 
// path name, and use encoding for any non-standard characters.
// For example, showMovieLink( "pets/My%20cat" )
//
function getMovieLink ( ) 
{ 
	var val = '<a href="' + jaguarPath + 'play.html' + '">'
		   + getThumbnailTag()
		   + '</a>';
	return val;
} 

//
// Return the Thumbnail screen URL for a movie path.
//
function getThumbScreenUrl ( )
{
	var val = jaguarPath + 'playlink.html' + '';
	return val;
}

//
// Show the content of what should be in a Blog entry.
//
function showBlogContent ( width, height )
{
	var url = getThumbScreenUrl();
	var fallback = getMovieLink();
	showEmbedded( url, fallback, width, height );
}

//
// The following code takes care of refreshing the page when the window is resized,
// if the user is using Navigator 4.0. This works around a Navigator bug.
//
function HandleResize()
{
	location.reload();
	return false;
}

if (isNav4)
{
	window.captureEvents(Event.RESIZE);
	window.onresize = HandleResize;
}

var iWidth = Math.max( parseInt( msWidth ) + widthAddition, minWidth );
var iHeight = Math.max( parseInt( msHeight ) + heightAddition, minHeight );

showBlogContent( iWidth, iHeight );


