function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
// sign up for enews
$(function() {
	$("#eNews").click(function(){
		myWindow = window.open($(this).attr("href"), "emailPage", "scrollbars=1, width=670, height=750");
		myWindow.focus();
		return false;
	})

})
$(document).ready(function() {
    $('a[rel=external]').livequery(function(){
        $(this).click(function(){window.open($(this).attr('href'));return false;}).each(function(){
            $at=$(this).attr('title');
            $linktext = /Link opens new window/.test($at);
            if (!$linktext) $(this).attr('title',((typeof $at!="undefined") ? $at : $(this).text()) +' - Link opens new window');
        });
    });
	
	// news ticker
	if(typeof $().newsTicker == "function") {
		var options = {
			newsList: "#news-ticker ul",
			tickerRate: 40,
			startDelay: 10,
			loopDelay: 4000,
			placeHolder1: " -",
			placeHolder2: ""
		}
		$().newsTicker(options);
	}
	// home boxes
	equalHeight($(".eh"));
	equalHeight($(".eh2"));
	// featured tabs
	$('#tout ul').tabs({event:'mouseover'}).tabs('rotate', 8000);

	// bring links to parent level
	$("#tout ul li").live("click",function() {
		self.location = $(this).find('a#test').attr("href");
	});
	
	// social bookmarks share button
	$("#share").click(function(){
		$("#share-detail").toggleClass("sd");
	})
	// print page
	$("#print").click(function(){
		window.print();return false;
	})
	// send this page
	$("#email a").fancybox({
		'hideOnContentClick': false,
		'frameHeight': 380
	});
});