function openContent( url, width, height, target ) {
	var w = window;
	if (isUndefined(width))
		width = w.screen.width;
		//width = screen.availWidth;
	if (isUndefined(height))
		height = w.screen.height;
		//height = screen.availHeight;
	if (isUndefined(target))
		target = "_blank";
	if (!isEmpty(w.top))
		w = w.top;
	var left = 0;
	var top = 0;
	var params = "height="+height+",width="+width
		+",left="+left+",top="+top
		+",location=0,menubar=0,resizeable=1,scrollbars=1,status=0,titlebar=0";
	if (w.open( url, target, params )) 
		return false;
	else 
		return true;
}

function openGlossary( url ) {
	width = 760;
	height = 480;
	target = "_blank";
	var w = window;
	if (!isEmpty(w.top))
		w = w.top;
	var left = (w.screen.width-width)/2;
	var top = w.screen.height*0.4-height/2;
	var params = "height="+height+",width="+width
		+",left="+left+",top="+top
		+",location=0,menubar=0,resizeable=1,scrollbars=1,status=0,titlebar=0";
	if (w.open( url, target, params )) 
		return false;
	else 
		return true;
}

function csSubnodeAccessMap( field, csroot, root,destmap ) {
	if (isUndefined(field))
		return;

	var i;
	var form = field.form;
	var fieldName = field.name;
	var fields = form[fieldName];

	var nodeids = csroot[field.id];
	var child = 0;
	
	if (isUndefined(destmap))
		destmap = new Array();
	if (!isUndefined(field.title)) {
		if(root){
			destmap[field.id] = true;
		}else{
			if (!isUndefined(nodeids)) {
				for(i=0; i<nodeids.length; i++) {
					if(fields[nodeids[i]].checked == true)
						child = 1;
				}
				if (child == 0){
					destmap[field.id] = true;
				}
			}
		}
		csSubnodeAccessMap( fields[field.title], csroot, root, destmap);
	}
	return destmap;
}

function csSubnodeSelectCA( field, csroot ) {
	var form = field.form;
	var fieldName = field.name;
	var fields = form[fieldName];
	if (isUndefined(fields.length))
		return;
	var checked = field.checked;
	var subnodes = csSubnodeMap( csroot, field.value );
	var subnodes2 = csSubnodeAccessMap(field, csroot, checked);
	var i;
	for(i=0; i<fields.length; i++) {
		if (subnodes[fields[i].value]==true||subnodes2[fields[i].value]==true)
			fields[i].checked = checked;
	}
}
function confirmModify() {
	return confirm('Are you sure you want to do this?'); 
}

