$(document).ready(function(){

  // highlight active field
  $("input").focus(function() {
    $(this).addClass("focused");
  });
  $("input").blur(function() {
    $(this).removeClass("focused");
  });
  $("textarea").focus(function() {
    $(this).addClass("focused");
  });
  $("textarea").blur(function() {
    $(this).removeClass("focused");
  });

  // replace standard submit button (assumes there's only one form per page, called "theform")
  $(":submit").replaceWith("<img src=\"images/submit.gif\" alt=\"Submit\" width=\"91\" height=\"19\" style=\"cursor:pointer;\" />");
  $(".submit > img").hover(function() {
    $(this).attr("src", "images/submit-over.gif");
  }, function() {
    $(this).attr("src", "images/submit.gif");
  });
  $(".submit > img").click(function() {
    $(this).parent().parent().submit();
  });

  $(".popupwindow").popupwindow();

});

function ShowImage(file, w, h, alt) {
  $("#bigimage").attr("src", file);
  $("#bigimage").attr("width", w);
  $("#bigimage").attr("height", h);
  $("#bigimage").attr("alt", alt);
}

