/**
 * javascript popup and dynamic menu popup functions
 * @author		Ignatius Teo	<ignatius@worlddo.com>
 * @author		Morgan Tocker	<morgan@icedotblue.com>
 * @copyright	(c)2000-2004 Worlddo Pty Ltd		<http://worlddo.com>
 * $Id: popup.js,v 1.1.1.1 2005/09/21 11:00:27 Owner Exp $
 */
function popup(url, handle, w, h)
{
	if (!handle || handle == undefined)
		handle = 'popup';
	if (!w || w == undefined)
		w = 450;
	if (!h || h == undefined)
		h = 300;
	var win = window.open(url, handle, 'height='+h+',width='+w+',top=20,left=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	win.focus();
	return win;
}

function liveUpdate_popup(liveupdateURL)
{
	var w = window.open(liveupdateURL,'liveupdate','height=400,width=400,top=20,left=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	w.focus();
}


function liveUpdate_clearSelect(formname, selectName)
{
	select = document.forms[formname].elements[selectName];

	for(i=select.length-1;i >= 0;i--) {
		select.options[i] = null;
	}
}

function liveUpdate_writeValue(formname, selectName, text, value)
{
	select = document.forms[formname].elements[selectName];//nextstep;
	select.options[select.length] = new Option(text, value);
}

function Help(topic, context)
{
	popup('/shared/v.php/help/view/title=' + escape(topic) + '&context=' + context, 'Help', 400, 300);
}

