home *** CD-ROM | disk | FTP | other *** search
/ DOKAN 21 / DOKAN21.iso / Extra / wmtools.exe / RCDATA / CABINET / showmult.asp < prev    next >
Text File  |  1998-11-20  |  17KB  |  468 lines

  1. <%@ LANGUAGE="javascript" %>
  2. <% Response.Expires = 0 %>
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  6. <TITLE>
  7.     Windows Media Presenter
  8. </TITLE>
  9. </HEAD>
  10. <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0>
  11. <SCRIPT Langauge="JavaScript">
  12. <!--
  13.     // Init values for browser detect.
  14.     bName = navigator.appName;
  15.     bVer = parseInt(navigator.appVersion);
  16.     if      (bName == "Netscape" && bVer >= 4) br = "n4";
  17.     else if (bName == "Netscape" && bVer == 3) br = "n3";
  18.     else if (bName == "Microsoft Internet Explorer" && bVer >= 4) br = "e4";
  19.     else if (bName == "Microsoft Internet Explorer") br = "e3";
  20.     else br = "n2";
  21. // -->
  22. </SCRIPT>
  23. <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%" BGCOLOR="#000000">
  24.     <TR><TD ALIGN=LEFT VALIGN=TOP><IMG SRC="images/tbleft.gif" BORDER=0 WIDTH=291 HEIGHT=19 ALT="-"></TD></TR>
  25. </TABLE>
  26. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
  27.     <TR><TD ALIGN=LEFT VALIGN=TOP><IMG SRC="images/logo.gif" BORDER=0 ALT="Windows Media Presenter" WIDTH=270 HEIGHT=43></TD><TD ALIGN=RIGHT VALIGN=TOP><IMG SRC="images/topright.gif" BORDER=0 ALT="-" WIDTH=608 HEIGHT=57></TD></TR>
  28. </TABLE>
  29. <BR>
  30. <BLOCKQUOTE>
  31.     <TABLE BORDER="0">
  32.         <TR>
  33.             <TD>
  34.                 <FONT FACE="verdana, arial, helvetica" SIZE="2">
  35.                     Today's Event:  
  36.                 </FONT>
  37.             </TD>
  38.             <TD>
  39.                 <FONT FACE="verdana, arial, helvetica" SIZE="2">
  40.                     <B><% = Application("EVENT_TITLE") %></B>
  41.                 </FONT>
  42.             </TD>
  43.         </TR>
  44.         <TR>
  45.             <TD>
  46.                 <FONT FACE="verdana, arial, helvetica" SIZE="2">
  47.                     Start Time:
  48.                 </FONT>
  49.             </TD>
  50.             <TD>
  51.                 <FONT FACE="verdana, arial, helvetica" SIZE="2">
  52.                     <B>
  53.                         <SCRIPT LANGUAGE="JavaScript">
  54.                         <!--
  55.                             // This script takes the UTC SHOW_TIME value and writes it to the screen in the users local time.  It supports all time zones.
  56.                             // Init display Date
  57.                             var showDisplayDate = new Date("<%= Application("SHOW_TIME") %>");
  58.                             
  59.                             // Find Time Zone Offset and adjust
  60.                             var offsetDate = new Date(0);
  61.                             var offset = (offsetDate.getTimezoneOffset() / 60);
  62.                             showDisplayDate.setHours(showDisplayDate.getHours() - offset);
  63.                         
  64.                             // Break down date values for display
  65.                             var year = showDisplayDate.getYear();
  66.                             var month = showDisplayDate.getMonth();
  67.                             var day = showDisplayDate.getDate();
  68.                             var hours = showDisplayDate.getHours();
  69.                             var minutes = showDisplayDate.getMinutes();
  70.                             var zerobuffer = "";
  71.                             var ntbuffer = "19";
  72.                             var nandd = "temp";
  73.                             
  74.                             // sets the zero buffer
  75.                             if (minutes <= "9")
  76.                                 {
  77.                                     zerobuffer = "0"
  78.                                 }
  79.                         
  80.                             // sets the ntbuffer
  81.                             var yearstring = year.toString();
  82.                             var ntbuffertemp = yearstring.indexOf("20", 0);
  83.                             if (ntbuffertemp != "-1")
  84.                                 {
  85.                                     ntbuffer = ""
  86.                                 }
  87.                         
  88.                             //sets am or pm
  89.                             if (hours <= 11)
  90.                                 {
  91.                                     nandd = "am"
  92.                                 }
  93.                                 else if (hours >= 12)
  94.                                 {
  95.                                     nandd = "pm"
  96.                                 }
  97.                         
  98.                             // gets rid of military time
  99.                             if (hours > 12)
  100.                                 {
  101.                                     hours = (hours - 12)
  102.                                 }
  103.                         
  104.                             // Writes final values to screen
  105.                             var monthname;
  106.                                 if (month == 0) monthname = "January";
  107.                                 if (month == 1) monthname = "February";
  108.                                 if (month == 2) monthname = "March";
  109.                                 if (month == 3) monthname = "April";
  110.                                 if (month == 4) monthname = "May";
  111.                                 if (month == 5) monthname = "June";
  112.                                 if (month == 6) monthname = "July";
  113.                                 if (month == 7) monthname = "August";
  114.                                 if (month == 8) monthname = "September";
  115.                                 if (month == 9) monthname = "October";
  116.                                 if (month == 10) monthname = "November";
  117.                                 if (month == 11) monthname = "December";
  118.                             document.write(hours + ":" + zerobuffer + minutes + " " + nandd + " on " + monthname + " " + day + ", " + ntbuffer +  year + "</font><BR>")
  119.                         // -->
  120.                         </SCRIPT>
  121.                     </B>
  122.                 </FONT>
  123.             </TD>
  124.         </TR>
  125.     </TABLE>
  126. </BLOCKQUOTE>
  127. <HR WIDTH="85%">
  128. <BLOCKQUOTE>
  129. <FONT FACE="verdana, arial, helvetica" SIZE="2">
  130. <SCRIPT Language="JavaScript">
  131. <!--
  132.     // Check Global Event Variables for common errors
  133.     // Check for invalid Dates
  134.     var sdate = new Date("<%= Application("SHOW_TIME") %>");
  135.     var edate = new Date("<%= Application("SHOW_END_TIME") %>");
  136.  
  137.     var errorDetect0
  138.     var errorDetect1
  139.  
  140.     var invalidDate
  141.     var conflictDate
  142.     var invalidMult
  143.     var errorNum = 0
  144.     
  145.     if ((sdate == "NaN") || (sdate == "Invalid Date") || (edate == "NaN") || (edate == "Invalid Date") || ("<%= Application("SHOW_TIME") %>" == "<%= Application("SHOW_END_TIME") %>"))
  146.         {
  147.             errorDetect0 = "True"
  148.             invalidDate = "True"
  149.         }
  150.     // Check for conflicting Begin and End Times
  151.     var startMilli = Date.parse(sdate);
  152.     var endMilli = Date.parse(edate);
  153.     if (startMilli > endMilli) 
  154.         {
  155.             errorDetect1 = "True"
  156.             conflictDate = "True"
  157.         }
  158.         
  159.     if (errorDetect0 == "True")
  160.         {
  161.             errorNum++
  162.         }
  163.     if (errorDetect1 == "True")
  164.         {
  165.             errorNum++
  166.         }
  167. // -->
  168. </SCRIPT>
  169. <SCRIPT language="javascript">
  170. <!--
  171. // Write Out Any Error Messages
  172.     if(errorNum >= 1)
  173.         {
  174.             if (errorNum >=2)
  175.                 {
  176.                     document.write("Errors have been detected in the current configuration of Presenter.  The following errors need to be repaired before Presenter will work correctly:");
  177.                 }
  178.             else
  179.                 {
  180.                     document.write("An error has been detected in the current configuration of Presenter.  The following error needs to be repaired before Presenter will work correctly:");
  181.                 }
  182.             document.write('<UL>');
  183.             if (errorDetect0 == "True")
  184.                 {
  185.                     document.write('<LI>The SHOW_TIME or SHOW_END_TIME for this event are not valid dates.');
  186.                 }
  187.             if (errorDetect1 == "True")
  188.                 {
  189.                     document.write('<LI>The SHOW_TIME and SHOW_END_TIME dates conflict.');
  190.                 }
  191.             document.write('</UL>');
  192.  
  193.             var adminName = "<%= Application("ADMIN_NAME") %>"
  194.             var adminEmail = "<%= Application("ADMIN_EMAIL") %>"
  195.             if (adminName == "" && adminEmail == "")
  196.                 {
  197.                     document.write('Please contact your event administrator for more information.')
  198.                 }
  199.             else if (adminName != "" && adminEmail != "")
  200.                 {
  201.                     document.write('Please contact <A href="mailto:' + adminEmail + '">' + adminName + '</A> for information on how to adjust these settings.')
  202.                 }
  203.             else if (adminEmail != "" && adminName == "")
  204.                 {
  205.                     document.write('Please contact <A href="mailto:' + adminEmail + '">the event administrator</A> for information on how to adjust these settings.')
  206.                 }
  207.             else if (adminEmail == "" && adminName != "")
  208.                 {
  209.                     document.write('Please contact ' + adminName + ' for information on how to adjust these settings.')
  210.                 }
  211.         }
  212. // End Write Out Any Error Messages
  213. // -->
  214. </SCRIPT>
  215. </FONT>
  216. </BLOCKQUOTE>
  217.  
  218. <SCRIPT Langauge="JavaScript">
  219. <!--
  220.     // Write out the appropriate messages on the screen depending on which browser the client is using and if Windows Media Player is installed.
  221.     if ((br == "e4") && (errorNum == 0))
  222.         {
  223.             document.write('<BLOCKQUOTE><FONT FACE="verdana, arial, helvetica" SIZE="2">As you wait for the presentation to start, Windows Media Player is automatically loading the required software components and presentation slides.<BR></FONT></BLOCKQUOTE>');
  224.             document.write('<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><IMG SRC="images/bfiller.gif" BORDER=0 WIDTH=266 HEIGHT=173 ALT="Graphic">    </TD><TD><OBJECT ID="lblClock" WIDTH=400 HEIGHT=50 CLASSID="CLSID:40F07A91-8E6F-11D0-8A0A-00A0C90C9B67" CODEBASE="<% = Application("MCSIControls") %>"><PARAM NAME="ForeColor" VALUE="0"><PARAM NAME="BackColor" VALUE="2385975"><PARAM NAME="Alignment" VALUE="3"><PARAM NAME="Appearance" VALUE="0"><PARAM NAME="BackStyle" VALUE="0"><PARAM NAME="Text" VALUE=""><PARAM NAME="Angle" VALUE="0"><PARAM NAME="BorderStyle" VALUE="2"><PARAM NAME="FontName" VALUE="Arial"><PARAM NAME="FontSize" VALUE="14"><PARAM NAME="FontBold" VALUE="0"><PARAM NAME="FontItalic" VALUE="0"><PARAM NAME="FontUnderline" VALUE="0"><PARAM NAME="FontStrikethrough" VALUE="0"><PARAM NAME="FontCharset" VALUE="0"></OBJECT></TD></TR></TABLE>');
  225.         }
  226.     else if ((br == "n4") && (errorNum == 0))
  227.         {
  228.             if (navigator.mimeTypes["application/asx"])
  229.                 {
  230.                     document.write('<BLOCKQUOTE>The Windows Media Player is already installed on this machine.<BR>  Thank you for using the Windows Media Player.  Enjoy the Presentation.')
  231.                 }
  232.             else
  233.                 {
  234.                     document.write('<BLOCKQUOTE>You currently do not have not the Windows Media Player installed.  Please follow these steps:<BR><OL><LI>Download <A HREF="<%= Application("NS_PLAY") %>">nsfull.exe</A>.<LI>Exit from Netscape Navigator.<LI>Double click on nsplay.exe to install the Windows Media Player.<LI>You may be asked to restart your computer.<LI>Restart Netscape Navigator and return to this page.</OL>')
  235.                 }
  236.             document.write('</BLOCKQUOTE><table border="0"><TR><TD><IMG SRC="images/bfiller.gif" BORDER=0 WIDTH=266 HEIGHT=173 ALT="Graphic"></TD><TD>');
  237.             document.write('<APPLET CODE="Clbl.class" NAME="ColorLabel" ALIGN="MIDDLE" HEIGHT="30" WIDTH="400" HSPACE="0" VSPACE="0">');
  238.             document.write('<param name=Caption value="">');
  239.             document.write('<param name=Foreground value="0">');
  240.             document.write('<param name=Background value="16777215">');
  241.             document.write('<param name=FontStyle value=1>');
  242.             document.write('<param name=FontSize value=16>');
  243.             document.write('<param name=XCoord value=10>');
  244.             document.write('<param name=YCoord value=20>');
  245.             document.write('</applet>');
  246.             document.write('</TD></TR></TABLE>');
  247.         }
  248. // -->
  249. </SCRIPT>
  250. <SCRIPT Language="JavaScript">
  251. <!--
  252.     var startTimeTimerTemp = new Date("<%= Application("SHOW_TIME") %>");
  253.     var startMilliTemp = Date.parse(startTimeTimerTemp);
  254.     var theCurrentTimeTemp = new Date();
  255.     var currentMilliTemp = Date.parse(theCurrentTimeTemp);
  256.     if (currentMilliTemp <= startMilliTemp)
  257.         {
  258.             document.write('<OBJECT ID="LoadNSPlayer" BORDER=0 WIDTH=0 HEIGHT=0 CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" CODEBASE="<%= Application("NS_CORE") %>"></OBJECT>');
  259.             document.write('<OBJECT ID="TimerCtl1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:1A12C811-9001-11D0-8A0B-00A0C90C9B67" CODEBASE="<% = Application("MCSIControls") %>"></OBJECT>');
  260.         }
  261. // -->
  262. </script>
  263. <SCRIPT Langauge="JavaScript">
  264. <!--
  265. function errortrap(){
  266.     return true;
  267.     }
  268. // -->
  269. </SCRIPT>
  270. <SCRIPT Langauge="JavaScript">
  271. <!--
  272.     function TimeToShow()
  273.         {
  274.             // The current time, show time, and end time
  275.             var theCurrentTime = new Date();
  276.             var showTimeTimer = new Date("<%= Application("SHOW_TIME") %>");
  277.             var endTimeTimer = new Date("<%= Application("SHOW_END_TIME") %>");
  278.  
  279.             // offset times
  280.             showTimeTimer.setHours(showTimeTimer.getHours() - offset);
  281.             endTimeTimer.setHours(endTimeTimer.getHours() - offset);
  282.  
  283.             // The current time, show time, and end time in milliseconds
  284.             var currentMilli = Date.parse(theCurrentTime);
  285.             var startMilli = Date.parse("<%= Application("SHOW_TIME") %>");
  286.             var endMilli = Date.parse("<%= Application("SHOW_END_TIME") %>");
  287.             
  288.             // Time left before presentation
  289.             var timeLeft = (showTimeTimer.getTime() - theCurrentTime.getTime());
  290.             
  291.             var timer_killtimer = false
  292.  
  293.             // General Time Checking
  294.             if (timeLeft <= 0)  // The show has started or has ended
  295.                 {
  296.                     if (theCurrentTime.getTime() > endTimeTimer.getTime())
  297.                         {
  298.                             str = "The presentation has ended.";
  299.                             window.status = "The presentation has ended."
  300.                             timer_killtimer = true;
  301.                         }
  302.                     if (theCurrentTime.getTime() < endTimeTimer.getTime())
  303.                         {
  304.                             str = "The presentation is in session.";
  305.                             top.location.href = "first/default.asp";
  306.                             timer_killtimer = true;
  307.                         }
  308.                 }
  309.                 else  //continue counting down the timer
  310.                 {
  311.                     varSecondMilli = 1000;
  312.                     varMinuteMilli = varSecondMilli * 60;
  313.                     varHourMilli = varMinuteMilli * 60;
  314.                     varDayMilli = varHourMilli * 24;
  315.                 
  316.                     varDays = Math.floor(timeLeft / varDayMilli);
  317.                     timeLeft -= varDays * varDayMilli;
  318.                     varHours = Math.floor(timeLeft / varHourMilli);
  319.                     timeLeft -= varHours * varHourMilli;
  320.                     varMins = Math.floor(timeLeft / varMinuteMilli);
  321.                     timeLeft -= varMins * varMinuteMilli;
  322.                     varSecs = Math.floor(timeLeft / varSecondMilli);
  323.                     str = "Presentation will begin in " +
  324.                             (varDays > 0 ? ("" + varDays + " days, ") : "") +
  325.                             (varHours < 10 ? "0" : "") + varHours +
  326.                             (varMins < 10 ? ":0" : ":") + varMins +
  327.                             (varSecs < 10 ? ":0" : ":") + varSecs;
  328.                 }
  329.                 // Rewrite timer label
  330.                 if ((br == "e4") || (br == "e3"))
  331.                     {
  332.                         lblClock.Text = str;
  333.                     }
  334.                 else if ((br == "n3") || (br == "n4"))
  335.                     {
  336.                         document.ColorLabel.setCaption(str);
  337.                     }
  338.                 
  339.                 // check if the timer needs killed
  340.                 if (timer_killtimer == false)
  341.                     {
  342.                         timer_timerID = setTimeout('TimeToShow()',1000);
  343.                     }
  344.                 return true;
  345.             }
  346. // -->
  347. </SCRIPT>
  348. <SCRIPT Langauge="JavaScript">
  349. <!--
  350.     if (errorNum == 0)
  351.         {
  352.             TimeToShow();
  353.         }
  354. // -->
  355. </SCRIPT>
  356. <SCRIPT Langauge="JavaScript">
  357. <!--
  358.     var multtemp = "<%= Application("MULTICAST") %>";
  359.     multtemp = multtemp.toLowerCase();
  360.     if (multtemp == "true")
  361.         {
  362.             document.write('<OBJECT ID="LoadFTS" BORDER=0 WIDTH=0 HEIGHT=0 CLASSID="CLSID:26F24A93-1DA2-11D0-A334-00AA004A5FC5" CODEBASE="<%= Application("NS_FILE") %>"></OBJECT>');
  363.         }
  364. // -->
  365. </SCRIPT>
  366. <SCRIPT LANGUAGE="VBScript">
  367.     Dim bSlidesDownloaded
  368.     bSlidesDownloaded = False
  369.     Dim iNumSlidesDownloaded
  370.     iNumSlidesDownloaded = 0
  371.  
  372.         Sub CheckControls            
  373.             On Error Resume Next
  374.             If LoadNSPlayer is Nothing Then
  375.                 MsgBox "Error:  Unable to load the Windows Media Player control. " + _
  376.                        " ", 0, "Windows Media Player Error"
  377.                 PLAYER_LOADED = False
  378.             Else
  379.                 PLAYER_LOADED = True
  380.             End If
  381.            
  382.             If LoadFTS is Nothing Then
  383.                 MsgBox "Error:  Unable to load the Windows Media File Transfer control." + _
  384.                        " ", 0, "Windows Media File Transfer Control Error"
  385.                 FTS_LOADED = False
  386.             Else
  387.                 FTS_LOADED = True
  388.             End If
  389.         
  390.             ' Wait until all objects are loaded.
  391.             If (FTS_LOADED = True) Then
  392.                 LoadSlides()
  393.             End If
  394.         End Sub
  395.  
  396.         Sub LoadSlides()
  397.         On Error Resume Next
  398.         Call LoadFTS.FtsRegisterStatusCallback(0, 0, 4096, 1, 0, 0, 0, 0, 0, 4+8+16+32+64, 0)
  399.         If LoadFTS.FtsStartFileTransferReceive("<%= Application("VS_FTS_IP") %>", "<%= Application("VS_FTS_PORT") %>", "", "", 0, 17409) Then 
  400.             MsgBox "Start Error = " & ReturnError(StartError)
  401.             Else
  402.             window.status = "Waiting for file transfer..."
  403.             End If
  404.         End Sub
  405.  
  406.         Sub LoadFTS_FtsOnTransferStarted
  407.             window.status = "Starting transfer..."
  408.         End Sub
  409.         
  410.         Sub LoadFTS_FtsOnFileTransferStarted
  411.         window.status = "Receiving slide from " & LoadFTS.CurrentFilePath
  412.         End Sub
  413.  
  414.         Sub LoadFTS_FtsOnFileTransferCompleted
  415.         window.status = "Transfer complete."
  416.         End Sub
  417.  
  418.     Sub LoadFTS_FtsOnTransferCompleted    
  419.         If bSlidesDownloaded = True Then
  420.             iNumSlidesDownloaded = LoadFTS.NumFilesTransferred
  421.             Call KillDownloadSession
  422.         Else
  423.             bSlidesDownloaded = True
  424.         End If
  425.     End Sub
  426.  
  427.     Sub LoadFTS_FtsOnStatusChanged
  428.         Cancelled = (LoadFTS.TransferStatus = 5) and (LoadFTS.Result = -2147467260)
  429.             If Cancelled Then 
  430.                 window.status = "Slide Transfer Completed." & iNumSlidesDownloaded & " Slides Transfered."
  431.             End If
  432.     End Sub
  433.  
  434.     Sub KillDownloadSession
  435.         TimerCtl1.Interval=500
  436.         TimerCtl1.Start    
  437.     End Sub
  438.  
  439.     Sub TimerCtl1_Timer
  440.         Call KillTimer
  441.     End Sub
  442.  
  443.     Sub KillTimer
  444.         TimerCtl1.Stop
  445.     End Sub
  446.  
  447.     Sub KillFts
  448.         On Error Resume Next
  449.         Call LoadFTS.FtsCancelFileTransferReceive
  450.         Call LoadFTS.FtsRevokeStatusCallback(0, 0, 4096, 1, 0, 0, 0, 0, 0, 4+8+16+32+64)
  451.     End Sub
  452.     
  453.     Sub Window_onunLoad()
  454.         On Error Resume Next
  455.         Call LoadFTS.FtsCancelFileTransferReceive
  456.         Call LoadFTS.FtsRevokeStatusCallback(0, 0, 4096, 1, 0, 0, 0, 0, 0, 4+8+16+32+64)
  457.     End Sub
  458. </SCRIPT>
  459. <SCRIPT Langauge="JavaScript">
  460. <!--
  461.     if ((errorNum == 0) && (currentMilliTemp <= startMilliTemp))
  462.         {
  463.             CheckControls();
  464.         }
  465. // -->
  466. </SCRIPT>
  467. </BODY>
  468. </HTML>