$(document).ready(function() {
	//make phone numbers clickable
	$('.phone')
	.css('cursor','pointer')
	.css('padding-left','18px')
	.css('background','transparent url(\'/i/silk/telephone.png\') top left no-repeat')
	.click(function(){
		$(this).toggleClass('big_phone');
	})
	.hover(function(){
		$(this).addClass('hihover');
	},function(){
		$(this).removeClass('hihover');
	});
	//add "new features" to the top of the page
	var now = new Date();
	var date_expires = new Date(2007,9,29);
	if (now<date_expires) {
		//$('#content').prepend('<p class="notice"><strong>New to Hilo Eats:</strong><br />&bull; Fixed a bug that prevented reviews from being submitted.</br >&bull; Moved to hiloeats.com! (Aug-29)<br />&bull; Added <a href="/view/134">Millie\'s Deli and Snack Shop</a>. (Aug-30)<br />&bull; Report a closed establishment via a link at the bottom of the place\'s review page. (Aug-30)<br />&bull; Reviews older than 6 months are hidden but can be shown via a link at the bottom of the place\'s review page. (Aug-30)</p>');
	}
	//make labels work (esp in Safari)
	$('label').click(function(){
		$('#'+$(this).attr('for')).focus();
	});
	$('textarea.resizable:not(.processed)').TextAreaResizer();
});

function showNotice(message, prepend_to_id) {
	var prepend_to_id = prepend_to_id || '#content';
	$('<p class="notice">'+message+'</p>')
		.prependTo(prepend_to_id)
		.fadeIn('slow')
		.animate({opacity: 1.0}, 3000)
		.fadeOut('slow', function() {
			$(this).remove();
		});
} //showNotice();

function reStripeTable(id) {
	$('#'+id).removeClass('alt');
	$('#'+id+' tr:visible:even:not(0)').addClass('alt');
} //reStripeTable()

function toggleTag(id, tag) {
	$('#'+id+' .'+tag).toggle();
} //toggleTag()
