

// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();

// Features
s[0] = "Basic Features^http://185-70154:8080/hmc/features/cf_basic.jsp^Basic Features^Basic, Features, Cash Advance, Customer Service, Free, Basic Feature, Value Payment, Value, Payment, Free Membership, Membership, Payment Options, Payment, Options, Ebanking";
s[1] = "More Value for Money^http://185-70154:8080/hmc/features/cf_more_value.jsp^More Value for Money^Value, Money, Accident, Insurance, Claim, Rebates, More Value, More Value for Money";
s[2] = "Free Accident Insurance^http://185-70154:8080/hmc/features/cf_more_value.jsp^Free Accident Insurance^Free, Accident, Insurance, Disability, Medical, Death, Claim, Permanent, Free Accident Insurance";
s[3] = "1% Cash Rebates^http://185-70154:8080/hmc/features/cf_more_value.jsp^1% Cash Rebates^Cash, Coupon, Auto-charged, Auto-charged transactions, Cash rebate, Rebate, 1%";
s[4] = "Practical Lifestyle^http://185-70154:8080/hmc/features/cf_lifestyle.jsp^Practical Lifestyle^Practical Lifestyle, Practical, Lifestyle, Cash advance, EasyPay, Transfer, Cash, Convert, Installments, Partner, Merchants";
s[5] = "Convenience Page^http://185-70154:8080/hmc/features/cf_homebills_payment.jsp^Convenience Page^Convenience, Homebills, Payment, Utility, Charge-on-demand, Facility";
s[6] = "List of Companies^http://185-70154:8080/hmc/features/cf_company.html^List of Companies^Company, List, Payment, Utility, Provider";
s[7] = "Utility Providers^http://185-70154:8080/hmc/features/cf_utilitylist.html^Utility Providers^Company, List, Payment, Utility, Provider";
s[8] = "Requirements Page^http://185-70154:8080/hmc/apply/ap_req.jsp^Requirements Page^Requirements, Documents, Income, Identification";

// Information Center
s[9] = "Fees and Charges^http://185-70154:8080/hmc/infocenter/ic_feesncharges.jsp^Fees and Charges^Fees, Charges, Minimum, Late, Payment, Supplementary, Agreement";
s[10] = "FAQ^http://185-70154:8080/hmc/infocenter/ic_faq.jsp^FAQ^FAQ, Question, Questions, Card Loss, Defective, Update, Supplementary, Cancel, Cancellation, Sodexho, Rebate, Rebates, Auto-Charge";
s[11] = "Payment Center^http://185-70154:8080/hmc/infocenter/ic_payment_ctr.jsp^Payment Center^Payment Center, BDO Branches, SM Bills, Payment, Center, ATM, Phone Banking, E-banking";
s[12] = "Request Replacement Card^http://185-70154:8080/hmc/infocenter/ic_replacement_card.jsp^Request Replacement Card^";
s[13] = "Contact Us^http://185-70154:8080/hmc/infocenter/ic_contact_us.jsp^Contact Us^Contact Us, Call Center, Domestic Toll-Free, Toll-Free, Business Center, BDO Branch, Email, Phone, Support";
s[14] = "Feedback^http://185-70154:8080/hmc/infocenter/ic_feedback.jsp^Feedback^Feedback, Comment, Opinion, Inquire, Complain, Suggest, Follow-up";
s[15] = "Refer a Friend^http://185-70154:8080/hmc/infocenter/ic_refer_friend.jsp^Refer a Friend^Refer Friend, Refer, Friend, Apply, Referral";
s[16] = "Refer Website^http://185-70154:8080/hmc/infocenter/ic_refer_website.jsp^Refer Website^Refer, Website";
s[17] = "Site Map^http://185-70154:8080/hmc/infocenter/ic_site_map.jsp^Site Map^Site, Map";
s[18] = "Supplementary Card^http://185-70154:8080/hmc/infocenter/ic_supplementary_card.jsp^Supplementary Card^Supplementary, Supplementary Card, Card, Cards, Sublimit feature";

// Apply
s[19] = "Downloadable Forms^http://185-70154:8080/hmc/apply/ap_download_application.jsp^Downloadable Forms^Download, Form, Forms, Download Forms, Application , Application Form, Homebills Payment, Homebills, Homebills Payment Form, Payment Form";



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('<font>Your search did not match any documents.<p>Make sure all keywords are spelt correctly.<br>Try different or more general keywords.</font>');
		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>');
		}
	}

}
