﻿// JScript File for login js elements


function getHelp(strElementID)
    {
        var strPage = window.location.pathname
        
        if (strPage.length == 1)
        {
            strPage = 'default.aspx'
        }
        else
        {
            strPage = strPage.substring(1)
        }
        
        window.open('/viewHelp.aspx?Page=' + strPage + '&ElementID=' + strElementID,'HelpWindow','height=500,width=475,menubar=no,resizable=yes,status=no,toolbar=no,location=no,scrollbars=yes')
    }
    
function getHelpTOC() {
        window.open('/viewHelpTOC.aspx','HelpWindow','height=500,width=475,menubar=no,resizable=yes,status=no,toolbar=no,location=no,scrollbars=yes')
    }

function getWiki() {
    window.open('/wiki/Login.ashx', 'WikiWindow', 'menubar=yes,resizable=yes,status=yes,toolbar=yes,location=yes,scrollbars=yes')
    }
    
var confirmClose = false;
var refreshParent = false;

function confirm_on()
{
    confirmClose = true;
}

function confirm_off()
{
    confirmClose = false;
}

var checkfocus = false;

function check_focus()
{  
     if (checkfocus)
        {
             window.focus();            
        }
              
}

function confirm_close()
{  
   
   if (confirmClose)
        {
            event.returnValue = "This form has been edited, but not saved.";

        }  
              
}

function refresh_parent()
{  
     if (refreshParent)
        {
         
            try{
                window.opener.WebGrid1_Undo('WebGrid1');
            }
            catch(e){
            }
            
        }
              
}
function getQueryVar(variable)
    {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        
        for (var i=0;i<vars.length;i++)
        {
            var pair = vars[i].split("=");
            
            if (pair[0] == variable)
            {
                return pair[1];
            }

        }
    
    } 