function goURL(url)
{
window.open(url,'popup','width=700,height=500,location=yes,toolbar=yes, status=yes, menubar=yes, scrollbars=yes,resizable=yes');
}
function newWindow(url, name, params)
{
    window.open(url,name,params);
}
function newWindowCrossRef(baseurl, an, id, data, params)
{
	//Use the id as the name for the window
	var windowName = "crossRef";
	//Build the url from the information provided
    url = baseurl + "?an=" + an + "&id=" + id + "&data=" + escape(data);
    window.open(url,windowName,params);
}
function replaceParent(url)
{
    window.parent.location.href=url;
}
function goBack()
{
    window.parent.history.back();
}
function submitForm(name)
{
    window.document.forms[name].submit();
}
function sortSelect(obj)
{
    var o = new Array();
    if (obj.options==null)
    {
        return;
    }
    for (var i=0; i<obj.options.length; i++)
    {
        o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
    }
    if (o.length==0)
    {
        return;
    }
    o = o.sort(
        function(a,b)
        {
            if ((a.text+"") < (b.text+""))
            {
                return -1;
            }
            if ((a.text+"") > (b.text+""))
            {
                return 1;
            }
            return 0;
        }
        );

    for (var i=0; i<o.length; i++)
    {
        obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
    }
}
function etocsAllAdd(from,to,suffix)
{
    // Move them over
    var optionText = "";
    for (var i=0; i<from.options.length; i++)
    {
        var o = from.options[i];
        if (o.selected)
        {
            if (suffix=="H")
                optionText = o.text + " - [HTML]";
            else
                optionText = o.text + " - [Text]";
            to.options[to.options.length] = new Option( optionText, o.value+suffix, false, false);
        }
    }

    // Delete them from original
    for (var i=(from.options.length-1); i>=0; i--)
    {
        var o = from.options[i];
        if (o.selected) {
            from.options[i] = null;
        }
    }

    // Always Sort
    sortSelect(to);
    sortSelect(from);

    to.selectedIndex = -1;
    from.selectedIndex = -1;
}
function etocsAllRemove(from,to)
{
    // Move them over
    var optionText = "";
    var pos = 0;
    for (var i=0; i<from.options.length; i++)
    {
        var o = from.options[i];
        if (o.selected)
        {
            pos = o.text.indexOf(" - [");
            to.options[to.options.length] = new Option( o.text.substring(0, pos), o.value.substring(0,8), false, false);
        }
    }

    // Delete them from original
    for (var i=(from.options.length-1); i>=0; i--)
    {
        var o = from.options[i];
        if (o.selected) {
            from.options[i] = null;
        }
    }

    // Always Sort
    sortSelect(to);
    sortSelect(from);

    to.selectedIndex = -1;
    from.selectedIndex = -1;
}
function populateHidden(fromObject,toObject)
{
    var output = "";
    for (var i=0, l=fromObject.options.length;i<l;i++)
    {
        output += escape(fromObject.options[i].value) + "|";
    }
    toObject.value = output;
}
function TableCreate()
{
	var i;
	document.write("<TABLE class=ptMenuTabTable cellSpacing=0 width=841> ");
	for (i=0;i<11;i++)
	{
		document.write("<tr><td></td><td></td><td></td><td></td></tr>");
	}
	document.write("</table>");
}