//------------------------------------------------------------
//
// Living Internet Search Code, Version 2005-01-01,
// Copyright (c) 1999-2005 William Stewart
//
// The Living Internet search code is free software; you can redistribute
// it and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA
//
//------------------------------------------------------------
//
// Global variables
//

var s1 ;
var s2 ;
var i, j, k ;

var selected_url ;
var base_url ;
base_url = "www.livinginternet.com" ;
selected_url = base_url ;

//
// Functions
//

function Site_search () {
var s1 = window.document.search_form_bool.text_bool.value;

var s2 = Filter_query(s1); 

s2 = "%28" + s2 + "%29" ;
s2 = "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=" + s2 +
  "+site%3A" + selected_url ; 

window.open(s2,'livinginternet_search')
// location = s2 ;

}

function Filter_query(s) {
var s1 = s ;
var j = s1.length;
var i = 0 ;
var c1 ="zz" ;
var c2 = "zz" ;
var c3 = "" ;
s1 = s1 + "zz" ;

while (i<j) {
 c1 = s1.charAt(i) ;
 c2 = c1 ;
 if (c1 == "(") { c2 = "%28" ; } ;
 if (c1 == ")") { c2 = "%29" ; } ;
 if (c1 == " ") { c2 = "+" ; } ;
 if (c1 == "&") { c2 = "%26" ; } ;
 if (c1 == "'") { c2 = "%27" ; } ;
 if (c1 == '"') { c2 = "%22" ; } ;
 if (c1 == ':') { c2 = "%3A" ; } ;
 c3 = c3 + c2 ;
 i = i+1 ;
}
return c3 ;
}

//
// Code start
//

s1 = location + "misc" ;
s2 = Get_page_name(s1) ;
Set_current_page(s2) ;

window.document.search_form_bool.text_bool.focus ;

//
// End source
//
//---------------------------------------------------------



