setTimeout(hideIfNoAuctions, 50);

function hideIfNoAuctions () {
	if ($('bidding').getElementsBySelector('table').length == 0) {
		setTimeout(hideIfNoAuctions,50);
	}
	else if ($('bidding').getElementsBySelector('table')[0].getElementsBySelector('table').length == 0) {
		$('bidding').hide();
		$('btnBidding').up('li').hide();
	}else {
		// Read a page's GET URL variables and return them as an associative array.
		function getUrlVars()
		{
			var vars = [], hash;
			var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
				for(var i = 0; i < hashes.length; i++)
			{
				hash = hashes[i].split('=');
				vars.push(hash[0]);
				vars[hash[0]] = hash[1];
			}
			return vars;
		}
		vars = getUrlVars();
		if (vars['page'] == 'bidding') {
			$('btnBidding').simulate('click');
		}
	}
}
