Mirage Audio Visual Media 

CLOX WebMaster ASC (Active Server Component) v.2.0

File Name:  WebClox2.dll

Description:  An active server component designed to work in 32bit ASP compatible environments such as Microsoft's Internet Information Server 4 or later. The component works in conjunction with a set of special clock graphic files to produce a rows of five analogue clocks showing the times in various time zones around the world. The clocks will appear on the vast majority of web browsers both old and new as no client-side scripting or special browser features or plug-ins are required.  The clocks are animated and in most browsers will keep time for about three minutes after the page is accessed.

Deployment: The DLL component must be installed in a server directory with 'execute' permission set (e.g. \cgi-bin\ or \scripts\) . Installation is complete after successfully running regsvr32.exe.  A typical command line to do this is as follows... 

	regsvr32.exe  f:\inetpub\wwwroot\cgi-bin\WebClox2.dll

If you don't have direct access to your web server, you should ask the system administrator to register the component onto the system. If the component isn't registered on the server, it will not work.

IMPORTANT: The server must have the following Microsoft system file installed.... MSVBVM50.DLL version 5.00.4319 or later. This file is supplied with the Visual Studio 5 Service Pack 2 or 3. If you have an older  version of this file, the component will not work properly. 

Additional Files:  The ASC works by referencing a series of clock image files.  These clock image files are most easily managed if placed in a specially created directory e.g. \clocks\ . All the files in the self extracting ZIP archive called CXG3.EXE should be expanded into this directory.

(TIP: If you are transferring the clock images by FTP... Note that most FTP clients can send multiple files with a single command. It should never be necessary to transfer the files one at a time, this would be very time consuming.)


Using the Preset Time Zones:

The preset  provides a quick and easy way to get the component working. It shows clocks for  the following selection of cities across the globe...  Seattle,  New York,  London,  Beijing  and  Canberra

This simple script should do the trick... (Copy and paste this rather than type it out again.)
_______________________________________________________

<html><body>
	<%@ EnableSessionState=False %>
	<%	
	Set CX = Server.CreateObject("MWC2.Clocks")
	CX.CP = "clocks"
	CX.SO = 0
	CX.RunWebCloxP
	%>
</body></html>
_______________________________________________________

Save the file as WcPreset.asp , upload it to your server and see it working in a web browser.

What does it all mean?

<%@ EnableSessionState=False %>
This line should appear in the body of your page above the main CLOX WebMaster script. This line, though not essential, will improve the performance of the script and keep the server overhead to a minimum. If however your page contains further ASP scripting which requires the use of the Active Server Session State Object, then you should omit this line.

Set CX = Server.CreateObject("MWC2.Clocks")
This line basically switches the component on, ready to receive its instructions.

CX.CP  = "clocks"  
This tells the component where to find the clock images.  This must be a subdirectory of the folder containing the script.  In this case, the clock directory is called clocks, as suggested above. However, if you have called your clock directory by another name, then replace the word clocks with that name.

CX.SO = 0 
The zero here refers to the server clock offset (in hours) from UTC (UTC is equivalent to GMT). If the server clock is synchronised to UTC then leave this setting at zero.  If the server clock is set to your local time zone, you should replace the zero with the server's UTC offset.  For example: If the server clock follows American/Canadian Eastern Time, the server offset is likely to be -5 (note the minus sign) hours in the winter and -4 hours during the summer (daylight saving time).  Another example would be Japan which is 9 hours ahead of UTC all year round. If your server is set on Japan time then you should replace the zero with a 9.

If you're not sure what the time zone on the server is, add the following line to your script... CX.RequestTime . The resulting page will tell you the time according to the server.

CX.RunWebCloxP
This function is intended to work while northern hemisphere countries are on standard time.  When it is summer in the northern hemisphere, you must use CX.RunWebCloxPD instead. (This does not apply if you are using custom time zones instead.)

Using Custom Time Zones:

The chances are that you will probably prefer to choose your own selection of time zones for your clocks rather than use the preset selection. This is easily done based on the following example...
_______________________________________________________

<html><body>	
	<%@ EnableSessionState=False %>

	<%	
	Set CX = Server.CreateObject("MWC2.Clocks")
	CX.CP = "clocks"
	CX.SO = 0
	CX.C1C = "PST"
	CX.C1O = -8
	CX.C2C = "EST"
	CX.C2O = -5
	CX.C3C = "GMT"
	CX.C3O = 0
	CX.C4C = "JAPAN"
	CX.C4O = 9
	CX.C5C = "SYDNEY"
	CX.C5O = 11
	CX.RunWebClox
	%>

</body></html>
_______________________________________________________

(You could call this file WcCustom.asp for testing purposes.)

CX.C1C = "PST"
This line represents the caption for the leftmost clock. Note that the caption must be enclosed in double-quotes.

CX.C5O = 11
This line represents the time zone offset for the rightmost clock (clock number 5 - with the caption "SYDNEY").   

Why 11? - "Surely Sydney, Australia is only 10 hours ahead of UTC!"
Sydney, Australia is 11 hours ahead of UTC for daylight saving during the Australian summertime which coincides with the wintertime in the northern hemisphere. From late March to late October, Sydney is on NSW standard time which is 10 hours ahead of UTC.  

You should note that the daylight saving time change dates cannot always be relied on. For instance, there is a strong possibility that in the year 2000, Sydney, Australia will change over to daylight saving time two months early - in August rather than in October, because of the Olympic Games. Mirage Audio Visual Media's CLOX 2000 software provides frequent updates about daylight saving time changes around the world. It is recommended that you use CLOX 2000 to keep track of different time zones. See the web site at http://www.mirage1.u-net.com/clox.htm .

This script lets you to enter virtually any caption and time zone you choose for each of the five clocks. You simply set the parameters by entering the captions and the corresponding time zone offsets for each clock.


