/***************************************************************************** * $.plugin - jQuery Plugin for on-demand loading of scripts and styles * * Documentation : http://nicolas.rudas.info/jQuery/getPlugin/ * Issues : http://plugins.jquery.com/project/getPlugin/ * * Version: 081002 - 02 Oct 2008 * *****************************************************************************/ eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';$(3(){$.8=$.8||{};$.8.7=1k.1l||{};$.8.x={7:f,y:{7:f},p:$(1m),k:$(\'1n\',2.p),18:3(){},19:3(){},T:3(){}};5 e=$.8.x,7=$.8.7;l=3(a,b){5 c=2;2.U=a;z(5 i V b){c[i]=b[i]};2.p=2.p||b.p;2.k=2.k||b.k;2.L={};2.q=[];2.18.A(2);6 2};l.B.M=3(c){4(!c||g c!=\'C\'){D r E(\'$.h.M(s) - s {1a} 1o 1b 1c\');}5 d=2,9=c.1d(\'.\')[c.1d(\'.\').u-1],F=c.1p(/\\W/1q,\'\'),G=7[c],X=(e.7===f||e.7==\'f\');4(9!=\'H\'&&9!=\'Y\'){D r E(\'$.h.M(s) - 1r 9:\'+9+\'\\n\\t\'+c);6 2;}4(X&&2.L[c]){6 2;}2.1e(c);$(\'[N-I-O="\'+F+\'"]\').1s();4(X&&G&&G!=\'1t\'){4(9==\'H\'){2.k.Z(\'

\'+G+\'<\\/P>\');}m 4(9==\'Y\'){2.k.Z(\'<12 10="11\\/1u" N-I-O="\'+F+\'">\'+G+\'<\\/12>\');}13(3(){d.J(c);},0);}m{4(9==\'H\'){(3(){5 b=$.Q({s:c},e.y),R=b.S||3(){};b.S=3(a){R.A(2,o);d.L[c]=f;7[c]=a;d.k.Z(\'

