/* concord.js  
 * Bob Turner, Sept. 2002
 */

var user;
var domain;
var suffix;

function noSpam(user, domain, suffix) {
  document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
}

/* 
 function noRightClick() {
   if (event.button==2) {
     //alert('The right mouse button has been disabled.');
     javascript:info();
  }
}
document.onmousedown = noRightClick;
*/ 
var menu_speed = 20;     //lower the speed, smoother the menu will be
var menu_width = 150;    //stay above 100 else it will look cramped
var menu_height = 350;   //maybe shouldn't go above 400
var instant_close = 1;   //close as soon as user leaves menu, else 0
var total = 5;           //total number of menus you want to have

if (menu_speed > 20) {
  menu_speed = 20;
}

if (document.all) {
  doc = "document.all";
  sty = ".style";
  htm = ""
}
else if (document.layers) {
  doc = "document";
  sty = "";
  htm = ".document"
}

function positionLayers(num) {
  abcObj = eval(doc + '["Lyr"+num+""]'+ sty);
  abcObj.left = (menu_width * num) + 5;
  abcObj.top =-(menu_height - 35);
  abcObj.width = menu_width;
  abcObj.height = menu_height;
}

function pullitup(num) {
  abcObj = eval(doc + '["Lyr"+num+""]'+ sty);
  if (window.dropdown) {
    clearInterval(dropdown)
  }
  pullup = setInterval("uplift()",1)
}

function dropitdown(num) {
  closeothers(num);
  abcObj = eval(doc+'["Lyr"+num+""]'+ sty);
  if (window.pullup) {
    clearInterval(pullup)
  }
  dropdown = setInterval("downlift()",1)
}

function uplift() {
  var x_pos1 = parseInt(abcObj.top);
  if (x_pos1 >=-(menu_height-40)) {
    if (instant_close == 1) {
      abcObj.top =-(menu_height-35);
    }
    else if (instant_close == 0) {
      abcObj.top = x_pos1-menu_speed;
    }
  }
  else if (window.pullup) {
    clearInterval(pullup);
  }
}

function downlift() {
  var x_pos1 = parseInt(abcObj.top);
  if (x_pos1 < 0) {
    abcObj.top = x_pos1 + menu_speed;
  }
  else if (window.dropdown) {
    clearInterval(dropdown);
  }
}
 
function info() {
  alert("Written by:\n\n Bob Turner,\n Prince of Wales #29,\n Milton, NS\nContact: 902-634-4594\n © 2002 - 2009");
}
 
function NoGo() {
  alert("Not Published as yet\n\nWarrant not issued");
}
 
function start() {
  for (x = 0; x < total; x++) {
    positionLayers(x);
  }
}

function closeothers(num) {
  for (x = 0; x < total; x++) {
    if (x == num) {
      continue;
    }
    abcObj = eval(doc+'["Lyr"+x+""]' + sty);
    abcObj.top =-(menu_height-35);
  }
}

function PopIt(filename, h, w){  
        popup = window.open(filename,"popDialog","top="+20+",left="+260+",height="+470+",width="+500+",scrollbars=no")  
        if ( popup.document.close() ) {
                popup.document.close()
        }
}

var days=new Array(8);
days[1]="Sunday";
days[2]="Monday";
days[3]="Tuesday";
days[4]="Wednesday";
days[5]="Thursday";
days[6]="Friday";
days[7]="Saturday";

var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";

var dateObj=new Date(document.lastModified)
var wday=days[dateObj.getDay() + 1]
var lmonth=months[dateObj.getMonth() +1]
var date = dateObj.getDate()
var fyear=dateObj.getYear()

<!-- greeting script

 datetoday = new Date();
 timenow=datetoday.getTime();
 datetoday.setTime(timenow);
 thehour = datetoday.getHours();

 if (thehour >= 18) display = "Evening";
 else if (thehour >= 12) display = "Afternoon";
 else display = "Morning";

 var greeting = ("<b>" + "Good " + display + "!" + "</b>");

// end greeting script -->

function bookmarksite(title, url){
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "");
}

