function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function createPopups() {
	//get anchors
	var anchors = document.getElementsByTagName("a");
	//find anchors that should popup
	for(var i=0; i<anchors.length; i++){
		if(anchors[i].rel=="quote-popup")
		{
			//if rel is set to quote-popup then attach popup function
			anchors[i].onclick = quotePopup;
		}
	}
}

function quotePopup(){
	var screenWidth = Math.floor(screen.width*.9);
	var screenHeight = screen.height;
	window.open(this.href,"quoteWindow","status=1,scrollbars=1,toolbar=0,location=0,menubar=1,history=0,resizable=1,screenX=0,screenY=0,top=0,left=0,height="+screenHeight+",width="+screenWidth);
	return false;

}

addLoadEvent(createPopups);
