Cufon.set('forceHitArea', true);
Cufon.replace('#sidebar li');
Cufon.replace('#searchbox h3');
Cufon.replace('#cattree h1');
Cufon.replace('#content h1');
Cufon.replace('.categorypage h1');
Cufon.replace('.authorspage h1');
Cufon.replace('.authorspage h2');
Cufon.replace('#authorbooks h3');
Cufon.replace('#mainbody .catalogs h3');

$.get('cattree.php?location=' + encodeURIComponent(document.location), function(data) {
		$('#cattree .content').html(data);
	}
);

$(document).ready(function() {
		$('#searchfield').autocomplete("livesearch.php", {
				width: 400,
				minChars: 2,
				cache: false
		}).result(function() {
				var s = $(this).val();
				var start = s.indexOf('[');
				var end = s.indexOf(']');
				if (start > 0 && end > 0) {
					window.location = '/title/' + s.substr(start+1, (end-start)-1) + '.html';
				}
		});
		
		try {
			$('#featured-webspecials').load("catbox.php?Category_Code=SPECIAL&Offset=0");
			$('#featured-bestsellers').load("catbox.php?Category_Code=BESTSELL&Offset=0");
		} catch (ex) { }

		try {
			$('#basketcount').load("basketcount.php");
		} catch (ex) { }
});

