<!--

window.defaultStatus = '';

var news_list=new Array();
var news_i=-1; var news_j=0;

function news_ticker()
{
  if (news_i < news_list[news_j][0].length)
  {
    news_i++;
    str = news_list[news_j][1] ? '<a href="'+news_list[news_j][1]+'">' : '';
    str += news_list[news_j][0].substr(0,news_i)+'_';
    str += news_list[news_j][1] ? '</a>' : '';
    changeContent('Ticker',str);
    setTimeout('news_ticker()',50)
    return;
  }
  news_i = -1;
  if (news_j<news_list.length-1) news_j++; else news_j=0;
  setTimeout('news_ticker()',5000)
}


dayName = new Array("", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")

var timerID = null
var timerRunning = false
function stopclock(){   
	if(timerRunning)      
		clearInterval(timerID)   
	
	timerRunning = false
}
function startclock(){   
	// Make sure the clock is stopped   
	stopclock()   
	timerID = setInterval("showtime()",1000)   
	timerRunning = true
}
function showtime(){
	var now = new Date() 
	var hours = now.getHours()   
	var minutes = now.getMinutes()   
	var seconds = now.getSeconds()   
	var timeValue = "" + ((hours > 12) ? hours - 12 : hours)   
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes   
	//timeValue += ((seconds < 10) ? ":0" : ":") + seconds   
	timeValue += (hours >= 12) ? "pm" : "am" 
	timeValue += " "
	
	var strDay;
	if ((now.getDate() == 1) || (now.getDate() != 11) && (now.getDate() % 10 == 1)) 		// Correction for 11th and 1st/21st/31st
		strDay = "st ";
	else if ((now.getDate() == 2) || (now.getDate() != 12) && (now.getDate() % 10 == 2)) 	// Correction for 12th and 2nd/22nd/32nd
		strDay = "nd ";
	else if ((now.getDate() == 3) || (now.getDate() != 13) && (now.getDate() % 10 == 3)) 	// Correction for 13th and 3rd/23rd/33rd
		strDay = "rd ";
	else
		strDay = "th ";
		   
	var dateValue = dayName[now.getDay()]+" "+
					now.getDate()+
					strDay+
					monName[now.getMonth()]+" "+
					now.getFullYear()+
					"  "
					  
	//document.clock.face.value = dateValue;
	document.getElementById('face').innerHTML = dateValue;

	
}

function changeContent(ele,val)
    {
    if (document.all) // IE4+
        {
        el = document.all[ele];
        if (typeof(el) != "undefined") el.innerHTML = val;
        }
    else if (document.getElementById) // DOM
        {
        rng = document.createRange();
        el = document.getElementById(ele);
        if ((el != null) && (typeof(el) != "undefined"))
            {
            rng.setStartBefore(el);
            htmlFrag = rng.createContextualFragment(val);
            while (el.hasChildNodes()) el.removeChild(el.lastChild);
            el.appendChild(htmlFrag);
            }
        }
    else if (document.layers) // NS4
        {
        el = document.layers[ele];
        if (typeof(el) != "undefined")
            {
            el.document.open();
            el.document.write(val);
            el.document.close();
            }
        }
    }

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_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_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];}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function confirmLink(data) { if (confirm(data)) return true; else return false; }

function popup(width,height,location,needscroll) {
    var options,top=(screen.availHeight-height)/2,left=(screen.availWidth-width)/2;
    options = "top="+top+",left="+left+",location=0,status=0,";
    options = options+"toolbar=0,menubar=0,directories=0,width=";
    if (width <= screen.availWidth) { options = options + width; }
        else { value = screen.availWidth-12; options = options + value; needscroll = true; }
    options = options + ",height=";
    if (height <= screen.availHeight) { options = options + height; }
        else { value = screen.availHeight-30; options = options + value; needscroll = true; }
    if (needscroll == true) { options = "scrollbars,resizable," + options; }
        else { options = "scrollbars=0,resizable=0," + options; }
    if (window.cwin) cwin.close();
    cwin=window.open(location,"",options);
    }


