﻿function GetSiteSearchResults(newWindow,frameObject,frameObjectName,fontFace,fontSize,fontColour,linkFace,linkSize,linkColour)
{
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(\" hello welcome indigopig site here find what's whats currently sale both online auctions through dedicated shops ebid feel free leave comments guest book give shout ‘shout box' tell what like about don't dont please below terms conditions sales check various sales sites indigopig collectables will followed soon almost famous emporium fantastic forums helpful very friendly using paypal google checkout pppay updated regularly look items special offers well clearance blog keeps everything happening indigopig world counter shout **new** site search always price postage packing realistically re-use packaging where possible reduces costs which passed customers being more environmentally customers outside offer choice either airmail surface mail surface slower your package arrive however substantially cheaper than recommend unless require faster obtain proof this ensures item insured upto that they perfect condition we're were happy answer questions include photo's photos information know emails promptly please hours reply dvd's dvds sold region english marked otherwise ensure able play discs before purchase purchaser responsible import taxes other local relevant paperwork sent royal parcel courier items available collection delivery stated only posted when payment cleared accept postal orders cheques e-cheques cash from buyers rest checks drawn banks dollars email first collecting ‘collection only' method paying refunds been ‘miss-sold' ‘miss-sold ‘lost post' post problems favourite links conditions voted best ebay alternative indigopig's indigopigs blog \",\" indigopig about over coming months i'll posting photo's photos restoration projects i've vintage gutbrod tractor restore along with villiers powered sawbench stationary engine planet hoes amongst others always interested purchasing engines tractors garden horticultural machinery architectural salvage trailers briggs stratton rotorvators collect cash \");");
d.write("var pageMap = new Array(\"Home\",\"About us\");");
d.write("var linkMap = new Array(\"index.html\",\"page2.html\");");
d.write("var preMap = new Array(\" Hello, and welcome to the new INDIGOPIG site. Here you can find out what’s currently for sale both in our online auctions and through our new dedicated shops on Ebid.   Feel free to leave comments in\",\"INDIGOPIG.COM ABOUT US Over the coming months, I’ll be posting photo’s of my restoration projects. I’ve got a vintage Gutbrod tractor to restore, along with a Villiers powered sawbench, BSA stationary\");");
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+\" result(s) found for search term: \"+searchTerms+\"<br><br>\"+results;");
d.write("}");
d.write("wpDoSearch(\""+sTerms+"\");");
d.write("</script>");
d.write("</body></html>");
d.close();
}