
today           = new Date
thisYear        = today.getFullYear() 

function menuON(slot)   { slot.className='menuitemON';  }
function menuOFF(slot)  { slot.className='menuitemOFF';    }

function popup(url) {
    var winl = (screen.width - 600) / 2;
    var wint = (screen.height - 600) / 2;
    var condition="top=" +wint+ ",left=" + winl + ",width=780,height=600,directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=yes,status=no"
    window.open(url, "Popup2", condition);
}                                                           
function popup2(url) {
    var winl = 10;
    var wint = 10;
    var condition="top=" +wint+ ",left=" + winl + ",width=500,height=380,directories=no,toolbar=no,resizable=no,menubar=no,scrollbars=no,status=no"
    window.open(url, "Popup2", condition);
}    
function checksize(source, outImage, maxWidth, maxHeight){
    var globalPic;
    globalPic=new Image();
    globalPic.src=source;   
    var field=document.getElementById(outImage);
    var x=parseInt(globalPic.width);
    var y=parseInt(globalPic.height); 
    if (x>maxWidth) {
      y*=maxWidth/x;
      x=maxWidth;
    }
    if (y>maxHeight) {
      x*=maxHeight/y;
      y=maxHeight;
    }
    field.style.display=(x<1 || y<1)?"none":"";
    field.width=x;
    field.height=y;
}

function winclose() {    can = window.self;    can.opener = window.self;    can.close();}
    
function dw_swapImgRestore() { //v3.0
      var i,x,a=document.dw_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
function dw_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.dw_p) d.dw_p=new Array();
        var i,j=d.dw_p.length,a=dw_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.dw_p[j]=new Image; d.dw_p[j++].src=a[i];}}
    }
    
function dw_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=dw_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
function dw_swapImage() { //v3.0
      var i,j=0,x,a=dw_swapImage.arguments; document.dw_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=dw_findObj(a[i]))!=null){document.dw_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    } 

function refreshpic(id, outImage){ 
    var field=document.getElementById(outImage);
    field.src=id.value;
}

function refreshpic2(id2, outImage2){ 
    var field2=document.getElementById(outImage2);
    field2.src=id2;
}

function refreshpic3(source, outImage, maxWidth, maxHeight){    
    var frame=document.getElementById(outImage);    
    frame.src=source; 
    var newPic=new Image();
    newPic.src=source;   
    var x=parseInt(newPic.width);
    var y=parseInt(newPic.height); 
    if (x>maxWidth) {
      y*=maxWidth/x;
      x=maxWidth;
    }
    if (y>maxHeight) {
      x*=maxHeight/y;
      y=maxHeight;
    } 
    frame.style.display=(x<1 || y<1)?"none":"";
    frame.width=x;
    frame.height=y; 
    
}

function clearbox(bob) {
    bob.value = ""
}
//clock in status bar.
    function statustime()
    {
        var days = ["Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur"]
        var d = new Date();
        var h = d.getHours();
        var m = d.getMinutes();
        var s = d.getSeconds();
        var y = d.getYear();
        var n = d.getMonth();
        var a = d.getDate();
        var w = d.getDay();
        var ampm = (h >= 12)?"PM":"AM";
        n += 1;
        if (h > 12) h -= 12;
        if (h == 0) h = 12;
        if (m < 10) m = "0" + m;
        if (n < 10) n = "0" + n;
        if (s < 10) s = "0" + s;
        var t = days[w] + 'day    ' + a + '/' + n + '/' + y + '    ' + h + ':' + m + ':' + s + '  ' + ampm + ':    An excellent time to sign up for Distance learning courses, crystal healing, anatomy & physiology, colour therapy, Reiki training';
        defaultStatus = t;
        setTimeout("statustime()", 1000);
    }
        setTimeout("statustime()", 1000);

function dw_tabswitch() { 
  var i,p,v,q,obj,args=dw_tabswitch.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=dw_findObj(args[i]))!=null) { v=args[i+2]; q=args[i+3];
    if (obj.style) 
        { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v;  q=(q=='vis')?'static':(q=='invis')?'absolute':q;  }
        obj.visibility=v; obj.position=q;
    }
}

function dw_tabswitch2() { 
  var i,p,v,d,obj,args=dw_tabswitch2.arguments;
  for (i=0; i<(args.length-2); i+=3) 
    if ((obj=dw_findObj(args[i]))!=null){v=args[i+1]; d=args[i+2];obj=obj.style;obj.visibility=v;obj.display=d;}
}
    
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Sorry, right clicking is not allowed.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;

//shadow
var depth = 6 // in pixels

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {

var a = document.all ? document.all : document.getElementsByTagName('*');
    for (var i = 0;i < a.length;i++) {
        if (a[i].className == "shadow") {
            for (x = 0;x < depth;x++) {
                var newSd = document.createElement("DIV")
                newSd.className = "shadow2"
                newSd.style.background = a[i].id
                newSd.style.width = a[i].offsetWidth + "px"
                newSd.style.height = a[i].offsetHeight + "px"
                newSd.style.left = a[i].offsetLeft + x + "px"
                newSd.style.top = a[i].offsetTop + x + "px"
                document.body.appendChild(newSd)
                }
            }
        }
    }
)

function dw_bgswitch(id,col) { 
    var mitem = document.getElementById(id);
    mitem.style.backgroundColor = col;
}

function runslideshow(){
       if (document.all){
          document.images.SlideShow1.style.filter="blendTrans(duration=2)"
          document.images.SlideShow1.filters.blendTrans.Apply() 
       }
       document.images.SlideShow1.src = preLoad1[j1].src
       if (document.all){
          document.images.SlideShow1.filters.blendTrans.Play()
       }
       j1 = j1 + 1
       if (j1 > (p1-1)) j1=0
       t = setTimeout('runslideshow()', slideShowSpeed)
      changeImage()
    }
function changeImage()
    {
         SlideShow1.src = preLoad1[j1].src;
    }
function runslideshow2(){
       if (document.all){
          document.images.SlideShow2.style.filter="blendTrans(duration=2)"
          document.images.SlideShow2.filters.blendTrans.Apply() 
       }
       document.images.SlideShow2.src = preLoad2[j2].src
       if (document.all){
          document.images.SlideShow2.filters.blendTrans.Play()
       }
       j2 = j2 + 1
       if (j2 > (p2-1)) j2=0
       t2 = setTimeout('runslideshow2()', slideShowSpeed2)
      changeImage2()
    }
function changeImage2()
    {
         SlideShow2.src = preLoad2[j2].src;
    }

