﻿function GetSiteSearchResults(newWindow,frameObject,frameObjectName,fontFace,fontSize,fontColour,linkFace,linkSize,linkColour,resultsText)
{
var sTerms="";
var iDepth = 0;
var sURL = new String(document.location);
if (sURL.indexOf("?") > 0)
{
var arrParams = sURL.split("?");
var arrURLParams = arrParams[1].split("&");
for (var i=0;i<arrURLParams.length;i++)
{
var sParam = arrURLParams[i].split("=");
var sValue = unescape(sParam[1]);
if( sParam[0] == frameObjectName)
	sTerms = sValue;
if( sParam[0] == "depth")
	iDepth = parseInt(sValue);
}
}
var d=frameObject.document;
if (sTerms=="") {d.open(); d.write("<html><head></head><body style=\"background: transparent;\"></body></html>"); d.close();return;}
var sBack=""; for (i=0; i<iDepth; i++) sBack+='..\\\\';
d.open();
d.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
d.write("<html lang=\"en\">");
d.write("<head>");
d.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
d.write("</head>");
d.write("<body style=\"margin: 0px 0px 0px 0px; font-family: "+fontFace+"; font-size: "+fontSize+"; color: "+fontColour+"; background: transparent;\">");
d.write("<div id=\"wpSearchResults\"></div>");
d.write("<script type=\"text/javascript\">");
d.write("var wordMap = new Array(\" chippinghistory archive available private study mary's marys community hall longridge road chipping census records graveyard documents miscellaneous records many photographs local area people happy welcome assist with information require search results tuesday february 15th 2011 45pm origins surnames peter watson hits= search site local history society meetings events sunday 6thmarch 00pm open \",\" hold informal sessions mary's marys community hall chipping first sunday each month except january from 30pm when archive available private study census records graveyard documents miscellaneous photographs local area people this excellent opportunity visitors members share information about family history friendly welcoming environment local history society open lancashire have would like with then please bring them along able your permission scan also click census reprints 1841 1851 1861 1871 1881 plus dept honour booklet commemorating those gave their lives great conflicts 20th century click here find location input post code google \",\" brabins-chipping brabin's brabins shop gallery buckleysociety provided help site site editor historysiteditor email contact press john pearson irenapreston btconnect information-britain chippingvillage useful external contacts lancashire history federation ribchesterhistory ancestor-search info cyndislist ukvillages genuki chipping email chippinghistory wikipedia encyclopedia johnpearson30 hotmail \",\" back home page meeting place mary community hall chipping alternative \");");
d.write("var pageMap = new Array(\"Chipping Local History Society\",\"Open Day\",\"Contacts\",\"How to find us\");");
d.write("var linkMap = new Array(\"index.html\",\"page5.html\",\"contacts.html\",\"How to find us.html\");");
d.write("var preMap = new Array(\"www.chippinghistory.org.uk           Our archive is available for private study, at St Mary’s Community Hall Longridge Road Chipping, the archive has Census Records,Graveyard Records, old documents, m\",\" We hold informal sessions at St Mary’s Community Hall in Chipping on the first Sunday of each month (except January)  from 2 - 4.30pm  when our archive is available for private study.         The arc\",\"www.brabins-chipping.co.uk ........Brabin’s Shop & Gallery       www.buckleysociety.org.uk  .... Provided help for us to set up our web site    Site editor       Historysiteditor@aol.com I T / Email C\",\"- back to Home Page - our meeting place St Mary,s  Community Hall, Chipping PR3 2QD - try our alternative map of Chipping \");");
d.write("function doNav(ind)");
d.write("{");
if (newWindow)
d.write("		 window.open(\""+sBack+"\"+linkMap[ind],\"_blank\");");
else
d.write("		 parent.window.location.href=linkMap[ind];");
d.write("}");
d.write("function wpDoSearch(searchTerms){");
d.write("var terms = searchTerms.split(\" \");");
d.write("if (terms==\"\") return;");
d.write("var results = \"\";");
d.write("var resultscount = 0;");
d.write("for (var i=0; i<wordMap.length; i++)");
d.write("{");
d.write("			var found=true;");
d.write("			for (var j=0; j<terms.length; j++)");
d.write("					if (wordMap[i].indexOf(terms[j].toLowerCase())==-1) found=false;");
d.write("			if (found)");
d.write("			{");
d.write("				 results+=\"<a style=\\\"cursor: pointer; font-family: "+linkFace+"; font-size: "+linkSize+"; color: "+linkColour+"; \\\" onclick=\\\"doNav(\"+i+\");\\\"><u>\"+pageMap[i]+\"</u></a><br>\"+preMap[i]+\"...<br><br>\";");
d.write("				 resultscount++;");
d.write("			}");
d.write("}");
d.write("document.getElementById(\"wpSearchResults\").innerHTML=resultscount+\" "+resultsText+" \"+searchTerms+\"<br><br>\"+results;");
d.write("}");
while(sTerms.indexOf("\"") != -1 ) {
sTerms = sTerms.replace("\"","");
};
d.write("wpDoSearch(\""+sTerms+"\");");
d.write("</script>");
d.write("</body></html>");
d.close();
}
