function initMediaFileBrowser(mainDiv)
{
clearChildNodes(mainDiv);
createLayeredContainer(null, null, mainDiv);
var editorDiv = document.createElement('div');
divToContainer(editorDiv);
var div = document.createElement('div');
divToVerticalSplitContainer(div);
div.myLayerID = mainDiv.addContainer(div);
div.editorDivID = mainDiv.addContainer(editorDiv);
div.layerManger = mainDiv;
initMediaBrowser(editorDiv, new objfn('viewMode', div));
div.viewMode = function()
{
this.rootFolder = new mediaBrowserFolderChildren(0, new objfn('reloadFolderDS', this));
this.layerManger.selectContainer(this.myLayerID);
}
div.editMode = function()
{
this.layerManger.selectContainer(this.editorDivID);
}
var leftPadding = document.createElement('div');
var rightPadding = document.createElement('div');
var center = document.createElement('div');
divToHorizontalSplitContainer(center);
divToContainer(leftPadding);
divToContainer(rightPadding);
div.addContainer(leftPadding, 20);
div.addContainer(center);
div.addContainer(rightPadding, 20);
var title = document.createElement('div');
divToContainer(title);
title.className = 'media_browser_title';
title.appendChild(document.createTextNode('Media Browser'));
center.addContainer(title, 22);
var folderTitle = document.createElement('div');
divToContainer(folderTitle);
folderTitle.className = 'media_browser_desc';
var folderListTitle = document.createElement('div');
folderListTitle.className = 'media_browser_list_title';
folderListTitle.appendChild(document.createTextNode('Folders: '));
folderTitle.appendChild(folderListTitle);
div.folderListInfo = document.createElement('div');
div.folderListInfo.className = 'media_browser_list_info';
folderTitle.appendChild(div.folderListInfo);
div.readUserStatus = function(userObj)
{
clearChildNodes(this.folderListInfo);
if (app.auth.inGroup('media_browser_admin'))
{
this.folderListInfo.appendChild(document.createTextNode('['));
var link = document.createElement('span');
link.className = 'media_browser_link';
link.appendChild(document.createTextNode('Edit Directories'));
var parent = this;
link.onclick = function()
{
parent.editMode();
}
this.folderListInfo.appendChild(link);
this.folderListInfo.appendChild(document.createTextNode('] ['));
var link = document.createElement('a');
link.className = 'media_browser_link';
link.appendChild(document.createTextNode('Edit Media'));
link.href = 'editmedia.php';
link.target = '_blank';
this.folderListInfo.appendChild(link);
this.folderListInfo.appendChild(document.createTextNode(']'));
}else
{
this.folderListInfo.appendChild(document.createTextNode('Click folder to expand tree. Click name to load media.'));
}
this.viewMode();
}
center.addContainer(folderTitle, 14);
div.folderDS = new dataset(new Array('id', 'depth', 'open', 'name', 'description', 'media'), null);
var folderColRenderer = function(input, inputRow, inputColPos, inputRowPos)
{
var cell = document.createElement('div');
var spacing = document.createElement('div');
var spacing2 = document.createElement('div');
var image = document.createElement('img');
var text = document.createElement('div');
cell.className = 'sslistview_cell';
spacing.className = 'media_browser_cell_element_small_spacing';
spacing2.className = 'media_browser_cell_element_small_spacing';
image.className = 'media_browser_cell_element_image';
text.className = 'media_browser_cell_folder_text';
spacing.style['width'] = (inputRow['depth']*16).toString() + 'px';
spacing.style['height'] = '2px';
spacing2.style['width'] = '2px';
spacing2.style['height'] = '2px';
image.style['width'] = '16px';
image.style['height'] = '16px';
text.appendChild(document.createTextNode(input.toString()));
if (inputRow['open'] == 1)
{
image.src = 'app/images/icons/open_folder.gif';
image.onclick = function()
{
div.rootFolder.closeFolder(inputRow['id']);
}
}else if(inputRow['open'] == 0)
{
image.src = 'app/images/icons/closed_folder.gif';
image.onclick = function()
{
div.rootFolder.openFolder(inputRow['id']);
}
}else if(inputRow['open'] == -1)
{
text.className = 'media_browser_cell_element_dimstate';
cell.appendChild(spacing);
cell.appendChild(text);
return cell;
}
text.onclick = function()
{
div.loadMediaFromFolder(inputRow['id']);
}
cell.appendChild(spacing);
cell.appendChild(image);
cell.appendChild(spacing2);
cell.appendChild(text);
cell.onmouseover = function()
{
app.tip.request(cell);
}
cell.onmouseout = function()
{
app.tip.clear();
}
return cell;
}
var normalColRenderer = function(input, inputRow, inputColPos, inputRowPos)
{
if (input == null)
{
input = "";
}
var cell = document.createElement('div');
cell.className = 'sslistview_cell';
cell.appendChild(document.createTextNode(input.toString()));
cell.onmouseover = function()
{
app.tip.request(cell);
}
cell.onmouseout = function()
{
app.tip.clear();
}
return cell;
}
var centerColRenderer = function(input, inputRow, inputColPos, inputRowPos)
{
if (input == null)
{
input = "";
}
var cell = document.createElement('div');
cell.className = 'sslistview_cell_centered';
cell.appendChild(document.createTextNode(input.toString()));
return cell;
}
var nullLabelClick = function(column, listView) {};
var columns = {
0:{
'label':'Name',
'attr':'name',
'width':35,
'widthType':'%',
'renderer':folderColRenderer,
'labelClick':nullLabelClick
},
1:{
'label':'Description',
'attr':'description',
'width':65,
'widthType':'%',
'renderer':normalColRenderer,
'labelClick':nullLabelClick
},
2:{
'label':'Media',
'attr':'media',
'width':45,
'widthType':'.',
'renderer':centerColRenderer,
'labelClick':nullLabelClick
}
};
div.folderView = document.createElement('div');
listView(
div.folderView,
div.folderDS,
columns,
0,
0,
13,
17,
'sslistview_label',
0,
null
);
center.addContainer(div.folderView, 150);
div.reloadFolderDS = function(folder, depth)
{
if (depth == null)
{
folder = (this.rootFolder!=null?this.rootFolder:folder);
depth = 0;
this.folderDS.clearSort();
this.folderDS.clear();
}
var folderSet = null;
///*
if (folder.children.length == 0 && folder.loading == false)
{
folderSet = {
'id':null,
'depth':depth,
'open':-1,
'name':'No Sub Folders',
'description':''
};
this.folderDS.add(folderSet);
}
//*/
if (folder.children.length == 0 && folder.loading == true)
{
folderSet = {
'id':null,
'depth':depth,
'open':-1,
'name':'Loading...',
'description':''
};
this.folderDS.add(folderSet);
}
for (var i = 0; i < folder.children.length; i++)
{
folderSet = {
'id':folder.children[i]['id'],
'depth':depth,
'open':(folder.children[i]['children']==null?0:1),
'name':folder.children[i]['name'],
'description':folder.children[i]['description'],
'media':folder.children[i]['media']
};
this.folderDS.add(folderSet);
if (folder.children[i]['children'] != null)
{
this.reloadFolderDS(folder.children[i]['children'], depth+1);
}
}
if (depth == 0)
{
this.folderView.refreshData();
}
}
div.rootFolder = new mediaBrowserFolderChildren(0, new objfn('reloadFolderDS', div));
var fileTitle = document.createElement('div');
divToContainer(fileTitle);
fileTitle.className = 'media_browser_desc';
var listTitle = document.createElement('div');
listTitle.className = 'media_browser_list_title';
listTitle.appendChild(document.createTextNode('Media: '));
fileTitle.appendChild(listTitle);
div.fileListInfo = document.createElement('div');
div.fileListInfo.className = 'media_browser_list_info';
div.fileListInfo.appendChild(document.createTextNode('Folder: /'));
fileTitle.appendChild(div.fileListInfo);
center.addContainer(fileTitle, 14);
var fileColRenderer = function(input, inputRow, inputColPos, inputRowPos)
{
var cell = document.createElement('div');
var image = document.createElement('img');
var text = document.createElement('div');
var spacing2 = document.createElement('div');
cell.className = 'sslistview_cell';
image.className = 'media_browser_cell_element_image';
text.className = 'media_browser_cell_folder_text';
image.style['width'] = '16px';
image.style['height'] = '16px';
text.appendChild(document.createTextNode(input.toString()));
image.src = 'app/images/icons/media.gif';
if (inputRow['id'] == null)
{
text.className = 'media_browser_cell_element_dimstate';
cell.appendChild(text);
return cell;
}
image.onclick = function()
{
app.getFunction('mediaManager', 'loadMedia').run(inputRow['id']);
}
text.onclick = function()
{
app.getFunction('mediaManager', 'loadMedia').run(inputRow['id']);
}
cell.appendChild(image);
cell.appendChild(spacing2);
cell.appendChild(text);
cell.onmouseover = function()
{
app.tip.request(cell);
}
cell.onmouseout = function()
{
app.tip.clear();
}
return cell;
}
var numericSorter = function(a, b)
{
a = parseFloat(a);
b = parseFloat(b);
if (a == b)
{
return 0;
}
if (a < b)
{
return -1;
}
return 1;
}
var numericSorterRev = function(a, b)
{
a = parseFloat(a);
b = parseFloat(b);
if (a == b)
{
return 0;
}
if (a > b)
{
return -1;
}
return 1;
}
div.fileDS = new dataset(new Array('id', 'name', 'description', 'timestamp', 'date', 'captions', 'downloadURL'), {'timestamp':numericSorterRev});
div.fileView = document.createElement('div');
var sortByTimestamp = function(column, listView)
{
var attr = 'timestamp';
var prevSort = listView.dataSet.getSort(attr);
var prevSortPos = listView.dataSet.getSortPos(attr);
if (prevSortPos != 0)
{
prevSort = null;
}
if (prevSort == 'asc')
{
listView.dataSet.setSort(attr, false);
}else
{
listView.dataSet.setSort(attr, true);
}
listView.refreshData();
}
var downloadRenderer = function(input, inputRow, inputColPos, inputRowPos)
{
var cell = document.createElement('div');
if (inputRow['id'] == null)
{
return cell;
}
var a = document.createElement('a');
a.appendChild(document.createTextNode('Download'));
a.target = "_blank";
a.href = inputRow['downloadURL'];
cell.className = "sslistview_cell";
cell.appendChild(a);
cell.onmouseover = function()
{
app.tip.request(cell, "Right click. Then click 'Save Target As...'!");
}
cell.onmouseout = function()
{
app.tip.clear();
}
return cell;
}
columns = {
0:{
'label':'Name',
'attr':'name',
'width':40,
'widthType':'%',
'renderer':fileColRenderer,
'labelClick':null
},
1:{
'label':'Description',
'attr':'description',
'width':60,
'widthType':'%',
'renderer':normalColRenderer,
'labelClick':null
},
2:{
'label':'Caps',
'attr':'captions',
'width':35,
'widthType':'.',
'renderer':centerColRenderer,
'labelClick':null
},
3:{
'label':'Added',
'attr':'date',
'width':75,
'widthType':'.',
'renderer':normalColRenderer,
'labelClick':sortByTimestamp
},
4:{
'label':'',
'attr':null,
'width':65,
'widthType':'.',
'renderer':downloadRenderer,
'labelClick':function(c, lv){}
}
};
listView(
div.fileView,
div.fileDS,
columns,
0,
0,
13,
17,
'sslistview_label',
0,
null
);
center.addContainer(div.fileView);
div.loadMediaFromFolder = function(id)
{
this.fileDS.clear();
var file = {
'id':null,
'name':'Loading...',
'description':'',
'timestamp':0,
'date':''
};
this.fileDS.add(file);
this.fileView.refreshData();
var rsp = new phpRequest(new objfn('loadMedia', this), 'getFolderMedia', 'media_browser_responder', 'app/jsresponder.php');
rsp.run(id);
}
div.loadMedia = function(mediaInfo)
{
clearChildNodes(this.fileListInfo);
this.fileListInfo.appendChild(document.createTextNode(mediaInfo['location']));
media = mediaInfo['listing'];
this.fileDS.clear();
this.fileDS.clearSort();
var file = null;
if (media.length == 0)
{
file = {
'id':null,
'name':'Empty',
'description':'',
'timestamp':0,
'date':''
};
this.fileDS.add(file);
}
if (mediaInfo['folderID'] != null)
{
this.rootFolder.openFolder(mediaInfo['folderID']);
}
for (var i = 0; i < media.length; i++)
{
file = {
'id':media[i]['id'],
'name':media[i]['name'],
'description':media[i]['description'],
'timestamp':media[i]['added'],
'captions':media[i]['captions'],
'date':media[i]['date'],
'downloadURL':media[i]['downloadURL']
};
this.fileDS.add(file);
}
this.fileView.refreshData();
}
app.cach.bind('userInfo', new objfn('readUserStatus', div));
div.loadMediaFromFolder(0);
}
function mediaBrowserFolderChildren(id, monitor)
{
this.id = id;
this.children = new Array();
this.monitor = monitor;
this.loading = true;
var rsp = new phpRequest(new objfn('readChildren', this), 'getFolderChildren', 'media_browser_responder', 'app/jsresponder.php');
rsp.run(id);
}
mediaBrowserFolderChildren.prototype.readChildren = function(result)
{
var child = null;
for (var i = 0; i < result.length; i++)
{
child = {
'id':result[i]['id'],
'name':result[i]['name'],
'description':result[i]['description'],
'media':result[i]['media'],
'children':null
};
this.children[this.children.length] = child;
}
this.loading = false;
this.monitor.run(this);
}
mediaBrowserFolderChildren.prototype.openFolder = function(id)
{
for (var i = 0; i < this.children.length; i++)
{
if (this.children[i]['id'] == id)
{
if (this.children[i]['children'] == null)
{
this.children[i]['children'] = new mediaBrowserFolderChildren(id, this.monitor);
this.monitor.run(this);
}
return true;
}else
{
if (this.children[i]['children'] != null)
{
if (this.children[i]['children'].openFolder(id))
{
return true;
}
}
}
}
return false;
}
mediaBrowserFolderChildren.prototype.closeFolder = function(id)
{
for (var i = 0; i < this.children.length; i++)
{
if (this.children[i]['id'] == id)
{
this.children[i]['children'] = null;
this.monitor.run(this);
return true;
}else
{
if (this.children[i]['children'] != null)
{
if (this.children[i]['children'].closeFolder(id))
{
return true;
}
}
}
}
return false;
}
function audioPlayer(playerLocation)
{
while(playerLocation.childNodes.length != 0)
{
playerLocation.removeChild(playerLocation.childNodes[0]);
}
this.player = null;
if (isExplorer())
{
playerLocation.innerHTML = '';
this.player = playerLocation.childNodes[0];
this.setUrl = function(url)
{
this.player.URL = url;
}
this.play = function()
{
this.player.controls.play();
if (this.state() != 3 && window.app != null)
{
if (this.playTimerID != null)
{
return;
}
this.playTimerID = app.timer.addTimer(new objfn('forcePlay', this), 100);
}
}
this.stop = function()
{
this.player.controls.stop();
}
this.pause = function()
{
this.player.controls.pause();
}
this.state = function()
{
var conversion = new Array(0,0,4,3,5,5,2,2,0,1,0,1)
return conversion[this.player.playState];
}
this.textState = function()
{
var states = new Array('Stopped', 'Contacting', 'Buffering', 'Playing', 'Paused', 'Seeking');
return states[this.state()];
}
this.getPosition = function()
{
return this.player.controls.currentPosition*1000;
}
this.getClipLength = function()
{
try
{
return this.player.currentMedia.duration*1000;
}catch(e)
{
return 0;
}
}
this.setPosition = function(pos)
{
return this.player.controls.currentPosition = pos/1000;
}
}else if (isMozilla())
{
playerLocation.innerHTML = '';
this.player = playerLocation.childNodes[0];
this.setUrl = function(url)
{
playerLocation.innerHTML = '';
this.player = playerLocation.childNodes[0];
/*
this.requestedURL = url;
this.player.SetSource(url);
this.stop();
this.player.SetSource(url);
var parent = this;
var fn = function()
{
parent.player.SetSource(url);
var fn2 = function()
{
parent.player.SetSource(url);
parent.play();
}
// setTimeout(fn2, 100);
}
setTimeout(fn, 100);
*/
// this.checkUrlChanged();
}
this.checkUrlChanged = function()
{
if (this.player.GetSource() == this.oldRealURL)
{
this.player.SetSource(this.requestedURL);
var parent = this;
var fn = function()
{
parent.checkUrlChanged();
}
setTimeout(fn, 200);
}else
{
this.oldRealURL = this.player.GetSource();
this.play();
}
}
this.play = function()
{
this.player.DoPlay();
// if (this.player.GetPlayState() != 3 && window.app != null)
// {
// this.playTimerID = app.timer.addTimer(new objfn('forcePlay', this), 100);
// }
}
this.stop = function()
{
this.player.DoStop();
}
this.pause = function()
{
this.player.DoPause();
}
this.state = function()
{
var result = null;
try
{
result = this.player.GetPlayState();
}catch(e)
{
result = 0;
}
return result;
}
this.textState = function()
{
var states = new Array('Stopped', 'Contacting', 'Buffering', 'Playing', 'Paused', 'Seeking');
return states[this.player.GetPlayState()];
}
this.getPosition = function()
{
var result = null;
try
{
result = this.player.GetPosition();
}catch(e)
{
result = 0;
}
return result;
}
this.getClipLength = function()
{
var result = null;
try
{
result = this.player.GetLength();
}catch(e)
{
result = 0;
}
return result;
}
this.setPosition = function(pos)
{
return this.player.SetPosition(pos);
}
}
this.monitorEvents = function()
{
if (this.oldClipLength != this.getClipLength())
{
this.oldClipLength = this.getClipLength();
if (this.clipLenMon != null)
{
this.clipLenMon.run(this.oldClipLength);
}
}
if (this.oldState != this.state())
{
this.oldState = this.state();
if (this.stateMon != null)
{
this.stateMon.run(this.oldState, this.textState());
}
}
}
this.forcePlay = function()
{
if (this.state() != 3)
{
this.play();
return;
}
if (this.playTimerID == null)
{
return;
}
app.timer.removeTimer(this.playTimerID);
this.playTimerID = null;
}
this.oldClipLength = 0;
this.oldState = -1;
if (window.app != null)
{
this.monEventTimerID = app.timer.addTimer(new objfn('monitorEvents', this), 100);
}
}
function initApplication(buttonCont, contentCont)
{
var tabs = new tabHandler(contentCont);
app.addComponent('mainTabHandler', tabs);
app.addFunction('mainTabHandler', 'selectTab', new objfn('selectTab', tabs));
var tabPages = new Array();
tabPages[tabPages.length] = createMainPage();
tabPages[tabPages.length] = createMediaBrowser();
tabPages[tabPages.length] = createPlayer();
tabPages[tabPages.length] = createHowTo();
for(var i = 0; i < tabPages.length; i++)
{
var button = document.createElement('div');
var text = document.createElement('div');
text.appendChild(document.createTextNode(tabPages[i].buttonTitle));
text.className = 'main_button_text';
button.appendChild(text);
divToButton(button, 'main_button_up', 'main_button_down', 'main_button_hl', 100, 22);
buttonCont.addContainer(button, 100);
tabPages[i].layerID = contentCont.addContainer(tabPages[i]);
tabs.addTab(button, tabPages[i].layerID);
}
tabs.selectTab(0);
}
function lineSlideMonitor(slideCnt, precisionSlider, capMan)
{
this.slideCnt = slideCnt;
this.capMan = capMan;
this.precisionSlider = precisionSlider;
this.lines = new Array();
this.searchNewLines = function(currPos)
{
var workingWidth = this.precisionSlider.sliderMax;
var halfTimeSpan = ((workingWidth/2)*app.cach.get('precisionSliderMillisecondsPerPixel'))/1000;
var minTime = (currPos - halfTimeSpan);
var maxTime = (currPos + halfTimeSpan);
var startingIndex = this.capMan.getCurrentCaption(minTime);
if (startingIndex == null)
{
startingIndex = 0;
}else
{
startingIndex++;
}
if (startingIndex < this.capMan.captions.length)
{
var currMaxTime = this.capMan.captions[startingIndex]['time'];
while (currMaxTime < maxTime)
{
this.addLine(startingIndex);
startingIndex++;
if (startingIndex == this.capMan.captions.length)
{
break;
}
currMaxTime = this.capMan.captions[startingIndex]['time'];
}
}
this.updateCurrentLines(minTime, maxTime, workingWidth);
}
this.updateCurrentLines = function(minTime, maxTime, workingWidth)
{
for(var i = 0; i < this.lines.length; i++)
{
if (this.lines[i] != null)
{
this.lines[i].updateSelf(minTime, maxTime, workingWidth);
}
}
}
this.addLine = function(index)
{
var freeLine = null;
for(var i = 0; i < this.lines.length; i++)
{
if (this.lines[i] == null)
{
if (freeLine == null)
{
freeLine = i;
}
}else
{
if (this.lines[i].lineIndex == index)
{
return;
}
}
}
if (freeLine == null)
{
freeLine = i;
}
this.lines[freeLine] = new captionLineSlider(this.slideCnt, this, index, this.capMan.captions[index]);
}
this.removeLine = function(index)
{
for(var i = 0; i < this.lines.length; i++)
{
if (this.lines[i] != null)
{
if (this.lines[i].lineIndex == index)
{
this.lines[i] = null;
}
}
}
}
this.clearLines = function()
{
for(var i = 0; i < this.lines.length; i++)
{
if (this.lines[i] != null)
{
this.lines[i].updateSelf(0, -1, 10);
}
}
}
}
function captionLineSlider(sliderLoc, slideMon, lineIndex, capLine)
{
this.sliderLoc = sliderLoc;
this.slideMon = slideMon;
this.lineIndex = lineIndex;
this.capLine = capLine;
this.pointerDiv = document.createElement('div');
this.pointerDiv.style['position'] = 'absolute';
this.pointerDiv.style['height'] = '20px';
this.pointerDiv.style['width'] = '20px';
this.sliderLoc.appendChild(this.pointerDiv);
this.pointerDiv.parent = this;
this.sliderInfo = document.createElement('div');
this.sliderInfo.style['height'] = '20px';
this.sliderInfo.style['width'] = '100px';
this.sliderInfo.style['top'] = '-24px';
this.sliderInfo.style['left'] = '5px';
this.sliderInfo.style['position'] = 'absolute';
this.sliderInfo.style['display'] = 'none';
var styler = document.createElement('span');
styler.className = 'player_media_popup_text';
this.labelText = document.createTextNode('test');
styler.appendChild(this.labelText);
this.sliderInfo.appendChild(styler);
this.pointerDiv.appendChild(this.sliderInfo);
this.draging = false;
this.pointerDiv.onmousedown = function(evnt)
{
if (isExplorer())
{
evnt = event;
}
if (!this.parent.slideMon.capMan.editMode)
{
app.getFunction('player', 'setPosition').run(this.parent.capLine['time']*1000+10);
return;
}
if (this.parent.slideMon.capMan.previousRenderedCap == this.parent.lineIndex && this.parent.slideMon.capMan.editing)
{
if (this.parent.mousemoveid != null)
{
app.docEvents.removeEvent('mousemove', this.parent.mousemoveid);
}
if (this.parent.mouseupid != null)
{
app.docEvents.removeEvent('mouseup', this.parent.mouseupid);
}
this.parent.mouseupid = app.docEvents.addEvent('mouseup', new objfn('mouseup', this));
this.parent.mousemoveid = app.docEvents.addEvent('mousemove', new objfn('mousemove', this));
this.parent.prevClientX = evnt.clientX;
this.parent.draging = true;
this.parent.sliderInfo.style['display'] = 'block';
this.parent.labelText.nodeValue = this.parent.slideMon.precisionSlider.posToTextFn.run(this.parent.currPixelPos);
return;
}
if (this.parent.slideMon.capMan.didEditorChangeLineCaptions())
{
alert('You are currently editing another line. Please save or cancel it before editing another.');
return;
}
this.parent.slideMon.capMan.setEditingLine(this.parent.lineIndex);
}
this.pointerDiv.mousemove = function(evnt)
{
if (!this.parent.draging) {return;}
if (isExplorer())
{
evnt = event;
}
var xChange = evnt.clientX - this.parent.prevClientX;
this.parent.prevClientX = evnt.clientX;
this.parent.currPixelPos = this.parent.currPixelPos + xChange;
var pixelPos = this.parent.currPixelPos.toString() + 'px';
if (this.style['left'] != pixelPos)
{
this.style['left'] = pixelPos;
}
this.parent.labelText.nodeValue = this.parent.slideMon.precisionSlider.posToTextFn.run(this.parent.currPixelPos);
}
this.pointerDiv.mouseup = function(evnt)
{
if (!this.parent.draging) {return;}
if (isExplorer())
{
evnt = event;
}
this.parent.draging = false;
if (this.parent.mousemoveid != null)
{
app.docEvents.removeEvent('mousemove', this.parent.mousemoveid);
}
if (this.parent.mouseupid != null)
{
app.docEvents.removeEvent('mouseup', this.parent.mouseupid);
}
this.parent.sliderInfo.style['display'] = 'none';
var timeText = this.parent.slideMon.precisionSlider.posToTextFn.run(this.parent.currPixelPos);
this.parent.slideMon.capMan.timeInput.value = timeText;
this.parent.slideMon.capMan.timeInput.onblur();
}
this.updateSelf = function(minTime, maxTime, workingWidth)
{
if (this.capLine['time'] < minTime || this.capLine['time'] > maxTime)
{
this.sliderLoc.removeChild(this.pointerDiv);
this.slideMon.removeLine(this.lineIndex);
return;
}
if (this.draging)
{
return;
}
var offSetTime = this.capLine['time'] - minTime;
maxTime = maxTime - minTime;
this.currPixelPos = Math.round((offSetTime/maxTime)*workingWidth);
var pixelPos = this.currPixelPos.toString() + 'px';
if (this.pointerDiv.style['left'] != pixelPos)
{
this.pointerDiv.style['left'] = pixelPos;
}
var className;
if (this.slideMon.capMan.previousRenderedCap == this.lineIndex)
{
className = 'player_media_slider_line_button_hl';
}else
{
className = 'player_media_slider_line_button';
}
if (this.pointerDiv.className != className)
{
this.pointerDiv.className = className;
}
}
}
function flashaudioplayer(playerLocation)
{
while(playerLocation.childNodes.length != 0)
{
playerLocation.removeChild(playerLocation.childNodes[0]);
}
this.flashObjectName = "FlashAudioPlayerIdentifier";
this.soundCompleteCBName = this.flashObjectName + "_complete_cb";
var parent = this;
window[this.soundCompleteCBName] = function()
{
parent.soundCompleteFlashCB();
}
if (isExplorer())
{
playerLocation.innerHTML = '';
}else
{
playerLocation.innerHTML = '