function getElementsByClass(classes) //function to create an array containing all elements with first class being 'classes'
{
	var i;
	var tagarr = new Array();
	var tarele = new Array();
	tagarr = document.getElementsByTagName('*'); //get all elements into an array
	for(i=0; i < tagarr.length; i++)
	{
		if(tagarr[i].className.indexOf(classes) == 0) //if className = 'classes' then add to an array
		{
			tarele.push(tagarr[i]); // add element hook to array
		}
	}
	return tarele; // return array containing all elements
}

function addOnloadEvent(fnc) //function to add another function to window.onload event.
{
  if (typeof window.addEventListener != "undefined") // cross browser adding fnc to onload.
    window.addEventListener("load", fnc, false);
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}
