function replaceText(obj_id, newstring) {
	document.getElementById(obj_id).innerHTML = newstring;
}

function redirectURL(url) {
	window.location=url;
}

function redirect(url) {
	window.location=url;
}

function changeObjectVisibility(objectId, newVisibility) {
	// first get the object's stylesheet
	var styleObject = getStyleObject(objectId);

	// then if we find a stylesheet, set its visibility
	// as requested
	//
	if (styleObject) {
		styleObject.visibility = newVisibility;
		return true;
	} else {
		return false;
	}
}

function getStyleObject(objectId) {
	// checkW3C DOM, then MSIE 4, then NN 4.
	//
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId)) {  
		return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId]) { 
		return document.layers[objectId];
	} else {
		return false;
	}
}

function showHelp(topic) {
	//openPopupWindow('<?php echo $base_url?>/help.php?topic=' . topic, 'Test', 100, 100, 100, 100);
	openPopupWindow('<?php echo $base_url?>/help/?topic=' + topic, 'Test', 300, 300, 100, 100);
}

function openPopupWindow(url, winName, w, h, x, y) {
	var sAttribs = "location=no,buttons=no,toolbar=no,scrollbars=yes,width=" + w + ",height=" + h + ",left=" + x + ",top=" + y ;
	if (navigator.appName == "Netscape" && navigator.appVersion.charAt (0) >= 4)
		sAttribs += ",resizable=no,left=" + x + ",top=" + y ;
	else if (navigator.appName == "Microsoft Internet Explorer")
		sAttribs += ",resizable=yes,left=" + x + ",top=" + y ;

	//newWindow = top.CCBodyi.open (url, winName, sAttribs);
	newWindow = open (url, winName, sAttribs);

	if (navigator.appName == "Microsoft Internet Explorer" &&
		navigator.appVersion.charAt (0) >= 4 && newWindow.opener == null)
	{
		newWindow.opener = window ;
	}

	// Bring window to front on Navigator 3.0+ and MSIE 4.0+
	if (navigator.appName == "Netscape" && navigator.appVersion.charAt (0) >= 3 ||
		navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.charAt (0) >= 4)
	{
		newWindow.focus();
	}
}
