﻿//<!-- Begin
//Check all childern check boxes in RadTreeView
function UpdateAllChildren(nodes, checked)
{
    var i;
    for (i=0; i<nodes.length; i++)
    {
        checked ? nodes[i].Check() : nodes[i].UnCheck(); 
        if (nodes[i].Nodes.length > 0)
        {
            UpdateAllChildren(nodes[i].Nodes, checked);    
        }
    }   
}

function PopupRadWindow(url)
{
var oWin = window.radopen(url, "");
var leftPosition, topPosition, strOptions;
leftPosition = 100;
topPosition = 100;
oWin.SetModal(true);
oWin.SetSize( 670, 480 );
return false;
}
function PopupRadWindow2(url, windowName)
{
    url = currentDomainPath(url);
    var oWin = window.radopen(url, windowName);
    return false;
}
//Check all childern check boxes in Prometehus RadTreeView
function UpdateAllChildrenPrometheus(nodes, checked)
{for (var i=0; i < nodes.get_count(); i++){var node = nodes.getNode(i);node.set_checked(checked);UpdateAllChildrenPrometheus(node.get_nodes(), checked);}}

function AfterCheck(treeView, args)
{var node = args.get_node();if (!node.get_checked() && node.get_parent() != treeView)
{node.get_parent().set_checked(false);}

var siblingNodes = node.get_parent().get_nodes();
var allChecked = true;
for (var i = 0; i < siblingNodes.get_count(); i++)
{var siblingNode = siblingNodes.getNode(i);
if (!siblingNode.get_checked())
{
allChecked = false;
break;
}
}
if (allChecked && node.get_parent() != treeView)
{node.get_parent().set_checked(true);}
UpdateAllChildrenPrometheus(node.get_nodes(), node.get_checked());
}
//This code is used to provide a reference to the radwindow "wrapper"
function GetRadWindow(){var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;}
//-->
//This is to for getting the Task popup to work both internally & externally
function refreshGridTasks() { };
