﻿function doHourglass() {
    document.body.style.cursor = 'wait';
}
function undoHourglass() {
    document.body.style.cursor = 'auto';
}

function MyToolbarMouseOver(cell)
{	
	var cellElement = document.getElementById(cell);
	cellElement.style.cssText = "background-color:#012C8E;";
}

function MyToolbarMouseOut(cell) 
{
	var cellElement = document.getElementById(cell);
	cellElement.style.cssText = "background-color:Transparent;";
}


/* Opens a small new window pointing to the specified URL. */
function openNewWindowUsingUrl(url, newWindowName)
{
    var newWindow = window.open(url, newWindowName, 'scrollbars=yes,width=300,height=300,resizable=yes');
    
    if (newWindow == null) 
    { 
        alert("Cannot display new window. Check that popup blockers are disabled for this site."); 
    } 
    else 
    { 
        if (!newWindow.focus) 
        {
            newWindow.focus();
        }
    }
}

/* Opens a small new window with the specified title and innerHTML. */
function openNewWindowUsingHtml(title, innerHTML, newWindowName)
{
    var newWindow = window.open('', newWindowName, 'scrollbars=yes,width=300,height=300,resizable=yes');
    
    if (newWindow == null) 
    { 
        alert("Cannot display new window. Check that popup blockers are disabled for this site."); 
        
        // Just in case the alert doesn't work, also set the status bar text.
        window.status = "Cannot display new window. Check that popup blockers are disabled for this site.";
    } 
    else 
    {   
        // Note: Use write() instead of setting body.innerHTML.  Setting body.innerHTML doesn't render quotes correctly in Firefox.
        newWindow.document.write(innerHTML);
        
        // Make sure to set the title _after_ the write command; otherwise it'll be overwritten.
        newWindow.document.title = title;
        
        newWindow.document.close();
        newWindow.focus();
    }
}

/* Opens a small new window with the specified title and image URL. */
function openNewWindowDisplayingImage(title, imageUrl, newWindowName)
{
    var newWindow = window.open('', newWindowName, 'scrollbars=yes,width=300,height=300,resizable=yes');
    
    if (newWindow == null) 
    { 
        alert("Cannot display new window. Check that popup blockers are disabled for this site."); 
        
        // Just in case the alert doesn't work, also set the status bar text.
        window.status = "Cannot display new window. Check that popup blockers are disabled for this site.";
    }
    else 
    { 
        // Note: Use write() instead of setting body.innerHTML.  Setting body.innerHTML doesn't render quotes correctly in Firefox.
        newWindow.document.write("<span style=\"font-family:Arial;font-size:12pt;\"><B>" + title + "<B></span><BR/><BR/>" + "<img border=\"0\" src=\"" + imageUrl + "\" >");
        
        // Make sure to set the title _after_ the write command; otherwise it'll be overwritten.
        newWindow.document.title = title;
        
        newWindow.document.close();
        newWindow.focus();
    }
}