function attachEventListener(target, eventType, functionRef, capture){
	// function can be called with a pointer or a string representing a function name
	if (typeof(functionRef)== 'string') {
		functionRef=eval(functionRef);
	}
	if (typeof target.addEventListener != "undefined"){
	   target.addEventListener(eventType, functionRef, capture);
	} 
	else if (typeof target.attachEvent != "undefined"){
	    target.attachEvent("on" + eventType, functionRef);
	} 
	else {
	    eventType = "on" + eventType;
	    if(typeof target[eventType] == "function"){
        		var oldListener = target[eventType];
		        target[eventType] = 
			function(){
			    oldListener();
		            return functionRef();
		        };
	    }else{
	        target[eventType] = functionRef;
	    }
  	}
}

//attachEventListener(window,'load',hideRegions,false);

//function checkForDET(){
//    if(document.getElementById("ctl00_ContentPlaceHolder1_ddlSchRegion") && document.getElementById("ctl00_ContentPlaceHolder1_lblSchoolRegion")){
//        if(document.forms["aspnetForm"]["ctl00_ContentPlaceHolder1_ddlSchSector"].value == "DET"){
//            document.getElementById("ctl00_ContentPlaceHolder1_ddlSchRegion").style.display = "inline";
//            document.getElementById("ctl00_ContentPlaceHolder1_lblSchoolRegion").style.display = "block";
//        }else{
//        document.getElementById("ctl00_ContentPlaceHolder1_ddlSchRegion").style.display = "none";
//            document.getElementById("ctl00_ContentPlaceHolder1_lblSchoolRegion").style.display = "none";
//        }
//    }
//}

//function hideRegions(){
//    if(document.getElementById("ctl00_ContentPlaceHolder1_ddlSchRegion") && document.getElementById("ctl00_ContentPlaceHolder1_lblSchoolRegion") && location.href.indexOf("register.aspx") != -1){
//            document.getElementById("ctl00_ContentPlaceHolder1_ddlSchRegion").style.display = "none";
//            document.getElementById("ctl00_ContentPlaceHolder1_lblSchoolRegion").style.display = "none";
//    }
//}

function makeCurrent() {
    if (document.getElementById(elementID))
        document.getElementById(elementID).className = "current";
}

function popUp(newPage,popMode,popWidth,popHeight)  {
	if(popWidth && popHeight){
		var popProperties = "width=" + popWidth + ", height=" + popHeight + ", left=0, top=0, scrollbars=1,resizable=yes";
	}
	else if(popMode=="small"){ //if popMode is feedback
		var popProperties = "width=300, height=300, left=0, top=0, scrollbars=1,resizable=yes";
	}else{ //if popMode is large or other
		var popProperties = "width=610, height=460, left=0, top=0, scrollbars=1,resizable=yes";
	}
	
	activityWindow = window.open(newPage, 'thepopup', popProperties);
	activityWindow.focus();
}

function printPage(){
	window.print?
		window.print()
		: alert('Sorry, your browser does not support this feature. Please choose print from the file menu.');
}