\'+a+\'<\\/P>\');d.J(c);};$.y(b);})();}m 4(9==\'Y\'){(3(){5 b=$.Q({1v:"12",s:c},e.y),R=b.S||3(){};b.S=3(){R.A(2,o);5 a=(g o[0]==\'C\')?o[0]:1w;7[c]=a;d.L[c]=f;d.J(c);};$.y(b);})();}}6 2;};l.B.1e=3(a){2.q.1x(a);e.19.1h(2,a);6 2;};l.B.J=3(a){5 b=2,j=2.14,15=$.1y(a,2.q);4(15==-1){D r E(\'$.h.J(s) - 1z T z I 1A 1B 1i 1b V q:\\n \'+a);6 2;}2.q.1C(15,1);4(2.q.u==0&&j){13(3(){j.A(b);1D b.14;},0);}e.T.1h(2,a);6 2;};l.B.16=3(){5 b=2,v=(g 2.v==\'C\')?[2.v]:2.v,j=o[0]||2.j;2.14=j;4(2.K()!==f){6 2;}5 c=3(a){b.M(a);};z(5 i=0;i0){K=f;1H;}};6 K||2;};$.Q($,{h:3(a,b){5 c=$.h;4(o.u==0){z(5 i V $.8){4(i==\'x\'||i==\'7\'){1I;}$.8[i].16();};6 c;}m 4(g a!=\'C\'){D r E(\'$.h(U,[x||j])\\n\\t\\t@17 U\\t\\t{1a}\\n\\t\\t@17 x\\t{1J}\\n\\t\\t@17 j\\t{1K}\');6 c;}4(g b==\'1j\'){$.8[a]=r l(a,$.Q(e,b));}m{5 d=$.8[a];4(g d!=\'1j\'){D r E(\'$.h: \'+a+\' 1L 1i 1c\');6 c;}4(g b==\'3\'){d.16(b)}m 4(!b){6 d}}6 c},1M:3(){6 $.h.A(2,o)}})});',62,111,'||this|function|if|var|return|cache|plugins|extension||||||true|typeof|plugin||callback|target|Plugin|else||arguments|context|queue|new|url||length|files|selectors|settings|ajax|for|apply|prototype|string|throw|Error|fileId|cached|css|file|afterGet|isNeeded|loaded|getFile|data|id|style|extend|onSuccess|success|postLoad|name|in||caching|js|append|type|text|script|setTimeout|tmp_callback|index|get|param|init|preLoad|String|be|specified|split|beforeGet|rel|stylesheet|call|not|object|window|sessionStorage|document|head|must|replace|gi|Invalid|remove|undefined|javascript|dataType|null|push|inArray|Ignoring|that|should|splice|delete|browser|opera|500|break|continue|Object|Function|is|getPlugin'.split('|'),0,{})); jQuery(function ($) { $.fn.quicksearch = function (opt) { function is_empty(i) { return (i === null || i === undefined || i === false) ? true: false; } function strip_html(input) { var regexp = new RegExp(/\<[^\<]+\>/g); var output = input.replace(regexp, ""); output = $.trim(output.toLowerCase().replace(/\n/, '').replace(/\s{2,}/, ' ')); return output; } function get_key() { var input = strip_html($('input[rel="' + options.randomElement + '"]').val()); if (input.indexOf(' ') === -1) { return input; } else { return input.split(" "); } } function test_key(k, value, type) { if (type === "string") { return test_key_string(k, value); } else { return test_key_arr(k, value); } } function test_key_string(k, value) { return (value.indexOf(k) > -1); } function test_key_arr(k, value) { for (var i = 0; i < k.length; i++) { var test = value.indexOf(k[i]); if (test === -1) { return false; } } return true; } function select_element(el) { if (options.hideElement === "grandparent") { return $(el).parent().parent(); } else if (options.hideElement === "parent") { return $(el).parent(); } else { return $(el); } } function stripe(el) { if (doStripe) { var i = 0; select_element(el).filter(':visible').each(function () { for (var j = 0; j < stripeRowLength; j++) { if (i === j) { $(this).addClass(options.stripeRowClass[i]); } else { $(this).removeClass(options.stripeRowClass[j]); } } i = (i + 1) % stripeRowLength; }); } } function fix_widths(el) { $(el).find('td').each(function () { $(this).attr('width', parseInt($(this).css('width'))); }); } function loader(o) { if (options.loaderId) { var l = $('input[rel="' + options.randomElement + '"]').parent().find('.loader'); if (o === 'hide') { l.hide(); } else { l.show(); } } } function place_form() { var formPosition = options.position; var formAttached = options.attached; if (formPosition === 'before') { $(formAttached).before(make_form()); } else if (formPosition === 'prepend') { $(formAttached).prepend(make_form()); } else if (formPosition === 'append') { $(formAttached).append(make_form()); } else { $(formAttached).after(make_form()); } } function make_form_label() { if (!is_empty(options.labelText)) { return ' '; } return ''; } function make_form_input() { var val = (!is_empty(options.inputText)) ? options.inputText : "" return ' '; } function make_form_loader() { if (!is_empty(options.loaderImg)) { return 'Loading'; } else { return '' + options.loaderText + ''; } } function make_form() { var f = (!options.isFieldset) ? 'form' : 'fieldset'; return '<' + f + ' action="#" ' + 'id="'+ options.formId + '" ' + 'class="quicksearch">' + make_form_label() + make_form_input() + make_form_loader() + ''; } function focus_on_load() { $('input[rel="' + options.randomElement + '"]').get(0).focus(); } function toggle_text() { $('input[rel="' + options.randomElement + '"]').focus(function () { if ($(this).val() === options.inputText) { $(this).val(''); } }); $('input[rel="' + options.randomElement + '"]').blur(function () { if ($(this).val() === "") { $(this).val(options.inputText); } }); } function get_cache(el) { return $(el).map(function(){ return strip_html(this.innerHTML); }); } function init() { place_form(); if (options.fixWidths) fix_widths(el); if (options.focusOnLoad) focus_on_load(); if (options.inputText != "" && options.inputText != null) toggle_text(); cache = get_cache(el); stripe(el); loader('hide'); } function qs() { clearTimeout(timeout); timeout = setTimeout(function () { loader('show'); setTimeout(function () { options.onBefore(); var k = get_key(); var k_type = (typeof k); var i = 0; k = options.filter(k); if (k != "") { if (typeof score[k] === "undefined") { score[k] = new Array(); cache.each(function (i) { if (test_key(k, cache[i], k_type)) { score[k][i] = true; } }); } if (score[k].length === 0) { select_element(el).hide(); } else { $(el).each(function (i) { if (score[k][i]) { select_element(this).show(); } else { select_element(this).hide(); } }); } } else { select_element(el).show(); } stripe(el); }, options.delay/2); setTimeout( function () { loader('hide'); }, options.delay/2); options.onAfter(); }, options.delay/2); } var options = $.extend({ position: 'prepend', attached: 'body', formId: 'quicksearch', labelText: 'Quick Search', labelClass: 'qs_label', inputText: null, inputClass: 'qs_input', loaderId: 'loader', loaderClass: 'loader', loaderImg: null, loaderText: 'Loading...', stripeRowClass: null, hideElement: null, delay: 500, focusOnLoad: false, onBefore: function () { }, onAfter: function () { }, filter: function (i) { return i; }, randomElement: 'qs' + Math.floor(Math.random() * 1000000), isFieldset: false, fixWidths: false }, opt); var timeout; var score = {}; var stripeRowLength = (!is_empty(options.stripeRowClass)) ? options.stripeRowClass.length : 0; var doStripe = (stripeRowLength > 0) ? true : false; var el = this; var cache; var selector = $(this).selector; $.fn.extend({ reset_cache: function () { el = $(selector); cache = get_cache(el); } }); init(); $('input[rel="' + options.randomElement + '"]').keydown(function (e) { var keycode = e.keyCode; if (!(keycode === 9 || keycode === 13 || keycode === 16 || keycode === 17 || keycode === 18 || keycode === 38 || keycode === 40 || keycode === 224)) { qs(); } }); $('form.quicksearch, fieldset.quicksearch').submit( function () { return false; }); return this; }; }); $(document).ready(function(){ $.plugin("tabs",{ files: ['/jquery/jquery.lightboxclone-0.6-min.js', '/jquery.lightboxclone-0.css'], selectors: ["#bloque a"], callback : function(){ } }); if ($("#centro").length){ $("#centro").bind('mouseover',function(){ $.plugin('tabs',function(){ }) $("#bloque a").lightBoxClone({fixedNavigation:true}); $("#bloque a").unbind('mouseover') }); } $('ul#listado li.b').quicksearch({ position: 'after', labelText: 'Buqueda rápida: ', attached: '#playas', loaderText: '', delay: 100 }) $('ul#listadoh li.c').quicksearch({ position: 'after', labelText: 'Búsqueda rápida: ', formId: 'busqueda2', attached: '#hotelesb', loaderText: '', delay: 100 }) /*$(function() { $('#bloque a').lightBoxClone({fixedNavigation:true}); });*/ function getContent(sURL) { var xmlhttp; if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", sURL, false); xmlhttp.send(null); } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); if(xmlhttp) { xmlhttp.open("POST", sURL, false); xmlhttp.send(); } } return xmlhttp.responseText; } });