/* Event handler */
function addEvent(obj, evType, fn) {
	if (obj != null) {
        if (obj.addEventListener) {
		    obj.addEventListener(evType, fn, false);	// maybe set to true
    		return true; 
    	} else if (obj.attachEvent) {
	    	var r = obj.attachEvent("on"+evType, fn); 
		    return r;
		}
    }
	return false; 
}

function popup_window(url) {
	window.open(url,'pop_win','scrollbars=yes,resizable=no,toolbar=no,width=650,height=430,left=400,top=250,status=yes');
}

function clear_bg_img(obj) {
	if (obj) {
		obj.style.backgroundImage = 'none';
	} else if (this) {
		this.style.backgroundImage = 'none';
	}
}

function restore_bg_img(obj) {
	if (obj && obj.value == "") {
		obj.style.backgroundImage = '';
	} else if (this && this.value == "") {
		this.style.backgroundImage = '';
	}
}