// ajax_user_standings.js v1.0
// copyright 2008
// Easy2play BV

$(document).ready(function() {
	
	// After loading the document for the first time get the default results
	var varMethod = "get";
	var varUrl  = 'inc/functions/ajax_user_standings.php';		
	var varParam = 'x=0&paramID=1&sorton=y';
	var varContent = "#ajaxcontent";
	var varWait = "#ajaxwait";
	AjaxMainHandler(varMethod, varUrl, varParam, varContent, varWait);

	// On pagination pagenumber clicks call in livequery to trigger the content refresh
	// push the params sorton (time, sprint, mountain) and showstage (general, first, second etc.)
	$('#pagination a').livequery('click', function() {
		var varParam = 'paramID=' + $(this).attr('id') + '&showstage=' +  $('#stg').attr('param');
		AjaxMainHandler(varMethod, varUrl, varParam, varContent, varWait);
		return false;
	}); 
	$("#selstage").livequery('change', function() {
		var varParam = 'paramID=' + $(this).attr('id') + '&showstage=' + $('#selstage').val();
		AjaxMainHandler(varMethod, varUrl, varParam, varContent, varWait);
		return false;
	});

});