//
//	attachments.js
//
//	Written by Jon Burney (e4education)
//	Copyright 2007 Bluestone New Media Ltd (e4education)



//  function:  attachmentsNewWindow
//  arguments:  none
//  return: none
// desc: Sets the target of all links to document attachments so they open
//	in a new window (where the rel is set to "external") without breaking XHTML strict
function attachmentsNewWindow() {

	var attachmentList = document.getElementById("fileAttachments");
	var attachmentLinks = attachmentList.getElementsByTagName("a");
	
	for (var i =0; i < attachmentLinks.length; i++) {
		if (attachmentLinks[i].rel == "external") {
			attachmentLinks[i].target = "_blank";
		}
	}
	
}



// attach this event to the body onload function
addLoadEvent(attachmentsNewWindow);

