/*
Author: Mike Sheridan (Interactive Army.com)
*/


//This function is used by the flash player to remove itself from the website
//returns nothing.
function removePlayer() {
	parentNode = document.getElementById("wosPlayer").parentNode;
	nodeToRemove = document.getElementById("wosPlayer");
	parentNode.removeChild(nodeToRemove);
}

//function that creates the player HTML
//@param w = width of movie
//@param h = height of movie
//@param location = "location of movie on the website (bl,br,tl, tr)
//@param url = click through URL, this defines where it takes the user once they click on the actor defaults to walkonsite.com
//@param end = what to do when we reach the end of the movie b=goToBeginning, e=stay at the last frame of the movie, c=close the player totally as if they clicked on the x
function createWosPlayer(w, h, location, flv, url, done) {
	
	if(done == null)
	{
		done = "e";	
	}
	
	if(location == 'bl'){
		styleLocation = 'bottom:0px; left:0px;';	
	}
	if(location == 'br') {
		styleLocation = 'bottom:0px; right:0px;';
	}
	if(location == 'tr') {
		styleLocation = 'top:0px; right:0px;';
	}
	if(location == 'tl') {
		styleLocation = 'top:0px; left:0px;';
	}
	
	//create the HTML
	document.write('<div style="position:fixed; '+styleLocation+' z-index:99999999;" id="wosPlayer">');
	document.write('<script language="javascript" src="http://videoobjects.walkonsite.com/library/wosplayer_js.js"></script>');
	document.write('<object id="wosPlayerObjectID" height="'+h+'" width="'+w+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">');
	document.write('<param value="flvPlayer.swf" name="movie"/>');
	document.write('<param value="flvsource='+flv+'&clickThruURL=http://www.interactivearmy.com&pos=bc&sw='+w+'&sh='+h+'&done='+done+'" name="FlashVars"/>');
	document.write('<param value="high" name="quality"/>');
	document.write('<param value="true" name="allowResize"/>');
	document.write('<param value="always" name="allowScriptAccess"/>');
	document.write('<param value="transparent" name="wmode"/>');
	document.write('<param value="true" name="menu"/>');
	document.write('<param value="true" name="swLiveConnect"/>');
	document.write('<embed height="'+h+'" align="middle" width="'+w+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" quality="high" loop="false" menu="true" allowresize="true" wmode="transparent" play="true" swliveconnect="true" name="wosPlayerEmbed" flashvars="flvsource='+flv+'&clickThruURL='+url+'&sw='+w+'&sh='+h+'&done='+done+'&location=bc" src="Player.swf"/>');
	document.write('</object>');
	document.write('</div>');

}
						
	