/**
 * These javascript functions are for the different page actions that should show up on
 * pretty much all the Dallas subpages. The actions are represented by 3 icons: print,
 * email, and bookmark.
 */

/* This method will automatically create a bookmark with the given title and the given URL
   in both IE and Firefox. Actually it will bring up the 'add bookmark/favorite' dialog
   box so the user can assign the bookmark to a particular category, etc. */
function createBookmark(title, url)
{ 
    if (window.sidebar) // Mozilla Firefox Bookmark
    {
        window.sidebar.addPanel(title, url, "");
    }
    else if (window.external) // IE Favorite 
    {
        window.external.AddFavorite(url, title);
    }
}

/* This method will bring up a popup dialog for printing. It basically adds a print parameter
   (print_format) to the current browser URL. There is code within common/shared/content.php 
   that will then change the template to be printer appropriate (if the printer parameter is
   set). */
function showPrintPage (width, height)
{
    var location_url = window.document.location.toString();

    var query_delimiter;
    if (location_url.indexOf("?") == -1)
    {
        query_delimiter = "?";
    }
    else
    {
        query_delimiter = "&";
    }

    popup(location_url + query_delimiter + "print_format=1", width, height);
}