var twtCount = 0;
var twtLimit = 5;
//var moreItems = 2;
$(document).ready(function() {
	
	$('.items').morerer({
      showcount: false
    });
	$('input[type="text"], textarea').labelswitch();
	
	var tweets = $('ul.twitter p');
	for(var i=0;i<tweets.length;i++){
		$(tweets[i]).html(ParseTweet($(tweets[i]).html()));
	}
	
	
	//Clear form input text
	/*$("div.textbox input").attr({ value: 'Name' }).focus(function(){
				if($(this).val()=="Name"){
				   $(this).val("");
				}
		   }).blur(function(){
				if($(this).val()==""){
				   $(this).val("Name");
				}
		   });*/	
	
});
function ParseTweet(html) {
		html = html.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
		  return '<a href="'+url+'" target="_blank">'+url+'</a>';
		}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
			return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>';
		});
	return html;
}