/*var Tudors = {
  wordlib: {
    setup: function(letter_id, letter_title, letter_libs, sender_name, sender_email, recipient_name, recipient_email, message) {
			// Do something here, like call the Flash function: $("tudors").publish_success(1);
			$("tudorswordlib").publish_success(1);
		}
	}
};*/

function setFlashDimensions() {
  var a = document.getElementById("treatmentdiv");
  var w = document.body.offsetWidth;
  var h = document.body.offsetHeight;
  var wt = 960;
  var ht = 750;
  a.style.width = Math.max(w, wt) + "px";
  a.style.height = Math.max(h, ht) + "px";
}


var Popup = {
  open: function(options) {
    this.options = {
      url: "#",
      width: 550,
      height: 550,
      name: "_blank",
      location: "no",
      menubar: "no",
      toolbar: "no",
      status: "no",
      scrollbars: "no",
      resizable: "yes",
      left: "",
      top: "",
      normal: false
    }
    Object.extend(this.options, options || {});
    if (this.options.normal) {
      this.options.menubar = "yes";
      this.options.status = "yes";
      this.options.toolbar = "yes";
      this.options.location = "yes";
    }
    this.options.width = this.options.width < screen.availWidth ? this.options.width : screen.availWidth;
    this.options.height = this.options.height < screen.availHeight ? this.options.height : screen.availHeight;
    var openoptions = "width=" + this.options.width + ",height=" + this.options.height + ",location=" + this.options.location + ",menubar=" + this.options.menubar + ",toolbar=" + this.options.toolbar + ",scrollbars=" + this.options.scrollbars + ",resizable=" + this.options.resizable + ",status=" + this.options.status;
    if (this.options.top != "") openoptions += ",top=" + this.options.top;
    if (this.options.left != "") openoptions += ",left=" + this.options.left;
    window.open(this.options.url, this.options.name, openoptions);
    return(false);
  }
};

function launch(link) {
	Popup.open({ url: link, scrollbars: "yes", width: 615, height: 650 });
}

function contest(link) {
	Popup.open({ url: link, scrollbars: "yes", width: 615, height: 650 });
}