Offsets must be integers (whole numbers) in the range '-12 hours to +13 hours'.  If you want to set a zone with a x:30 minute offset e.g. for India (UTC+5:30), you can set the clock 3 offset to 5 (CX.C3O = 5) and add the following line to the script... 

CX.C3H = 1 

This command adds half an hour to the offset for clock 3.  So in this case the offset will be +51/2 hours. Note that this function only works for clocks 3 and 4.

Remember that you may need to alter the script slightly at different times of the year if the time zones you have chosen are subject to daylight saving time changes. If you don't do this, some or all of your clocks could be wrong by an hour or more.  Fortunately, it is unlikely that you will need to make changes more than two or three times in a year. 


Putting the Clocks on a Web Page:

The script examples above simply contain the clocks and nothing else.  You can include the clocks just about anywhere and on any kind of web page.  All you need to do is place the script inside your HTML file at the point where you want the clocks to appear.

Remember that your HTML file must be saved with a .asp extension not .htm or .html.  

Your finished .asp file should be laid out like this...
_______________________________________________________
<html>
<head>
	= ANY HTML HEADERS GO HERE =
</head>
<body>
	<%@ EnableSessionState=False %>

	= ANY HTML BEFORE THE CLOCKS GOES HERE =

	<%	
	Set CX = Server.CreateObject("MWC2.Clocks")

	= THE WEBCLOX PARAMETERS GO HERE =

	CX.RunWebClox
	%>

	= ANY HTML AFTER THE CLOCKS GOES HERE =

</body>
</html>
_______________________________________________________

The ASP scripts will only work on a web server. If you view your .asp page in a web browser from a standard local disk directory you won't see any clocks.  All you will see is the script you have typed.  If you are designing pages, and you don't have access to a fully fledged IIS4 system, you can use Microsoft's Personal Web Server (PWS) instead.  Another way to deal with this is to substitute the CLOX WebMaster script with an image file.  A GIF file called examplec.gif is available for this very purpose.  It can be used to simulate the position of the clocks while designing your HTML layout. You can temporarily hide the script from your browser by enclosing it in HTML comment tags, like this...

	<!--  script can be hidden in here -->  

Just below this, insert the dummy clocks image like this...  

	<img src="examplec.gif" border=0>

This simulates the exact size and position of the real clocks as they will appear on your working page. When you are ready to publish your page on the server, remove the comment tags from before and after the script, and delete this line.




Getting Fancy:

The clocks can be placed inside tables, layers, frames and 'center' tags, in fact you can place them just about anywhere you could position an ordinary single image on your page. Simply put the main block of script in that position.

The clock captions automatically adopt the default text colour of your page or style sheet, however, it is possible to alter the colour of each caption individually.  To put a caption in red, you could modify the script like this...  

	CX.C3C = "<font color=#ff0000>PARIS</font>"

Note that double-quotes are not used in the font-color tag.

You could also change the font-size and use bold or italic tags in a similar manner.

If you want to change the background behind the clocks in relation to the rest of the page, all you need to do is place the script inside a table and set the 'background' or 'bgcolor' property. For example:

for a blue background...

	<table bgcolor="#0000ff" border=0><tr><td>
	= THE WEBCLOX SCRIPT GOES IN HERE =
 	</td></tr></table>

for an image/textured background with a border...

	<table background="an_image.gif" border=2><tr><td>
	= THE WEBCLOX SCRIPT GOES IN HERE =
	<td></tr></table>


If you need to display more clocks on one page, you can simply repeat the main body of the code with different parameters to get another row of clocks below the first.  However, you should note that the more clocks you display, the longer it will take for your page to load-up or refresh.

The image file cloxstop.gif  which reads ("clocks stopped") can be added to your clock page to indicate to users when the clocks have stopped. The image is invisible at first, appearing when the clocks have stopped. 

Licensing Agreement:

a. The CLOX Webmaster Active Server Component and its associated files are not free.  If you have been provided with these items for evaluation purposes, you may use them for a period of not more than ten days.  After which you must either pay the registration fee for the product or refrain completely any further use.

b. This file containing the licence agreement must always accompany the software if you distribute the package to other users.

c.  A registration is required for each web page for which the software will be used. If the web page appears on the internet, the URL of the page must be supplied to Mirage Audio Visual Media. Registration details must not be disclosed to any unauthorised third party. Web-page based clocks are hyperlinked to the CLOX web site. Registered users can, if preferred, disable this hyperlink but only on pages showing not more than five clocks.

d. Registration is not transferable without the prior permission of Mirage Audio Visual Media.

e. In addition to the server-based component, registered users may install the dll component and associated files on a separate machine for page development purposes. 

f. You will not attempt to plagiarize, disassemble, discompile or modify the software or associated files in any way. The copying and modification of the script illustrations provided is of course excepted to facilitate the proper use of the software.

g. This software, including all associated files and information are provided 'as is' and neither the author nor his agents will be held responsible for loss or damage of any nature arising either directly or indirectly as a result of any use or misuse. No warranty of any kind is given relating to the accuracy or suitability of this software or associated information for any particular purpose.

h. In the event of a dispute all parties will submit to the jurisdiction of the courts of law of the United Kingdom of Great Britain and Northern Ireland.

i. In any event, the liability of the author or his agent will not exceed either (at their discretion) a replacement of the product or refund of the original purchase price.

j. By using this software or any associated file you agree to be bound by the above conditions.



Other Information:

This package may be freely distributed as is.

Web Site http://www.mirage1.u-net.com/webclox.htm
Or http://www.page-1.com/webclox.asp

Email Support: ian@mirage1.u-net.com



Copyright (c)1998  Ian Tragen, Mirage Audio Visual Media.
