//  To use this script, simply define the variables below:

var image = "darrin1";		// The path to & name of the image.
var link  = "";			// Link URL, if want the image to be a link.
var flvwidth = "320";
var flvheight = "320";
var floaterCookieName = "TPPVideoDarrin";
var expireInXDays = 30;

var showFloater;

document.write("<style type=\"text/css\"><!--\n");
document.write("#float_pane {position: absolute; right: 0px; bottom: 0px;}\n");
document.write("body > div#float_pane {position: fixed;}\n");
document.write("--></style>\n");
document.write("<!--[if gte IE 5.5]><![if lt IE 7]><style type=\"text/css\">\n");
document.write("div#float_pane {\n");
document.write("right: auto; bottom: auto;\n");
document.write("left: expression( ( -0 - float_pane.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );\n");
document.write("top: expression( ( +0 - float_pane.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );\n");
document.write("}\n");
document.write("</style><![endif]><![endif]-->\n");

if ( floaterCookieName == "" ) { //if no cookie name is provided then always show floater
	showFloater = true;
} else {
	if ( getCookie(floaterCookieName) == "" ) { // cookie not found so show floater
		showFloater = true;
		// set cookie so it isn't shown the next time
		setFloaterCookie(floaterCookieName)
	} else { // don't show the floater
		showFloater = false;
	}
}

if ( showFloater ) {
	document.write('<div id="float_pane">\n');
	if( link != "" )
		document.write('<a href="' + link + '">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + flvwidth + '" height="' + flvheight + '" id="FLVPlayer1"><param name="movie" value="FLVPlayer_Progressive.swf" /><param name="salign" value="lt" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" /><param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=' + image + '&autoPlay=true&autoRewind=true" /><embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=' + image + '&autoPlay=true&autoRewind=true" quality="high" scale="noscale" width="' + flvwidth + '" height="' + flvheight + '" name="FLVPlayer1" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /></object>');
	if( link != "" )
		document.write('</a>');
	document.write('</div>');
}

function getCookie(c_name)
{
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=")
		if (c_start!=-1) { 
			c_start=c_start + c_name.length+1 
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
			return unescape(document.cookie.substring(c_start,c_end))
		} 
	}
	return ""
}

function setFloaterCookie(c_name)
{
	var exp = new Date();
	exp.setDate(exp.getDate() + expireInXDays);
	document.cookie=c_name+ "=1;expires=" + exp.toGMTString();
}

function hideDiv()
{
     var videoElement = document.getElementById("float_pane");
     videoElement.innerHTML = "&nbsp;";
}
