function doBlank() {
	if (!document.getElementsByTagName) return false;
  	var links = document.getElementsByTagName('a');
  	for (var i=0; i < links.length; i++) {
   		if (links[i].className.match('blank')) {
     		links[i].onclick = function() {
        		window.open(this.href);
        		return false;
      		}
    	}
  	}
}

window.addEvent('domready', function(){
	
	doBlank();
	
	var size = 100;
	
	$('menu-amore').addEvent('click', function(){
		if (size < 130) size = size + 10;
		$('content-posts').style.fontSize = size+'%';
		return false;
	});
	
	$('menu-aless').addEvent('click', function(){
		if (size > 80) size = size - 10;
		$('content-posts').style.fontSize = size+'%';
		return false;
	});
	
	$('menu-a1').addEvent('click', function(){
		$('content').style.color = '#8C979B';
		return false;
	});
	
	$('menu-a2').addEvent('click', function(){
		$('content').style.color = '#000000';
		return false;
	});

	var myAbout = new Fx.Slide('content-about');
	$('head-about-button').addEvent('click', function(e){
		e = new Event(e);
		myAbout.toggle();
		e.stop();
	});
	myAbout.hide(); $('content-about').style.display = 'block';

	var featButton = 'off';
	var myFeats = new Fx.Slide('feat-container');
	$('feat-button').addEvent('mousedown', function(e){
		
		if (featButton == 'off') {
			$('feat-button').style.backgroundImage = 'url(http://splitdadiz.com/wp-content/themes/default/images/featured/feat-button-on.jpg)';
			featButton = 'on';
		} else {
			$('feat-button').style.backgroundImage = 'url(http://splitdadiz.com/wp-content/themes/default/images/featured/feat-button-off.jpg)';
			featButton = 'off';
		}
		
		e = new Event(e);
		myFeats.toggle();
		e.stop();
	});
	myFeats.hide(); $('feat-container').style.display = 'block';

	new SmoothScroll();

});
   
  function relative_created_at(time_value) {  // thanks to Lionel of rarsh.com for pointing out that Twitter changed their code, and this is the fix which will work in IE
     var created_at_time = Date.parse(time_value.replace(" +0000",""));
     var relative_time = ( arguments.length > 1 ) ? arguments[1] : new Date();
     var wordy_time = parseInt(( relative_time.getTime() - created_at_time ) / 1000) + (relative_time.getTimezoneOffset()*60);

       if ( wordy_time < 59 ) {
         return 'less than a minute ago';
         } 
       else if ( wordy_time < 119 ) {       // changed because otherwise you get 30 seconds of 1 minutes ago  
         return 'about a minute ago';
         } 
       else if ( wordy_time < 3000 ) {         // < 50 minutes ago
         return ( parseInt( wordy_time / 60 )).toString() + ' minutes ago';
         } 
       else if ( wordy_time < 5340 ) {         // < 89 minutes ago
         return 'about an hour ago';
         } 
       else if ( wordy_time < 9000 ) {          // < 150 minutes ago
         return 'a couple of hours ago';  
         }
       else if ( wordy_time < 82800 ) {         // < 23 hours ago
         return 'about ' + ( parseInt( wordy_time / 3600 )).toString() + ' hours ago';
         } 
       else if ( wordy_time < 129600 ) {       //  < 36 hours
         return 'a day ago';
         }
       else if ( wordy_time < 172800 ) {       // < 48 hours
         return 'almost 2 days ago';
         }
       else {
         return ( parseInt(wordy_time / 86400)).toString() + ' days ago';
         }
    }

