

// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();

s[0] = "Pro Shop^proshop.php^A convenient Pro Shop equipped with a range of golf accessories is available to you for yor convenience.^pro shop, golf accessories, clubs, ball, shirt, hat, equipment, apparel, clothing, club house";
s[1] = "Restaurant^restaurant.php^The Black Forest Restaurant is located within the Club House on elevated ground, commands a panoramic and scenic view of the golf course.^restaurant, cafe, food, ice kacang, eat, dinner, lunch, drink, club house";
s[2] = "Duty Free Shop^dutyfreeshop.php^A convenient Duty Free Shop selling a wide range of duty free liquor and cigarette is available to you for yor convenience. ^duty free, shop, cigarette, cigar, liquor, wine, whisky, club house";
s[3] = "Changing Room^changeroom.php^.....^club house, changing room";
s[4] = "Course Guide^courseguide.php^A par 72 with a total yardage of 7110, the 18-hole golf course blankets over the emerald green terrain of the Black Forest.^course guide, hole, golf, layout, characteristics, play surface, challenging features";
s[5] = "Scorecard^scorecard.php^Black Forest Golf and Country Club scorecard, with golf course and slope rating info. Printable version available.^golf, score card, course, holes, slope rating";
s[6] = "Local Rules^localrules.php^Black Forest Golf and Country Club local rules, adopted from Royal St. Andrews and USGA Rules.^local rules, course, golf";
s[7] = "Buggy & Caddy Service^buggycaddy.php^Enjoy your golf with our electric buggies and caddy service.^buggy, caddy, service, course, golf, hole";
s[8] = "Course Photos^coursephotos.php^Scenes from around Black Forest Golf and Country Club.^golf, course, photo, holes, views";
s[9] = "Packages^packages.php^Black Forest Golf and Country Club golfing packages.^packages, rates, prices, fees, registration, register, counter, golf";
s[10] = "Tournaments and Events^events.php^Tournaments and events hosted at Black Forest Golf and Country Club.^tournament, golf, course, event";
s[11] = "Golf Membership^golfmembership.php^Apply today and take advantage of our Black Forest Term Membership priviledges.^golf, membership, member, term, priviledge";
s[12] = "The ZON Duty Free^zonshopping.php^Visit our Zon Duty Free Shopping Complex at Bukit Kayu Hitam, located next to Black Forest Golf and Country Club. ^zon, duty free, shopping, kayu hitam, cergas jaya, cergasjaya, complex, supermarket, bordertown, thai border";
s[13] = "Location Map^location.php^Location map of Black Forest Golf and Country Club.^location, map, where, direction, golf, thai border";
s[14] = "How to Get There^hottogetthere.php^How to get to Black Forest Golf and Country Club.^direction, map, travel, location, thai border, transportation, transport, golf, where, how, drive, taxi, bus, haadyai";
s[15] = "Contact Us^contactus.php^Contact Black Forest Golf and Country Club for any enquiries. Online feedback form available.^contact, feedback, form, online, golf, address, telephone, facsimile, fax, email, e-mail, website, register, regiatration, golf, travel, accommodation, golf";
s[16] = "Sitemap^sitemap.php^Website sitemap of www.blackforest.com.my.^sitemap, structure, website, pages";
s[17] = "Terms^terms.php^Terms and Conditions of Black Forest Golf and Country Club website.^terms, conditions, privacy, website, legal, copyright";
s[18] = "Your Privacy^privacy.php^Your Privacy statement of Black Forest Golf and Country Club website.^privacy, terms, conditions, website, legal, copyright";

// ---------- 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 specific keywords.');
		return;
	}
	for (var a = 0; a < r.length; a++) {
		var os = r[a].split("^");
		if (bold == 1 && m == 1) {
			var br = "<strong>" + d + "</strong>";
			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>');
		}
	}

}
