


$(document).ready(function() {
	fn_oneRuler();
	fn_setFeaturedContentHeight();
	fn_setTweetContentHeight();
	fn_removeOlderLinks();
	fn_blankwin();
})


/////FUNCTION DEFINITIONS/////
fn_oneRuler = function() {
	$('.dottedRule:last').css({display:"none"});
};
fn_setFeaturedContentHeight = function() {
	$.featuredContentHeight = $('#newsBubble').height(); 
	$('#featuredContent').css({height:$.featuredContentHeight});
};
fn_setTweetContentHeight = function() {
	$.tweetContentHeight = $('#newsBubble').height()-50; 
	$('#tweetContent').css({height:$.tweetContentHeight});
};
fn_removeOlderLinks = function() {
	$('.alignleft a').remove();
};

this.fn_blankwin = function(){
	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;				
	};
	this.set = function(obj){
		obj.target = "_blank";
		obj.className = obj.className+" external";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};
