// OBJECT BUILDER : DO NOT MODIFY THIS SCRIPT

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
		str +='swLiveConnect=true ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


function createObject() {

AC_FL_RunContent(
			"src", swfPath,
			"FlashVars", "version_hi_value="+version_hi_value+'&version_medium_value='+version_medium_value+'&version_low_value='+version_low_value+'&version_hi_extension='+version_hi_extension+'&version_medium_extension='+version_medium_extension+'&version_low_extension='+version_low_extension+'&detectFlashPlayer='+detectFlashPlayer+'&phpPath='+phpPath+'&movieName='+movieName+'&differentVersions='+differentVersions+'&subtitleXML='+subtitleXML+'&autoSize='+autoSize+'&playerWidth='+playerWidth+'&playerHeight='+playerHeight+'&bufferTime='+bufferTime+'&autoStart='+autoStart+'&endBehaviour='+endBehaviour+'&controls='+controls+'&screenBorder='+screenBorder+'&controlsY='+controlsY+'&stopButton='+stopButton+'&rewindFastForwardButtons='+rewindFastForwardButtons+'&subButton='+subButton+'&volumeSlider='+volumeSlider+'&playerColor='+playerColor+'&playbarColor='+playbarColor+'&timeColor='+timeColor+'&barColor='+barColor+'&buttonsColor='+buttonsColor+'&screenBorderColor='+screenBorderColor+'&subColor='+subColor+'&subButtonOffColor='+subButtonOffColor+'&subBackgroundColor='+subBackgroundColor+'&subBackgroundAlpha='+subBackgroundAlpha+'&backgroundColor='+backgroundColor+'&backgroundAlpha='+backgroundAlpha+'&subBackground='+subBackground+'&subVisible='+subVisible+'&subFontSize='+subFontSize+'&autohideSubBackground='+autohideSubBackground+'&volume='+volume+'&commercialText='+commercialText+'&commercialTextColor='+commercialTextColor+'&commercialTextBold='+commercialTextBold+'&bufferTextBackgroundColor='+bufferTextBackgroundColor+'&bufferTextBackgroundAlpha='+bufferTextBackgroundAlpha+'&bufferTextColor='+bufferTextColor+'&bufferTextPosition='+bufferTextPosition+'&bufferText='+bufferText+'&timeFormat='+timeFormat+'&logo='+logo+'&logoPath='+logoPath+'&logoPosition='+logoPosition+'&logoAlpha='+logoAlpha+'&logo_x='+logo_x+'&logo_y='+logo_y+'&controlsBarPress='+controlsBarPress+'&bufferMessage='+bufferMessage+'&showTimecode='+showTimecode+'&subAlign='+subAlign+'&rw_ff_interval='+rw_ff_interval+'&stopButtonFirst='+stopButtonFirst+'&detectPopUpTitle='+detectPopUpTitle+'&detectPopUpText1='+detectPopUpText1+'&detectPopUpText2='+detectPopUpText2+'&detectPopUpButton1='+detectPopUpButton1+'&detectPopUpButton2='+detectPopUpButton2+'&bandwidthDetectPopUpTitle='+bandwidthDetectPopUpTitle+'&bandwidthDetectPopUpText1='+bandwidthDetectPopUpText1+'&bandwidthDetectPopUpText2='+bandwidthDetectPopUpText2+'&bandwidthSelectPopUpTitle='+bandwidthSelectPopUpTitle+'&bandwidthSelectPopUpButton1='+bandwidthSelectPopUpButton1+'&bandwidthSelectPopUpButton2='+bandwidthSelectPopUpButton2+'&bandwidthSelectPopUpButton3='+bandwidthSelectPopUpButton3+'&bandwidthTextForLowBandwidth='+bandwidthTextForLowBandwidth+'&bandwidthTextForMediumBandwidth='+bandwidthTextForMediumBandwidth+'&bandwidthTextForHiBandwidth='+bandwidthTextForHiBandwidth+'&bandwidthSelectPopUpText1='+bandwidthSelectPopUpText1+'&bandwidthSelectPopUpText2='+bandwidthSelectPopUpText2+'&bandwidthSelectPopUpText3='+bandwidthSelectPopUpText3+'&playerColorFullScreen='+playerColorFullScreen+'&barColorFullScreen='+barColorFullScreen+'&playbarColorFullScreen='+playbarColorFullScreen+'&buttonsColorFullScreen='+buttonsColorFullScreen+'&timeColorFullScreen='+timeColorFullScreen+'&backgroundColorFullScreen='+backgroundColorFullScreen+'&backgroundAlphaFullScreen='+backgroundAlphaFullScreen+'&blankLineFullScreen='+blankLineFullScreen+'&controlsYFullScreen='+controlsYFullScreen+'&blankLineListMode='+blankLineListMode+'&subColorFullScreen='+subColorFullScreen+'&subBackgroundFullScreen='+subBackgroundFullScreen+'&subBackgroundColorFullScreen='+subBackgroundColorFullScreen+'&subBackgroundAlphaFullScreen='+subBackgroundAlphaFullScreen+'&subFontSizeFullScreen='+subFontSizeFullScreen+'&autohideSubBackgroundFullScreen='+autohideSubBackgroundFullScreen+'&subAlignFullScreen='+subAlignFullScreen+'&speedClipPath='+speedClipPath+'&fullScreenFunction='+fullScreenFunction+'&endFullScreenBackToNormal='+endFullScreenBackToNormal+'&blackBorderWidth='+blackBorderWidth+'&blackBorderHeight='+blackBorderHeight+'&displayBandwidthDetectPopUp='+displayBandwidthDetectPopUp+'&playCommercialFirst='+playCommercialFirst+'&commercialMovieName='+commercialMovieName+'&commercialLink='+commercialLink+'&loadingMoviePopUpTitle='+loadingMoviePopUpTitle+'&loadingMoviePopUpText='+loadingMoviePopUpText+'&displayLoadingMoviePopUp='+displayLoadingMoviePopUp+'&endJavascriptFunction='+endJavascriptFunction+'&stopCloseConnect='+stopCloseConnect+'&startShowControls='+startShowControls+'&picturesFolder='+picturesFolder+'&startPauseMode='+startPauseMode+'&infoPopUpText='+infoPopUpText+'&infoPopUpTitle='+infoPopUpTitle+'&displayInfoPopUp='+displayInfoPopUp,
			"menu","false",
			"width", swfWidth,
			"height", swfHeight,
			"align", "middle",
			"id", swfID,
			"quality", "high",
			"bgcolor", swfBackgroundColor,
			"name", swfID,
			"allowFullScreen","true",
			"allowScriptAccess","sameDomain",
			"wmode","transparent",
			"type", "application/x-shockwave-flash",
			'codebase', '../external.html?link=http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
			"pluginspage", "../external.html?link=http://www.adobe.com/go/getflashplayer"
);
}




