﻿// PageMethods.js 
var prevPageID = null;
var timer = null;

// Initializes global variables and session state.
function pageLoad()
{
       
}
// Callback function invoked on successful 
// completion of the page method.
function dumpProps(obj, parent) {
   // Go through all the properties of the passed-in object 
   for (var i in obj) {
      // if a parent (2nd parameter) was passed in, then use that to 
      // build the message. Message includes i (the object's property name) 
      // then the object's property value on a new line 
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      // Display the message. If the user clicks "OK", then continue. If they 
      // click "CANCEL" then quit this level of recursion 
      if (!confirm(msg)) { return; }
      // If this property (i) is an object, then recursively process the object 
      if (typeof obj[i] == "object") { 
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
      }
   }
}

if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

function validateDropDownList(source, arguments)
{
    if(arguments.Value == "-1")
        arguments.IsValid = false;
    else
        arguments.IsValid = true;   
}
function dropDownListHasOptions(source, arguments)
{
    if(arguments.Value == '')
        arguments.IsValid = false;
    else
        arguments.IsValid = true;   
}
function passwordMatches(p, val1, val2)
{    
    var passwordTextBox = $get(p);
    var passwordValidator = $get(val1);
    var confirmationValidator = $get(val2);

    if(passwordTextBox.value != '')
    {
        passwordValidator.enabled = true;
        confirmationValidator.enabled = true;
    } else {
        passwordValidator.enabled = false;
        confirmationValidator.enabled = false;
    }
}
function popup(url)
{
    window.open(url,'','menubar=no,status=no,scrollbars=yes,menubar=no,location=no,width=500,height=400');
}
/*
    include this in code-behind
    ---------------------------
    
    [WebMethod]
    // Get session state value.
    public static string GetSessionValue(string key)
    {
        return (string)HttpContext.Current.Session[key];
    }

    [WebMethod]
    // Set session state value.
    public static string SetSessionValue(string key, string value)
    {
        HttpContext.Current.Session[key] = value;
        return (string)HttpContext.Current.Session[key];
    }
*/
