$(document).ready(function() { 
	if (!document.getElementsByTagName) return; 
		var anchors = document.getElementsByTagName('a'); 
		for (var i = 0; i < anchors.length; i++) { 
			var anchor = anchors[i]; 
			if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') 
				anchor.target = '_blank'; 
	} 
});

function toggleBlurValue(obj, defaut) {
	if (obj.value == '') { obj.value = defaut; }
}

function toggleFocusValue(obj, defaut) {
	if (obj.value == defaut) { obj.value = ''; }
}

function _getLiveWrite(comment, user, date) {
	if (comment.value == '') { 
		$('#livewrite').text('Ecrivez un commentaire pour avoir un aper\347u en temps r\351el');
	}
	else {
		$('#livewrite').html('<h3>' + user + '</3><h6>Publi\351e le ' + date + '</h6><div class="news">' + _stripHTML(comment.value) + '</div>');
	}
}

function _stripHTML(txt) { 
	return txt.replace(/<\S[^><]*>/g, '');
}