// CONTROL FLASH FROM JAVASCRIPT

/* =========================================================================

CLASS: JSFCommunicator
AUTHOR: Abdul Qabiz 
DATE  : 12/13/2003

*/

function JSFCommunicator(flashMovie)
{	
	this.init(flashMovie);
}

JSFCommunicator.prototype.init = function(flashMovie) {

	if(flashMovie=="undefined") {
		var flashMovie = null;
	 }
	this.setMovie(flashMovie);
	this.functionToCall = null;
	this.functionLocationinFlash = null;
	this.functionArgs = null;
}

JSFCommunicator.prototype.setMovie = function(flashMovie)
{
	this.flashMovie = flashMovie;
}


JSFCommunicator.prototype.setVariable  = function(propName, propValue) {
	this.flashMovie.SetVariable(propName,propValue);
}

JSFCommunicator.prototype.getVariable  = function(propName) {

	var result = this.flashMovie.GetVariable(propName);
	return result;
}

JSFCommunicator.prototype.callFunction = function(fnLocation,fnName,fnArgs) {
	if(this.flashMovie==null) {	return false; }
	var flag = this.getVariable("/:triggerFn");
	var result = false;
	if(fnName=="") {return false; }
	if(fnLocation=="") {
		var fnLocation = "_level0";
	}
	this.setVariable("/:fnLocation",fnLocation);
	this.setVariable("/:fnName",fnName);
	if(typeof(fnArgs)=="object") {
		this.setVariable("/:fnArgs",fnArgs.join("$@$$"));
	}else if(typeof(fnArgs)=="number" || typeof(fnArgs)=="string") {
		this.setVariable("/:fnArgs",fnArgs);
	}
	this.setVariable("/:triggerFn",!flag);
	result = this.getVariable("triggerFnStatus");
	this.setVariable("/:triggerFnStatus",false);
	return result;	
}

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
	
  } else {
   return window.document[movieName]
  }
}


function createJSFCommunicatorObject(playerObj)
{
		//create an instance of JSFCommunicator, pass the flashMovie's reference
		//make sure flash object is loaded when you create this object with parameter otherwise
		//you can JSFCommunicator.setMovie(flashMovie) once flash object is loaded
		fc = new JSFCommunicator(playerObj);
}


// =========================================================================

function play() {
fc.callFunction("_level0","playMovie");		
}
function pause() {
fc.callFunction("_level0","pauseMovie");		
}
function stop() {
fc.callFunction("_level0","stopMovie");		
}
function seek(time) {
fc.callFunction("_level0","seek",[time]);		
}
function load(movie,sub) {
fc.callFunction("_level0","load",[movie,sub]);		
}
function loadWithCommercial(com,movie,comlink,sub) {
fc.callFunction("_level0","loadWithCommercial",[com,movie,comlink,sub]);		
}
function showSubtitles() {
fc.callFunction("_level0","showSubtitles");		
}
function hideSubtitles() {
fc.callFunction("_level0","hideSubtitles");		
}
function showControls() {
fc.callFunction("_level0","showControls");		
}
function hideControls() {
fc.callFunction("_level0","hideControls");		
}
function setVolume(v) {
fc.callFunction("_level0","setVolume",[v]);		
}
function mute() {
fc.callFunction("_level0","mute");		
}
function changeSubtitles(sub) {
fc.callFunction("_level0","changeSubtitles",[sub]);		
}
function close() {
fc.callFunction("_level0","close");		
}


createObject();

createJSFCommunicatorObject(thisMovie(swfID));
