function tcInit() {
	RegisterListeners()
	timedCount()
}

function timedCount()
{
	showCurrentTime()
	t=setTimeout("timedCount()",1000);
}

function showCurrentTime()
{
	var timeScale = document.movie1.GetTimeScale(); 
	var duration = document.movie1.GetDuration();
	var dString = timeValueToTimeString(duration,timeScale);
	document.getElementById("durationDiv").innerHTML = dString;

	var timeNow = document.movie1.GetTime();
	var nowString;
	if(document.movie1) {
		nowString = timeValueToTimeString(timeNow,timeScale);
	} else {
		nowString = "00:00:00:00";	
	}			
	document.getElementById("timeDiv").innerHTML = nowString;
	document.form1.currentTimeHiddenField.value = (nowString + '.000/600'); 
}         

function timeValueToTimeString(value, scale) 
{
        var days = parseInt((value / scale) / 86400);
	var hours = parseInt((value / scale) / 3600);
	var minutes = parseInt((value / scale) / 60);
        var seconds = parseInt((value  / scale) - (minutes * 60) );
        var timestring = pad(days,2) + ':' + pad(hours,2) + ':' + pad(minutes,2) + ':' + pad(seconds,2);
	return timestring;
}


function setFileNameAfterUpload() {
	alert('test');
}

function myAddListener(obj, evt, handler, captures)
        {
        if ( document.addEventListener )
            obj.addEventListener(evt, handler, captures);
        else
            // IE
            obj.attachEvent('on' + evt, handler);
       }
 
   /* define functions that register each listener */
    function RegisterListener(eventName, objID, embedID, listenerFcn)
    {
        var obj = document.getElementById(objID);
        if ( !obj )
            obj = document.getElementById(embedID);
        if ( obj )
            myAddListener(obj, eventName, listenerFcn, false);
    }
 
    /* define a single function that registers all listeners to call onload */
    function RegisterListeners()
    {
       RegisterListener('qt_timechanged', 'ArchiveMovie1_embed', 'ArchiveMovie1_embed', showCurrentTime);
	}

function pad(number,length) {
    var str = '' + number;
    while (str.length < length)
        str = '0' + str;
    return str;
}


function newLinkFormWindow() {

	newLinkWindow = window.open(null,"newLinkWindow","status=no,toolbar=no,location=no,scrollbars=no,menubar=no,resizable=no,width=300,titlebar=no,height=100");
	

	newLinkWindow.focus();
	newLinkWindow.document.title = "New Link";
	newLinkWindow.document.write('<html><body id=myBody></body></html>'); 
	 newLinkWindow.document.write('<div id=textrow>Text: </div>');
		var linkTextTextField = document.createElement('input');
		linkTextTextField.setAttribute('type','text');
		linkTextTextField.setAttribute('id','field'+9);
		linkTextTextField.setAttribute('name','field'+9);
		linkTextTextField.onclick=function(){ addTextField('field'+9); }
		newLinkWindow.document.getElementById('textrow').appendChild(linkTextTextField);
		linkTextTextField.focus();	
	newLinkWindow.document.write('<div id=urlrow>URL: </div>');
	 var linkURLTextField = document.createElement('input');
                linkURLTextField.setAttribute('type','text');
                linkURLTextField.setAttribute('id','field'+9);
                linkURLTextField.setAttribute('name','field'+9);
                linkURLTextField.onclick=function(){ addTextField('field'+9); }
                newLinkWindow.document.getElementById('urlrow').appendChild(linkURLTextField);
	newLinkWindow.document.write('<div id=newlinkoptions></div>');
	var newLinkCancelButton = document.createElement('input');
	newLinkCancelButton.setAttribute('type','button');
	newLinkCancelButton.setAttribute('id','cancelbutton');
	newLinkCancelButton.setAttribute('name','cancelbutton');
	newLinkCancelButton.onclick=function(){ closeWindow(newLinkWindow); }
	newLinkCancelButton.value = "Cancel";
	newLinkWindow.document.getElementById('newlinkoptions').appendChild(newLinkCancelButton);

	var newLinkSubmitButton = document.createElement('input');
        newLinkSubmitButton.setAttribute('type','button');
        newLinkSubmitButton.setAttribute('id','cancelbutton');
        newLinkSubmitButton.setAttribute('name','cancelbutton');
        newLinkSubmitButton.value = "Link";
        newLinkWindow.document.getElementById('newlinkoptions').appendChild(newLinkSubmitButton);
}


function closeWindow(aWindow) {
	aWindow.close();
}


function ManageTabPanelDisplay() {
var idlist = new Array('tab1focus','tab2focus','tab3focus','tab4focus','tab5focus','tab1ready','tab2ready','tab3ready','tab4ready','tab5ready','content1','content2','content3','content4','content5');

// No other customizations are necessary.
if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
   var block = false;
   for(var ii = 0; ii < arguments.length; ii++) {
      if(idlist[i] == arguments[ii]) {
         block = true;
         break;
         }
      }
   if(block) { document.getElementById(idlist[i]).style.display = "block"; }
   else { document.getElementById(idlist[i]).style.display = "none"; }
   }
}

