//<![CDATA[

function $() 
{
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) 
      {
        var element = arguments[i];
        if (typeof element == 'string')
            element = document.getElementById(element);
        if (arguments.length == 1)
            return element;
        elements.push(element);
      }
    return elements;
}

function toggle() 
{
    for ( var i=0; i < arguments.length; i++ ) 
      {
        $(arguments[i]).style.display = ($(arguments[i]).style.display != 'none' ? 'none' : '' );
      }
}

function newWindow(page, name, w, h, scroll, pos)
{
    if (pos == "random")
      {
        leftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
        topPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
      }
    if (pos == "center")
      {
        leftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
        topPosition = (screen.height) ? (screen.height - h) / 2 : 100;
      }
    else if ((pos != "center" && pos != "random") || pos == null)
      {
        leftPosition = 0;
        topPosition = 20;
      }
    settings = 
        'width=' + w + 
        ',height=' + h + 
        ',top=' + topPosition + 
        ',left=' + leftPosition + 
        ',scrollbars=' + scroll + 
        ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win = window.open(page, name, settings);
}


//]]>

