﻿
    function onTabSelecting(sender, args)
    {
		if (args.get_tab().get_pageViewID())
		{
			args.get_tab().set_postBack(false);
		}
    }

	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 az well)				
		return oWindow;
	}
	
	function CloseOnReload()
	{
		GetRadWindow().BrowserWindow.document.location.href = GetRadWindow().BrowserWindow.document.location;
		GetRadWindow().Close();			
	}
	
	var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

/*For site new member app. Need to revise this to make more generic. Has rgMemberOptions grid name in it.*/
            var selectedRowIndex;
            
            function RowClick(rowIndex)
            {
                if(rowIndex == selectedRowIndex)
                {
                    window["<%= rgMembershipOptions.ClientID %>"].MasterTableView.DeselectRow(window["<%= rgMembershipOptions.ClientID %>"].MasterTableView.Rows[rowIndex].Control); 
                    selectedRowIndex = -1;
                    return false;
                }
            }
            function RowSelected(rowObject, eventObject)
            {
                selectedRowIndex = rowObject.Index;
            }
