//////////////////////////////////////////////////////////////
//
//  Earth Clock Gadget Version 1.0.1 2008/12
//  Written by CadWizard  2008 all rights reserved.
//  cadwizardx@hotmail.com
//
//  Version 1.0.1 Small bug fix causing input textbox from functioning
//
//  Based on the Vista  Orb Clock available on the
//  Microsoft Gadget Galley  with a new spin added.
//  My Earth Clock has a rotating background written using Flash
//  Actionscript 3.0 , creating the illusion of the earth rotating
//  around an axis. The clock comes with 16 (or so) built in themes
//  including a rotating eight ball and a smiley face as well as a
//  space station. With a little Javascript, XML and image knowldge
//  themes can easily be added. Has all of the features of other
//  clock gadgets, including setting the time zone for each instance
//  seperate from your local time settings. You can assign each instance
//  it's own unique name and use a different theme for each.
//
//  Vista  Orb Clock available on the Microsoft Gadget Galley  at
//  http://vista.gallery.microsoft.com/vista/SideBar.aspx?mkt=en-us
//  Some code modified from sample code available on MSDN at
//  http://msdn.microsoft.com/en-us/library/aa965850(VS.85).aspx
//  Vista , SideBar , Gadget Galley  and Sidebar Gadget  are all
//  registered trademarks of Microsoft Corporation.
//  Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
//  Microsoft Corporation can not be held liable for the use of this
//  application.
//
//  All images created using Adobe  Fireworks CS3  licensed by
//  Adobe Systems Incorporated.
//  All Flash animations and dialogs created using Adobe  Flash CS3 
//  licensed by Adobe Systems Incorporated.
//  Core application code written in Adobe  Actionscript 3.0  for Flash 
//  licensed by Adobe Systems Incorporated.
//  Adobe , Flash , Firworks , CS3  and Actionscript 
//  are all registered trademarks of  Adobe Systems Incorporated.
//  Copyright (c) 2007 Adobe Systems Incorporated.  All rights reserved.
//
//  To add more themes you must recreate an image coresponding to each
//  of the images for each theme. They are : 
//  (where [themename] is the name of your theme)
//  
//  [themename].png
//  [themename]_bkg6.png
//  [themename]_bkg7.png
//  [themename]_bkg8.png
//  [themename]_bkg9.png
//  [themename]_bkg10.png
//  [themename]_bkg11.png
//  [themename]_bkg12.png
//  [themename]_bkg13.png
//  [themename]_bkg14.png
//  [themename]_bkg15.png
//  [themename]_bkg16.png
//  [themename]_bkg17.png
//  [themename]_bkg18.png
//  [themename]_set.png
//
//  NOTE : 100px high is the standard image height for the main image,
//  smaller sizes can be used but the results become unpredictable because flash controls
//  the rotating background and the clock, but javascript and the gadget control the backgrounds
//  for better rendering.
//
//  To create the main image ([themename].png), it must have a size of width = 2 * height,
//  so an image 100px high should be 200px wide. 
//  Then this image must be duplicated and placed side by side in an image twice as wide as
//  your base image so that you end up with and image that is width = 4 * height, so now 
//  you have an image 400px X 100px. Be sure to make the transition between the two images
//  blend together smoothly. Any noticeable seams will reflect in the generated rotating image.
//
//  The images with the [themename]_bkg#.png create the moving shadow effect of the gadget.
//  These images should be 130px X 130px.
//  Between the hours 06:00 and 18:00, on the hour, the background switches to a new image
//  where the shadow has been slightly offset from it's previous position, giving the illusion
//  of the suns position throughout the day. These images also provide a 2px ring around the
//  clock to compensate for the gadget transparent color not blending well with the flash glow
//  effect being applied to the clock wich is part of the 3D illusion of the clock.
//  Even if you don't wish to have the moving shadow effect these images are still necessary
//  or you will have a magenta ring around your clock.
//  The background images included with the gadget are un-flattened Fireworks PNG's that you can
//  freely edit to accommodate your own themes.
//
//  The image with the [themename]_set.png is for the settings dialog preview window, just copy a 100px
//  circle selection from your main image and paste it into to the un-flattened "blank_set.png" file
//  I included with the gadget. Paste it just above the background path, so the highlight paths
//  will give it the 3D effect, then save a copy with your themename replacing the word "blank".
//  Flattening the new copy first will make the theme images load faster in the settings dialog.
//
//  Next, you will need to add the theme to the "themes.xml" document at the root of this gadget folder.
//  First, change the 'count' field on the main themes node to reflect the addition of the new theme.
//  It will not show up otherwise, the 'count' field can be lower than the number of defined themes but,
//  never higher, this will cause an error and the gadget will not function at all.
//  Add the info for id, display, bkgglow & hands fields. The 'id' field is the name used as a prefix for your
//  theme images ([themename].png). The 'display' field is how it will be displayed in the settings dialog
//  and can be any text string 25 characters or less, including spaces. The 'bkgglow' is a hexadecimal
//  number in the format and range of '0x000000' to '0xFFFFFF', the number should be a medium color of the
//  most prominant color in your main image, experiment to find the best color value, or just use a 
//  light to medium grey for neutrality. The 'hands' field is for the color of the hands, the valid values
//  are 'whitenorm', 'blacknorm', 'whitesml' & 'blacksml'.
//
//  That's pretty much it, themes can be re-ordered or removed by editing the "themes.xml" document directly.
//  In fact some may have noticed that the "themes.xml" document contains one more theme than the count reflects.
//  Increasing the 'count' field by one will make this hidden theme appear in the settings dialog.
//
//  To edit the un-flattened Fireworks PNG's you will need Adobe Fireworks CS3 or better to preserve the paths.
//  
//  Thank you, and I hope you enjoy my little spin on the "Orb Clock Gadget".
//
//  CadWizard
//  cadwizardx@hotmail.com
//  Larry Williams
//  San Bernardino, CA.
//
//