function initPage() {
	//alert(categories.length);
	var num_cats = categories.length;
	for (var x=0; x<num_cats; x++) {
		if (categories[x]) {
			//alert('categories[x] = ' + x);
			var cat_list_id = 'cat' + x + 'ArticleList';
			categories[x]['list_node'] = document.getElementById(cat_list_id);
			//alert(categories[x]['list_node']);
		}
	}
}

//--------------------------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------------------------

function addCommas(nStr) {
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}


//--------------------------------------------------------------------------------------------------------------



function removeNode() {
	content_div_node.style.display = 'none';
	this.parentNode.removeChild(this);
	
}

//--------------------------------------------------------------------------------------------------------------

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	//return [curleft,curtop];
	var coords = new Array(curleft,curtop);
	return coords;
}

//--------------------------------------------------------------------------------------------------------------


function showArticles(kb_cID) {

	if (categories[kb_cID]['display'] == 'none') {
		categories[kb_cID]['display'] = 'block';
	} else {
		categories[kb_cID]['display'] = 'none';
	}
	
	categories[kb_cID]['list_node'].style.display = categories[kb_cID]['display'];
}

//--------------------------------------------------------------------------------------------------------------

// this is the func that runs when the Rad Upload has completed
function uploadCompleted() {
	alert('uploadCompleted js/site funct');
}


//--------------------------------------------------------------------------------------------------------------