this.searchfield = function(){
	
	// this is id of the search field you want to add this script to. 
	// You can use your own id just make sure that it matches the search field in your html file.
	var id = "plcRoot_Layout_zoneMenu_cmssearchbox_txtWord";
	
	// Text you want to set as a default value of your search field.
	var defaultText = "Search the site...";	
	
	// set to either true or false
	// when set to true it will generate search suggestions list for search field based on content of variable below
	var suggestion = true;
	
	// static list of suggestion options, separated by comma
	var suggestionText = "100, 1053, 11, 110, 120, 13, 130, 140, 150, 180, 2004, 2147023739, 2147024769, 2147024770, 2147024882, 2147024893, 2147217339, 2147221231, 2147417848, 2147418113, 2147467259, 2147483640, 2147484882, 260, 28, 280, 300, 3000, 30006, 3008, 3010, 3011, 3015, 3019, 3021, 3022, 3024, 3026, 3033, 3040, 3041, 3043, 3046, 3049, 3050, 3051, 3058, 3077, 3078, 310, 3111, 3112, 3159, 3163, 3167, 3183, 3197, 320, 3202, 3204, 321, 3211, 3218, 3219, 3259, 326, 3260, 3261, 3265, 3315, 3343, 3356, 339, 340, 3420, 3421, 3446, 3447, 35756, 3633, 370, 372, 380, 381, 40, 400, 400, 405, 410, 429, 438, 458, 48, 481, 482, 484, 5, 50003, 510, 52, 53, 57, 6, 6016, 62, 68, 70, 71, 713, 75, 76, 8002, 8005, 8018, 8020, 8021, 9, 91, 94, Access to Windows\System - When is it Required?, Accounts Payable Error, Advanced Scheduler Limits, Application Defined Or Object Defined Error, Attendance Tracker Screen Colors, Autodraft Payment Authorization, Backup History, Bad Ass Coffee, Bad Debt Procedure, Bad Debt Write Off / Collections, Balance Settings, BAM Alert, BAM Credit Card Processing, BAM VPN Policy, Billing Methods Summary, Bright Horizons, Buyguide.mdb, Caffe Diem Coffee House, California Attendance Tracker Requirements, Changing A Voice Greeting, Check Reader, Childcare Network, Children of America, Children's Friend Learning Centers, Children's World Learning Centers, Childtime Children's Centers, Clocknet.exe Changes, Competitor Data Conversion, Competitor Web Sites, Copying Letters From One Multi-site to Another, Corporate FTP Restore Manager, Corporate Organizer, Creative Kids, Creative Web Cam, Credit Card Payments over $5000, Creme de la Creme, Crystal Report Errors, Custom Reports, Customer/Tech Resolution, Daily Perks, Daily Tech Schedules, Data Corruption, Data Folder Confirmation, Declined Credit Card Payment Procedure, Dell Picture Studio, Deposit Report: No Entries Were Found To Close, Dispatch Rotation, Door Controller, Dutch Brothers Coffee, Ebenezer Child Care Centers, Educator's Program, EIC Overpayment, Elapsed Time in Attendance Tracker, Encryption Error, End of Sale Process, Expired Update Subscription Script, Exporting Reports To Excel, FTP Commands, FTP Corp Directory Bin, FTP Downloads, FTP Error Codes, FTP Order Processing, Garnishment For Minimum Net Pay, Garnishment From Net Pay, Getting Started Call, GFGTT Holdings, Gourmet Coffee Co, Hardware Accessory Pricing, Hardware Core Credit Program, Hardware Procedure, Hardware Procedures, Hardware Warranty / Return Policy, Hildebrandt Learning Center, How To Export To Character-Delimited In Report Designer, Human Bean Coffee, Illegal Operation, Island Juice, Java House Coffee, KES Recall, Revised Warranty and Replacement Procedure, Keyless Entry System Cabling, Keyless Entry System, Kinder Attend, Koffee Kottage, Legacy Academy for Children, License Transfer Policy, License Transfer within Company, Mailing a CD Install Key, Mellelo's Coffee, Mini-Skool Early Learning Center, Minnieland Private Day School, Module Is Active In Vista, MSTFILE Registration, Multi-Site Name Search, Multi-Site Update Pricing, Network Time Clock, Normal Domain vs. Peer 2 Peer, North Carolina E-Procurement System, O'Java Coffee, Online Error Codes, Online Information, Online Service Codes, Online Store, Out Of Balance, Payroll Withholding Variables Disappear, PCLiteX.dll, Pictures Do Not Display In Reports, Pocket Attendance Tracker Errors, Pocket Attendance Tracker Handheld Device Screen Shots, Pocket Attendance Tracker Information, Procare File Extensions, Procare Lite Registration Cheat Sheet, Procare Lite, Procare Sync Screen Shots, Procare Utilities, Program RegistrationRemote Attendance Tracker, Purchase Orders for Corporations - Hospitals - Universities, Rainbow Child Development, RCMA - Redlands Christian Migrant Association, Referral Source Qualification, Replacement of Media, Report Designer, Run Time Errors & Zip Errors, Safeway Coffee, Serial Port Redirection - Terminal Services, Setting Up A Secondary Data Drive, Shipping Guidelines, Sony Micro Vault, Starbucks Coffee, Startup Error, State Tax Changes, Supervisor Authenticator Code, Switching From Single To Multi-site, Table Rock Coffee, Tax Exempt Pay, Tech Projects2004 HP Pavilion PCs, Techinline, Temporary Registration, Terminal Services - Things To Know, Terminal Services and Citrix, The Children's Courtyard, The Malvern School, The String In Non-Numeric, Time Clock as NT Service, Time Clock Door Relay Connecting Block, Time Clock Test Mode, Time Clock, Tuition Express Emails, Tuition Express Exception Codes, Tuition Express Getting Started, Tuition Express Status Codes, Tutor Time Childcare Learning Center, Type Mismatch, Unable To Connect, Update Credit Towards New Purchase, Update Registration Information, UpdateBillingBoxes.exe, UPS Shipping, User Defined Fields Errors, Using the Postage Machine, v10 Information, vbrun60, W2 Tech Download, W2, Web Stats, Wi-Fi Networking Issues, Windows 2003 Server Remote Desktop Protocol, Windows XP Media Center With NVidia Video Cards, XP Compatibility Mode"; 
	
	// END CONFIG (do not edit below this line. )

	var field = document.getElementById(id);	
	var classInactive = "sf_inactive";
	var classActive = "sf_active";
	var classText = "sf_text";
	var classSuggestion = "sf_suggestion";
	this.safari = ((parseInt(navigator.productSub)>=20020000)&&(navigator.vendor.indexOf("Apple Computer")!=-1));
	if(field && !safari){
		field.value = defaultText;
		field.c = field.className;		
		field.className = field.c + " " + classInactive;
		field.onfocus = function(){
			this.className = this.c + " "  + classActive;
			this.value = (this.value == "" || this.value == defaultText) ?  "" : this.value;
		};
		field.onblur = function(){
			this.className = (this.value != "" && this.value != defaultText) ? this.c + " " +  classText : this.c + " " +  classInactive;
			this.value = (this.value != "" && this.value != defaultText) ?  this.value : defaultText;
			clearList();
		};
		if (suggestion){
			
			var selectedIndex = 0;
						
			field.setAttribute("autocomplete", "off");
			var div = document.createElement("div");
			var list = document.createElement("ul");
			list.style.display = "none";
			div.className = classSuggestion;
			list.style.width = field.offsetWidth + "px";
			div.appendChild(list);
			field.parentNode.appendChild(div);	

			field.onkeypress = function(e){
				
				var key = getKeyCode(e);
		
				if(key == 13){ // enter
					selectList();
					selectedIndex = 0;
					return false;
				};	
			};
				
			field.onkeyup = function(e){
			
				var key = getKeyCode(e);
		
				switch(key){
				case 13:
					return false;
					break;			
				case 27:  // esc
					field.value = "";
					selectedIndex = 0;
					clearList();
					break;				
				case 38: // up
					navList("up");
					break;
				case 40: // down
					navList("down");		
					break;
				default:
					startList();			
					break;
				};
			};
			
			this.startList = function(){
				var arr = getListItems(field.value);
				if(field.value.length > 0){
					createList(arr);
				} else {
					clearList();
				};	
			};
			
			this.getListItems = function(value){
				var arr = new Array();
				var src = suggestionText;
				var src = src.replace(/, /g, ",");
				var arrSrc = src.split(",");
				for(i=0;i<arrSrc.length;i++){
					if(arrSrc[i].substring(0,value.length).toLowerCase() == value.toLowerCase()){
						arr.push(arrSrc[i]);
					};
				};				
				return arr;
			};
			
			this.createList = function(arr){				
				resetList();			
				if(arr.length > 0) {
					for(i=0;i<arr.length;i++){				
						li = document.createElement("li");
						a = document.createElement("a");
						a.href = "javascript:void(0);";
						a.i = i+1;
						a.innerHTML = arr[i];
						li.i = i+1;
						li.onmouseover = function(){
							navListItem(this.i);
						};
						a.onmousedown = function(){
							selectedIndex = this.i;
							selectList(this.i);		
							return false;
						};					
						li.appendChild(a);
						list.setAttribute("tabindex", "-1");
						list.appendChild(li);	
					};	
					list.style.display = "block";				
				} else {
					clearList();
				};
			};	
			
			this.resetList = function(){
				var li = list.getElementsByTagName("li");
				var len = li.length;
				for(var i=0;i<len;i++){
					list.removeChild(li[0]);
				};
			};
			
			this.navList = function(dir){			
				selectedIndex += (dir == "down") ? 1 : -1;
				li = list.getElementsByTagName("li");
				if (selectedIndex < 1) selectedIndex =  li.length;
				if (selectedIndex > li.length) selectedIndex =  1;
				navListItem(selectedIndex);
			};
			
			this.navListItem = function(index){	
				selectedIndex = index;
				li = list.getElementsByTagName("li");
				for(var i=0;i<li.length;i++){
					li[i].className = (i==(selectedIndex-1)) ? "selected" : "";
				};
			};
			
			this.selectList = function(){
				li = list.getElementsByTagName("li");	
				a = li[selectedIndex-1].getElementsByTagName("a")[0];
				field.value = a.innerHTML;
				clearList();
			};			
			
		};
	};
	
	this.clearList = function(){
		if(list){
			list.style.display = "none";
			selectedIndex = 0;
		};
	};		
	this.getKeyCode = function(e){
		var code;
		if (!e) var e = window.event;
		if (e.keyCode) code = e.keyCode;
		return code;
	};
	
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",searchfield);