== REQUEST TO digistatic.libero.it:80 (9 headers, 0 byte payload) == GET //js/search-header.js HTTP/1.0 Accept: */* Referer: http://digiland.libero.it/ Accept-Language: it-IT UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30) Proxy-Connection: Keep-Alive Host: digistatic.libero.it Cookie: Libero=78.46.80.205.1215682043004499; ADVDCFAHP=2 == SERVER RESPONSE (6 headers, 5134 byte payload, detected MIME application/x-javascript) == HTTP/1.0 200 Date: Thu, 10 Jul 2008 09:27:40 GMT Server: Apache Last-Modified: Mon, 07 Jul 2008 14:04:59 GMT ETag: "140e-8f9578c0" Accept-Ranges: bytes Content-Type: application/x-javascript if ( typeof(Libero) == "undefined" ) { Libero = { Version: '1.0.0' }; } // test prototype library if ( typeof(Prototype) == "undefined" ) { var Class = { create: function() { return function() { this.initialize.apply(this, arguments); } } }; Object.extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; }; } // Create search class Libero.Search = Class.create(); Libero.Search.prototype = { // constructor initialize: function() { var params = Object.extend({ form_el: 'search', engine_el : 'search_engine', query_el: 'search_query', class_query_empty: 'sn-search-form-empty', class_query: 'sn-search-form', initial_query : '', engine_drivers: { video: { action: 'http://video.libero.it/app/search', method: 'get', on_empty_query: function (q) { document.location.href = 'http://video.libero.it'; return false } }, blog: { action: 'http://blog.libero.it/ricerca_blog.php', on_empty_query: function (q) { document.location.href = 'http://blog.libero.it'; return false } }, persone: { action: 'http://digiland.libero.it/ricerca_persone.php', on_empty_query: function (q) { document.location.href = 'http://digiland.libero.it'; return false }, empty_message: 'Interessi o nickname' }, siti: { action: 'http://digiland.libero.it/ricerca_siti.php', on_empty_query: function (q) { document.location.href = 'http://digiland.libero.it'; return false } }, tutti: { action: 'http://digiland.libero.it/ricerca_tutti.php', on_empty_query: function (q) { document.location.href = 'http://digiland.libero.it'; return false }, empty_message: 'Persone, Blog, Siti' } } }, arguments[0]); this.params = params; this.query = this.params.initial_query; if ( typeof(Prototype) == "undefined" ) { this.form = document.getElementById(this.params.form_el); this.q = document.getElementById(this.params.query_el); this.engine = document.getElementById(this.params.engine_el); } else { this.form = $(this.params.form_el); this.q = $(this.params.query_el); this.engine = $(this.params.engine_el); } // pre-select engine for ( var i = 0; i < this.engine.length; i++ ) { if ( this.engine[i].value == this.params.engine ) { this.engine.selectedIndex = i; break; } } this.init(); }, // init and onChange callback blur: function () { if ((this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message == undefined )|| (this.q.value != this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message)) { this.query = this.q.value; //autocompletamento } if (this.query.length == 0) { this.set_default(); } }, // init and onChange callback change: function () { if ( this.query.length == 0 ) { this.set_default(); } }, // init and onChange callback init: function () { if ( this.query.length > 0 ) { this.q.value = this.query; this.q.className = this.params.class_query; } else { this.set_default(); } }, set_default: function () { if ( this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message != undefined ) { this.q.className = this.params.class_query_empty; this.q.value = this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message; } else { this.q.value = ''; } }, // onKeyUp callback keyup: function () { this.query = this.q.value; }, // onFocus callback focus: function () { this.q.className = this.params.class_query; if (this.q.value != this.query) { this.q.value = this.query; } }, // form submit action search: function () { // Get/set a valid engine var engine = this.engine[this.engine.selectedIndex].value; if ( this.params.engine_drivers[engine] == undefined ) engine = this.params.default_engine; // Set form properties if ( this.params.engine_drivers[engine].action != undefined ) this.form.action = this.params.engine_drivers[engine].action; if ( this.params.engine_drivers[engine].target != undefined ) this.form.target = this.params.engine_drivers[engine].target; else this.form.target = '_self'; if ( this.params.engine_drivers[engine].method != undefined && this.params.engine_drivers[engine].method.match(/^get|post$/i) ) this.form.method = this.params.engine_drivers[engine].method; // Check query value if ((this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message != undefined )&& (this.q.value == this.params.engine_drivers[this.engine[this.engine.selectedIndex].value].empty_message)) { this.q.value = this.query; } if ( this.q.value.match(/^\s*$/)) { if (typeof this.params.on_empty_query_default == 'function' ) { return this.params.on_empty_query_default(this.q); } if (typeof this.params.engine_drivers[engine].on_empty_query == 'function' ) { return this.params.engine_drivers[engine].on_empty_query(this.q); } } } }; == END OF TRANSACTION ==