function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
} 


var edit_url = new Array();
edit_url['page','url'] = 'login/login.html';
edit_url['page','width'] = 700;
edit_url['page','height'] = 250;

function editElement(fcn,data){
	pop('modal',edit_url[fcn,'url']+data,edit_url[fcn,'width'],edit_url[fcn,'height']);
}


function pop(pointer,url,width,height){
   	var left = (screen.width-width)/2;
   	var top = (screen.height-height)/2;
	var pop = window.open(url,pointer,'toolbar=no,location=no,directories=no,menubar=no,statusbar=no,width='+width+',height='+height+',scrollbars=yes,resizable=no,top='+top+',left='+left,false);
	pop.focus();
}

