function getDiv(id) {
	if (document.getElementById) {
		return document.getElementById(id);
	}
	
	if (document.all) {
		return document.all[id];
	}
	
	if (document.layers) {
		return document.all[id];
	}
	
	return null;
}

function addEvent(obj, evType, fn, opt_flag) { 
	var flag = false;
	if (opt_flag != null) {
		flag = opt_flag;
	}
		
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, flag); 
		return true; 
	} else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	} else { 
		return false; 
	} 
}

function hilite(element) {
	if (element) {
		if (element.className) {
			element.className  = element.className + " on";
		} else {
			element.className  = "on";
		}
	}
}

function lolite(element) {
	if (element && element.className) {
		element.className = element.className.replace(/ on$/, "");
		element.className = element.className.replace(/on$/, "");
	}
}

function showPopup(url) {
	var height = 640;
	//if (is_opera) {
	//	height += 30;
	//}
	
	var wnd = window.open(url, 'nlrg', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1000,height=' + height );
	wnd.focus();
}

function showVarPopup(url, w, h) {
	var sb = 0;
	var width = w;
	var height = h + 40;
	
	if (h > 800) {
		sb = 1;
		height = 750;
		width += 15;
	}
	
	//if (is_opera) {
	//	height += 30;
	//}
	
	var wnd = window.open(url, 'nlrg', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + sb + ',resizable=0,width=' + width + ',height=' + height );
	wnd.focus();
}
