var pageTracker; 
jQuery(document).ready(function($) {

   
	DD_roundies.addRule('.roundie', '8px',true);
	DD_roundies.addRule('#sub-page-menu', '8px',true);
	
	//google stuff. comes afer roundies so the page looks complete first
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

	jQuery.getScript(gaJsHost + "google-analytics.com/ga.js", function(){
		pageTracker = _gat._getTracker("UA-4372852-2");
		pageTracker._trackPageview();
	});
	
	// Drop downs
	jQuery('#pagenav > li ul').mouseover(function(){
		jQuery(this).parent().addClass('current_page_item');
	});
	jQuery('#pagenav > li ul').mouseout(function(){
		jQuery(this).parent().removeClass('current_page_item');
	});
	
	// Remove borders, etc
	jQuery("#nav ul li:last").css("background","none");
	jQuery("#featured-tabs li:first").css("border-top","0");
	jQuery("#featured-tabs li:last").css("border-bottom","0");
	jQuery("#news ul li:last").css("border-bottom","0");
	jQuery("#comments_wrap ol li ul.children li").css("border-bottom","0");
	jQuery(".widget ul li:last-child").each(function(){
		jQuery(this).css("border-bottom","0");
	});
	
	$('#the_scoop-questions').localScroll({target:'#the_scoop-answers' });
	
	$("#the_scoop-questions a").click(function(event){
		pageTracker._trackPageview('/the_scoop/'+ $(this).attr('href'));
		event.preventDefault();
		$('#the_scoop-arrow').animate({ top: $(this).attr("rel") } );
	});
	$("#tweet").getTwitter({
		userName: "greenbillit",
		numTweets: 3,
		loaderText: "Loading tweets...",
		slideIn: true,
		showHeading: false,
		showProfileLink: false
	});

	
});

/**for the menus*/
sfHover = function() {
	if (!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	//
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);