﻿function ShowNewWindow(url,x,y,title)
      {
        //Show new window
          var oWindow = window.radopen(url, null);
          
      //  var xLoc = (window.innerWidth - x) / 2; wouldnt work in ie 6
      var xLoc = (document.body.clientWidth - x) / 2;
         oWindow.MoveTo(xLoc, 50);
                 
        //Using the reference to the window its clientside methods can be called
        oWindow.SetSize (x, y);
        oWindow.SetTitle (title);
        oWindow.Center();
       // oWindow.attachEvent("OnDeactivate", Onblur);
        
        
      } 
      
      function CancelView()
		{
		    GetRadWindow().Close();		
		}

//		function CloseAndNavigate(arg)
//		{
//			GetRadWindow().BrowserWindow.location = arg;
//			GetRadWindow().Close();
//		}
      
     function test()
     {
        window.alert('test');
     }
     
         function CloseAndNavigate(arg) {
          //  window.alert(test());
           GetRadWindow().BrowserWindow.location = arg;
            GetRadWindow().Close();
    }
    
    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 HandleSliderValueChange(sender, eventArgs)
                {
                    $get("sliderValue").innerHTML = sender.get_value();
                }
                
  function CloseAndRebind(arg)
		{
			GetRadWindow().BrowserWindow.refreshGrid(arg);
			GetRadWindow().Close();
		}
		
		 function PrintRadWindow()
            {
                GetRadWindow().GetContentFrame().contentWindow.print();
            }

            function show(element) {

                var div = document.getElementById(element);
                div.style.visibility = 'visible';

            }

            function hide(element) {

                var div = document.getElementById(element);
                div.style.visibility = 'hidden';

            }