// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();
//add new page as s[i]
//s[i]="Results page title^page.html^Short description...^keywords separated by ,";
s[0]="Client Access Login^client_access_login.html^Client Access Login ...^client, client access, login, client login, access ";
s[1]="Client Forgot Password^client_forgot_password.html^Client Forgot Password ...^client, forgot password, password,";
s[2]="Contact Us^contact_us.html^Contact details page ...^contact us, contact, find us,American Profit Recovery, address,email address, phone number ";
s[3]="Industries serverd^industries_served.html^We provide debt collection services to different companies looking to obtain debts owed to them for services rendered ...^industry, industry served, industries served";
s[4]="Mthodology^methodology.html^Every debt is taken through our extensive debt collection system in order to collect the largest portion ...^methodology";
s[5]="Pay Online Here^pay_online.html^To complete an online payment, please enter the reference number and dollar amount of your payment below ...^pay online, pay for services, online payment,how to pay, payment";
s[6]="Place account collection^place_account_collection.html^Have a client that has not paid you back for services rendered on their behalf? Need to collect debts owed to you?  ...^client account collection, debt, debitor info,";
s[7]="Rates^rates.html^If we are unable to collect the amount that is owed, we will not charge for service and ...^rates, service rate";
s[8]="Resource center^resource_center.html^Services to attempt to collect the amount owed.  ...^resource, resources, center,";
s[9]="NO COLLECTION MEANS NO FEE^index.html^Web Credit Services is a specialized commercial debt Web Credit Services with a focus around the online interactive industry.  ...^Web Credit Services,";

// ---------- 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('No results found.<p><br>Please seach again.');
		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 class="results" href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		} else {
			document.write('<a class="results" href="', os[1], '">', os[0], '</a><br>', os[2], '<p>');
		}
	}

}

