
addEv(win, 'load', check);addEv(win, 'resize', check)
function check(){
	var sPath = window.location.pathname;

var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
//fine ig the window is less than 950 px wide
	var oneCol = false; var j=0;
	if (window.document.body.clientWidth){
				if (window.document.body.clientWidth < 950){oneCol = true}
	}

//force single column in center if unnder 950 px
var divs = document.getElementsByTagName('div')
for (var i=0;i<divs.length;i++) {
				var cl = divs[i].getAttribute("className");
				
				if (divs[i].getAttribute("className") == null ) { var cl = divs[i].getAttribute("class")}
				if (cl=="left" || cl=="right"){
					if (oneCol){
					divs[i].style.width = '100%';
										}else{
					divs[i].style.width = '49%';
					
				}
				
			}
		}
		
//add top border to second h4 if under 950
var h = document.getElementsByTagName('h4');
for (var i=0;i<h.length;i++) {
	if(!h[i].innerHTML||h[i].innerHTML.length ==1){h[i].style.borderTop='0'}
	var hcl = h[i].getAttribute("className");if (hcl==null){hcl=h[i].getAttribute("class")}
	if (hcl=="first right" && oneCol){h[i].style.borderTop='1px solid #ccc';}
	if (hcl=="first right" && !oneCol){h[i].style.borderTop='0';}
	
	
}		

//make the first centre column div span full width in student homepage only
if(sPage=='stdserv-home.asp'){
	document.getElementById("one").style.width = "100%";
	if (oneCol){
			document.getElementById("four").style.borderTop='1px solid #ccc';
		}else{
			document.getElementById("four").style.borderTop='0';
		}
	
	}
	
	//make the first centre column div span full width in staff homepage only
if(sPage=='staff-home.asp'||sPage=='staff-home-test-2.asp'){
	document.getElementById("three").style.width = "100%";
	if (oneCol){
			document.getElementById("three").style.borderTop='0';
		}else{
			document.getElementById("three").style.borderTop='0';
		}
	
	}

}