function imgPopup(width,height,location,description) {
    height+=40; width+=60;
    var options,top=(screen.availHeight-height)/2,left=(screen.availWidth-width)/2;
    popup=window.open("","Image","scrollbars=1,resizable=0,top="+top+",left="+left+",location=0,status=0,toolbar=0,menubar=0,directories=0,width="+width+",height="+height);
    popup.document.open();
    popup.document.write("<html><head><title>"+description+"</title></head><body marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" onload=\"window.focus();\"><div align=\"center\"><a href=\"javascript:window.close();\"><img src="+location+" border=\"0\" style=\"margin:20px;\" alt=\"Click image to close\" /></a></div></body></html>");
    popup.document.close();
    popup.focus();
    }

function picture(width,height,location,description) {
    var options,needscroll=false,top=(screen.availHeight-height)/2,left=(screen.availWidth-width)/2;
    options = "top="+top+",left="+left+",location=0,status=0,";
    options = options+"toolbar=0,menubar=0,directories=0,width=";
    if (width <= screen.availWidth) { options = options + width; }
        else { value = screen.availWidth-12; options = options + value; needscroll = true; }
    options = options + ",height=";
    if (height <= screen.availHeight) { options = options + height; }
        else { value = screen.availHeight-30; options = options + value; needscroll = true; }
    if (needscroll == true) { options = "scrollbars,resizable," + options; }
      else { options = "scrollbars=0,resizable=0," + options; }
    if (window.pici) pici.close();
    pici=window.open("","Picture",options);
    pici.document.open();
    pici.document.write("<html><head><title>"+description+"</title></head><body marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\" onload=\"window.focus();\"><a href=\"javascript:window.close();\"><img src="+location+" border=\"0\" hspace=\"0\" vspace=\"0\" alt=\"Click image to close\" /></a></body></html>");
    pici.document.close();
    }








function checkPassword(str,str2)
    {
    var isValid = true;
    var illegalChars = /[\W_]/; // allow only letters and numbers
    if (str == '') return 'Please enter a password';
    if (str2 != str) return 'Passwords do not match';
    if (str.length < 6) isValid = false;
    if (illegalChars.test(str)) isValid = false;
    if (!((str.search(/[a-z]+/i) != -1) && (str.search(/[0-9]+/) != -1))) isValid = false;
    if (isValid) return '';
    return 'Your password must be at least 6 characters and must contain a mixture of letters and numbers only';
    }




var dw_event = {

  add: function(obj, etype, fp, cap) {
    cap = cap || false;
    if (obj.addEventListener) obj.addEventListener(etype, fp, cap);
    else if (obj.attachEvent) obj.attachEvent("on" + etype, fp);
  },

  remove: function(obj, etype, fp, cap) {
    cap = cap || false;
    if (obj.removeEventListener) obj.removeEventListener(etype, fp, cap);
    else if (obj.detachEvent) obj.detachEvent("on" + etype, fp);
  },

  DOMit: function(e) {
    e = e? e: window.event;
    e.tgt = e.srcElement? e.srcElement: e.target;
    if (!e.preventDefault) e.preventDefault = function () { return false; }
    if (!e.stopPropagation) e.stopPropagation = function () { if (window.event) window.event.cancelBubble = true; }
    return e;
  }

}


