function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}

$(document).ready(function(){
  
  $("#totalPd").find("span").hide();
  $("#totalAmt").find("span").hide();
  
  $("input#sitebox").click(function(){
      // If checked
    if ($("#sitebox").is(":checked"))
    {
      //show the hidden div
      $("#totalPd").find("#lblSetup").show();
      $("#totalAmt").find("#amtSetup").show();
      $("#totalPd").find("#lblHosting").show();
      $("#totalAmt").find("#amtHosting").show();
    }
    else
    {      
      //otherwise, hide it
      $("#totalPd").find("#lblSetup").hide();
      $("#totalAmt").find("#amtSetup").hide();
      $("#totalPd").find("#lblHosting").hide();
      $("#totalAmt").find("#amtHosting").hide();
    }
  });
  
  // map box
  $("input#mapbox").click(function(){
    // If checked
    if ($("#mapbox").is(":checked"))
    {
      // show the hidden div
      $("#totalPd").find("#lblMapping").show();
      $("#totalAmt").find("#amtMapping").show();
    }
    else
    {      
      // otherwise, hide it
      $("#totalPd").find("#lblMapping").hide();
      $("#totalAmt").find("#amtMapping").hide();
    }
  });
  
});


function updatePrice()
{
  var promoCode = $("#promocode").val();
  if (promoCode == "")
  {
    alert("Please enter the Promotion Code to take advantage of this outstanding limited time offer.");
  }
  else
  {
    var arrCodes = new Array("BILL", "KEVIN", "KELLY", "CHUCK", "CHARLES", "DENNIS", "DENIS", "DAVE", "AMIR", "BRYAN", "BRIAN", "STEVEM", "REMAXSPECIAL", "CRAIG", "PETER", "PHIL", "BRADY","R4");
    var match = false;
    for (var i = 0; i < arrCodes.length; i++)
    {
      if (promoCode.toUpperCase() == arrCodes[i])
      {
        match = true;
        window.location = "SignUpToday.aspx?promocode=" + promoCode.toUpperCase();
      }
    }
    if (!match)
    {
      alert("Invalid promotion code!");
    }
  }
  return false;
}

function goodForm()
{
  var msg = "";
  if (!$("#sitebox").is(":checked") && !$("#mapbox").is(":checked"))
  {
    msg = "Please select a product first.";
  }
  if (!$("input#terms").is(":checked"))
  {
    if (msg != "")
      msg += "\n";
    msg += "Please check the 'Terms & Conditions' checkbox.";
  }
  if (msg != "")
  {
    alert(msg);
    return false;
  }  
  return true;
}

















