﻿
$(document).ready(function () {
	addtargetTolink();
});

function addtargetTolink() {

	$("DIV.HTMLContent A").each(function () {
		var http = $(this).attr('href').indexOf('http://');
		if (http == 0) {
			ubi = $(this).attr('href').indexOf('ubifrance.com');
			pdf = $(this).attr('href').indexOf('.pdf');
			if ((ubi < 0) || (ubi > 0 && pdf > 0)) {
				$(this).attr('target', '_blank');
			}
		}
	});
}

function UiBlock(msg) {
	$.blockUI({
		message: msg,
		centerY: false,
		css: {
			border: '1px solid #000000',
			padding: '15px',
			backgroundColor: '#000',
			'-webkit-border-radius': '10px',
			'-moz-border-radius': '10px',
			opacity: '1',
			color: '#ffffff'
		},
		overlayCSS: { backgroundColor: '#ff0000' }
	});


	setTimeout($.unblockUI, 3000);
}

function twit_me(u) {
	window.open('http://twitter.com/home?status=' + encodeURIComponent(u), '_blank');
	return false;
}

function fbs_me(t, u) {
	window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), '_blank', 'toolbar=0, status=0, width=626, height=436');
	return false;
}

function digg_me(t, u) {
	window.open('http://digg.com/submit?url=' + encodeURIComponent(u) + '&title=' + encodeURIComponent(t) + '&bodytext=&topic=tech_news', '_blank');
	return false;
}
