
$(document).ready(function(){
	window.onload=function(){
		setMidHeight();
		setBotHeight();
	}
	$(".newItem").mouseover(function() {
		$(this).css({'background-color': '#F5EDC8'});
	});
	$(".newItem").mouseout(function() {
		$(this).css({'background-color': ''});
	});

	$("#findHR").mouseover(function() {
		$(this).css({'background-color': '#f1e6b2'});
		$("#findHR h3, #findHR a").css({'color': '#1A3555'});
		Cufon.replace('#findHR h3', { fontFamily: 'Hewitt Unit Regular' });
		$("#findHR img").attr({ src: "/Lib/assets/global/images/reskin/findHR_arrow_ov.gif" });
	});
	$("#findHR").mouseout(function() {
		$(this).css({'background-color': ''});
		$("#findHR h3, #findHR a").css({'color': ''});
		Cufon.replace('#findHR h3', { fontFamily: 'Hewitt Unit Regular' });
		$("#findHR img").attr({ src: "/Lib/assets/global/images/reskin/findHR_arrow.gif" });
	});
	
	
	if ($(".homeMid .rightCol .quickPoll").height()==0)
	{
	  $(".homeMid .rightCol .quickPoll").css({'display':'none'});
	}

	if ($(".homeBot .rightCol").height()==0)
	{
	  $(".homeBot .rightCol").css({'display':'none'});
	}
	 
	if(($.browser.msie)) { 
	
	 if ($(".homeMid .rightCol .quickPoll").height()==1)
	 {	   
	    $(".homeMid .rightCol .quickPoll").css({'display':'none'});
	 }
	 
	 if ($(".homeBot .rightCol").height()==18)
	 {	   
	    $(".homeBot .rightCol").css({'display':'none'});
	 }
	
	}
	
	if ($(".homeBot").height()==6)
	{
	  $(".homeBot").css({'display':'none'});
	}

	
	 
	if(($.browser.msie)) { 
	 if ($(".homeBot").height()<=25) {
	   $(".homeBot").css({'display':'none'});
		}
	}
});
	

function setMidHeight() {
	midLColHeight = $(".homeMid .lcol").height();
	midCColHeight = $(".homeMid .centerCol").height();
	midRColHeight = $(".homeMid .rightCol").height();
	var midHeights = [midLColHeight, midCColHeight, midRColHeight];
	var lHeight = Math.max.apply(Math, midHeights);
	if(lHeight == midRColHeight) {
		$(".quickPoll").css({'position': 'relative'});
	}
	if(lHeight > midLColHeight) {
		var bottomFeatureHeight = $(".homeMid .homeFeatures .bottom").height();
		jQuery.each(jQuery.browser, function(i, val) {
			if(!($.browser.msie)) {   
				featurePad = (lHeight - midLColHeight);
			}
			else {
				featurePad = (lHeight - midLColHeight) + 15;
			}
		});
		newbottomheight = bottomFeatureHeight + featurePad;
        $(".homeMid .homeFeatures .bottom").css({'height': newbottomheight});
	}
	if(lHeight > midCColHeight) {
		middlePad = (lHeight - midCColHeight) +10;
		$(".homeMid .whatsNew").css({'padding-bottom': middlePad});
	}
	if(lHeight > midRColHeight) {
		jQuery.each(jQuery.browser, function(i, val) {
			if(!($.browser.msie)) {   
				newHeight = lHeight;
				stHeight = $(".stayConnected").height() + 15;
				qpNewHeight = newHeight - stHeight - 10;
				//alert(stHeight);
			}
			else {
				newHeight = lHeight+6;
				stHeight = $(".stayConnected").height() + 21;
				qpNewHeight = newHeight - stHeight;
			}
		});
		$(".homeMid .rightCol .quickPoll").css({'height': qpNewHeight});
	}
}


function setBotHeight() {
	botLColHeight = $(".homeBot .lcol").height();
	botCColHeight = $(".homeBot .centerCol").height();
	botRColHeight = $(".homeBot .rightCol").height();
	
	var botHeights = [botLColHeight, botCColHeight, botRColHeight];
	var lHeight = Math.max.apply(Math, botHeights);
	if(lHeight > botLColHeight) {
		jQuery.each(jQuery.browser, function(i, val) {
			if(!($.browser.msie)) {	
				newHeight = lHeight - 15;
			}
			else {
				newHeight = lHeight;
			}
		});
		$(".homeBot .mostPopular").css({'height': newHeight});
	}
	if(lHeight > botCColHeight) {
		jQuery.each(jQuery.browser, function(i, val) {
			if(!($.browser.msie)) {	
				newHeight = lHeight-10;
			}
			else {
				newHeight = lHeight;
			}
		});
		$(".homeBot .readersLike").css({'height': newHeight});
	}
	if(lHeight > botRColHeight) {
		jQuery.each(jQuery.browser, function(i, val) {
			if(!($.browser.msie)) {	
				newHeight = lHeight-5;
			}
			else {
				newHeight = lHeight;
			}
		});
		$(".homeBot .helpfulLinks").css({'height': newHeight});
	}
}