<!-- hide this script

/*****************************************************************************/
/*                                                                           */
/* Author:       Mark A. Cauchi for Contexsa                                 */
/* Date:         April, 2007                                                 */
/*                                                                           */
/* Designed and Developed by Contexsa                                        */
/*                                                                           */
/* Project Name: Zenco                                                       */
/* Program:      http://zenco.contexsa.com                                   */
/* File:                                                                     */
/* Function:     Zenco Web Site                                              */
/* Description:  Zenco Web Site                                              */
/*                                                                           */
/* Environment:  Apache v2.0 or later, Linux, UNIX Perl v5.6 or later, Mod   */
/*               Perl v2.0 & Emb Perl v2.0 or later                          */
/*                                                                           */
/* Notes:                                                                    */
/* Version:      1.0.0 - 04/2007 (MAC) First Release                         */
/*                                                                           */
/* Web:          www.contexsa.com                                            */
/* Email:        operations@contexsa.com                                     */
/* Tel:          +44 (0)845 226 0505                                         */
/*                                                                           */
/* Copyright (c) 2007 contexsa <operations@contexsa.com>. United Kingdom.    */
/* All rights reserved.                                                      */
/*                                                                           */
/*****************************************************************************/

// window popup function
function popup (mylink, windowName, windowAttributes) {

  if (! windowAttributes) {
    windowAttributes = 'top=10, left=10, width=800, height=600, menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no';
  }

  if (! window.focus) { 
    return true;
  }

  var href = false;

  if (typeof(mylink) == 'string') {
    href = mylink;
  } else {
    href = mylink.href;
  }

  window.open(href, windowName, windowAttributes);
  // return true;
} // End function popup (mylink, windowName, windowAttributes) 


// Returns the time in the format: HH:MM:SS AM/PM
function calctime () {
  var currenttime = new Date();                   // Sun Apr 15 07:50:28 UTC+0100 2007

  // Convert the time, to reflect your local time wherever you are - theoretically!
  // Note, these functions convert the date object into a string
  // currenttime = currenttime.toGMTString();
  currenttime = currenttime.toLocaleString();

  // So we need to convert it back into a date object
  currenttime = new Date(currenttime);
    // alert ('The time is: ' + currenttime);
  
  // Now split the time into it's constituent parts
  var hours = currenttime.getHours();
  var minutes = currenttime.getMinutes();
  var seconds = currenttime.getSeconds();
  var timesuffix = "AM";

  /* 
    // This shouldn't be needed anymore because of the code above, but I remain a little sceptical
    var timeZoneOffset = currenttime.getTimezoneOffset();
    alert ('The timezone is: ' + timeZoneOffset);

    //alert(hours);
    timeZoneOffset = (timeZoneOffset / 60); // timeZoneOffset is in minutes!

    // hours = timeZoneOffset + hours + 1; // summer
    // hours = timeZoneOffset + hours;		 // winter
    hours = hours + timeZoneOffset;		 // winter

    // alert(timeZoneOffset);
  */

  /*
  This figures out whether it is the afternoon
  if (hours > 11) {
    timesuffix = "PM";
    hours = hours - 12;
  }
  */

  if (hours == 0) {
    hours = 12;
  }

  if (hours < 10) {
    hours = "0" + hours;
  }

  if (minutes < 10) {
    minutes = "0" + minutes;
  }
 
  if (seconds < 10) {
    seconds = "0" + seconds;
  }
  
  var clocklocation = document.getElementById('digitalclock');
  // clocklocation.innerHTML = hours + ":" + minutes + ":" + seconds + " " + timesuffix;
  clocklocation.innerHTML = hours + ":" + minutes + ":" + seconds;
  
  setTimeout("calctime()", 1000);
} // End function calctime ()

// Returns the time in the format: HH:MM:SS AM/PM
function incrementSecond (stime) {
  alert('This is the hours: ' + stime);

  var hours = stime.getHours();
  alert('This is the hours: ' + hours);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// -->
