  function openModalWindowsOnStartCTC() {
    if(tempCTCEmail=="1") {
      openModalClickToCallAnswer();
    }
    if(tempCTC=="1") {
      openModalClickToCallAnswer();
    }
  }

  function checkMandatoryFields() {
    var complete ="false";
    var defaultValues ="false";
    var title_error ="true";
    var firstnamne_error ="true";
    var lastname_error ="true";
    var areacode_error ="true";
    var phone_error ="true";
    var county_error ="true";
    var aufmerksam_error ="true";

    if (document.getElementById("country_ctc").value=="") {
      if (document.getElementById("title_ctc").value=="") {
        if (document.getElementById("last_name_ctc").value=="") {
          if (document.getElementById("first_name_ctc").value=="") {
            if (document.getElementById("area_code_ctc").value=="") {
              if (document.getElementById("phone_ctc").value=="") {
                defaultValues="true";
              } else {defaultValues ="false"}
            } else {defaultValues ="false"}
          } else {defaultValues ="false"}
        } else {defaultValues ="false"}
      } else {defaultValues ="false"}
    } else {defaultValues ="false"}

    if (defaultValues =="true") {
      Modalbox.hide();
      return (false);
    } else {
      if (document.getElementById("title_ctc").value!="") {
        title_error ="true";document.getElementById("titletext").style.color="black";
      } else {title_error ="false";document.getElementById("titletext").style.color="red";}

      if (document.getElementById("last_name_ctc").value!="") {
        lastname_error ="true";document.getElementById("lastnametext").style.color="black";
      }else {lastname_error ="false";document.getElementById("lastnametext").style.color="red";}

      if (document.getElementById("first_name_ctc").value!="") {
        firstnamne_error ="true";document.getElementById("firstnametext").style.color="black";
      }else {firstnamne_error ="false";document.getElementById("firstnametext").style.color="red";}

      if (document.getElementById("area_code_ctc").value!=""){
        areacode_error ="true";document.getElementById("phone_area_text").style.color="black";
      } else {areacode_error ="false";document.getElementById("phone_area_text").style.color="red";}

      if (document.getElementById("phone_ctc").value!="") {
        phone_error ="true";document.getElementById("phone_area_text").style.color="black";
      } else {phone_error ="false";document.getElementById("phone_area_text").style.color="red";}

      if ((phone_error =="false") || (areacode_error =="false")) {
        document.getElementById("phone_area_text").style.color="red";
      }

      if (document.getElementById("country_ctc").value!="") {
        county_error ="true";document.getElementById("countrytext").style.color="black";
      } else {county_error ="false";document.getElementById("countrytext").style.color="red";}

      if (document.getElementById("aufmerksam_ctc").value!="") {
        aufmerksam_error ="true";document.getElementById("aufmerksam_ctc_text").style.color="black";
      } else {aufmerksam_error ="false";document.getElementById("aufmerksam_ctc_text").style.color="red";}

      if ((title_error =="false") || (lastname_error =="false") || (firstnamne_error =="false") || (areacode_error =="false") || (phone_error =="false") || (county_error =="false") || (aufmerksam_error =="false")) {
        complete = "false";
      } else {complete = "true";}
      if (complete=="true") {
        return (true);
      } else if (complete=="false"){
        alert("Por favor, rellene todos los campos obligatorios.");
        return (false);
      }
    }
  }

  function showAgencyCTC(show) {
    if (show==1) {
      document.getElementById('agencylabel_ctc').style.display='';
      document.getElementById('agencyname_ctc').style.display='';
    }
    if (show==2) {
      document.getElementById('agencylabel_ctc').style.display='none';
      document.getElementById('agencyname_ctc').style.display='none';
      document.getElementById('agencyname_ctc').value='';
    }
  }

  function setEmail() {
    if (document.getElementById('allowemailspecial_ctc').checked == true) {
      document.getElementById('email_label_ctc').style.display='';
      document.getElementById('email_address_ctc').style.display='';
    } else {
      document.getElementById('email_label_ctc').style.display='none';
      document.getElementById('email_label_ctc').value='';
      document.getElementById('email_address_ctc').style.display='none';
      document.getElementById('email_address_ctc').value='';
    }
  }
  function checkValue() {
    if (document.getElementById("aufmerksam_ctc").value=="others") {
      document.getElementById('others_ctc').style.display="";
    } else {
      document.getElementById('others_ctc').style.display="none";
      document.getElementById('others_ctc').value="";
    }
  }

  function openModalClickToCall() {                                                                                                            
    var ShowText = "<form class=\"new_signup_request_ctc\" id=\"callback_form_ctc\" name=\"callback_form_ctc\" method=\"post\" action=\"http://www.es.ncl.eu/itinerary/insert_ctc.php\" onsubmit=\"return checkMandatoryFields(this)\">";
    var header= "<div class=\"block\"><img alt=\"Signup_header\" src=\"http://www.es.ncl-freestylecruising.eu/web/images/ctc/callback_header.jpg\" align=\"left\"/><h2 class=\"title16px\">¡Permítame ayudarle a planear su Crucero a su Aire!</h2></div>";
    header += "<br><p style=\"margin-top:0px\">Nuestros agentes están disponibles de lunes a viernes de 9:00 a 19:00 horas y los sábados de 9:00 a 14:00 horas.</p><br>";
    header += "<div id=\"another_search_ctc\"><div class=\"dotDivider\"></div><p style=\"margin-top:2px;margin-bottom:2px;margin-left:5px;\"><b>Por favor rellene el formulario para que nuestros agentes puedan contactarle o consulte a su<br>agencia de viajes.</b></p><div class=\"dotDivider\"></div></div>";
    header += "<p class=\"small_text\">Información obligatoria* </p><br>";
    var text = "<table><tr><td colspan=\"2\"><p style=\"margin-bottom:0px;margin-top:0px\">¿Es usted agente de viajes? *&nbsp;&nbsp;&nbsp;";
    text += "<input name=\"agency_ctc\" id=\"agency_ctc\" type=\"radio\" value=\"true\" tabindex=\"1\" onclick=\"javascript:showAgencyCTC(1)\">";
    text += "<label>Sí</label>&nbsp;&nbsp;&nbsp;&nbsp;";
    text += "<input name=\"agency_ctc\" id=\"agency_ctc\" type=\"radio\" value=\"false\" checked tabindex=\"2\" onclick=\"javascript:showAgencyCTC(2)\">";
    text += "<label>No</label></p></td></tr>";
    text += "<tr><td><label><p style=\"margin-bottom:0px;margin-top:0px;display:none\" name=\"agencylabel_ctc\" id=\"agencylabel_ctc\">Agencia de viajes&nbsp;&nbsp;</label>";
    text += "<input name=\"agencyname_ctc\" id=\"agencyname_ctc\" type=\"text\" style=\"display:none;width:365px;font-size:9pt\"></p></td></tr>";
    text += "<tr><td colspan=\"3\"><p style=\"margin-bottom:0px;margin-top:0px\">¿Tiene usted ya alguna reserva con NCL?&nbsp;&nbsp;&nbsp;&nbsp;";
    text += "<input name=\"boobing_ctc\" id=\"boobing_ctc\" type=\"radio\" value=\"true\" tabindex=\"3\">";
    text += "<label>Sí</label>&nbsp;&nbsp;&nbsp;&nbsp;";
    text += "<input name=\"boobing_ctc\" id=\"boobing_ctc\" type=\"radio\" value=\"false\" checked tabindex=\"4\">";
    text += "<label>No</label></p></td></tr></table>";
    text += "<table id=\"cb_layout\" style=\"margin-bottom:0px\"><tr><td valign=\"top\"><label><p style=\"margin-bottom:1px\" name=\"titletext\" id=\"titletext\">Título*</p></label><select name=\"title_ctc\" id=\"title_ctc\" size=\"1\" style=\"font-size:9pt;width:100px;\"><option value=\"\">Seleccione por favor<option value=\"Señor\">Se&ntilde;or<option value=\"Se&ntilde;ora\">Se&ntilde;ora<option value=\"Familia\">Familia</select></p>";
    text += "</td><td valign=\"top\">";
    text += "<label><p style=\"margin-bottom:0px\" name=\"firstnametext\" id=\"firstnametext\">Nombres*</p></label>";
    text += "<input name=\"first_name_ctc\" id=\"first_name_ctc\" style=\"width:175px;font-size:9pt\" tabindex=\"5\" type=\"text\" >";
    text += "</td><td valign=\"top\">";
    text += "<label><p style=\"margin-bottom:0px\" name=\"lastnametext\" id=\"lastnametext\">Apellidos*</p></label>";
    text += "<input name=\"last_name_ctc\" id=\"last_name_ctc\" style=\"width:178px;font-size:9pt\" tabindex=\"5\" type=\"text\" >";
    text += "</td></tr></table>";
    text += "<table id=\"cb_layout\" style=\"margin-top:0px\"><tr><td>";
    text += "<label><p style=\"margin-bottom:0px;margin-top:0px\" name=\"countrytext\" id=\"countrytext\">¿Dónde vive?*</p></label>";
    text += "<select name=\"country_ctc\" id=\"country_ctc\" size=\"1\" style=\"font-size:9pt\" tabindex=\"6\"><option value=\"\">Seleccione por favor<option value=\"AL\">Albania<option value=\"DE\">Alemania<option value=\"AD\">Andorra<option value=\"AT\">Austria<option value=\"BE\">Bélgica<option value=\"BY\">Bielorrusia<option value=\"BA\">Bosnia y Hercegovina<option value=\"BG\">Bulgaria<option value=\"CY\">Chipre<option value=\"VA\">Ciudad del Vaticano<option value=\"HR\">Croacia<option value=\"DK\">Dinamarca<option value=\"SK\">Eslovaquia<option value=\"ES\">España<option value=\"EE\">Estonia<option value=\"FI\">Finlandia<option value=\"FR\">Francia<option value=\"GR\">Grecia<option value=\"HU\">Hungría<option value=\"IS\">Islandia<option value=\"FO\">Islas Feroe<option value=\"LV\">Letonia<option value=\"LI\">Liechtenstein<option value=\"LT\">Lithuania<option value=\"IT\">Italia<option value=\"LU\">Luxemburgo<option value=\"MK\">Macedonia<option value=\"MT\">Malta<option value=\"MD\">Moldavia<option value=\"MC\">Mónaco<option value=\"NO\">Noruega<option value=\"NL\">Países Bajos<option value=\"PL\">Polonia<option value=\"PT\">Portugal<option value=\"CZ\">República Checa<option value=\"RO\">Rumania<option value=\"RU\">Rusia<option value=\"SM\">San Marino<option value=\"SI\">Slovenia<option value=\"SE\">Suecia<option value=\"CH\">Suiza<option value=\"TR\">Turquía<option value=\"UA\">Ucrania<option value=\"YU\">Yugoslavia</select>";
    text += "</td><td>";
    text += "<label><p style=\"margin-bottom:0px\" name=\"phone_area_text\" id=\"phone_area_text\">Prefijo*&nbsp;/&nbsp;&nbsp;Teléfono*</p></label>";
    text += "<input name=\"area_code_ctc\" id=\"area_code_ctc\" style=\"width:60px;font-size:9pt\"  tabindex=\"7\" type=\"text\" > / <input name=\"phone_ctc\" id=\"phone_ctc\" style=\"width:100px;font-size:9pt\" tabindex=\"7\" type=\"text\" >";
    text += "</td></tr>";
    text += "<tr><td colspan=\"3\"><p><input type=\"checkbox\" name=\"allowemailspecial_ctc\" id=\"allowemailspecial_ctc\" tabindex=\"9\" onclick=\"javascript:setEmail();\">Quiero recibir por e-mail las ofertas y promociones de NCL.</p></td></tr>";
    text += "<tr><td colspan=\"2\">";
    text += "<label><p style=\"margin-bottom:0px;margin-top:0px;display:none\" name=\"email_label_ctc\" id=\"email_label_ctc\">Dirección de correo electrónico</p></label>";
    text += "<input name=\"email_address_ctc\" id=\"email_address_ctc\" size=\"24\" tabindex=\"10\" type=\"text\" style=\"display:none;width:360px;font-size:9pt\">";
    text += "</td></tr>";
    text += "<tr><td colspan=\"3\"><label><p style=\"margin-bottom:0px;margin-top:0px;\" id=\"aufmerksam_ctc_text\" name=\"aufmerksam_ctc_text\">¿Cómo te has enterado de NCL?*</label></p></td></tr>";
    text += "<tr><td colspan=\"3\"><label><p><select name=\"aufmerksam_ctc\" id=\"aufmerksam_ctc\" size=\"1\" style=\"font-size:9pt;width:170px;\" onChange=\"javascript:checkValue();\"><option value=\"\">Seleccione por favor<option value=\"customer\">Ya soy cliente<option value=\"searchengine\">Motor de búsqueda (p. ej. Google)<option value=\"travel_agency\">Agencia de viajes<option value=\"friends\">Conocidos/amigos<option value=\"advertising_newspaper\">Publicidad en periódicos/revistas<option value=\"advertising_online\">Publicidad en Internet<option value=\"others\">Otros</select>";
    text += "&nbsp;&nbsp;<input name=\"others_ctc\" id=\"others_ctc\" type=\"text\" style=\"display:none;width:183px;font-size:9pt\"></p></td></tr>";
    text += "</table>";
    text += "<input type=\"hidden\" name=\"modal_type\" value=\"ctc\">";
    text += "<p><input type=\"submit\" value=\"Enviar/Cerrar\"></p>";
    ShowText += header + text;
    ShowText += "</form>";
    Modalbox.show(ShowText, {title: "&nbsp;", height: 550, width: 700}); return false;
  }

  function openModalClickToCallAnswer() {
    var test="<p class=\"billing\">Muchas gracias por registrarse.<br><br>Con gusto nos pondremos en contacto telefónicamente con usted a la brevedad.<br><br>Si usted se ha registrado para nuestro boletín recibirá en breve un e-mail nuestro con un enlace de confirmación.<br>Para recibir en el futuro el boletín de NCL simplemente deberá hacer un clic en el enlace.<br><br>Su Equipo de NCL Freestyle Cruising.</p>";
    Modalbox.show(test, {title: "Muchas gracias por registrarse.", height: 250, width: 450 }); return false;
  }