/*
OctopusMT provide a range of streaming and media managment services including online conversion and managment of HD content. For more information please visit the website www.octopusmt.com

*/


//SWFobject Ver 1.5


if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


var OctopusMT = function(){

   function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

var dragObj = new Object();
dragObj.zIndex = 0;

function dragStart(event, id) {

  var el;
  var x, y;

  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    // If this is a text node, use its parent element.

    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

  // Update element's z-index.

  dragObj.elNode.style.zIndex = ++dragObj.zIndex;

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}

function dragGo(event) {

  var x, y;

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function dragStop(event) {


  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}

	
    var DefaultSettings = {
			VideoID: '',		
			Width: 430,
			Height: 400, 
			Volume: 50, 
			VolumeControl: 'show', 
			Mute: 'off', 
			MuteControl: 'show', 
			AutoPlay: true,
			SeekControl: 'show', 
			FullScreenControl: 'show',
			Carousel: 'hide',
			ChaptersControl: 'hide',
			FullscreenVersionTest: 'on',
			FlashUpdateURL: '',
			wmode: 'transparent',
			VideoLocationName: 'OctopusMTPlayer',
			AllowPlayerResize: 'false',
			StartPositionX:200,
			StartPositionY:100,
			EmbedPlayer:false,
			VID: '',
			LID: '',
			VideoFile: '',
			VideoFileBitrates: '100,300,500,800,1000'
			
			
    };
    
	
	var SysFunc = new Object();
         SysFunc.extendObject = function(destination, source) {
              
                  for (var property in source) {
                        destination[property] = source[property];
                  };
                  return destination;
            }
    if(typeof ConfigSettings !== 'undefined'){
	    DefaultSettings = SysFunc.extendObject(DefaultSettings, ConfigSettings);
	    console.log(DefaultSettings);
	}

    var VideoGUID,
    	Width,
		Height,
    	VideoWidth,
    	VideoHeight,
    	Volume,
    	VolumeControl,
    	Mute,
		MuteControl,
    	AutoPlay,
    	SeekControl,
    	FullScreenControl,
  		PlayerHeight,
		ChannelGUID,
		FullscreenVersionTest,
		FlashUpdateURL,
		AllowPlayerResize,
		wmode,
		VideoLocationName,
		ThumbNailWidth,
		ThumbNailHeight,
		ThumbNailLinkName,
		AssetGUID,
		PreviousHeight,
		StartPositionX,
		StartPositionY,
		EmbedPlayer = false,
		VID,
		LID,
		VideoFileBitrates,
		VideoFile;

    var get_element = document.all ?
        function (s_id) { return document.all[s_id] } :
        function (s_id) { return document.getElementById(s_id) };

	var carouselTarget;

    var Flash = {
        write : function (target){
			var playerHeight ,
				playerWidth,
				playerLocation = "http://static.octopusmt.com/clients/u/uspmedia/USPmediaPlayer.swf",
				playerFullScreenControl;     
				playerWidth = Width
				playerHeight = Height
			
          	var so = new SWFObject(playerLocation,"mediaPlayer", playerWidth, playerHeight, "9.0.124","");
			so.addParam("allowScriptAccess", "always");
			so.addParam("swLiveConnect", "true");
			so.addParam("allowFullScreen", "true");
			so.addParam("wmode", wmode);
			so.addVariable("setWidth", Width);
			so.addVariable("setHeight", Height);
			so.addVariable("setVideoWidth", VideoWidth);
			so.addVariable("setVideoHeight", VideoHeight);
			so.addVariable("setPreviousHeight", PreviousHeight);
			so.addVariable("setAssetGUID", AssetGUID); // Fixed!! 
			so.addVariable("setChannelGUID", ChannelGUID);
			so.addVariable("setVolume", Volume);
			so.addVariable("setVolumeControl", VolumeControl);
			so.addVariable("setMute", Mute);
			so.addVariable("setMuteControl", MuteControl);
			so.addVariable("setAutoPlay", AutoPlay);
			so.addVariable("setSeekControl", SeekControl);
			so.addVariable("setFullScreenControl", FullScreenControl);
			so.addVariable("setFullscreenVersionTest", FullscreenVersionTest);
			so.addVariable("setFlashUpdateURL", FlashUpdateURL);
			so.addVariable("setAllowPlayerResize", AllowPlayerResize);
			so.addVariable("setThumbNailWidth", ThumbNailWidth);
			so.addVariable("setThumbNailHeight", ThumbNailHeight);
			so.addVariable("setThumbNailLinkName", ThumbNailLinkName);
			so.addVariable("setVID", VID);
			so.addVariable("setLID", LID);
			so.addVariable("setVideoFile", VideoFile);
			so.addVariable("setVideoBitRate", VideoFileBitrates);
			so.write(VideoLocationName); 

        }
    };
	

	function hex2RGB ( hex ) {
		return '0x'+hex;
	}
	
    function RenderPlayer(guid,autoPlay) {
         
		if(guid != null && guid !=='undefined') {
		    AssetGUID=guid;
		} else {
		    AssetGUID = DefaultSettings.VideoGUID;
		}
		
		var isFlash = false;
		  
		if(guid != null && guid !=='undefined'){
		    AssetGUID=guid;
		} else {
		    AssetGUID = DefaultSettings.AssetGUID;
		}
		
		Width = DefaultSettings.Width;
		Height = DefaultSettings.Height;
		Volume = DefaultSettings.Volume;
		VolumeControl = DefaultSettings.VolumeControl;
		Mute = DefaultSettings.Mute;
		MuteControl = DefaultSettings.MuteControl;
		
		if(typeof autoPlay === 'undefined'){
			AutoPlay = DefaultSettings.AutoPlay;
		} else {
			AutoPlay = autoPlay;
		}
		
		SeekControl = DefaultSettings.SeekControl;
		FullScreenControl = DefaultSettings.FullScreenControl;
		ChannelGUID = DefaultSettings.ChannelGUID;
		FullscreenVersionTest = DefaultSettings.FullscreenVersionTest;
		FlashUpdateURL = DefaultSettings.FlashUpdateURL;
		AllowPlayerResize = DefaultSettings.AllowPlayerResize;
		wmode = DefaultSettings.wmode;
		VideoLocationName = DefaultSettings.VideoLocationName;
		VID = DefaultSettings.VID;
		LID = DefaultSettings.LID;
		VideoFile = DefaultSettings.VideoFile,
		VideoFileBitrates = DefaultSettings.VideoFileBitrates

		Flash.write(VideoLocationName);
		   	        
    }
    
	function InsertDragPlayerCode(){

	document.write(unescape("%3C%64%69%76%20%69%64%3D%22%62%6F%78%42%22%20%63%6C%61%73%73%3D%22%62%6F%78%22%20%73%74%79%6C%65%3D%22%70%6F%73%69%74%69%6F%6E%3A%61%62%73%6F%6C%75%74%65%3B%20%20%7A%2D%69%6E%64%65%78%3A%31%30%30%30%3B%22%20%3E%0A%09%09%3C%64%69%76%20%69%64%3D%22%74%6F%70%62%61%72%22%20%63%6C%61%73%73%3D%22%62%61%72%22%20%6F%6E%6D%6F%75%73%65%64%6F%77%6E%3D%22%4F%63%74%6F%70%75%73%4D%54%2E%64%72%61%67%53%74%61%72%74%28%65%76%65%6E%74%2C%20%27%62%6F%78%42%27%29%22%20%73%74%79%6C%65%3D%22%64%69%73%70%6C%61%79%3A%6E%6F%6E%65%22%3E%3C%74%61%62%6C%65%20%77%69%64%74%68%3D%22%31%30%30%25%22%20%62%6F%72%64%65%72%3D%22%30%22%20%63%65%6C%6C%70%61%64%64%69%6E%67%3D%22%33%22%20%63%65%6C%6C%73%70%61%63%69%6E%67%3D%22%30%22%20%73%74%79%6C%65%3D%22%63%75%72%73%6F%72%3A%68%61%6E%64%22%3E%0A%20%20%3C%74%72%3E%0A%20%20%20%20%3C%74%64%20%68%65%69%67%68%74%3D%22%33%22%20%63%6F%6C%73%70%61%6E%3D%22%34%22%20%62%67%63%6F%6C%6F%72%3D%22%23%33%39%33%39%33%39%22%20%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%46%46%46%46%46%46%3B%20%66%6F%6E%74%2D%73%69%7A%65%3A%31%32%70%78%22%3E%3C%2F%74%64%3E%0A%20%20%20%20%3C%2F%74%72%3E%0A%20%20%3C%74%72%3E%0A%20%20%20%20%3C%74%64%20%77%69%64%74%68%3D%22%32%22%20%62%67%63%6F%6C%6F%72%3D%22%23%33%39%33%39%33%39%22%20%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%46%46%46%46%46%46%3B%20%66%6F%6E%74%2D%73%69%7A%65%3A%31%32%70%78%22%3E%26%6E%62%73%70%3B%3C%2F%74%64%3E%0A%20%20%20%20%3C%74%64%20%62%67%63%6F%6C%6F%72%3D%22%23%33%39%33%39%33%39%22%20%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%46%46%46%46%46%46%3B%20%66%6F%6E%74%2D%73%69%7A%65%3A%31%32%70%78%22%3E%43%6C%69%63%6B%20%74%6F%20%64%72%61%67%20%76%69%64%65%6F%3C%2F%74%64%3E%0A%20%20%20%20%3C%74%64%20%77%69%64%74%68%3D%22%35%30%22%20%62%67%63%6F%6C%6F%72%3D%22%23%33%39%33%39%33%39%22%20%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%46%46%46%46%46%46%3B%20%66%6F%6E%74%2D%73%69%7A%65%3A%31%32%70%78%22%3E%3C%64%69%76%20%61%6C%69%67%6E%3D%22%72%69%67%68%74%22%3E%3C%61%20%68%72%65%66%3D%22%6A%61%76%61%73%63%72%69%70%74%3A%4F%63%74%6F%70%75%73%4D%54%2E%43%6C%6F%73%65%46%6C%61%73%68%57%69%6E%64%6F%77%28%29%22%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%43%43%43%43%43%43%3B%22%3E%43%6C%6F%73%65%20%58%3C%2F%61%3E%3C%2F%64%69%76%3E%3C%2F%74%64%3E%0A%20%20%20%20%3C%74%64%20%77%69%64%74%68%3D%22%33%22%20%62%67%63%6F%6C%6F%72%3D%22%23%33%39%33%39%33%39%22%20%20%73%74%79%6C%65%3D%22%66%6F%6E%74%2D%66%61%6D%69%6C%79%3A%56%65%72%64%61%6E%61%2C%20%41%72%69%61%6C%2C%20%48%65%6C%76%65%74%69%63%61%2C%20%73%61%6E%73%2D%73%65%72%69%66%3B%20%63%6F%6C%6F%72%3A%23%46%46%46%46%46%46%3B%20%66%6F%6E%74%2D%73%69%7A%65%3A%31%32%70%78%22%3E%26%6E%62%73%70%3B%3C%2F%74%64%3E%0A%20%20%3C%2F%74%72%3E%0A%3C%2F%74%61%62%6C%65%3E%0A%3C%2F%64%69%76%3E%0A%09%09%3C%64%69%76%20%69%64%3D%22%4F%63%74%6F%70%75%73%4D%54%50%6C%61%79%65%72%22%3E%3C%2F%64%69%76%3E%0A%09%3C%2F%64%69%76%3E"))
	
	}
   	
	function init() {
		if(typeof this.ConfigSettings !=='undefined'){
			DefaultSettings = SysFunc.extendObject(DefaultSettings, this.ConfigSettings);  
		}	
		
		InsertDragPlayerCode();
		
		if(DefaultSettings.DragPlayer==true){
			OpenFlashWindow(AssetGUID);
		}else if(DefaultSettings.EmbedPlayer==true){
			RenderPlayer(AssetGUID,AutoPlay);
		}
		
	}
    
	function ResizeVideo(newHeight, videoWidth, videoHeight){	
			VideoWidth = videoWidth;
        	VideoHeight = videoHeight;
			PreviousHeight = newHeight;
			if(browser.isIE){

			}
			document.getElementById('OctopusMTPlayer').style.width = OctopusMT.ConfigSettings.Width + 'px';
			document.getElementById('OctopusMTPlayer').style.height = newHeight + 'px';
			
			
			document.getElementById('boxB').style.width = videoWidth + 'px';
			document.getElementById('boxB').style.height = videoHeight + 'px';
			document.getElementById('mediaPlayer').setAttribute('height',newHeight);
    }
	
	function OpenFlashWindow(AssetGUID,VID,LID){
		
		DefaultSettings.VideoLocationName = 'OctopusMTPlayer';
		DefaultSettings.VID = VID;
		DefaultSettings.LID = LID
		document.getElementById('boxB').style.top = DefaultSettings.StartPositionY + 'px';
		document.getElementById('boxB').style.left = DefaultSettings.StartPositionX + 'px';
		document.getElementById('boxB').style.width = DefaultSettings.Width + 'px';
		document.getElementById('boxB').style.height = DefaultSettings.Height + 'px';
		document.getElementById('topbar').style.width = DefaultSettings.Width + 'px';
		document.getElementById('topbar').style.display = 'block';
		document.getElementById('OctopusMTPlayer').style.display = 'block';
		DefaultSettings.AssetGUID = AssetGUID;
		
		RenderPlayer();
	}
	

	function CloseFlashWindow(){
		document.getElementById('OctopusMTPlayer').innerHTML="";
		document.getElementById('topbar').style.display = 'none';
		document.getElementById('OctopusMTPlayer').style.display = 'none';
	}
	
	function RenderTopBar(){
		var soTop = new SWFObject("swf/TopBar.swf", "Drag Bar", OctopusMT.ConfigSettings.Width, "28", "8");
		soTop.addParam("wmode", "transparent");
		soTop.addVariable("sWidth", OctopusMT.ConfigSettings.Width);
		soTop.write('topbar');
	}
	
    return {
	    init : init,
	    RenderPlayer : RenderPlayer,
		ResizeVideo : ResizeVideo,
		OpenFlashWindow : OpenFlashWindow,
		CloseFlashWindow : CloseFlashWindow,
		dragStart: dragStart
	}   
	
	
}();

OctopusMT.init();


	

