

/* Multi Tweens Object  */
function twSection (oID, lprop, tprop, wprop, hprop, func, lbegin, lfinish, tbegin, tfinish, wbegin, wfinish, hbegin, hfinish, obegin, ofinish)
{
	// set object
	this._oID = oID;
	this._obj = document.getElementById(oID);
	this._wait		= false;
	
	this._lprop		= lprop;
	this._tprop		= tprop;
	this._wprop		= wprop;
	this._hprop		= hprop;
	this._func		= func;
	this._lbegin	= lbegin;
	this._lfinish	= lfinish;
	this._tbegin	= tbegin;
	this._tfinish	= tfinish;
	this._wbegin	= wbegin;
	this._wfinish	= wfinish;
	this._hbegin	= hbegin;
	this._hfinish	= hfinish;
	this._obegin	= obegin;
	this._ofinish	= ofinish;
	
	// set tweens
	this.lTween		= "";
	this.tTween		= "";
	this.wTween		= "";
	this.hTween		= "";
	this.oTween		= "";
}


/* Show Video */
var twFlashTimeout = 1;
var TweenObjects = new Array();

function initFlash(IDs){	var arrIDs = new Array();	var sResult = "";		arrIDs = IDs.split(",");
	
	// create objects list
	for(var i=0; i<arrIDs.length; i++) 	{		sResult += "TweenObjects.push('twVideo" + arrIDs[i] + "') \n; var twVideo" + arrIDs[i] + " = new twSection('bg" + arrIDs[i] + "', '', '', '', '', 'Tween.regularEaseOut', '', '', '', '', '', '', '', '', 1, 70); \n";	} /// strongEaseOut 
	return sResult; }


function openFlash(id, dir)
{
	if(!id) return;


	// define a new method for twSection class
	twSection.prototype.twFlashSection = function (duration)
	{
		var oID = this._oID;
		
		if(this._obegin != "" && this._ofinish != "") // Opacity Tween
		{
			this.oTween = new OpacityTween(this._obj, eval(this._func), dir?this._obegin:this._ofinish, !dir?this._obegin:this._ofinish, duration);
			
			this.oTween.onMotionStarted = function()
			{
				if(!dir) { openSection("box" + id, false); }
				if(dir)
				{
					openSection(oID, true);
				 }
			}
			
			this.oTween.onMotionFinished = function()
			{
				if(dir) openSection("box" + id, true);
				if(!dir) openSection(oID, false);
				// stop banner 
				if(typeof pause != "undefined")
				{
					if(dir)
						clearTimeout(0);
					else
						setTimeout("rotateimage()",0);
				}
	

				
				if(!dir) FIND("player").SetVariable("player:jsStop", "");
				
			}
			
			this.oTween.start();
		}
	}

	// let's tween
	eval("twVideo" + id).twFlashSection(twFlashTimeout, dir);
}


