//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // instantiate object var vidmail = new VideoMail(); //////////////////////////////////////////////////////////////////////////////// // F U N C T I O N S /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //// videomail object function VideoMail() { var vm; // progress and status for installer var status; var progress; var progbar; var metersize = 300; var timeout = undefined; // special tokens var uname = 'rstolley@chorus.net'; var passwd = '1078257'; var classid = 'CLSID:87587503-20f0-4ff5-8da3-011ec4c03fdc'; var launcher = 'http://videomail.tds.net/vm/vmdata/download/1032-TDS/vmLauncher.cab#Version=1,0,2,14'; var partner = '103295Xkz9'; var minisite = 'http://videomail.tds.net/tds//index.jsp'; ////////////////////////////////////////////////// // METHODS /////////////////////////////////////// ////////////////////////////////////////////////// ////////////////////////////////////////////////// // install ActiveX object function init() { var div; var obj; // check for installer widgets if (document.getElementById('vidmail_status')) { status = document.getElementById('vidmail_status').firstChild; progress = document.getElementById('vidmail_progress'); progbar = document.getElementById('vidmail_progbar'); } // check for static object try { vm = vidmail_activex; vm.setPartner(partner); } catch(e) { // no problem vm = undefined; } // attempt to load object dynamically if (!vm) { // create div to hide object div = document.createElement('div'); div.style.width = '0px'; div.style.height = '0px'; div.style.top = '0px'; div.style.left = '0px'; div.style.position = 'absolute'; div.style.visibility = 'hidden'; // create object obj = document.createElement('object'); obj.setAttribute('id', 'vidmail_activex'); div.appendChild(obj); obj.uiMode = 'none'; obj.classid = classid; obj.URL = launcher; document.body.appendChild(div); vm = vidmail_activex; vm.setPartner(partner); } } ////////////////////////////////////////////////// // start videomail client this.start = function(close) { // check for other applications running if (vm.confirmLaunch()) { // launch videomail vm.run(uname, passwd); } // close window if requested if (close) { window.close(); } } ////////////////////////////////////////////////// // main videomail link action this.main = function(setup) { try { urchinTracker('/clicktracking/video_mail'); } catch(e) { // ignore the error } try { init(); } catch(e) { // don't even try for non-Microsoft browsers if (!navigator.appName || !navigator.appName.match(/Microsoft/)) { openwin2('/videomail/requirements.php', 'error', 450, 300); } else if (setup) { document.location.href = '/videomail/requirements.php'; } else { openwin('/videomail/setup.php', 'vidmail_setup', 700, 500); } vm = undefined; return; } switch (vm.checkInstall()) { case -1: // return help desk code openwin2('/error.php?class=vib?msg=500', 'error', 450, 300); break; case 0: // open window for mini-site if (setup) { document.location.href = minisite; } else { openwin(minisite, 'vibemini', 700, 500); } break; case 1: // launch this.start(false); break; case 2: // open window for installer openwin2('/videomail/install.php', 'vibeinstall', 700, 500); break; } return false; } ////////////////////////////////////////////////// // install/upgrade videomail client this.install = function() { try { init(); } catch(e) { document.location.href = '/videomail/requirements.php'; vm = undefined; return; } // doublecheck the installation if (vm.checkInstall() == 1) { this.start(true); return; } // we're providing the install screens vm.setShowInstallScreens(false); if (vm.doInstall2() != 1) { // return help desk code document.location.href = '/error.php?class=vib?msg=501'; return; } // start checking install status timeout = setTimeout('vidmail.update()', 400); } ////////////////////////////////////////////////// // cancel installation this.cancel = function() { clearInterval(timeout); vm.cancelInstall(); window.close(); return false; } ////////////////////////////////////////////////// // check install status this.update = function() { var code; var complete; // check on installation switch (vm.getInstallState()) { case 0: // installer not running if ((code = vm.getInstallStatus()) == 1) { // installation complete this.start(true); return; } else { // installation failed document.location.href = ('/error.php?class=vib&msg=' + code); return; } case 1: // downloading status.nodeValue = 'Downloading files...'; complete = vm.getDownloadPercentComplete(); progress.width = parseInt(complete * metersize / 100) progbar.width = (metersize - progress.width) break; case 2: // installing status.nodeValue = 'Installing TDS Video Mail...'; progress.width = metersize; progbar.width = 0 break; } // check again later timeout = setTimeout('vidmail.update()', 100); } ////////////////////////////////////////////////// } //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////