// Javascript search facility - keywords must be specified
// Declare Variables
var item = new Array(); // Holds the search array
var c=0; // Array counter
var page='<p><strong><u>Your Search Results</u></strong></p>'; // HTML formatting for search results header
var text_to_display; // Output string
var site_root = "http://www.codematrix.com/" //Path to documentation folder
//########################################################################
// Define your searches
// Example Line
// "HTML Page link","Page Title","Many,Key,Words","Descriptive Comments"
item[c]=new Array("ug/workspaces.shtml","CXInsight user guide","workspace,active,mount,copy,client,computer,edit","Workspaces");c++;
item[c]=new Array("ug/install_004.shtml","Installation guide","install,same","Installation guide; Installing client and server software on the same computer");c++;
item[c]=new Array("ug/install_003.shtml","Installation guide","install,server,windows","Installation guide; Installing server software on Windows");c++;
item[c]=new Array("ug/edit.shtml","CXInsight user guide","view,checkin,checkout,uncheckout,edit,3rd,party,delete,rename","Work with controlled files");c++;
item[c]=new Array("ug/diff.shtml","CXInsight user guide","revision,compare,diff,difference,history,change","Examining revision differences");c++;
item[c]=new Array("ug/concepts.shtml","CXInsight user guide","CodeMatrix,whats","Concepts and terminology");c++;
item[c]=new Array("ug/changenumbers.shtml","CXInsight user guide","change,numbers,transaction,filter","Change numbers");c++;
item[c]=new Array("ug/branches.shtml","CXInsight user guide","branches,life,cycle,merge,strand","Work with branches");c++;
item[c]=new Array("ug/attributes.shtml","CXInsight user guide","attributes","Use file attributes");c++;
item[c]=new Array("ug/labels.shtml","CXInsight user guide","labels","Use revision labels");c++;
item[c]=new Array("ug/install_client_w32.shtml","Installation guide","installing,client,windows","Installing client software on Windows");c++;
item[c]=new Array("ug/viewbar.shtml","CXInsight user guide","viewbar","Manage views - the View Bar");c++;
item[c]=new Array("ug/install.shtml","Installation guide","installing","Installing CodeMatrix");c++;
item[c]=new Array("ug/views.shtml","CXInsight user guide","view,filter","Customize a view");c++;
item[c]=new Array("ug/merge.shtml","CXInsight user guide","integrate,promote,merge,changes,branch","Integrate and promote changes");c++;
item[c]=new Array("ug/un-mount.shtml","CXInsight user guide","unmount,workspace,active","Mount and unmount workspaces");c++;
item[c]=new Array("ug/regress.shtml","CXInsight user guide","revert,undo,backout,regress,rollback,history,old","Backing out changes");c++;
item[c]=new Array("ug/uncheckout.shtml","CXInsight user guide","revert,undo,backout,uncheckout","Uncheckout");c++;
item[c]=new Array("ug/recycle.shtml","CXInsight user guide","unmount,recycle,temporary,save,recover","The recycle folder");c++;
item[c]=new Array("ug/options.shtml","CXInsight user guide","options,settings,editors,server,port,timeout,cache,user,login,logon","Changing settings");c++;
item[c]=new Array("ug/transactions.shtml","CXInsight user guide","transactions,begin,end,rollback","Using transactions");c++;
item[c]=new Array("menu/quick_title.shtml","Guided tours","flash,guided,tour","Guided tour index");c++;
item[c]=new Array("quick/quick_cx.shtml","Guided tours","flash,guided,tour,cx,command","Command line interface");c++;
item[c]=new Array("quick/cxinsight1.shtml","Guided tours","flash,guided,tour,cxinsight,gui,command","CXInsight");c++;
item[c]=new Array("menu/userg_title.shtml","User guides","user,guides","CodeMatrix user guide index");c++;
item[c]=new Array("menu/kb_title.shtml","Knowledge base","kb,knowledge,base","Knowledge base");c++;
item[c]=new Array("menu/ag_title.shtml","Adminstrator's guide","administrators,guide","CodeMatrix Administrator's guide");c++;
item[c]=new Array("menu/cx_title.shtml","User guides","cx,shell,console,command,line,dos,terminal,prompt","A guide to 'cx' the command line interface");c++;
item[c]=new Array("menu/ug_cxinsight_title.shtml","User guides","cxinsight,gui,java,application,interface,program,main","CXInsight user guide");c++;
item[c]=new Array("ag/acal.shtml","Adminstrator's guide","cal,license,licence","Administering client licenses");c++;
item[c]=new Array("ag/recovery.shtml","Adminstrator's guide","recovery,restore,backup","Database recovery");c++;
item[c]=new Array("ag/transactions.shtml","Adminstrator's guide","transactions","Administrating transactions");c++;
item[c]=new Array("ag/configure.shtml","Adminstrator's guide","configure,server,setup,set,get,cxoptions","Configuring the server");c++;
item[c]=new Array("ag/repository.shtml","Adminstrator's guide","repository","Creating repositories");c++;
item[c]=new Array("ag/stop.shtml","Adminstrator's guide","stop,start,run","Stopping and starting the server");c++;
item[c]=new Array("ag/backup.shtml","Adminstrator's guide","backup,save,restore","Database backup");c++;
item[c]=new Array("ag/license.shtml","Adminstrator's guide","license,licence","Installing a server license");c++;
item[c]=new Array("ag/users.shtml","Adminstrator's guide","users,roles","Managing users and roles");c++;
item[c]=new Array("ag/repair.shtml","Adminstrator's guide","repair","Repairing databases and workspaces");c++;
item[c]=new Array("api/api.shtml","API","api,application,program,interface","The application programming interface");c++;
item[c]=new Array("cx/acl.shtml","Command line reference","cx,shell,console,command,acl","The 'acl' command");c++;
item[c]=new Array("cx/add.shtml","Command line reference","cx,shell,console,command,add","The 'add' command");c++;
item[c]=new Array("cx/associate.shtml","Command line reference","cx,shell,console,command,associate","The 'associate' command");c++;
item[c]=new Array("cx/attribute.shtml","Command line reference","cx,shell,console,command,attribute","The 'attribute' command");c++;
item[c]=new Array("cx/begin.shtml","Command line reference","cx,shell,console,command,begin","The 'begin' command");c++;
item[c]=new Array("cx/branch.shtml","Command line reference","cx,shell,console,command,branch","The 'branch' command");c++;
item[c]=new Array("cx/cd.shtml","Command line reference","cx,shell,console,command,cd","The 'cd' command");c++;
item[c]=new Array("cx/checkin.shtml","Command line reference","cx,shell,console,command,checkin,ci","The 'checkin' command");c++;
item[c]=new Array("cx/checkout.shtml","Command line reference","cx,shell,console,command,checkout,co","The 'checkout' command");c++;
item[c]=new Array("cx/end.shtml","Command line reference","cx,shell,console,command,end","The 'end' command");c++;
item[c]=new Array("cx/exit.shtml","Command line reference","cx,shell,console,command,exit,quit,bye","The 'exit' command");c++;
item[c]=new Array("cx/fileclass.shtml","Command line reference","cx,shell,console,command,fileclass,fcl","The 'fileclass' command");c++;
item[c]=new Array("cx/filter.shtml","Command line reference","cx,shell,console,command,filter","The 'filter' command");c++;
item[c]=new Array("cx/flush.shtml","Command line reference","cx,shell,console,command,flush","The 'flush' command");c++;
item[c]=new Array("cx/folder.shtml","Command line reference","cx,shell,console,command,folder","The 'folder' command");c++;
item[c]=new Array("cx/get.shtml","Command line reference","cx,shell,console,command,get,settings","The 'get' command");c++;
item[c]=new Array("cx/help.shtml","Command line reference","cx,shell,console,command,help","The 'help' command");c++;
item[c]=new Array("cx/kill.shtml","Command line reference","cx,shell,console,command,kill","The 'kill' command");c++;
item[c]=new Array("cx/label.shtml","Command line reference","cx,shell,console,command,label","The 'label' command");c++;
item[c]=new Array("cx/license.shtml","Command line reference","cx,shell,console,command,license,licence","The 'license' command");c++;
item[c]=new Array("cx/locks.shtml","Command line reference","cx,shell,console,command,locks","The 'locks' command");c++;
item[c]=new Array("cx/logon.shtml","Command line reference","cx,shell,console,command,logon,user","The 'logon' command");c++;
item[c]=new Array("cx/ls.shtml","Command line reference","cx,shell,console,command,ls","The 'ls' command");c++;
item[c]=new Array("cx/merge.shtml","Command line reference","cx,shell,console,command,merge,integrate,promote","The 'merge' command");c++;
item[c]=new Array("cx/mount.shtml","Command line reference","cx,shell,console,command,mount,workspace","The 'mount' command");c++;
item[c]=new Array("cx/move.shtml","Command line reference","cx,shell,console,command,move,rename","The 'move' command");c++;
item[c]=new Array("cx/overview.shtml","Command line reference","cx,shell,console,command,overview","Overview");c++;
item[c]=new Array("cx/reference.shtml","Command line reference","cx,shell,console,command,reference","Index");c++;
item[c]=new Array("cx/queue.shtml","Command line reference","cx,shell,console,command,queue","The 'queue' command");c++;
item[c]=new Array("cx/popd.shtml","Command line reference","cx,shell,console,command,popd","The 'popd' command");c++;
item[c]=new Array("cx/pushd.shtml","Command line reference","cx,shell,console,command,pushd","The 'pushd' command");c++;
item[c]=new Array("cx/pwd.shtml","Command line reference","cx,shell,console,command,pwd","The 'pwd' command");c++;
item[c]=new Array("cx/recycle.shtml","Command line reference","cx,shell,console,command,recycle","The 'recycle' command");c++;
item[c]=new Array("cx/repair.shtml","Command line reference","cx,shell,console,command,repair","The 'repair' command");c++;
item[c]=new Array("cx/repository.shtml","Command line reference","cx,shell,console,command,repository","The 'repository' command");c++;
item[c]=new Array("cx/revise.shtml","Command line reference","cx,shell,console,command,revise","The 'revise' command");c++;
item[c]=new Array("cx/deletefol.shtml","Command line reference","cx,shell,console,command,delete,rd","The 'rd' command");c++;
item[c]=new Array("cx/rm.shtml","Command line reference","cx,shell,console,command,delete,rm","The 'rm' command");c++;
item[c]=new Array("cx/role.shtml","Command line reference","cx,shell,console,command,role","The 'role' command");c++;
item[c]=new Array("cx/rollback.shtml","Command line reference","cx,shell,console,command,rollback","The 'rollback' command");c++;
item[c]=new Array("cx/sessions.shtml","Command line reference","cx,shell,console,command,sessions","The 'sessions' command");c++;
item[c]=new Array("cx/set.shtml","Command line reference","cx,shell,console,command,settings","The 'set' command");c++;
item[c]=new Array("cx/shutdown.shtml","Command line reference","cx,shell,console,command,shutdown","The 'shutdown' command");c++;
item[c]=new Array("cx/snapshot.shtml","Command line reference","cx,shell,console,command,snapshot,backup","The 'snapshot' command");c++;
item[c]=new Array("cx/task.shtml","Command line reference","cx,shell,console,command,task","The 'task' command");c++;
item[c]=new Array("cx/transactions.shtml","Command line reference","cx,shell,console,command,transactions","The 'transactions' command");c++;
item[c]=new Array("cx/trigger.shtml","Command line reference","cx,shell,console,command,trigger","The 'trigger' command");c++;
item[c]=new Array("cx/unassociate.shtml","Command line reference","cx,shell,console,command,unassociate,disassociate","The 'unassociate' command");c++;
item[c]=new Array("cx/uncheckout.shtml","Command line reference","cx,shell,console,command,uncheckout","The 'uncheckout' command");c++;
item[c]=new Array("cx/unmount.shtml","Command line reference","cx,shell,console,command,unmount","The 'unmount' command");c++;
item[c]=new Array("cx/uptime.shtml","Command line reference","cx,shell,console,command,uptime","The 'uptime' command");c++;
item[c]=new Array("cx/user.shtml","Command line reference","cx,shell,console,command,user","The 'user' command");c++;
item[c]=new Array("cx/workspace.shtml","Command line reference","cx,shell,console,command,workspace","The 'workspace' command");c++;
item[c]=new Array("cx/workspaceclass.shtml","Command line reference","cx,shell,console,command,wcl,workspaceclass","The 'workspaceclass' command");c++;
item[c]=new Array("kb/kb001.shtml","Knowledge base","repair","Why do I get a message, workspace or repository repair required?");c++;
item[c]=new Array("kb/kb002.shtml","Knowledge base","active","What are active workspaces");c++;
item[c]=new Array("kb/kb003.shtml","Knowledge base","script,perl","How do I access CodeMatrix functions from a script?");c++;
item[c]=new Array("kb/kb004.shtml","Knowledge base","backup,restore,database,recover,recovery,save","How do I backup and restore the CodeMatrix database?");c++;
item[c]=new Array("kb/kb005.shtml","Knowledge base","filter,filters,view,views","What are filters?");c++;
item[c]=new Array("kb/kb006.shtml","Knowledge base","back,revert,regress,history,undo","How do I back out a change?");c++;
item[c]=new Array("kb/kb007.shtml","Knowledge base","accident,accidentally,recover,lost","How do I recover a file accidentally un-checked out?");c++;
item[c]=new Array("kb/kb008.shtml","Knowledge base","edition,editions,professional,enterprise","What are the differences between the CodeMatrix editions?");c++;
item[c]=new Array("kb/kb009.shtml","Knowledge base","operating,system,windows,linux,solaris,mac,osx","What operating systems are supported?");c++;
item[c]=new Array("kb/kb010.shtml","Knowledge base","transactions","How do I use transactions?");c++;
item[c]=new Array("kb/kb011.shtml","Knowledge base","price","How are CodeMatrix prices determined?");c++;
item[c]=new Array("kb/kb012.shtml","Knowledge base","evaluate,evaluation","How can I evaluate CodeMatrix?");c++;
item[c]=new Array("kb/kb013.shtml","Knowledge base","support","How do I get support?");c++;
item[c]=new Array("kb/kb014.shtml","Knowledge base","order,buy,purchase,license,licence","How do I place an order for CodeMatrix software?");c++;
item[c]=new Array("kb/kb015.shtml","Knowledge base","workspace","What is a workspace?");c++;
item[c]=new Array("kb/kb016.shtml","Knowledge base","java,crash,blue,bsod,video,driver","Windows video driver issues with Java version 1.4.1.01");c++;
item[c]=new Array("kb/kb017.shtml","Knowledge base","file,name,naming","CodeMatrix file naming");c++;
item[c]=new Array("kb/kb018.shtml","Knowledge base","hardware,cpu,memory,requirements","What are the hardware requirements for CodeMatrix?");c++;
item[c]=new Array("kb/sales_general_faq.shtml","FAQ","faq","Sales and general FAQ index");c++;
item[c]=new Array("kb/kb_index.shtml","Knowledge base","kb,knowledge","Knowledge base and FAQ index");c++;
item[c]=new Array("kb/tech_faq.shtml","FAQ","faq","Top technical FAQs");c++;
item[c]=new Array("training.shtml","CodeMatrix","training,course,","Training information request");c++;
item[c]=new Array("support.shtml","CodeMatrix","support,contact,phone,email,call,telephone,documentation,mail,list,peer","Support options");c++;
item[c]=new Array("prodinfo.shtml","CodeMatrix","active,101,overview,introduction,feature","CodeMatrix product information ");c++;
item[c]=new Array("pricing.shtml","CodeMatrix","prices,pricing,costs,edition,support,maintenance,tax,currency,order","CodeMatrix pricing for software and maintenance");c++;
item[c]=new Array("news.shtml","CodeMatrix","newsletter,subscribe","CodeMatrix news");c++;
item[c]=new Array("downloads.shtml","CodeMatrix","download,downloads,software,evaluate,evaluation","Software downloads");c++;
item[c]=new Array("documentation.shtml","CodeMatrix","documentation,help,?","CodeMatrix documentation");c++;
item[c]=new Array("contact.shtml","CodeMatrix","contact,phone,email,fax,telephone,call,US,abroad,overseas,international,sales,support,info","Contact information");c++;
item[c]=new Array("index.shtml","CodeMatrix","home,CodeMatrix","CodeMatrix home page");c++;


