$(document).ready(function() {
	$('a[href^="http://"]')
		.attr({
		target: "_blank", 
		title: "Åbner i et nyt vindue"
	});

	// Forside feature blocks i bunden
	$("#block-nodereference_block-1 div.teaser a").parent().parent().parent().addClass("cursor");
	$("#block-nodereference_block-1 div.teaser").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});

	// Related brick'sne
	$("##block-nodereference_block-0 li a").parent().parent().parent().addClass("cursor");
	$("##block-nodereference_block-0 li").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});

});

/*

function init() {

	$("#attachments td ~ td").css("text-align","right");

	$('#front-page h2.title').each(
		function(i) {
			var counter = i;
			var point = $(this).offset();
			var title = this.innerHTML;
			var height = $(this).height() + 5 // padding;
			var width = $(this).width();
			var boxid = $(this).parent('div')[0].id;
			var headerlink = $('#' + boxid + " a")[0].href;
			this.id = "elemnt"+i;

			var flashvars = {
				txt: encodeURIComponent(this.innerHTML),
				link: encodeURIComponent(headerlink),
				objid: this.id,
				isSelected:this.className,
				txtwidth: width
			};

			 var params = {
				wmode:"transparent",
				scale:'noscale',
				salign:'tl'
			 };

			 var attributes = {};
			 swfobject.embedSWF("/sites/all/themes/transmedica/t_header_forside.swf", flashvars.objid, width, 35, "9.0.0", "/sites/all/themes/transmedica/expressinstall.swf" , flashvars, params, attributes);

		}
	);

}

function headerreplace() {
	var headerlist = document.getElementsByTagName('h1');
	for(var i=0; i < headerlist.length; i++) {
		headerlist[i].id = "header" + i;
	}
	for(var i=headerlist.length-1; i >= 0 ; i--) {
	
		if (headerlist[i].className == 'title') {
		
			var params = {
			  wmode: "transparent",
			  scale: "noscale",
			  salign: "tl"
			};
			var attributes = {};
			var flashvars = {
			 text_o: headerlist[i].innerHTML
			};
			swfobject.embedSWF("/sites/all/themes/transmedica/t_header_underside.swf", headerlist[i].id, "480", "40", "9.0.0","/sites/all/themes/transmedica/expressInstall.swf", flashvars, params, attributes);
		}
	}

}

function setsize(id,width,height) {
	var obj = document.getElementById(id);
	if(obj) {
	   obj.width = width;
	   obj.height = height;
	}

}

*/
