jQuery(document).ready(function() {
	// handle external links
	$("a[rel='external']").addClass("external");
	$("a[rel='external']").bind("click", function() {
		window.open((this).href); 
		return false;
	});

	// hide googlesearch background image on click
	$(".googlesearch").bind("click", function() {
		$(this).css("background-image", "none");
	});
	
	$(".tooltip").tooltip({
		track: true, 
		delay: 0, 
	    showURL: false, 
	    fade: 250 
	});
	
	$(".tooltip").bind("click", function() {
		return false; // prevent tooltip links from being checkable
	});

});

function getNumById(id) {
	var num = id.substring(id.lastIndexOf("-") + 1)
	return num;
}

function autoForward(url) {
	window.location = document.location.protocol + '//' + document.domain + url;
}