var _client = 'old';
var browser=navigator.appName;
var ver=parseInt(navigator.appVersion);
if (ver >= 3) _client="ok";
if (browser == "Microsoft Internet Explorer") _client='ie';
function popup(url,w,h) {
// Start of modification by RFHL on 6-JAN-2004 last modif helmut 4221 substrings + _
   winame=url
   while (winame.substr(winame.length-1,1)=="/") {
   		winame=winame.substr(0,winame.length-1);
   }
   winame = winame.substring( ("/" + winame).lastIndexOf("/"));
   if (winame.lastIndexOf(".")>=0) {
	   	winame=winame.substr(0,winame.lastIndexOf("."));
   }
   winame = winame.substring( ("." + winame).lastIndexOf("."));
   winame = winame.substring( ("-" + winame).lastIndexOf("-"));
   winame = winame.substring( ("_" + winame).lastIndexOf("_"));
   winame = winame.substring( ("+" + winame).lastIndexOf("+"));
   winame = winame.substring( ("#" + winame).lastIndexOf("#"));
   title = winame;
// End of modification by RFHL on 6-JAN-2004
   if (_client == "ok") {
  		winparams = 'toolbar=1,location=1,left=5,top=5,directories=0,status=1,menubar=0,resizable=1,scrollbars=1,width='+ w + ',height=' + h  ;
		winame = open(url,winame,winparams);
		history.go(url);
		document.close();
		winame.focus();
   }
   if (_client == "ie") {
	  	baseurl = location.href;
	  	winparams = 'toolbar=1,location=1,left=5,top=5,directories=0,status=1,menubar=0,resizable=1,scrollbars=1,width=' + w + ',height=' + h  ;
	  	winame = open(url,winame,winparams);
	  	document.close();
	  	if  (ver > 3) {winame.focus()}
   }
   if (_client == "old") {
		baseurl = location.href;
		winparams = 'toolbar=1,location=1,left=5,top=5,directories=0,status=1,menubar=0,resizable=1,scrollbars=1,width=' + w + ',height=' + h ;
		winame = open(url,winame,winparams);
		document.close();
   } 
}

//4203Helmut: <!-- CLOCK ON...   coded by Squint@flash.net

/*
 *  Permission for the use of this script is hereby granted
 *  for non-commercial uses, with the condition that this notice
 *  is left intacted. No commercial entity may use this script
 *  in any form without explicit permission.
 *  
 *  No warranty is expressed or implied.
 *  
 *  Please give credit where due.
 *  
 *    Squint@flash.net
 */

var number  = new Array(10);
var am, pm, now, hour;

//  These are the sizes of your images; 
//  COLWIDTH is the width of the separator image
var WIDTH   = 20; 
var HEIGHT    = 30;
var COLWIDTH  =  9;
var ZOOM    =  1;

WIDTH   *= ZOOM;  
HEIGHT    *= ZOOM;
COLWIDTH  *= ZOOM;


function init() { // preload all number images
  for (i=0;i<10;i++) {
    number[i]     = new Image(WIDTH,HEIGHT);
    number[i].src = '../images/clockimg/' + 'n' + i + '.gif';
  }
//  am  = new Image();
//  pm  = new Image();
//  am.src = '../images/clockimg/am.gif';
//  pm.src = '../images/clockimg/pm.gif';
}

function clockUpdate() {  // method of Clock
  now     = new Date();
  hour    = now.getHours();
//  amPm    = hour<12 ? 'am' : 'pm';
//  hour    = hour == 0 || hour == 12 ? 12 : hour % 12 ;
//    uncomment the above for a 12 hour clock
  this.timeStr  =  ((hour - (-100))+'').substring(1);
  this.timeStr  += ((now.getMinutes() - (-100))+'').substring(1);
  this.timeStr  += ((now.getSeconds() - (-100))+'').substring(1);
}

function clockRepaint() {  // method of Clock
  for (i=0;i<this.length;i++) {
    var num = parseInt(this.timeStr.substring(i,i+1));
    if ( num != this.curTime[i] ) {
      this.curTime[i]     = num;
      this.digit[i].image.src = number[num].src;
    }
  }
//  this.amPm.image.src = eval(amPm + '.src');
}

function Clock(length) {
  this.length   = length;
  this.digit    = new Array(length);
  this.curTime  = new Array(length);
  this.timeStr  = "";
  for (i=0;i<length;i++) {
    this.digit[i] = new NumberImg(WIDTH,HEIGHT,'n0.gif');
    this.curTime[i] = 0;
    this.timerStr   += '0' ;    
    if ( i%2 == 1 && i!=(length-1) ) // Odd number and not last
      new NumberImg(COLWIDTH,HEIGHT,'col.gif');
  }
//  this.amPm   = new NumberImg(WIDTH,HEIGHT,'am.gif');
  this.update   = clockUpdate;
  this.repaint  = clockRepaint;
}

function NumberImg(x,y,img) {
  document.write('<IMG SRC="../images/clockimg/'+img+'" WIDTH="'+x+'" HEIGHT="'+y+'" BORDER="0">') ;
  this.image    = document.images[document.images.length-1];
}

function updateAllClocks() {
  clock.update();
  clock.repaint();
  setTimeout('updateAllClocks();',1000);
}



