function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}




function setInput(){
	if(!document.getElementById("cfEmail")) return false;
	document.getElementById("cfEmail").focus();
}

function printTimetable(){
	if(!document.getElementById("print-tt")) return false;
	document.getElementById("print-tt").onclick = function(){window.print(); return false;};
}

/*
	DOMAss is developed by Robert Nyman, http://www.robertnyman.com, and is free for anyone to use.
	For more information, please see http://www.robertnyman.com/domass
*/

/*
var DOMAss = {
	
	methodsToAdd : [],
	
	init : function (){
		this.applyMethod.call(window, "$", this.$);
		window.DOMAss = this;
		this.addBaseMethods();
	},
	
	addBaseMethods : function (){
		document.getElementsByClassName = this.getElementsByClassName;
		document.getElementsByAttribute = this.getElementsByAttribute;
		if(typeof HTMLElement == "function"){
			HTMLElement.prototype.getElementsByClassName = this.getElementsByClassName;
			HTMLElement.prototype.getElementsByAttribute = this.getElementsByAttribute;		
		}
		this.methodsToAdd.push(["getElementsByClassName", this.getElementsByClassName]);
		this.methodsToAdd.push(["getElementsByAttribute", this.getElementsByAttribute]);
	},
	
	applyMethod : function (method, func){
		if(typeof this[method] != "function"){
			this[method] = func;
		}
	},
	
	addMethods : function (elm){
		if(elm){
			var elms = (elm.constructor == Array)? elm : [elm];
			for(var i=0; i<elms.length; i++){	
				for(var j=0; j<this.methodsToAdd.length; j++){
	            	this.applyMethod.call(elms[i], this.methodsToAdd[j][0], this.methodsToAdd[j][1]);
	            }
			}
		}
	},
	
	$ : function (){
		var elm = null;
		if(document.getElementById){
			elm = (arguments.length > 1)? [] : null;
			var current;
			for(var i=0; i<arguments.length; i++){
				current = arguments[i];
				if(typeof current != "object"){
					current = document.getElementById(current);
				}
				if(arguments.length > 1){
					elm.push(current);
				}
				else{
					elm = current;
				}
			}
			this.DOMAss.addMethods(elm);
		}
		return elm;
    },
	
	getElementsByClassName : function (className, tag){
		var elms = ((!tag || tag == "*") && this.all)? this.all : this.getElementsByTagName(tag || "*");
		var returnElms = [];
		var className = className.replace(/\-/g, "\\-");
		var regExp = new RegExp("(^|\\s)" + className + "(\\s|$)");
		var elm;
		for(var i=0; i<elms.length; i++){
			elm = elms[i];		
			if(regExp.test(elm.className)){
				returnElms.push(elm);
			}
		}
		return (returnElms);
	},
	
	getElementsByAttribute : function (attr, attrVal, tag){
	    var elms = ((!tag || tag == "*") && this.all)? this.all : this.getElementsByTagName(tag || "*");
	    var returnElms = [];
	    if(typeof attrVal != "undefined"){
			var attrVal = new RegExp("(^|\\s)" + attrVal + "(\\s|$)");
		}
	    var current;
	    var currentAttr;
	    for(var i=0; i<elms.length; i++){
	        current = elms[i];
	        currentAttr = current.getAttribute(attr);
	        if(typeof currentAttr == "string" && currentAttr.length > 0){	
	            if(typeof attrVal == "undefined" || (attrVal && attrVal.test(currentAttr))){
					returnElms.push(current);
	            }
	        }
	    }
	    return returnElms;
	}	
}
DOMAss.init();

*/



/*
	DOMAss: http://www.robertnyman.com/domass
	This module by Robert Nyman, http://www.robertnyman.com
*/

/*
DOMAss.initCSS = function (){
	this.addCSSMethods();
};

DOMAss.addCSSMethods = function (){
	if(typeof HTMLElement == "function"){		
		HTMLElement.prototype.addClass = this.addClass;
		HTMLElement.prototype.removeClass = this.removeClass;
		HTMLElement.prototype.hasClass = this.hasClass;
		HTMLElement.prototype.getStyle = this.getStyle;
	}
	this.methodsToAdd.push(["addClass", this.addClass]);
	this.methodsToAdd.push(["removeClass", this.removeClass]);
	this.methodsToAdd.push(["hasClass", this.hasClass]);
	this.methodsToAdd.push(["getStyle", this.getStyle]);
};

DOMAss.addClass = function (className){
	var currentClass = this.className;
	if(!new RegExp(className, "i").test(currentClass)){
		this.className = currentClass + ((currentClass.length > 0)? " " : "") + className;
	}
	return this.className;
};

DOMAss.removeClass = function (className){
	var classToRemove = new RegExp((className + "\s?"), "i");
	this.className = this.className.replace(classToRemove, "").replace(/^\s?|\s?$/g, "");
	return this.className;
},

DOMAss.hasClass = function (className){
	return new RegExp(("(^|\\s)" + className + "(\\s|$)"), "i").test(this.className);
};

DOMAss.getStyle = function (cssRule){
	var cssVal = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		cssVal = document.defaultView.getComputedStyle(this, "").getPropertyValue(cssRule);
	}
	else if(this.currentStyle){
		cssVal = cssRule.replace(/\-(\w)/g, function (match, p1){
			return p1.toUpperCase();
		});
		cssVal = this.currentStyle[cssVal];
	}
	return cssVal;
};

DOMAss.initCSS();

*/

 


















