if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
    var ieVer = new Number(RegExp.$1);
    if (ieVer <= 6) {
	$(function(){
		$('#homeNav li.red').sfHover();
		$('#homeNav li.black').sfHover();
		$('#homeNav li.green').sfHover();
		$('#homeNav li.orange').sfHover();
	
	}); 
    }
}
    
/* 
Flash Text replacement
http://wiki.novemberborn.net/sifr3/ 
*/
var bryant = {
	src: '../swf/bryant.swf'
	,ratios: [8,1.3,11,1.21,12,1.2,14,1.19,21,1.16,28,1.13,38,1.12,61,1.11,94,1.1,95,1.09,103,1.1,107,1.09,110,1.1,119,1.09,120,1.1,1.09]
	,wmode: 'transparent'
	
};

sIFR.delayCSS  = true;
sIFR.prefetch(bryant);
sIFR.activate(bryant);

/* giving the h1 the sifr class isn't necessary to make it work, 
but instead it's used to provide more control over which h1s get replaced,
otherwise, it'll replace all h1s on the page */

sIFR.replace(bryant, {
selector: 'h1.sifr'
,css: [
  '.sIFR-root { color: #8b3281; }'
  ,'a { text-decoration: none; }'
  ,'a:link { color: #8b3281; }'
  ,'a:hover { color: #582779; }'
]
});

/******************************/
/* Footer Placement Functions */
/******************************/
function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight=document.documentElement.clientHeight;
		}
		else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() {
	if (document.getElementById) {
		var windowHeight=getWindowHeight();
		if (windowHeight>0) {
			var contentHeight=document.getElementById('wrapper').offsetHeight;
			var footerElement=document.getElementById('footer');
			var footerHeight=footerElement.offsetHeight;
			if (windowHeight-(contentHeight+footerHeight)>=0) {
				footerElement.style.position='relative';
				footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
			}
			else {
				footerElement.style.position='static';
			}
		}
	}
}
window.onload = function() {
  setFooter();
}
window.onresize = function() {
  setFooter();
}

//var bdyHt = document.body.offsetHeight;
//var ftr = document.getElementById('footer');
//var wrap = document.getElementById('wrapper');
//if (wrap != null) {
//    if ((wrap.offsetTop + wrap.offsetHeight) < bdyHt) {
//        wrap.style.height = (bdyHt - wrap.offsetTop);
//        ftr.style.top = (wrap.offsetHeight - (ftr.offsetHeight + 50));
//    }
//}

//if (ftr != null) {
//    if ((ftr.offsetTop + ftr.offsetHeight) < bdyHt) {
//        alert('ftr.offsetTop(before): ' + ftr.offsetTop);        
//        alert('ftr.style.top(before): ' + ftr.style.top);
//        alert('bdyHt - ftr.offsetHeight: ' + (bdyHt - ftr.offsetHeight));
//        ftr.style.top = (bdyHt - ftr.offsetHeight);
//        alert('ftr.style.top(after): ' + ftr.style.top);
//        alert('ftr.offsetTop(after): ' +ftr.offsetTop);
//    }
//}
