//Hierarchy:		( follow in order including from the top down )
// -Optimised 		( basically a final version of the base to extension including all common class libraries,
//			    	  it wont have a prerequesite, but may be one elsewhere )
// -Base			<-		Will be a prerequisite
// --Primal			<-^		If u use a Primal must include the base
// ---Extension		<--^	If you use an Extension you must follow hierarchy, and include Primal and Base
// ----Specialized	<---^	If you use a Specialized you must follow hierarchy, and include Extension(if required), Primal and Base

//Prerequisites:
//	-class.js
//	--cls_base_mediaObject.js

/*
--------------------
Type			:	Extension
Name			:	Javascript Extensions, focused on Flash Interaction
Source File Name: 	cls_base_FlashObject.js
Desc			:	Adds Advanced Extension Class, which provides an advanced media object pointing to a Flash file,
						and allowing High level customization: FlashVars, and advanced player manipulation (show/hide,open/close)

Author:	Joe Mieszczur
--------------------
*/
function FlashObject(nContainer, nTitle, nSrc, nWidth, nHeight, nBgColor)	{this.setSize(nWidth,nHeight);this.setBgColor(nBgColor);this.setContainer(nContainer);this.setSrc(nSrc);this.setTitle(nTitle);var tpArry = ['',''];this.params = [tpArry];this.flashVar = [tpArry];}
FlashObject.inherits(MediaFileObject);
FlashObject.method('makePlayer', function() {
    var tempStr = '';
    if (this.getBrowser() == 1) {
        tempStr = '<object id="' + this.getContainer().id + '_obj' + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + this.getWidth() + '" height="' + this.getHeight() + '" title="' + this.title + '">';
        tempStr += '<param name="movie" value="' + this.getSrc() + '"/><param name="bgcolor" value="' + this.getBgColor() + '"/>' + this.loadParams();
        if (this.flashVar.length >= 1) { tempStr += '<param name="FlashVars" value="' + this.loadFlashVars() + '"/>\n'; }
        tempStr += '</object>';
    } else {
        if (this.flashVar.length >= 1) { var strFlashVar = 'FlashVars="' + this.loadFlashVars() + '" '; }
        tempStr = '<embed id="' + this.getContainer().id + '_obj' + '" src="' + this.getSrc() + '" ' + strFlashVar + 'pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + this.getWidth() + '" height="' + this.getHeight() + '" title="' + this.title + '" bgcolor="' + this.getBgColor() + '"' + this.loadParams() + '></embed>';
    }
    if (this.getBrowser() == 1) { this.getContainer().style.display = 'block'; } else { this.getContainer().style.display = 'table-cell'; };
    this.getContainer().style.backgroundColor = this.getBgColor(); this.getContainer().style.width = this.getWidth(); this.getContainer().style.height = this.getHeight(); this.getContainer().innerHTML = tempStr;
    //alert(tempStr);
})
FlashObject.method('addFlashVar',			function(name,value)			{var tArry = [name,value];this.flashVar[this.flashVar.length] = [tArry];})
FlashObject.method('loadFlashVars',			function()						{var tempStr = '';for(var x=1;x<this.flashVar.length;x++){tempStr += '&' + this.flashVar[x][0][0] + '=' + this.flashVar[x][0][1] + '';};return tempStr;})
FlashObject.method('delFlashVar',			function(name)					{for(var x=1;x<this.flashVar.length;x++){if(this.flashVar[x][0][0] == name){this.flashVar.splice(x,1)};}return this.flashVar;})
FlashObject.method('modFlashVar',			function(name,value)			{for(var x=1;x<this.flashVar.length;x++){if(this.flashVar[x][0][0] == name){this.flashVar[x][0][1] = value;}}})
FlashObject.method('clearFlashVars', 		function ()						{var tArry = [];tArry = ['',''];this.flashVar = [tArry];})
