// global.js - Javascript functions used throughout the site
// This file is part of Patesnet, and is Copyright (C) 2005 Paul Henderson
// You may not copy or redistribute any part of this code without permission of the author

// Return the DOM object with the given ID (browser-safe)
function getObj(id)
{
	if (document.getElementById && document.getElementById(id))
		return document.getElementById(id);
	else if (document.all)
		return document.all[id];
	else if (document.layers)
		return document.layers[id];
    else
	    return null;
}

// Open the help popup for the specified page
function show_help(p)
{
	window.open('/help.aspx?page=' + p, '_blank', 'resizable = yes, toolbar = no, statusbar = no, scrollbars = yes, width = 600, height = 400, modal = yes');
}

// Open the feedback page in a new window
function do_bug_report()
{
	window.open('/folders/bug_report.aspx', '_blank', 'toolbar = no, statusbar = no, width = 600, height = 450');
}

// Opens a new satellite window with required url (used in static pages)
function openWindow(url)
{
	window.open(url, '_blank', 'resizable = yes, toolbar = yes, status = no, width = 790, height = 550');
}

// Closes the current satellite window (used in static pages)
function closeWindow()
{
	parent.close();
}
