	addLoadEvent (function() {
	
		if (document.getElementsByTagName) {

			//--------------------------------
			// Return a reference to all links
			// on the page

				var anchors = document.getElementsByTagName('a');

			//--------------------------------
			// Loop through all links, and search
			// for any which any which have the 
			// the relevant class attributes
	
				for (var i=0; i<anchors.length; i++) {
				
					 if (cssjs('check', anchors[i], 'external')) {
						anchors[i].target = "_blank";
					
					}else if (cssjs('check', anchors[i], 'popupLink')) {
						anchors[i].onclick = function () {

							//--------------------------------
							// Try to open the window
	
								oWin = window.open (this.href);

							//--------------------------------
							// Create a reference for the popup
							// to access the opener window.

								oWin.opener = self;

							//--------------------------------
							// If the popup was sucessfully 
							// created, then return false (dont
							// use normal href link), otherwise
							// return true (so the browser links
							// as normal).
		
								if (oWin == null || typeof(oWin) == 'undefined') {
									return true;
								} else {
									oWin.focus();
									return false;
								}

						}
					}
				}

		}
	});
	