// repeat as necessary
//########################################################################

// Function called to perform search
function search(frm)
{
	text_to_display = page;
	text = frm.srchval.value.toLowerCase()
	txt = text.split(" ");
	fnd = new Array(); total=0;
	for (i = 0; i < item.length; i++)
	{
		fnd[i] = 0; order = new Array(0, 3, 1, 2);
		for (j = 0; j < order.length; j++)
			for (k = 0; k < txt.length; k++)
				if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "") fnd[i] += (j+1);
	}
	for (i = 0; i < fnd.length; i++)
	{
		n = 0; w = -1;
		for (j = 0;j < fnd.length; j++)
			if (fnd[j] > n) { n = fnd[j]; w = j; };
		if (w > -1) total += show(w, n);
		fnd[w] = 0;
	}
	if(total==0) text_to_display += "<p>Sorry, no results found for your search.";
// Somehow output the string in a NS compatible manner
	showDisplay('searchResults',text_to_display);
}

// Function called to add a new search result to the output text 
function show(which,num)
{
	link = item[which][0]; 
	line = "<p><a href='"+site_root+link+"' class='links'>"+item[which][1]+"</a><br>";
	line += item[which][3] + "</p>";
	text_to_display += line;
	return 1;
}

function showDisplay(theLayer, theDisplay){
if (!document.layers && !document.all && !document.getElementById) 
return;
if (document.layers) { 
	document.layers[theLayer].document.write(theDisplay); 
	document.layers[theLayer].document.close();} 
else if (document.all) { 
	document.all[theLayer].innerHTML = theDisplay;} 
else if (document.getElementById) { 
	document.getElementById(theLayer).innerHTML = theDisplay;} 
}