
	//
	// hack per il TARGET='_blank' vietato in XHTML
	//
	// cverond - mar 2004 / sep 2005 / apr 2007
	//

TBHack = window.TBHack || {}

TBHack.sKeyCode = [13, 32];

TBHack.Init = function() {

	$('a.target_blank').each(function() {

		this.title += FlexJS.AppConfigure.Get('kBlankLinkMessage');

		$(this).click(function(e) {

			TBHack.Open(this.href);

			return e.preventDefault();

		});

		$(this).keypress(function(e) {

			if (FlexJS.Utils.InArray(e.keyCode, TBHack.sKeyCode)) {

				TBHack.Open(this.href);

				return e.preventDefault();
			}

		});
	});
}

TBHack.Open = function(url) {

		// apre in una finestra che ha sempre lo stesso nome

	window.open(url, 'TBH' + FlexJS.Utils.Random());
}

$().ready(function() {

	TBHack.Init();
});
