// site.js - global javascript code (for every dang page)
//
function xLinks ()
// make all links with rel="x"  into target="_blank"
//                   href="exp" and "con" into tglHid calls
{  if (! document.getElementsByTagName)  return;  // old browser?
  var aLst = document.getElementsByTagName ("a");
   for (var i = 0; i < aLst.length; i++) {
     var an = aLst [i];
     var r  = an.getAttribute ("rel");
      if (r && (r == "x"))  {an.target = "_blank";}
   }
}


this.InitHovImg = function() {
   xOffset = 120;            // these determine popup's distance from cursor
   yOffset = 137;            // probably gotta tweak em
   $("a.hovimg").hover(function(e){
      this.t = this.title;
      this.title = "";
     var c = (this.t != "") ? this.t + "<br/>" : "";
      $("body").append("<p id='hovimg'>" + c + "<img src='"+ this.href +
                       "' alt='hover image preview' /></p>");
      $("#hovimg").css("top", "137px")
                  .css("left","120px")
                  .fadeIn("fast");
   },
   function(){
      this.title = this.t;
      $("#hovimg").remove();
   });
};


// starting the script on page load
$(document).ready(function(){
   xLinks();
   InitHovImg();
});

