/*===========================================================================
	global.js
	
	This JavaScript executes dynamic behaviors such as:
	- Patch missing JavaScript features for certain browser versions
	- Define commonly used functions and variables
	- Preload images
	- Flash Replacements (i.e. sIFR, UFO, SWFObject, etc.)
	- Decorate the DOM with presentational elements
	- Collapse/expand/animate sections
	- Validate forms
	- Pop-up windows
===========================================================================*/

var $j = jQuery.noConflict();

$j(document).ready(function() {
	// Actions Section
	$j("li.search a").css("background-position", "0 -32px");
	
	$j('#search-form label').labelOver('over');
	
	$j("div#actions a").tooltip({
		offset: [-5, 0],
		effect: 'toggle',
		delay: 0,
		opacity: 0.7
	});
});

function twitterFail() {
	$j("div#twitter-feed")
		.text("Twitter is down at the moment. Check back later for our most recent updates.")
		.next("p").remove();
}

/* Utilities
===========================================================================*/

// Enable console logging
function log(msg) {
if (window.console && window.console.log)
console.log(msg);
}

// Prevent IE6 background flicker
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(e) {}

// Apply CSS rules to IE6's unknown elements
document.createElement("abbr");