<!--

icon_page                = new Image(14,16);
icon_page.src            = "/images/icon_page_14x16.gif";
icon_page_s              = new Image(14,16);
icon_page_s.src          = "/images/icon_page_14x16s.gif";

icon_page_first          = new Image(14,16);
icon_page_first.src      = "/images/icon_page_first_14x16.gif";
icon_page_first_s        = new Image(14,16);
icon_page_first_s.src    = "/images/icon_page_first_14x16s.gif";

icon_page_previous       = new Image(14,16);
icon_page_previous.src   = "/images/icon_page_previous_14x16.gif";
icon_page_previous_s     = new Image(14,16);
icon_page_previous_s.src = "/images/icon_page_previous_14x16s.gif";

icon_page_next           = new Image(14,16);
icon_page_next.src       = "/images/icon_page_next_14x16.gif";
icon_page_next_s         = new Image(14,16);
icon_page_next_s.src     = "/images/icon_page_next_14x16s.gif";

icon_page_last           = new Image(14,16);
icon_page_last.src       = "/images/icon_page_last_14x16.gif";
icon_page_last_s         = new Image(14,16);
icon_page_last_s.src     = "/images/icon_page_last_14x16s.gif";

icon_magnifier_1x        = new Image(15,19);
icon_magnifier_1x.src    = "/images/icon_magnifier_1x_15x19.gif";
icon_magnifier_1xs       = new Image(15,19);
icon_magnifier_1xs.src   = "/images/icon_magnifier_1x_15x19s.gif";

icon_magnifier_2x        = new Image(15,19);
icon_magnifier_2x.src    = "/images/icon_magnifier_2x_15x19.gif";
icon_magnifier_2xs       = new Image(15,19);
icon_magnifier_2xs.src   = "/images/icon_magnifier_2x_15x19s.gif";

icon_magnifier_3x        = new Image(15,19);
icon_magnifier_3x.src    = "/images/icon_magnifier_3x_15x19.gif";
icon_magnifier_3xs       = new Image(15,19);
icon_magnifier_3xs.src   = "/images/icon_magnifier_3x_15x19s.gif";

icon_magnifier_4x        = new Image(15,19);
icon_magnifier_4x.src    = "/images/icon_magnifier_4x_15x19.gif";
icon_magnifier_4xs       = new Image(15,19);
icon_magnifier_4xs.src   = "/images/icon_magnifier_4x_15x19s.gif";

icon_print               = new Image(14,16);
icon_print.src           = "/images/icon_print_14x16.gif";
icon_print_s             = new Image(14,16);
icon_print_s.src         = "/images/icon_print_14x16s.gif";

// ---------------------------------------------------------------------------------------
// magnifier
// ---------------------------------------------------------------------------------------

function magnifier(m,s,o) {
  document.all[o].style.height = m * s + "px";
}

// ---------------------------------------------------------------------------------------
// image on mouse over + on mouse out
// ---------------------------------------------------------------------------------------

function img_over_out(img_target,img_source) {
  img_target.src = img_source.src;
}

function letter_over_out(img_target,img_source) {
  img_target.src = img_source;
}

// ---------------------------------------------------------------------------------------
// window status for floating objects
// ---------------------------------------------------------------------------------------

function window_status(fname) {
  if (fname == "") {
    window.status = "";
  } else {
    window.status = "http://www.ctalmada.pt" + fname;
  }
}

// ---------------------------------------------------------------------------------------
// subscribe + unsubscribe
// ---------------------------------------------------------------------------------------

function onfocus_email() {
   if (document.subscribe.form_email.value == "indique e-mail") {
     document.subscribe.form_email.value = "";
   } 
}

function onblur_email() {
   if (document.subscribe.form_email.value == "") {
     document.subscribe.form_email.value = "indique e-mail";
   }
}

// ---------------------------------------------------------------------------------------
// highlight table cells
// ---------------------------------------------------------------------------------------

var bg_change_original;

function bg_change(highlightcolor) {
  source = event.srcElement;
  if (source.tagName == "TR" || source.tagName == "TABLE") {
    return;
  }
  while (source.tagName != "TD") {
    source = source.parentElement;
  }
  if (source.style.backgroundColor != highlightcolor && source.id != "ignore") {
    bg_change_original = source.style.backgroundColor;
    source.style.backgroundColor = highlightcolor;
  }
}

