var ajax = new sack();

function getQC(sel)
{
	if(sel){
		loading('quartile_chart');
		ajax.requestFile = 'quartile_chart.php?qs=' + sel + '&sid=' + Math.random();
		ajax.onCompletion = showQC;
		ajax.runAJAX();
	}
}

function showQC(){
	cell = $('quartile_chart');
	cell.innerHTML = ajax.response;
	//sorttable.init2('1');
	//done();
}

function loading(id){
	cell = $(id);
	cell.innerHTML = "<img src=/images/loadgp.gif>";
}

function getPS(sel)
{
	if(sel){
		//showStatus2();
		
		ajax.requestFile = 'ps_list.php?' + sel + '&sid=' + Math.random();
		ajax.onCompletion = showPS;
		ajax.runAJAX();
	}
}

function showPS(){
	cell = $('pstable');
	cell.innerHTML = ajax.response;
	sorttable.init2('1');
	edit_fav();
	//done();
}

function showStatus2(){
	busy();
	window.status = 'loading...';
}

function busy(){	
	$('pstable').style.cursor = 'wait';

	//all a hrefs
	zz = document.getElementsByTagName('A');
	for (var i=0,len=zz.length;i < len; i++)
		zz[i].style.cursor='wait';

}

function done(){
	$('pstable').style.cursor = 'default';
	
	zz = document.getElementsByTagName('A');
	for (var i=0,len=zz.length;i < len; i++)
		zz[i].style.cursor='pointer';
	window.status = 'Done';
}



