///////////////////////////////////////////////////////////
// DEBUGGING: use log('message'); 
// replaces console.log('message'); on FF with Firebug
// alert()'s on IE and other non-firebug-enabled browsers
///////////////////////////////////////////////////////////
var debug = false;
function log(msg){if(debug){if(window.__firebug__){console.log(msg)}else{alert(msg)}}}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// GLOBAL INIT
///////////////////////////////////////////////////////////
function globalInit(){
	/* If #q element: initialize LiveSearch instance */
	if($('q')){new LiveSearch('q', 'qResults', $('qArrow'));}
	
	/* If #nav element: initialize NavigationMenu instance */
	if($('nav')){navmenu = new NavigationMenu('nav');}

}


///////////////////////////////////////////////////////////
// Initiate sifr
///////////////////////////////////////////////////////////

function initSIFR(){
	sIFR.replace(myriadPro, {
  		selector: 'h1'
  		,css: [
  			'.sIFR-root { color: #596792; text-transform: uppercase; font-weight: bold;}'
			,'a { text-decoration: none; }'
			,'a:link { color: #596792; }'
			,'a:hover { color: #B9D300;}'
			,'em { color: #bac2da; }'
		]
		, wmode: 'transparent'
	});

	sIFR.replace(myriadPro, {
  		selector: 'h2'
  		,css: [
  			'.sIFR-root { color: #596792; text-transform: uppercase;  font-weight: bold;}'
			,'a { text-decoration: none; }'
			,'a:link { color: #596792; }'
			,'a:hover { color: #596792; text-decoration: none;}'
		]
		, wmode: 'transparent'
	});
}
///////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
// EVENTS
///////////////////////////////////////////////////////////
document.observe('dom:loaded', globalInit);
