function new_window_link() {
	var path_to_icon 		= '/img/icon.gif';
	var link_alt_text 		= 'Deschide adresa într-o nouă fereastră!';
	var link_title_text 	= 'Deschide acest link într-o fereastră nouă!';
	
	if (!document.getElementById || !document.createTextNode || !document.domain) return;
	
	$("a").not(".value").each(function(i){
		//console.info(this.href.split('/')[2].replace(/www\./, ''));
		// just for off-site links
		if (this.href.split('/')[2].replace(/www\./, '') != document.domain.replace(/www\./, '')
		&& !this.getAttribute('target')
		&& !this.parentNode.id.match(/^copy/)) {
			// create new elements
			var nwl = document.createElement('a');
			var nwl_image = document.createElement('img');
			var space = document.createTextNode(' ');

			// setup image attributes
			nwl_image.setAttribute('src', path_to_icon);
			nwl_image.setAttribute('alt', link_alt_text);
			nwl_image.setAttribute('title', link_title_text);

			// set link attributes
			nwl.setAttribute('href', this.getAttribute('href'));
			nwl.setAttribute('target', '_blank');
			nwl.setAttribute('title', link_title_text);
			nwl.className = 'new_window_link';

			// append new elements
			nwl.appendChild(nwl_image);
			this.parentNode.insertBefore(space, this.nextSibling);
			this.parentNode.insertBefore(nwl, this.nextSibling.nextSibling);
		}
	});
	
	$("#top-links li a").each(function(i){
		//console.info(this.href.split('/')[2].replace(/www\./, ''));
		// just for off-site links
		if (this.href.split('/')[2].replace(/www\./, '') != document.domain.replace(/www\./, '')
		&& !this.getAttribute('target')
		&& !this.parentNode.id.match(/^copy/)) {
		
			$(this).attr("target", "_blank");
			
			$(this).next().remove();
		}
	});
}