function footerChange(content) {

	//clear all bold styles
	for(i=1;i<4;i++) { $('footer'+i).style.fontWeight = ''; $('footer'+i).style.color = ''  }

	if(content == 1) {
		Element.update('footerContent','<iframe id="aboutIframe" src="/utilities/about.php" marginheight=0 marginwidth=0 border=0 width="600" height="120" frameborder="0" scrolling="no" name="contactFrame"></iframe>');
	}
	if(content == 2) {
		Element.update('footerContent','<iframe id="contactIframe" src="/utilities/contact.php" marginheight=0 marginwidth=0 border=0 width="600" height="120" frameborder="0" scrolling="no" name="contactFrame"></iframe>');
	}
	if(content == 3) {
		Element.update('footerContent','<iframe id="advertIframe" src="/utilities/advertise.php" marginheight=0 marginwidth=0 border=0 width="600" height="120" frameborder="0" scrolling="no" name="advertFrame"></iframe>');
	}	
	$('footer'+content).style.fontWeight = 'bold';		
	$('footer'+content).style.color = '#000000';
}


function init() {
	totalHeight = Element.getHeight ('mainContent');
	if(totalHeight < 1200) { totalHeight = 1200 } else { totalHeight = Element.getHeight ('mainContent') }
	$('sideNav').style.height = totalHeight + 'px';	
	logoHeight = totalHeight - 190;
	$('lucasLogo').style.top = logoHeight+'px';
	Element.show('lucasLogo');
	$('footer1').style.fontWeight = 'bold';		
	$('footer1').style.color = '#000000';
	//set nav
	if(currentPage != '') { $(currentPage).className = 'navLinkHere' }
	//set footer
	footerChange(1);
}


function showRss() {
	Element.toggle('chRss');
	$('rssTab').src='/img/subscribe_tab_open.gif';
}



function monthOn(thumb) {
	Element.show(thumb);
}

function monthOff(thumb) {
	Element.hide(thumb);
}

function bookmarkActions() {
	action = $F('bookmarksTools');
	window.open(action);
}

function monthBrowser() {
	action = $F('monthList');
	document.location = action;
}

function monthBrowserBottom() {
	action = $F('monthListBottom');
	document.location = action;
}

//set initial visible keyword list
var currKey = 'keywords_recently_used';
	
function keywordChooser() {
	Element.hide(currKey);
	newKey = $F('keywordDropdown');
	Element.show(newKey);
	currKey = newKey;
}

function keyWordOn(row)  {
	$(row).style.backgroundColor = '#009900';
	$(row).style.color = '#99FF00';
}

 function keyWordOff(row) {
 	$(row).style.backgroundColor = '#EFEFEF';
 	$(row).style.color = '#333333';
 	
 
 }
 
 //Bravo functionality 
 
 function showBravo() {
 		Element.show('bravoColors');
 }
 
 function hideBravo() {
 		Element.hide('bravoColors');
 }
 
 function getAllSheets() {
   if( !window.ScriptEngine && navigator.__ice_version ) { return document.styleSheets; }
   if( document.getElementsByTagName ) { var Lt = document.getElementsByTagName('link'), St = document.getElementsByTagName('style');
   } else if( document.styleSheets && document.all ) { var Lt = document.all.tags('LINK'), St = document.all.tags('STYLE');
   } else { return []; } for( var x = 0, os = []; Lt[x]; x++ ) {
     var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute('rel') : '';
     if( typeof( rel ) == 'string' && rel.toLowerCase().indexOf('style') + 1 ) { os[os.length] = Lt[x]; }
   } for( var x = 0; St[x]; x++ ) { os[os.length] = St[x]; } return os;
 }
 function changeStyle(newCSS) { 
   for( var x = 1, ss = getAllSheets(); ss[x]; x++ ) {
     if( ss[x].title ) { ss[x].disabled = true; }
     for( var y = 0; y < arguments.length; y++ ) {
      if( ss[x].title == arguments[y] ) { ss[x].disabled = false; }
 	} } 
 document.cookie ='bravo='+newCSS+'; expires=Thu, 8 Feb 2007 23:59:00 UTC; path=/; domain=coolhunting.com'
 }


//Check for Bravo cookie code

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

var bravoCookie = readCookie('bravo');
if(bravoCookie !=  'bravo0') { changeStyle(bravoCookie) }


//Email layer functionality
var closeFrameID;

function showEmailWindow(iframeUrl,iframeID,entryID) { 
	currentIframe = 'emailIframe'+entryID;	
	new Effect.Appear(iframeID, {duration:1.0, from:0, to:0.9});
	//Element.show(iframeID);
	$(currentIframe).src= iframeUrl;
	closeFrameID = iframeID;
}

function closeEmailWindow() {
	Element.hide(closeFrameID);
}