window.onload = function() {

	var $j = jQuery.noConflict();

	$j('a[rel*=facebox]').facebox({
        loadingImage : '/wp-content/themes/business-hub/images/loading.gif',
        closeImage   : '/wp-content/themes/business-hub/images/close.png'
    });

	
	$j("a.rate").click(function() {
		//Is this an up or down
		$j("#TTRating").addClass('loading');
		$j.ajax({
  			type: 'GET',
			url: '/tips-and-tricks/rate/',
			data: ({
				id : this.getAttribute('rev'),
				set: this.getAttribute('rel')
			}),
  			success: function(data) {
				if(data != 'false') {
					$j("#TTRating").replaceWith("<div id='TTRating'>Thanks!</div>");
				}
  			}
		});
		return false;

	});

	$j('.tooltip').tooltip({ 
		fixPNG: true,
		track: false,
		showURL: false, 
		showBody: ' - ', 
		fade: 250,
		top: -70,
		left: 10
	});
	
};