$(document).ready(function()
{
	$('#statement').cycle({ 
    fx:    'fade', 
    speed:  1500,
     timeout:       6000,
    random:  1
 });
});

var $facehackswitch = 0


$('#facehack').live('mouseenter', function(){
var $newdiv1 = $('<div id="face"><iframe src="http://www.facebook.com/plugins/like.php?app_id=173145829425446&amp;href=http%3A%2F%2Fpeterthomasryan.com%2F&amp;send=false&amp;layout=standard&amp;width=1&amp;show_faces=false&amp;action=recommend&amp;colorscheme=light&amp;font=arial&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:95px; height:30px;overflow:visible;" allowTransparency="true"></iframe></div>');

if ($facehackswitch == 0) {
$('div#facelink').empty().append($newdiv1);
$facehackswitch = 1;
}




});




$('#facehack').live('mouseleave', function(){
var $newdiv2 = $('<div id="facelink"><a href="">Like on Facebook</a></div>');

if ($facehackswitch == 1) {
$('div#facelink').empty().append($newdiv2);
$facehackswitch = 0;
}


});







	$.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name=petexryan&count=5&callback=?",


 		function(data){


			$.each(data, function(i,item){


				ct = item.text;


				ct = ct.replace(/http:\/\/\S+/g,  '<a href="$&" target="_blank">$&</a>');


			    ct = ct.replace(/\s(@)(\w+)/g,    ' @<a href="http://twitter.com/$2" target="_blank">$2</a>');


			    ct = ct.replace(/\s(#)(\w+)/g,    ' #<a href="http://search.twitter.com/search?q=%23$2" target="_blank">$2</a>');


				$("#jstweets").append('<span style="display:inline">'+ct +"</span>   ");



 			});

$("#jstweets").cmtextconstrain({
    event: 'click', // for future extensibility to allow other events
    onExpose: function(){}, // a function to be run once the element is exposed
    onConstrain: function(){}, // a function to be run once the element is constrained
    restrict: {type: 'chars', limit: 97}, // type can be 'words' or 'chars'
    showControl: {string: '', title: '', addclass: ''}, // element shown to expose
    hideControl: {string: '', title: '', addclass: ''}, // element shown to constrain
    trailingString: '...' // string to show at end of truncated text
    });

		});

      
	 			


