function getElementsByClassName(class_name) {

  var all_obj,ret_obj=new Array(),j=0,teststr;

  if (document.all) all_obj=document.all;
    else if(document.getElementsByTagName && !document.all) all_obj=document.getElementsByTagName("*");

  for(i=0;i<all_obj.length;i++) {
    if(all_obj[i].className.indexOf(class_name)!=-1) {
      teststr=","+all_obj[i].className.split(" ").join(",")+",";
      if(teststr.indexOf(","+class_name+",")!=-1) {
        ret_obj[j]=all_obj[i];
        j++;
      }
    }
  }
  return ret_obj;
}


function addStyle (paramStyleSource) {
  var styles = document.createElement('link');
  styles.rel='stylesheet';
  styles.type='text/css';
  styles.href=paramStyleSource;

  var headRef = document.getElementsByTagName('head')[0];
  headRef.appendChild(styles);  
}


function moveChild (paramDestination, paramSource) {

  var objCopy=paramSource.cloneNode(true);
  var objSourceParent=paramSource.parentNode;
  objSourceParent.removeChild (paramSource);
  paramDestination.appendChild (objCopy);
  return (objCopy);
}

if (document.all) IE=true; else IE=false;

Function.prototype.bindAsEventListener = function (object) {
	var method = this;
	var wrapper = function (event) {
     method.call(object, event || window.event);
	};
	return wrapper;
};