var viewport = {
  getWinWidth: function () {
    this.width = 0;
    if (window.innerWidth) this.width = window.innerWidth - 18;
    else if (document.documentElement && document.documentElement.clientWidth)
        this.width = document.documentElement.clientWidth;
    else if (document.body && document.body.clientWidth)
        this.width = document.body.clientWidth;
  },

  getWinHeight: function () {
    this.height = 0;
    if (window.innerHeight) this.height = window.innerHeight - 18;
    else if (document.documentElement && document.documentElement.clientHeight)
        this.height = document.documentElement.clientHeight;
    else if (document.body && document.body.clientHeight)
        this.height = document.body.clientHeight;
  },

  getScrollX: function () {
    this.scrollX = 0;
    if (typeof window.pageXOffset == "number") this.scrollX = window.pageXOffset;
    else if (document.documentElement && document.documentElement.scrollLeft)
        this.scrollX = document.documentElement.scrollLeft;
    else if (document.body && document.body.scrollLeft)
        this.scrollX = document.body.scrollLeft;
    else if (window.scrollX) this.scrollX = window.scrollX;
  },

  getScrollY: function () {
    this.scrollY = 0;
    if (typeof window.pageYOffset == "number") this.scrollY = window.pageYOffset;
    else if (document.documentElement && document.documentElement.scrollTop)
        this.scrollY = document.documentElement.scrollTop;
    else if (document.body && document.body.scrollTop)
        this.scrollY = document.body.scrollTop;
    else if (window.scrollY) this.scrollY = window.scrollY;
  },

  getAll: function () {
    this.getWinWidth(); this.getWinHeight();
    this.getScrollX();  this.getScrollY();
  }

}


var Tooltip = {
    followMouse: true,
    offX: 8,
    offY: 12,
    showDelay: 100,
    hideDelay: 200,
    tipID:"tipDiv",
    ready:false,
    timer:null,
    tip:null,
    init:function(){
        if(document.createElement&&document.body&&typeof document.body.appendChild!="undefined")
            {
            if(!document.getElementById(this.tipID))
                {var el=document.createElement("DIV");el.id=this.tipID;document.body.appendChild(el);}
            this.ready=true;
            }
        },
    show:function(e,msg){
        if(this.timer) {clearTimeout(this.timer);this.timer=0;}
        this.tip=document.getElementById(this.tipID);
        if(this.followMouse)dw_event.add(document,"mousemove",this.trackMouse,true);
        this.writeTip("");
        this.writeTip(msg);
        viewport.getAll();
        this.positionTip(e);
        this.timer=setTimeout("Tooltip.toggleVis('"+this.tipID+"', 'visible')",this.showDelay);
        },
    hide:function(){
        if(this.timer) {clearTimeout(this.timer);this.timer=0;}
        this.timer=setTimeout("Tooltip.toggleVis('"+this.tipID+"', 'hidden')",this.hideDelay);
        if(this.followMouse)dw_event.remove(document,"mousemove",this.trackMouse,true);
        this.tip=null;
        },
    toggleVis:function(id,vis){
        var el=document.getElementById(id);if(el)el.style.visibility=vis;
        },
    writeTip:function(msg){
        if(this.tip&&typeof this.tip.innerHTML!="undefined")this.tip.innerHTML=msg;
        },
    positionTip:function(e){
        if(this.tip&&this.tip.style)
            {
            var x=e.pageX?e.pageX:e.clientX+viewport.scrollX;var y=e.pageY?e.pageY:e.clientY+viewport.scrollY;
            if(x+this.tip.offsetWidth+this.offX>viewport.width+viewport.scrollX)
                {x=x-this.tip.offsetWidth-this.offX;if(x<0)x=0;}
                else x=x+this.offX;
            if(y+this.tip.offsetHeight+this.offY>viewport.height+viewport.scrollY)
                {y=y-this.tip.offsetHeight-this.offY;if(y<viewport.scrollY)y=viewport.height+viewport.scrollY-this.tip.offsetHeight;}
                else y=y+this.offY;
            this.tip.style.left=x+"px";this.tip.style.top=y+"px";
            }
        },
    trackMouse:function(e){
        e=dw_event.DOMit(e);Tooltip.positionTip(e);
        }
    };

function over(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.show(e, msg);
}

function hide() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.hide();
}

//-->
