var Popup = {
  open: function(options) {
    this.options = {
      url: "#",
      width: 667,
      height: 580,
      name: "_blank",
      location: "no",
      menubar: "no",
      toolbar: "no",
      status: "yes",
      scrollbars: "yes",
      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);
  }
};

var default_string = "Enter your email address";
var error_string = "Please enter a valid email address:";

function is_valid_email(email) {
  var illegal = /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
  var filter = /^.+@.+\..+$/;
  return(filter.test(email) && !email.match(illegal));
}
function get_wb_reel_news() {
  var email = $("email").value;
  if (is_valid_email(email)) {
    Popup.open({ url: "http://t.4at1.com/was1022/reg.html?source=thegoodgerman&amp;title=thegoodgerman&amp;email=" + email, name: "wb_reel_news" });
  } else {
    Element.update("instructions", error_string);
  }
}
function default_email() {
  if ($("email").value == default_string) $("email").value = "";
}
function default_copy() {
  if ($("email").value == "") $("email").value = default_string;
}
function trailer_window(url) {
   Popup.open({ url: url, name: "goodgerman" , width: 550, height: 500 });
}
function book_window(url) {
   Popup.open({ url: url, name: "goodgerman" , width: 910, height: 710 , resizable:"no"});
}
