var jaguarPath = "http://posetech.com/video/vidplayer/";
var thumbUrl = "";
var msWidth = "640";
var msHeight = "480";

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

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 (theThumb ) 
{ 
    var val = '<img src="'+theThumb+'" 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+cat" )
//
function getMovieLink ( theMovie , theThumb) 
{ 
    var val = '<a href="' + jaguarPath + 'play.php?id='+theMovie+'">'
	   + getThumbnailTag(theThumb)
	   + '</a>';
    return val;
} 

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

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

