// Coded by Stephen Pun


/* function taken from Simon Willison, http://simonwillison.net/2004/May/26/addLoadEvent/
 * PURPOSE: queues up functions to trigger when document finishes loading
 * EXAMPLES:
 *  	addLoadEvent(nameOfSomeFunctionToRunOnPageLoad); //do not include () with function name
 *  	addLoadEvent(function() {
 *  	 ... 
 *  	});
 */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
		window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function coscurve(percent){
	return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}
