(function ($) {
$(document).ready(function () {
	var query = "SELECT item.condition FROM weather.forecast WHERE location='98668' AND u='f'";
			var cacheBuster = Math.floor((new Date().getTime()) / 1200 / 1000);
			var url = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent(query) + '&format=json&_nocache=' + cacheBuster;

			window['wxCallback'] = function(data) {
				var info = data.query.results.channel.item.condition;
				$('#weather_icon').css({backgroundPosition: '-' + (75 * info.code) + 'px 0'}).attr({title: info.text});
				$('#temp').html('<h2><a href="http://couv.com/weather-for-clark-county-wa">' + info.temp + '&deg;F</a></h2>');
			};
			$.ajax({
				url: url,
				dataType: 'jsonp',
				cache: true,
				jsonpCallback: 'wxCallback'
			});
	$('a.fb_comment_count').each(function () {
			var cleanURL = $(this).attr('href').replace(/#.*/, '');
			var graph = 'http://graph.facebook.com/' + cleanURL;
			var postURL = $(this);
			$.ajax({
				type: "GET",
				dataType: 'jsonp',
				url: graph,
				success: function (data) {
			/* $.getJSON(graph, function (data) { */
				cCount = data.comments;
				if (cCount == 0 || !cCount) {
					postURL.text('Comments');
				} else if (cCount == 1) {
					postURL.text('1 Comment');
				} else {
					postURL.text(cCount + ' Comments');
				}
				}
			});
		});
});
})(jQuery);

