// finds all anchor tags
var getlinks = document.getElementsByTagName("a");
// regular expression  change the first details inside " " to change 
var linktest = new RegExp ("javascript|wa.gov.au|slwa.wordpress.com|www.surveymonkey.com|better-beginnings.com.au","i");
// the loop
for (var i=0; i < getlinks.length; i++) {
		// if name matches regular exp do nothing else do
	if (linktest.test(getlinks[i].hostname)) {
		}
	else {
		if (linktest.test(getlinks[i].href)) {
			}
		else {
			// adds title attribute
				getlinks[i].setAttribute("title", "external link");
			// opens in new window
				getlinks[i].setAttribute("target", "_blank");
			// adds class name extlink - method depends if class exisits already
			if(!getlinks[i].className) {
				getlinks[i].className = "extlink";
			} else {
				newClassName = getlinks[i].className;
				newClassName+= " ";
				newClassName+= "extlink";
				getlinks[i].className = newClassName;
			}
			// changes URL  removed for certain pages in albhome/eres
			
		}
	}
	}
		

