
/********************************** 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 *****************************************/
	reloadPage = function (){
		window.location.reload();
		dojo.byId('clearResults').style.display = 'none';		
	}

	showDescriptions = function (){
		var output = jQuery('#showDescriptions').text() == 'Show Descriptions' ? output = 'Hide Descriptions' : output = 'Show Descriptions';
		mySearch.toggleDescriptions();
		jQuery('#showDescriptions').html(output);
	}
	
	registerEvents = function () {
		jQuery('#showDescriptions').click(function(){
			showDescriptions();
		});
	}		
	
/********************************** 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];   
		});   
	}	
