function SearchExampleController(
	oExamplesElement,
	oInputElement,
	aExamples
	) {
	
	this.oExamplesElement = oExamplesElement;
	this.oInputElement = oInputElement;
	this.aExamples = aExamples;
	this.iCurrentExample = 0;

	var oThis = this;
	
	Common.Event.add(	
		this.oExamplesElement,
		'click',
		function() {
	
			oThis.get();
	
		}		
		);		
		
};
		

SearchExampleController.prototype = {
	
	get : function() {
			
		this.oInputElement.value = this.aExamples[this.iCurrentExample];
		this.oInputElement.focus();							
	
		var iNewExample = 0;
	
		do {
			iNewExample = Math.round(Math.random() * (this.aExamples.length - 1));
		}
		while(iNewExample == this.iCurrentExample);
		
		this.iCurrentExample = iNewExample;
				
		this.oExamplesElement.innerHTML = this.aExamples[this.iCurrentExample];
	
	}			

};