/********************************** Search *****************************************/	
	//listeners waiting for data to be ready
	searchDataReady = function(response){
		mySearch.xmlDoc = mySearch.loadXmlString(response);
		mySearch.handleXml();
		mySearch.defaultView();
		//this function hides the timer animation and shows both the categories and results columns
		hideTimer();
	}
	
	viewAll = function(){
		mySearch.defaultView();
	}	
	
	refreshView = function(num){
		mySearch.refreshView(num);
	}
	
	letterView = function(num){
		mySearch.letterView(num);	
	}
	
	gotoPage = function(num){
		mySearch.gotoPage(num);
	}
	
	nextPage = function(){
		mySearch.nextPage();
	}
	
	previousPage = function(){
		mySearch.previousPage();
	}
	
	scrollToResults = function (){
		//window.scroll(0,200);
	}

/********************************** key word *****************************************/
	showDescriptions = function (){
		var text = dojo.byId('showDescriptions').innerHTML;
		var output = text == 'Show Descriptions' ? output = 'Hide Descriptions' : output = 'Show Descriptions';
		mySearch.toggleDescriptions();
		dojo.byId('showDescriptions').innerHTML = output;		
		
		//dojo.byId('keyWord').value = '';
	}
	
	registerEvents = function () {
		dojo.connect(dojo.byId('showDescriptions'),'onclick',function(){
			showDescriptions();
		});
		
		dojo.connect(dojo.byId('clearResults'),'onclick',function(){
			//removeKeyWord();
		});	
		
		dojo.connect(dojo.byId('keyWordButton'),'onclick',function (){
			//keyWordSearch();			
		}); 

	}		
	
/********************************** Special String function *****************************************/	
	formatString = function(string) {   
		var args = arguments;   
		var pattern = new RegExp("%([1-" + arguments.length + "])", "g");   
		return String(string).replace(pattern, function(match, index) {   
			return args[index];   
		});   
	}	