﻿// add event
function addEvent(obj, evType, fn) {
    if (obj.addEventListener) {
        obj.addEventListener(evType, fn, false);
        return true;
    }
    else if (obj.attachEvent) {
        var r = obj.attachEvent("on" + evType, fn);
        return r;
    }
    else {
        return false;
    }
}

function popUpGlossary(id)
{
    if(id)
	    popUp('GlossaryPopup.asp?id=' + id, 500, 200, false, 'glossary');
}

function popUp(url, width, height, menubar, name, top, left) 
{
	var strName
	if(!top)
	{
		if(height)
			top = (screen.height / 2 - height / 2);
		else
			top = 50;
	}
	if(!left)
	{
		if(width)
			left = (screen.width / 2 - width / 2);
		else
			left = 100;
	}
	if(name) strName = name; else strName = "popup"
	window.open(url,strName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=' + left + ',top=' + top + ',width=' + width + ',height=' + height);
}
