﻿// 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 + "'?");
}

function pickDate(Url, Src, AllowClear)
{
    var o = document.getElementById(Src);
    if(o)
    {
        window.open(Url	+ '?date=' + o.value + '&src=' + Src + '&allowclear=' + AllowClear
		    , '_blank', 'height=250, width=275, left=300, top=300, location=no, menubar=no, resizable=no, scrollbars=no, titlebar=no, toolbar=no', true);
    }
	return false;
}

//MUST Come at end
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