function bg_change_back() {
  if (event.fromElement.contains(event.toElement) || source.contains(event.toElement) || source.id == "ignore") {
    return;
  }
  if (event.toElement != source) {
    source.style.backgroundColor = bg_change_original;
  }
}

// ---------------------------------------------------------------------------------------
// floating picture
// ---------------------------------------------------------------------------------------

function float_picture(window_title,fname,x,y) {
  var pos_x = (screen.width - x) / 2;
  var pos_y = (screen.height - y) / 2 - 20;
  var win_x = x + 30;
  var win_y = y + 30;

  var win_features = "menubar=no,scrollbars=no,resizable=no,status=no,width=" + win_x + ",height=" + win_y + ",left=" + pos_x + ",top=" + pos_y;
  msgWindow=window.open("","",win_features);

  msgWindow.document.write("<HTML>");
  msgWindow.document.write("<HEAD>");
  msgWindow.document.write("<TITLE>" + window_title + "</TITLE>");
  msgWindow.document.write("</HEAD>");
  msgWindow.document.write("<BODY BGCOLOR=#FFFFFF>");

  msgWindow.document.write("<CENTER>");
  msgWindow.document.write("<IMG ALT='" + window_title + "' SRC='" + fname + "' WIDTH=" + x + " HEIGHT=" + y + ">");
  msgWindow.document.write("</CENTER>");

  msgWindow.document.write("</BODY>");
  msgWindow.document.write("</HTML>");
}

// ---------------------------------------------------------------------------------------
// floating hires
// ---------------------------------------------------------------------------------------

function float_hires(fname) {
  var w;
  var h;
  var monitor = screen.width;
  fname = "http://www.ctalmada.pt" + fname;
  if (monitor == "640") {
    w =  540;
    h =  380;
  } else if (monitor == "800") {
    w =  640;
    h =  480;
  } else if (monitor == "1024") {
    w =  800;
    h =  600;
  } else if (monitor == "1152") {
    w =  800;
    h =  600;
  } else if (monitor == "1280") {
    w =  800;
    h =  600;
  } else if (monitor == "1281") {
    w =  800;
    h =  600;
  } else if (monitor == "1400") {
    w =  800;
    h =  600;
  } else if (monitor == "1440") {
    w =  800;
    h =  600;
  } else if (monitor == "1600") {
    w = 1024;
    h = 1078;
  } else if (monitor == "1680") {
    w = 1024;
    h = 768;
  } else if (monitor == "1920") {
    w = 1280;
    h = 1024;
  } else if (monitor == "2048") {
    w = 1280;
    h = 1024;
  } else if (monitor == "2560") {
    w = 1280;
    h = 1024;
  } else {
    w =  640;
    h =  480;
  }

  h += 50;


  var pos_x = (screen.width - w) / 2 - 10;
  var pos_y = (screen.height - h) / 2 - 20;

  var win_features = "menubar=no,scrollbars=yes,resizable=no,status=no,width=" + w + ",height=" + h + ",left=" + pos_x + ",top=" + pos_y;

  w -= 50;

  msgWindow = window.open("","",win_features);

  msgWindow.document.write("<HTML>");
  msgWindow.document.write("<HEAD>");
  msgWindow.document.write("<TITLE>" + fname + "</TITLE>");
  msgWindow.document.write("</HEAD>");
  msgWindow.document.write("<BODY BGCOLOR=#FFFFFF>");

  msgWindow.document.write("<CENTER>");
  msgWindow.document.write("<IMG SRC='" + fname + "' WIDTH='" + w + "'>");
  msgWindow.document.write("<BR CLEAR=ALL>");
  msgWindow.document.write("<FONT FACE='Arial','Helvetica','sans-serif' SIZE=-2><FONT COLOR=#FF0000><B>warning:</B></FONT> do not print this cover from your browser. save it to your hard disc, then print it.</FONT>");
  msgWindow.document.write("</CENTER>");

  msgWindow.document.write("</BODY>");
  msgWindow.document.write("</HTML>");

  // Here is a more detailed explanation of what to do. go to your RUN window from the start menu. 1. type in "regsvr32 msscript.ocx" and hit enter 2. do the same with dispex.dll, and vbscript.dll 3. open windows explorer, select folder options in the tools drop down. 4. select the file types tab 5. scroll down to the extension type JS, highlight it and hit the advanced button 6. highlight the Open command and hit the edit button. If you have more than one "Open" command showing (which was part of my problem)delete one of them. 7. In the field "application used to perform action" paste in this - C:\WINNT\System32\WScript.exe "%1" %* your done.
}

