function faqViewer(faqId) {
  this.linkId = faqId + "Link";
  this.contentId = faqId;

  this.show = function(newFaqId) {
    changeClass(this.linkId,"normal");
    changeClass(this.contentId,"invisible");
    this.linkId = newFaqId + "Link";
    this.contentId = newFaqId;
    changeClass(this.linkId,"selected");
    changeClass(this.contentId,"shown");
  }
}
function changeClass(id, newClass) {
  identity = document.getElementById(id);
  identity.className=newClass;
}
function imageView(imageUrl,caption) {
  imageWindow = window.open("","imageWindow", "width=600,height=820,scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=yes,toolbar=yes");
  window.imageWindow.resizeTo(600,820);  // trap if window open
  imageWindow.focus();
  imageWindow.document.open();
  imageWindow.document.writeln('<html><head><title>Smile by Dr. Benjamin Image Viewer: ' + caption +  '</title><link rel="stylesheet" href="smileImageViewer.css" type="text/css"></head>');
  imageWindow.document.writeln('<body>');
  imageWindow.document.writeln('<div id="bodyBlock">');
  imageWindow.document.writeln('<p><img src="' + imageUrl + '" alt="' + caption + '" /></p>');
  imageWindow.document.writeln('<p><a href="javascript:self.close();">close window</a></p>');
  imageWindow.document.writeln('</div></body></html>');
  imageWindow.document.close();
}

function imageViewCaption(imageUrl,caption,width,height) {
  windowParamsString = "width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=yes,toolbar=yes";
  imageWindow = window.open("","imageWindow", windowParamsString);
  window.imageWindow.resizeTo(parseInt(width),parseInt(height)); // trap if window open
  imageWindow.focus();
  imageWindow.document.open();
  imageWindow.document.writeln('<html><head><title>Smile by Dr. Benjamin Image Viewer: ' + caption +  '</title><link rel="stylesheet" href="smileImageViewer.css" type="text/css"></head>');
  imageWindow.document.writeln('<body>');
  imageWindow.document.writeln('<div id="bodyBlock">');
  if (caption != "") {
    imageWindow.document.writeln('<h1>' + caption + '</h1>');
  }
  imageWindow.document.writeln('<p><img src="' + imageUrl + '" alt="' + caption + '" /></p>');
  imageWindow.document.writeln('<p><a href="javascript:self.close();">close window</a></p>');
  imageWindow.document.writeln('</div></body></html>');
  imageWindow.document.close();
}
