

// ---------- script properties ----------

var include_num = 1;
var bold = 0;

// ---------- sites ----------


var s = new Array();

s[0] = "QuickBooks Enterprise^/products/quickbooks_enterprise.asp^QuickBooks Enterprise Solutions – Business Management Software^QuickBooks, Enterprise, 10, User, Multi, licence, software, accounts, finaces, money";

s[1] = "ACT^/products/act.asp^ACT Provides fully integrated calendar contact and communications functionality^ACT, customer, manager, calendar, contacts";

s[2] = "Quicken Personal^/products/quicken_personal.asp^Wanting easy to use software that will track your income and expenses.  Choose Quicken Personal^Personal, home, finances, account, quicken, cashbook, cash";

s[3] = "Quicken Personal Plus^/products/quicken_personal_plus.asp^Looking to track your personal income and expenses, look after your shares and investments and help you plan for your future? Choose Quicken Personal Plus.^Personal, plus, home, finances, account, quicken, cashbook, cash";

s[4] = "BusinessPlus - Support Program^/support/business_plus.asp^Here at Quicken we listen to what our customers want and to this end have developed a fantastic support package – BusinessPlus.^Business, plus, care, support, package, quickbooks, quicken, cashbook, cash";

s[5] = "BusinessCARE - Support Program^/support/business_plus.asp^Here at Quicken NZ we pride ourselves on our outstanding customer service. That’s why we have a network of excellent Accredited Trainers nationwide to provide local support and training. ^quickencare, Business, plus, care, support, package, quickbooks, quicken, cashbook, cash";

s[6] = "QuickBooks Easy Start^/products/quickbooks_easy_start.asp^QuickBooks EasyStart is a breakthrough in simple bookkeeping for new and home-based businesses. Designed for first-time users of accounting software, EasyStart makes it easy to get started with simple, practical tools to manage essential business tasks.^Business, plus, care, support, package, quickbooks, quicken, cashbook, cash";

s[7] = "QuickBooks Accounting^/products/quickbooks_accounting.asp^Need an accounting package that covers all of the basics and is still easy to use? Choose QuickBooks Accounting^QuickBooks, Accounting, single, software, accounts, finaces, money, business, small";

s[8] = "QuickBooks Small Business^/products/quickbooks_small_business.asp^Do you struggle with GST and managing your stock? Choose QuickBooks Small Business^QuickBooks, Accounting, single, software, accounts, finaces, money, business, small";

s[9] = "QuickBooks Professional^/products/quickbooks_pro.asp^Wanting a product that will allow you to on-charge your time? Choose QuickBooks Professional^QuickBooks, Accounting, single, software, accounts, finaces, money, business";

s[10] = "QuickBooks Premier^/products/quickbooks_premier.asp^Requiring more than 5 users? Choose QuickBooks Premier^QuickBooks, Accounting, multi, user, licence, software, accounts, finaces, money, business";

s[11] = "Intrepid Backup^/products/intrepid_backup.asp^Intrepid Backup is a revolutionary online storage application that allows users too safely and securely store files on a server that are accessible any time, anywhere.^intrepid, backup, securety, software, save, files, file, online";

s[12] = "Intrepid Bankdata^/products/intrepid_bankdata.asp^Effective Bank Transaction Importing & Processing Software for Professional Accountants that links directly to all major E-banking Systems in New Zealand.^intrepid, bankdata, bank, data, transactions, bank, internet, banking, import, securety, software, save, files, file, online";

s[13] = "QuickBooks Customer Manager^/products/qb_customer_manager.asp^Customer Manager is a new information and task management tool that will help you better serve your customers.^quickbooks, tasks, write, letters, customer, manager, calendar, contacts";

s[14] = "Software Support^/support/index.asp^Find a Trainer - Product Training -  Technical Support - Data Services - Service Patches - Data Converters^support, help, why, find, trainer, accountant, assist, book, keeper, quickbooks, tasks, write, letters, customer, manager, calendar, contacts";

s[15] = "Software Resellers^/professional_services_group/resellers.asp^A list of the Quicken software resellers. You can also purshace your Quicken software through your Quicken consultant. Check with your accountant.^reseller, resellers, trainer, accountant, assist, book, keeper, quickbooks";


// ---------- 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 spelt correctly.<br>Try different or more general keywords.');
		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>');
		}
	}

}
