/*MAKES EXTERNAL LINKS OPEN IN A NEW WINDOW BECAUSE XHTML STICT DOESNT ALLOW TARGET*/
function externallinks() {
	if(document.getElementsByTagName("a")) {
		var links=document.getElementsByTagName("a");
		//LOOPS THROUGH ANCHOR TAGS
		for(var i=0; i<links.length; i++) {
			links[i].onclick=function() {
				//GETS HREF ATTRIBUTE
				var attribute=this.getAttribute("href");
				//indexOf FUNCTION CHECKS THAT HTTP DOESN'T EXIST AND SITES DOMAIN DOES
				var contains_http=attribute.indexOf("http");
				var contains_domain=attribute.indexOf("bradfordexcel");
				var external_class = this.className;
				
				if((contains_http==-1 || contains_domain>-1) && external_class!='external') {
					return true;
				}else{
					//OPEN NEW WINDOW WITH ALL AVAILABLE FUNCTIONS
					window.open(attribute, 'link');
					return false;
				}
			}
		}
	}
}

//POP UP WINDOWS FIXED DIMENSIONS
function popUp() {
	if(document.getElementsByTagName("a")) {
		var links=document.getElementsByTagName("a");
		for(var i=0; i<links.length; i++) {
			if(links[i].className=="pop") {
				links[i].onclick=function() {
					var href=this.getAttribute("href");
					var newWin=window.open(href, 'newWin', 'width=525, height=725');
					newWin;
					return false;
				}
			}
		}
	}
}

function loadfunctions() {
	externallinks();
	popUp();
}
window.onload=loadfunctions;