this.searchfield = function(){
	
	// CONFIG 
	
	// 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 = "Zip";
	
	// Text you want to set as a default value of your search field.
	var defaultText = "Enter your zip...";	
	
	// 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
	// replace with your own
	var suggestionText = "02351 Abington MA, 02018 Accord MA, 01720 Acton MA, 02743 Acushnet MA, 01220 Adams MA, 01001 Agawam MA, 02134 Allston MA, 01913 Amesbury MA, 01002 Amherst MA, 01003 Amherst MA, 01004 Amherst MA, 01810 Andover MA, 01812 Andover MA, 01899 Andover MA, 05501 Andover MA, 05544 Andover MA, 02474 Arlington MA, 02476 Arlington MA, 02475 Arlington Heights MA, 01430 Ashburnham MA, 01431 Ashby MA, 01330 Ashfield MA, 01721 Ashland MA, 01222 Ashley Falls MA, 02702 Assonet MA, 01331 Athol MA, 02703 Attleboro MA, 02763 Attleboro Falls MA, 01501 Auburn MA, 02466 Auburndale MA, 02322 Avon MA, 01432 Ayer MA, 02457 Babson Park MA, 01436 Baldwinville MA, 02630 Barnstable MA, 01005 Barre MA, 01223 Becket MA, 01730 Bedford MA, 01007 Belchertown MA, 02019 Bellingham MA, 02478 Belmont MA, 02779 Berkley MA, 01224 Berkshire MA, 01503 Berlin MA, 01337 Bernardston MA, 01915 Beverly MA, 01821 Billerica MA, 01822 Billerica MA, 01504 Blackstone MA, 01008 Blandford MA, 01740 Bolton MA, 01009 Bondsville MA, 02101 Boston MA, 02102 Boston MA, 02103 Boston MA, 02104 Boston MA, 02105 Boston MA, 02106 Boston MA, 02107 Boston MA, 02108 Boston MA, 02109 Boston MA, 02110 Boston MA, 02111 Boston MA, 02112 Boston MA, 02113 Boston MA, 02114 Boston MA, 02115 Boston MA, 02116 Boston MA, 02117 Boston MA, 02118 Boston MA, 02119 Boston MA, 02120 Boston MA, 02121 Boston MA, 02122 Boston MA, 02123 Boston MA, 02124 Boston MA, 02125 Boston MA, 02127 Boston MA, 02128 Boston MA, 02133 Boston MA, 02163 Boston MA, 02196 Boston MA, 02199 Boston MA, 02201 Boston MA, 02202 Boston MA, 02203 Boston MA, 02204 Boston MA, 02205 Boston MA, 02206 Boston MA, 02207 Boston MA, 02208 Boston MA, 02209 Boston MA, 02210 Boston MA, 02211 Boston MA, 02212 Boston MA, 02215 Boston MA, 02216 Boston MA, 02217 Boston MA, 02222 Boston MA, 02241 Boston MA, 02266 Boston MA, 02283 Boston MA, 02284 Boston MA, 02293 Boston MA, 02295 Boston MA, 02297 Boston MA, 01719 Boxborough MA, 01921 Boxford MA, 01505 Boylston MA, 02184 Braintree MA, 02185 Braintree MA, 02020 Brant Rock MA, 02631 Brewster MA, 02324 Bridgewater MA, 02325 Bridgewater MA, 02135 Brighton MA, 01010 Brimfield MA, 02301 Brockton MA, 02302 Brockton MA, 02303 Brockton MA, 02304 Brockton MA, 02305 Brockton MA, 01506 Brookfield MA, 02445 Brookline MA, 02446 Brookline MA, 02447 Brookline Village MA, 02327 Bryantville MA, 01338 Buckland MA, 01803 Burlington MA, 01805 Burlington MA, 02532 Buzzards Bay MA, 02542 Buzzards Bay MA, 01922 Byfield MA, 02138 Cambridge MA, 02139 Cambridge MA, 02140 Cambridge MA, 02141 Cambridge MA, 02142 Cambridge MA, 02238 Cambridge MA, 02239 Cambridge MA, 02021 Canton MA, 01741 Carlisle MA, 02330 Carver MA, 02534 Cataumet MA, 02632 Centerville MA, 02634 Centerville MA, 02636 Centerville MA, 01339 Charlemont MA, 02129 Charlestown MA, 01507 Charlton MA, 01508 Charlton City MA, 01509 Charlton Depot MA, 02712 Chartley MA, 02633 Chatham MA, 01824 Chelmsford MA, 02150 Chelsea MA, 01611 Cherry Valley MA, 01225 Cheshire MA, 01011 Chester MA, 01012 Chesterfield MA, 02467 Chestnut Hill MA, 01013 Chicopee MA, 01014 Chicopee MA, 01020 Chicopee MA, 01021 Chicopee MA, 01022 Chicopee MA, 02535 ChilMArk MA, 01510 Clinton MA, 02025 Cohasset MA, 01340 Colrain MA, 01742 Concord MA, 01341 Conway MA, 02635 Cotuit MA, 02637 CumMAquid MA, 01026 Cummington MA, 02713 Cuttyhunk MA, 01226 Dalton MA, 01227 Dalton MA, 01923 Danvers MA, 02714 Dartmouth MA, 02026 Dedham MA, 02027 Dedham MA, 01342 Deerfield MA, 02638 Dennis MA, 02639 Dennis Port MA, 02715 Dighton MA, 01516 Douglas MA, 02030 Dover MA, 01826 Dracut MA, 01343 Drury MA, 01571 Dudley MA, 01827 Dunstable MA, 02331 Duxbury MA, 02332 Duxbury MA, 02228 East Boston MA, 02333 East Bridgewater MA, 01515 East Brookfield MA, 02641 East Dennis MA, 02536 East Falmouth MA, 02717 East Freetown MA, 01028 East Longmeadow MA, 02031 East MAnsfield MA, 02643 East Orleans MA, 01029 East Otis MA, 01517 East Princeton MA, 02537 East Sandwich MA, 02718 East Taunton MA, 01438 East Templeton MA, 02032 East Walpole MA, 02538 East Wareham MA, 02642 Eastham MA, 01027 Easthampton MA, 02334 Easton MA, 02539 Edgartown MA, 02337 Elmwood MA, 01344 Erving MA, 01929 Essex MA, 02149 Everett MA, 02719 Fairhaven MA, 02720 Fall River MA, 02721 Fall River MA, 02722 Fall River MA, 02723 Fall River MA, 02724 Fall River MA, 02540 Falmouth MA, 02541 Falmouth MA, 01745 Fayville MA, 01030 Feeding Hills MA, 01518 Fiskdale MA, 01420 Fitchburg MA, 01062 Florence MA, 02644 Forestdale MA, 02035 Foxboro MA, 01701 Framingham MA, 01702 Framingham MA, 01703 Framingham MA, 01704 Framingham MA, 01705 Framingham MA, 02038 Franklin MA, 01440 Gardner MA, 01833 Georgetown MA, 01031 Gilbertville MA, 01229 Glendale MA, 01930 Gloucester MA, 01931 Gloucester MA, 01032 Goshen MA, 01519 Grafton MA, 01033 Granby MA, 01034 Granville MA, 01230 Great Barrington MA, 02041 Green Harbor MA, 02040 Greenbush MA, 01301 Greenfield MA, 01302 Greenfield MA, 01450 Groton MA, 01470 Groton MA, 01471 Groton MA, 01834 Groveland MA, 01035 Hadley MA, 02338 Halifax MA, 01936 Hamilton MA, 01036 Hampden MA, 02339 Hanover MA, 02340 Hanover MA, 01731 Hanscom Afb MA, 02341 Hanson MA, 01037 Hardwick MA, 01451 Harvard MA, 02645 Harwich MA, 02646 Harwich Port MA, 01038 Hatfield MA, 01937 Hathorne MA, 01830 Haverhill MA, 01831 Haverhill MA, 01832 Haverhill MA, 01835 Haverhill MA, 01039 Haydenville MA, 01346 Heath MA, 02043 Hingham MA, 02044 Hingham MA, 01235 Hinsdale MA, 02343 Holbrook MA, 01520 Holden MA, 01521 Holland MA, 01746 Holliston MA, 01040 Holyoke MA, 01041 Holyoke MA, 01747 Hopedale MA, 01748 Hopkinton MA, 01236 Housatonic MA, 01452 Hubbardston MA, 01749 Hudson MA, 02045 Hull MA, 02047 HuMArock MA, 01050 Huntington MA, 02601 Hyannis MA, 02647 Hyannis Port MA, 02136 Hyde Park MA, 01151 Indian Orchard MA, 01938 Ipswich MA, 02130 JaMAica Plain MA, 01522 Jefferson MA, 02364 Kingston MA, 01347 Lake Pleasant MA, 02347 Lakeville MA, 01523 Lancaster MA, 01237 Lanesboro MA, 01840 Lawrence MA, 01841 Lawrence MA, 01842 Lawrence MA, 01843 Lawrence MA, 01238 Lee MA, 01053 Leeds MA, 01524 Leicester MA, 01240 Lenox MA, 01242 Lenox Dale MA, 01453 Leominster MA, 01054 Leverett MA, 02420 Lexington MA, 02421 Lexington MA, 01773 Lincoln MA, 01525 Linwood MA, 01460 Littleton MA, 01106 Longmeadow MA, 01116 Longmeadow MA, 01850 Lowell MA, 01851 Lowell MA, 01852 Lowell MA, 01853 Lowell MA, 01854 Lowell MA, 01056 Ludlow MA, 01462 Lunenburg MA, 01901 Lynn MA, 01902 Lynn MA, 01903 Lynn MA, 01904 Lynn MA, 01905 Lynn MA, 01910 Lynn MA, 01940 Lynnfield MA, 02148 MAlden MA, 01526 MAnchaug MA, 01944 MAnchester MA, 02345 MAnomet MA, 02048 MAnsfield MA, 01945 MArblehead MA, 02738 MArion MA, 01752 MArlborough MA, 02050 MArshfield MA, 02051 MArshfield Hills MA, 02648 MArstons Mills MA, 02649 MAshpee MA, 02126 MAttapan MA, 02739 MAttapoisett MA, 01754 MAynard MA, 02052 Medfield MA, 02153 Medford MA, 02155 Medford MA, 02053 Medway MA, 02176 Melrose MA, 02177 Melrose MA, 01756 Mendon MA, 02552 Menemsha MA, 01860 MerriMAc MA, 01844 Methuen MA, 02344 Middleboro MA, 02346 Middleboro MA, 02348 Middleboro MA, 02349 Middleboro MA, 01243 Middlefield MA, 01949 Middleton MA, 01757 Milford MA, 01244 Mill River MA, 01527 Millbury MA, 02054 Millis MA, 01529 Millville MA, 02186 Milton MA, 02187 Milton Village MA, 02055 Minot MA, 02350 Monponsett MA, 01350 Monroe Bridge MA, 01057 Monson MA, 01351 Montague MA, 01245 Monterey MA, 02553 Monument Beach MA, 01908 Nahant MA, 02554 Nantucket MA, 02584 Nantucket MA, 01760 Natick MA, 02492 Needham MA, 02494 Needham Heights MA, 02740 New Bedford MA, 02741 New Bedford MA, 02742 New Bedford MA, 02744 New Bedford MA, 02745 New Bedford MA, 02746 New Bedford MA, 01531 New Braintree MA, 01355 New Salem MA, 02456 New Town MA, 01951 Newbury MA, 01950 Newburyport MA, 02458 Newton MA, 02459 Newton Center MA, 02461 Newton Highlands MA, 02462 Newton Lower Falls MA, 02464 Newton Upper Falls MA, 02460 Newtonville MA, 02495 Nonantum MA, 02056 Norfolk MA, 01247 North Adams MA, 01059 North Amherst MA, 01845 North Andover MA, 02760 North Attleboro MA, 02761 North Attleboro MA, 01862 North Billerica MA, 01535 North Brookfield MA, 02355 North Carver MA, 02650 North Chatham MA, 01863 North Chelmsford MA, 02747 North Dartmouth MA, 02764 North Dighton MA, 02651 North Eastham MA, 02356 North Easton MA, 02357 North Easton MA, 01252 North Egremont MA, 02556 North Falmouth MA, 01536 North Grafton MA, 01066 North Hatfield MA, 02059 North MArshfield MA, 01537 North Oxford MA, 02358 North Pembroke MA, 01864 North Reading MA, 01889 North Reading MA, 02060 North Scituate MA, 02652 North Truro MA, 01538 North Uxbridge MA, 02455 North Waltham MA, 01060 Northampton MA, 01061 Northampton MA, 01063 Northampton MA, 01532 Northborough MA, 01534 Northbridge MA, 01354 Northfield MA, 01360 Northfield MA, 02766 Norton MA, 02061 Norwell MA, 02062 Norwood MA, 01865 Nutting Lake MA, 02557 Oak Bluffs MA, 01068 Oakham MA, 02065 Ocean Bluff MA, 02558 Onset MA, 01364 Orange MA, 02653 Orleans MA, 02655 Osterville MA, 01253 Otis MA, 01540 Oxford MA, 01069 Palmer MA, 01612 Paxton MA, 01960 Peabody MA, 01961 Peabody MA, 02359 Pembroke MA, 01463 Pepperell MA, 01366 Petersham MA, 01866 Pinehurst MA, 01201 Pittsfield MA, 01202 Pittsfield MA, 01203 Pittsfield MA, 01070 Plainfield MA, 02762 Plainville MA, 02360 Plymouth MA, 02361 Plymouth MA, 02362 Plymouth MA, 02367 Plympton MA, 02559 Pocasset MA, 01965 Prides Crossing MA, 01541 Princeton MA, 02657 Provincetown MA, 02169 Quincy MA, 02170 Quincy MA, 02171 Quincy MA, 02269 Quincy MA, 02368 Randolph MA, 02767 Raynham MA, 02768 Raynham Center MA, 01867 Reading MA, 02137 Readville MA, 02769 Rehoboth MA, 02151 Revere MA, 01254 Richmond MA, 01542 Rochdale MA, 02770 Rochester MA, 02370 Rockland MA, 01966 Rockport MA, 02131 Roslindale MA, 01367 Rowe MA, 01969 Rowley MA, 01368 Royalston MA, 01071 Russell MA, 01543 Rutland MA, 02561 Sagamore MA, 02562 Sagamore Beach MA, 01947 Salem MA, 01970 Salem MA, 01971 Salem MA, 01952 Salisbury MA, 01255 Sandisfield MA, 02563 Sandwich MA, 01906 Saugus MA, 01256 Savoy MA, 02066 Scituate MA, 02771 Seekonk MA, 02067 Sharon MA, 01369 Shattuckville MA, 01257 Sheffield MA, 01370 Shelburne Falls MA, 02070 Sheldonville MA, 01770 Sherborn MA, 01464 Shirley MA, 01545 Shrewsbury MA, 01546 Shrewsbury MA, 01072 Shutesbury MA, 02564 Siasconset MA, 02565 Silver Beach MA, 02725 Somerset MA, 02726 Somerset MA, 02143 Somerville MA, 02144 Somerville MA, 02145 Somerville MA, 01074 South Barre MA, 02366 South Carver MA, 02659 South Chatham MA, 02748 South Dartmouth MA, 01373 South Deerfield MA, 02660 South Dennis MA, 02375 South Easton MA, 01258 South Egremont MA, 01560 South Grafton MA, 01075 South Hadley MA, 01982 South Hamilton MA, 02661 South Harwich MA, 01561 South Lancaster MA, 01260 South Lee MA, 02662 South Orleans MA, 02071 South Walpole MA, 02663 South Wellfleet MA, 02664 South Yarmouth MA, 01073 Southampton MA, 01772 Southborough MA, 01550 Southbridge MA, 01259 Southfield MA, 01077 Southwick MA, 01562 Spencer MA, 01101 Springfield MA, 01102 Springfield MA, 01103 Springfield MA, 01104 Springfield MA, 01105 Springfield MA, 01107 Springfield MA, 01108 Springfield MA, 01109 Springfield MA, 01111 Springfield MA, 01114 Springfield MA, 01115 Springfield MA, 01118 Springfield MA, 01119 Springfield MA, 01128 Springfield MA, 01129 Springfield MA, 01133 Springfield MA, 01138 Springfield MA, 01139 Springfield MA, 01144 Springfield MA, 01152 Springfield MA, 01199 Springfield MA, 01564 Sterling MA, 01467 Still River MA, 01262 Stockbridge MA, 01263 Stockbridge MA, 02180 Stoneham MA, 02072 Stoughton MA, 01775 Stow MA, 01566 Sturbridge MA, 01776 Sudbury MA, 01375 Sunderland MA, 01590 Sutton MA, 01907 Swampscott MA, 02777 Swansea MA, 02780 Taunton MA, 02783 Taunton MA, 01468 Templeton MA, 01876 Tewksbury MA, 01079 Thorndike MA, 01080 Three Rivers MA, 01983 Topsfield MA, 01469 Townsend MA, 02666 Truro MA, 01349 Turners Falls MA, 01376 Turners Falls MA, 01879 Tyngsboro MA, 01264 Tyringham MA, 01568 Upton MA, 01569 Uxbridge MA, 01718 Village Of Nagog Woods MA, 02568 Vineyard Haven MA, 02468 Waban MA, 01880 Wakefield MA, 01081 Wales MA, 02081 Walpole MA, 02451 Waltham MA, 02452 Waltham MA, 02453 Waltham MA, 02454 Waltham MA, 01082 Ware MA, 02571 Wareham MA, 01083 Warren MA, 01378 Warwick MA, 02471 Watertown MA, 02472 Watertown MA, 02477 Watertown MA, 02479 Waverley MA, 01778 Wayland MA, 01570 Webster MA, 02482 Wellesley MA, 02481 Wellesley Hills MA, 02667 Wellfleet MA, 01379 Wendell MA, 01380 Wendell Depot MA, 01984 Wenham MA, 02668 West Barnstable MA, 01885 West Boxford MA, 01583 West Boylston MA, 02379 West Bridgewater MA, 01585 West Brookfield MA, 02669 West Chatham MA, 01084 West Chesterfield MA, 02573 West Chop MA, 02670 West Dennis MA, 02574 West Falmouth MA, 01472 West Groton MA, 02671 West Harwich MA, 01088 West Hatfield MA, 02672 West Hyannisport MA, 02156 West Medford MA, 01586 West Millbury MA, 01985 West Newbury MA, 02465 West Newton MA, 02132 West Roxbury MA, 01089 West Springfield MA, 01090 West Springfield MA, 01266 West Stockbridge MA, 02575 West Tisbury MA, 01474 West Townsend MA, 02576 West Wareham MA, 01092 West Warren MA, 02673 West Yarmouth MA, 01580 Westborough MA, 01581 Westborough MA, 01582 Westborough MA, 01085 Westfield MA, 01086 Westfield MA, 01886 Westford MA, 01441 Westminster MA, 01473 Westminster MA, 02493 Weston MA, 02790 Westport MA, 02791 Westport Point MA, 02090 Westwood MA, 02188 Weymouth MA, 02189 Weymouth MA, 02190 Weymouth MA, 02191 Weymouth MA, 01093 Whately MA, 01094 Wheelwright MA, 02381 White Horse Beach MA, 01588 Whitinsville MA, 02382 WhitMAn MA, 01095 Wilbraham MA, 01096 Williamsburg MA, 01267 Williamstown MA, 01887 Wilmington MA, 01475 Winchendon MA, 01477 Winchendon Springs MA, 01890 Winchester MA, 01270 Windsor MA, 02152 Winthrop MA, 01801 Woburn MA, 01806 Woburn MA, 01807 Woburn MA, 01808 Woburn MA, 01813 Woburn MA, 01815 Woburn MA, 01888 Woburn MA, 02543 Woods Hole MA, 01784 Woodville MA, 01601 Worcester MA, 01602 Worcester MA, 01603 Worcester MA, 01604 Worcester MA, 01605 Worcester MA, 01606 Worcester MA, 01607 Worcester MA, 01608 Worcester MA, 01609 Worcester MA, 01610 Worcester MA, 01613 Worcester MA, 01614 Worcester MA, 01615 Worcester MA, 01653 Worcester MA, 01654 Worcester MA, 01655 Worcester MA, 01097 Woronoco MA, 01098 Worthington MA, 02093 Wrentham MA, 02675 Yarmouth Port"; 
	
	// END CONFIG (do not edit below this line, well unless you really, really want to change something :) )
	
	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 = 3;
						
			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 > 3){
					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);

