function aPost(url,fm,content)
{
	$(content).css({opacity: '0.3'});
	$.post(url,$('#'+fm).serialize(),function(data) { $(content).html(data); $(content).css({opacity: '1'}); });
	
}

function aGet(url,content,param)
{
	aLoading('show');
	if (param == 'undefined' || param == null) { param = {}; }
	$(content).css({opacity: '0.3'});
	$(content).load(url,param,function(data) { $(content).html(data); $(content).css({opacity: '1'}); aLoading('hide'); });
}

function aLoading(show_hide)
{
	switch(show_hide) {
		case 'show' :
			$('#loading').fadeIn('slow');
		break;
		case 'hide' :
			$('#loading').fadeOut('slow');
		break;
	}
}


function showTip(c,data,offset)
{
		if (offset == 'undefined' || offset == null) {
			offX = 30;
			offY = -20;
		} else {
			//alert(offset);
			offX = offset.x;
			offY = offset.y
		}
		var showTipTimeOut;
		$('#'+c).mousemove(function(e){
			if ($('#showTip').html() == null) {
				$('body').append('<div id="showTip">&nbsp;</div>');	
			}
			//$('#showTip').fadeIn('fast');
			if (data.indexOf('.html') > -1) {
				///$('#showTip').html('Loading data...');
				$('#showTip').load(data);
			}
			else { $('#showTip').html(data); }
			$('#showTip').css({ minWidth:80, minHeight:20, maxWidth: 600, fontSize: '8pt', zIndex:99999, background:'#fff', padding:'4px', position: 'absolute', top:e.pageY+(offY * 1), left:e.pageX+(offX * 1), border:'1px solid #000'});
			clearTimeout(showTipTimeOut);
			showTipTimeOut = setTimeout(function(){ $('#showTip').fadeOut('slow'); },5000);
		});  
		
		$('#'+c).mouseout(function(){ 
			   $('#showTip').remove();
			   clearTimeout(showTipTimeOut);
		});

    		
}

function showHide(s,h) {
	$(h).fadeOut(2000,function(){
		$(s).fadeIn(3000);
	});
}