var URL = ""; var PATH = ""; var DS = ""; var PAISCODE = ""; var PAISNAME = ""; var LANG = ""; function cargar(jsonConfig) { var $json = JSON.parse(jsonConfig); if (!$json) return; URL = $json.URL; PATH = $json.PATH; DS = $json.DS; PAISCODE = $json.CODE; PAISNAME = $json.NAME; LANG = $json.LANG; } $(document).on('ready', function () { $('.drop-search').on('click', function () { $('#form-search').toggle(); }); $('li.dropdown').hover(function () { $(this).addClass('open'); $(this).find('a.dropdown-toggle').addClass('disabled'); }, function () { $(this).removeClass('open'); $(this).find('a.dropdown-toggle').removeClass('disabled'); }); $('.showViaje').on('click', function () { var vid = $(this).attr('data-travel'); var slug = $(this).attr('data-slug'); var mine = $(this).attr('data-mine'); if (!slug || mine) { if (!mine) mine = 0; location.href = URL + "/ver-viaje/" + vid + "/" + mine; } else location.href = URL + "/compartir-coche-" + slug + "-" + vid; }); $("#imgUpd").click(function () { $("#inUpd").show(); $("#inUpd").click(); }); $("#inUpd").change(function () { readURL(this, '#imgUpd'); }); }); $(function () { $(".datepicker-now").datepicker({ changeMonth: true, changeYear: true, minDate: 0 }); $(".datepicker").datepicker({ changeMonth: true, changeYear: true }); }); function showContacto(id, title) { $("#modal").modal('show'); $.ajax({ type: "POST", data: "&usuario=" + id, url: URL + "/index.php?rel=tab&accion=16", success: function (data) { $("#modal").find('.modal-body').eq(0).html(data); } }); } function showConversacion(id, elem, title) { $("#dialogo").dialog({ title: title, height: 500, width: 350, modal: true, resizable: false }); $.ajax({ type: "POST", data: "&conversacion=" + id, url: URL + "/index.php?rel=tab&accion=17", success: function (data) { $("#dialogo").html(data).show("slow"); $("#dialogo").scrollTop($("#dialogo").height()); } }); } function send() { var mensaje = $('input#newmencont').val(); var cid = $('input#conversacion').val(); var uid = $('input#receptor').val(); if (mensaje && cid) { $.ajax({ type: "POST", data: "&receptor=" + uid + "&conversacion=" + cid + "&mensaje=" + mensaje, url: URL + "/index.php?rel=tab&accion=18", success: function (data) { $('input#newmencont').val(""); var html = '
' + mensaje + '
'; html += 'Hace 1 segundo
'; html += '