///////////////////////////////////////////////////////////
// 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: #596792;}'
			,'em { color: #bac2da; }'
		]
		, wmode: 'transparent'
	});

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

	sIFR.replace(myriadPro, {
  		selector: 'h2.veronica'
  		,css: [
  			'.sIFR-root { color: #00aeef; text-transform: uppercase;  font-weight: bold; font-size:13px; }'
			,'a { text-decoration: none; }'
			,'a:link { color: #00aeef; }'
			,'a:hover { color: #00aeef; text-decoration: none;}'
		]
		, wmode: 'transparent'
	});
	
	sIFR.replace(myriadPro, {
  		selector: 'h2.classic'
  		,css: [
  			'.sIFR-root { color: #662d91; text-transform: uppercase;  font-weight: bold; font-size:13px; }'
			,'a { text-decoration: none; }'
			,'a:link { color: #662d91; }'
			,'a:hover { color: #662d91; text-decoration: none;}'
		]
		, wmode: 'transparent'
	});	
	sIFR.replace(myriadPro, {
  		selector: 'h2.srg'
  		,css: [
  			'.sIFR-root { color: #666666; text-transform: uppercase;  font-weight: bold; font-size:13px; }'
			,'a { text-decoration: none; }'
			,'a:link { color: #666666; }'
			,'a:hover { color: #666666; text-decoration: none;}'
		]
		, wmode: 'transparent'
	});	
	
	sIFR.replace(myriadPro, {
  		selector: 'h2'
  		,css: [
  			'.sIFR-root { color: #596792; text-transform: uppercase;  font-weight: bold; font-size:13px; }'
			,'a { text-decoration: none; }'
			,'a:link { color: #596792; }'
			,'a:hover { color: #596792; text-decoration: none;}'
		]
		, wmode: 'transparent'
	});	
}
///////////////////////////////////////////////////////////

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

