function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		nav_01_ImageMap_01_over = newImage("images/nav_01-ImageMap_01_over.gif");
		nav_01_ImageMap_02_over = newImage("images/nav_01-ImageMap_02_over.gif");
		nav_01_ImageMap_03_over = newImage("images/nav_01-ImageMap_03_over.gif");
		nav_01_ImageMap_04_over = newImage("images/nav_01-ImageMap_04_over.gif");
		nav_01_ImageMap_05_over = newImage("images/nav_01-ImageMap_05_over.gif");
		preloadFlag = true;
	}
}

// -->

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

var item = new Array();



// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new Array("products.php","http://scratchgolf.com/newsite/","EGG","grind,grinds,egg,pdg,home,front","Grind info blah blah.");

c++; item[c]=new Array("about.htm","http://scratchgolf.com/newsite/","About Me","about,author,contact,email,who","Contact details and general information about the creator of the site and what the site is about.");

c++; item[c]=new Array("index.php","http://scratchgolf.com/newsite/","Custom grinds","Custom grinds","Scratch Golf are premium clubs that are custom-made to fit your swing. We offer an unprecedented FIVE grind options to fit three universally recognized swing types.");

c++; item[c]=new Array("index.php","http://scratchgolf.com/newsite/","1018 Super Soft Carbon Steel","1018 Super Soft Carbon Steel","Scratch Golf wedges are the softest in golf and have the best feel. They make today’s super hard golf balls feel like you’re hitting an old balata. ");

c++; item[c]=new Array("index.php","http://scratchgolf.com/newsite/","Overtaking The Tour","Overtaking The Tour","Scratch Golf has become the #1 Forged Wedge on the PGA Nationwide Tour the last 12 weeks of the season despite the fact that Scratch does not pay the pros to play our clubs. They’re that good…");

c++; item[c]=new Array("index.php","http://scratchgolf.com/newsite/","Quality Usually reserved for the Pros","Quality Usually reserved for the Pros","Now everyone from Scratch golers, weekend players or beginners can benefit from a custom grind that fits their swing.");

c++; item[c]=new Array("news.html","http://scratchgolf.com/newsite/","News Page","news,new,Canada,PGA Tour,Championship","The main part of my site which contains what you have come to see. Lots of stuff like that and more great things. All in a sub directory.");


c++; item[c]=new Array("logo.gif","http://scratchgolf.com/newsite/<? echo($url) ?>/img/","Link Logo","link,image,logo,graphic","The logo.gif is just a small image which you can place on your site as a link to me. It's in a second level subdirectory.");

page="<html><head><title>Search Results</title></head><body bgcolor='#191919' style='color: #FF9900; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none;'><center><table border=0 cellspacing=10 width=80%>";


function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Total found: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0]; 
line = "<tr><td><a style='color: #FFFFFF; font-size: 14px; font-weight:bold; font-family: Verdana, Arial, Helvetica, sans-serif; border-bottom: #FFFFFF dashed 1px; text-decoration: none;' target='_blank' href='"+link+"'>"+item[which][2]+"</a> <div style='color: #F6E4C8; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none;'>Score: "+num+"</div><br>";
line += item[which][4] + "<br><div style='color: #FFFFFF; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none;'>"+link+"</div><hr></td></tr>";
wind.document.write(line);
return 1;
}