function VacancyTablesorter(table,model) {
		
	this.tableToSort = table;	
	this.model = model;
	//this.renderResults();
		//this.init();
}
VacancyTablesorter.prototype.renderResults = function(){

 		var mainObject = this;
		// add new widget called hoverTableRows 
		$.tablesorter.addWidget({ 
		    // give the widget a id 
		    id: "hoverTableRows", 
		    // format is called when the on init and when a sorting has finished 
		    format: function(table) { 
				$("tr",table).hover(
					function(){
						$(this).addClass("highlight");
					},
					function()
					{
						$(this).removeClass("highlight");
					}
				);        
		    } 
		});
		
		$.tablesorter.addWidget({ 
		    // give the widget a id 
		    id: "clickRows", 
		    // format is called when the on init and when a sorting has finished 
		    format: function(table) {
			
					$("tr", table).click(
						function(){
							
							var link = $("td > a",this)[0].href;
							//console.log(link)
							window.location=link;
						}
					);
					  

		    } 
		});



		$("#searchresults table")
		//.tablesorter({widthFixed: true,widgets: ['zebra','hoverTableRows','clickRows']})
		.tablesorter({widthFixed: true,sortList: [[2,1]], dateFormat:"uk", widgets: ['zebra','hoverTableRows','clickRows']})
		.tablesorterPager({container: $("#pager")});

		
		
		//$("#searchresults table").trigger("setCurrentPage",1);
		

		//console.log("tablesorterPager = " + );

		$("#searchresults th").hover(function(e){
				this.titleValue =  $(this)[0].title;
				var xPos = this.offsetLeft -20;
				var yPos = mainObject.model.utils.calculateTop(this)-229;
				var tooltip = $("#tooltip")
				tooltip.css("left",xPos);
				tooltip.css("top",yPos);
				tooltip.css("display","block");
				//tooltip.fadeIn("fast");
				tooltip.html(this.titleValue);
				$(this)[0].title = "";
			},
			function(e)
			{
				$("#tooltip").css("display","none");
				//$("#tooltip")tooltip.fadeOut("fast");
				$(this)[0].title = this.titleValue;
			}
			


		);
		

		
};