﻿// JScript File
// Core Insights Script
// REM: Keep it small and simple as every page loads this
function newPopupWindow(href)
{
    var newWindow;
    newWindow = window.open(href, '_blank','width=800,height=600,channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no',false);
    if (newWindow) { newWindow.focus(); }
    return false;
}
function newSmallWindow(href)
{
    var newWindow;
    newWindow = window.open(href, '_blank','width=400,height=300,channelmode=no,directories=no,fullscreen=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no',false);
    if (newWindow) { newWindow.focus(); }
    return false;
}
function closePopup()
{
    if(window.opener)
    {        
        window.opener.focus();        
    }
    window.self.close();
}
function closePopupAndReloadOpener(ClickButton)
{
    if(window.opener)
    {
        var o = window.opener.document.getElementById(ClickButton);
        if(o) { o.click(); } else { window.opener.document.forms[0].submit(); }
        window.opener.focus(); 
    }
    window.self.close();
}
function reloadOpener(ClickButton)
{
    if(window.opener)
    {
        var o = window.opener.document.getElementById(ClickButton);
        if(o) { o.click(); } else { window.opener.document.forms[0].submit(); }
    }
    window.self.focus();
}
function confirmDelete()
{
    return confirm('Are you sure you want to delete?');
}
function confirmDelete(DeleteWhat)
{
    return confirm("Are you sure you want to delete '" + DeleteWhat + "'?");
}