// ---------------------------------------------------------------------------------------
// high-res images
// ---------------------------------------------------------------------------------------

function db_dynamic_record_show_hires(type,subtype,width,height,bitdepth,link,size) {
  if (type == "" || type == "@DB_RECORD_OBJECT_HIRES_TYPE@") {
    return;
  }

  document.write("<A HREF=\"javascript:float_hires('" + link + "');\" onMouseOver=\"this.style.background='transparent'; window_status('" + link + "'); return true\" onMouseOut=\"window.status=''; return true\"><IMG ALT='Download high resolution cover' SRC='/images/icon_hires_60x33.gif' WIDTH=60 HEIGHT=33 BORDER=0></A>");
  document.write("<BR CLEAR=ALL>");
  document.write("<B>" + type + "</B> &nbsp; " + width + " x " + height + " pixels<BR>");
  document.write(subtype + "<BR>");
  document.write(bitdepth + "-bit color / " + size + " kbytes");
  document.write("<BR><BR>");
}

// ---------------------------------------------------------------------------------------
// jump to page
// ---------------------------------------------------------------------------------------

function db_dynamic_browse_jump_to_page(next_page,last_page,database_name_internal,section_name_internal) {
  var valid = 1;
  var valid_numbers = "0123456789"
  var f;
  var p;

  p = document.form_jump_to_page.form_page.value;

  if (p == "") {
    return false;
  }
  for (f = 0; f <= p.length - 1; f++) {
    if (valid_numbers.indexOf(p.charAt(f)) == -1) {
      valid = 0;
      break;
    }
  }
  if (p <= 0 || p > last_page) {
    valid = 0;
  }

  if (valid == 1) {
    location.href = "http://www.ctalmada.pt/cgi-bin/wnp_db_dynamic_browse.pl?dn=" + database_name_internal + "&sn=" + section_name_internal + "&pn=" + p;
  } else {
    alert("Invalid page number.\nPlease type in a number between 1 and " + last_page + ".");
    document.form_jump_to_page.form_page.value = next_page;
  }
}

// ---------------------------------------------------------------------------------------
// jump to record
// ---------------------------------------------------------------------------------------

function db_dynamic_browse_jump_to_record(total_records,database_name_internal,section_name_internal) {
  var valid = 1;
  var valid_numbers = "0123456789"
  var f;
  var p;

  p = document.form_jump_to_record.form_record.value;

  if (p == "") {
    return false;
  }
  for (f = 0; f <= p.length - 1; f++) {
    if (valid_numbers.indexOf(p.charAt(f)) == -1) {
      valid = 0;
      break;
    }
  }
  if (p <= 0 || p > total_records) {
    valid = 0;
  }

  if (valid == 1) {
    location.href = "http://www.ctalmada.pt/cgi-bin/wnp_db_dynamic_record.pl?dn=" + database_name_internal + "&sn=" + section_name_internal + "&rn=" + p;
  } else {
    alert("Invalid number.\nPlease type in a number between 1 and " + total_records + ".");
  }
}

// ---------------------------------------------------------------------------------------
// print record
// ---------------------------------------------------------------------------------------

function print_record(link) {
  var w;
  var h;
  var monitor = screen.width + "x" + screen.height;

  link = "http://www.ctalmada.pt" + link;

  if (monitor == "640x480") {
    w =  540;
    h =  380;
  } else if (monitor == "800x600") {
    w =  640;
    h =  480;
  } else if (monitor == "1024x768") {
    w =  800;
    h =  600;
  } else if (monitor == "1152x864") {
    w =  800;
    h =  600;
  } else if (monitor == "1280x960") {
    w =  800;
    h =  600;
  } else if (monitor == "1280x1024") {
    w = 1024;
    h =  768;
  } else if (monitor == "1600x1200") {
    w = 1280;
    h = 1024;
  } else {
    w =  640;
    h =  480;
  }

  var pos_x = (screen.width - w) / 2 - 10;
  var pos_y = (screen.height - h) / 2 - 20;
  var win_features = "menubar=no,scrollbars=yes,resizable=no,status=no,width=" + w + ",height=" + h + ",left=" + pos_x + ",top=" + pos_y;
  msgWindow=window.open(link,"print",win_features);
}

// -->
