

// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();

s[0] = "Forged Turnbuckles^Fturnbuckles.htm^Drop Forged Turnbuckles.^Drop, Forged, Turnbuckles";
s[1] = "Shackles^shackles.htm^Drop Forged Anchor Shackles. Drp Forged Chain Shackles.^Drop, Forged, Shackles, Anchor, Chain";
s[2] = "Malleable Wire Rope Clips^Mclips.htm^Malleable Wire Rope Clips.^Malleable, Wire, Rope, Clips";
s[3] = "Thimbles^thimbles.htm^Wire Rope Thimbles. Heavy Duty.^Wire, Rope, Heavy, Duty, Thimbles";
s[4] = "Nut Eye and Ring Bolts^eyebolts.htm^Drop Forged Eye Bolts.^Drop, Forged, Eyebolts, Hot, Galvanized, Eye, Bolts";
s[5] = "Ring Bolts^ringbolts.htm^Drop Forged Ring Bolts.^Drop, Forged, Ring, Bolts";
s[6] = "Lifting Eyes^liftingeyes.htm^Drop Forged Lifting Eyes.^Drop, Forged, Lifting, Eyes";
s[7] = "Hoist Rings^hoistrings.htm^Alloy Steel Swivel Hoist Rings.^alloy, swivel, steel, hoist, rings";
s[8] = "Hooks^hooks.htm^Drop Forged Hooks. Drop Forged High-Test Chain Hooks. Drop Forged Safety Snap Hooks.^Safety, Snap, Drop, Forged, Hooks, High-Test, Chain, hook";
s[9] = "Swivels^swivels.htm^Drop Forged Swivels.^drop, forged, swivels";
s[10] = "Pad Eyes^padeyes.htm^Drop Forged Pad Eyes.^drop, forged, pad, eyes, padeyes";
s[11] = "Eye Nuts^eyenuts.htm^Drop Forged Eye Nuts.^drop, forged, nuts, eye, eyenuts";
s[12] = "Rods and Rod Ends^rods.htm^Drop Forged Blank Rod Ends. Black Oxide Machined Rod Ends. Continuous Threaded Rod.^Drop, Forged, Blank, Black, Oxide, Machined, Continuous, Threaded, rod, rods, ends";
s[13] = "Pins^pins.htm^Clevis Pins. Heat Treated.^clevis, heat, treated, pins";
s[14] = "Yoke Ends and Clevis SAE clevis pins^yoke.htm^Drop Forged Yoke Ends and Clevis SAE clevis pins.^drop, forged, yoke, ends, clevis, pins, SAE";
s[15] = "Bevel Washers^washers.htm^Malleable Bevel Washers.^malleable, bevel, washer, washers";
s[16] = "S Hooks^shools.htm^Zinc Plated S-Hooks.^zinc, plated, shooks, S, s-hooks, hook, hooks";
s[17] = "U-Bolts^ubolts.htm^Round Bend U-Bolts. Round Bend Long Tangent U-Bolts. Square Bend U-Bolts.^square, bend, long, tangent, round, bend, U, bolt, bolts, u-bolts, ubolts";
s[18] = "Coupling Nuts^nuts.htm^Zinc Plated Steel Coupling Nuts.^zinc, plated, steel, coupling, nut, nuts";
s[19] = "Rounds, Flats and Angles^shapes.htm^Rounds, Flats and Angles.^zinc, plated, steel, shape, shapes";
s[20] = "Steel^steel.htm^Steel. Stainless.^stainless, steel";
s[21] = "Schematics^schematics.htm^View the schematic drawings of basic rod or wire forms and steel eye bolt forgings.^schematics, drawings, schematic";
s[22] = "Midget Turnbuckles^Mturnbuckles.htm^Midget Turnbuckles.^Turnbuckles, Midget";
s[23] = "Drop Forged Wire Rope Clips.^Fclips.htm^Drop Forged Wire Rope Clips.^Drop, Forged, Wire, Rope, Clips";
s[24] = "Machinery Eye Bolts^eyebolts.htm^Machinery Eye Bolts.^Eyebolts, Standard, Machinery, Zinc, Plated, Eye, Bolts";

// ---------- end of script properties and sites ----------


var cookies = document.cookie;
var p = cookies.indexOf("d=");

if (p != -1) {
	var st = p + 2;
	var en = cookies.indexOf(";", st);
	if (en == -1) {
		en = cookies.length;
	}
	var d = cookies.substring(st, en);
	d = unescape(d);
}
var od = d;
var m = 0;
if (d.charAt(0) == '"' && d.charAt(d.length - 1) == '"') {
	m = 1;
}

var r = new Array();
var co = 0;

if (m == 0) {
	var woin = new Array();
	var w = d.split(" ");
	for (var a = 0; a < w.length; a++) {
		woin[a] = 0;
		if (w[a].charAt(0) == '-') {
			woin[a] = 1;
		}
	}
	for (var a = 0; a < w.length; a++) {
		w[a] = w[a].replace(/^\-|^\+/gi, "");
	}
	a = 0;
	for (var c = 0; c < s.length; c++) {
		pa = 0;
		nh = 0;
		for (var i = 0; i < woin.length; i++) {
			if (woin[i] == 0) {
				nh++;
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa++;
				} else {
					pa = 0;
				}
			}
			if (woin[i] == 1) {
				var pat = new RegExp(w[i], "i");
				var rn = s[c].search(pat);
				if (rn >= 0) {
					pa = 0;
				}
			}
		}
		if (pa == nh) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;
}

if (m == 1) {
	d = d.replace(/"/gi, "");
	var a = 0;
	var pat = new RegExp(d, "i");
	for (var c = 0; c < s.length; c++) {
		var rn = s[c].search(pat);
		if (rn >= 0) {
			r[a] = s[c];
			a++;
		}
	}
	co = a;

}


function return_query() {
	document.jse_Form.d.value = od;
}

function num_jse() {
	document.write(co);
}

function out_jse() {
	if (co == 0) {
		document.write('Your search did not match any documents.<p>Make sure all keywords are spelled correctly.<br>Try different or more general keywords, like Hook instead of Hook & Eye.');
		return;
	}
	for (var a = 0; a < r.length; a++) {
		var os = r[a].split("^");
		if (bold == 1 && m == 1) {
			var br = "<b>" + d + "</b>";
			os[2] = os[2].replace(pat, br);
		}
		if (include_num == 1) {
			document.write(a + 1, '. <a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		} else {
			document.write('<a href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		}
	}

}
