
        function UseWindowManager(windowName,url)
        {
            var oManager = GetRadWindowManager();
            //Success. Getting existing window DialogWindow using GetWindowByName
            var oWnd = oManager.GetWindowByName(windowName);
//            alert(oWnd);//Success. Setting a size and a Url to the window using its client API before showing
            if (windowName == "LongTextEditor")
                setWindowSize(oWnd,580,400);    
            else
                setWindowSize(oWnd,400,300);    
            oWnd.SetUrl(url);
            //Success. Opening window
            oWnd.Show();
            oWnd.MoveTo(left,top);
            //Success. Calling window RadWindowManager.GetActiveWindow (should return reference to current window
            var oActive = oManager.GetActiveWindow();
            //Success. Is current visible window the active one? " + (oActive != null && oActive == oWnd)
            //Success. Open a new window using RadWindowManager.Open using default settings
            //var oNew = oManager.Open("../TestPage/Default.html", "NewWindow");
        } 
    var top =  0;
    var left = 0;
    function setWindowSize(oWnd,width,height)
    {
        CalculateWindowSize();
        if (width > winW || height > winH)
           if (height > winH)
           {
                width = (winH-20)*width/height;  
                height = winH-20;     
           }
           else
           {
                height = winW*height/width;  
                width  = winW;     
           }
           top = (winH - 20 - height)/2;
           left = (winW - width)/2;
           if (top <= 0 ) top = 0;
           if (left <= 0) left = 0; 
            oWnd.SetSize(width,height);
    }
   	function ShowDialog(windowName,url)
	{					
			//Force reload in order to guarantee that the onload event handler of the dialog which configures it executes on every show.
			UseWindowManager(windowName,url);
	}
		// Called when a window is being closed.
		function OnClientClose(radWindow)
		{					
			IsWindowResize = false;
			//Another option for passing a callback value
			//Set the radWindow.Argument property in the dialog
			//And read it here --> var oValue = radWindow.Argument;										
			//Do cleanup if necessary
		}	
     function CalculateWindowSize()
     {
        if (parseInt(navigator.appVersion)>3) {
            if (navigator.appName=="Netscape") {
                winW = window.innerWidth-16;
                winH = window.innerHeight-16;
           }
           if (navigator.appName.indexOf("Microsoft")!=-1) 
           {
               winW = document.documentElement.clientWidth;                
               if (winW == 0)
               {
                    winW = window.screen.availWidth - window.screenLeft;
               }
               winH = document.documentElement.clientHeight;
               if (winH == 0)
                    winH = window.screen.availHeight - window.screenTop - 100;
           }
        }
     }
function FillBarCodeData()
{
    var location = "BarCodeData.aspx";
    var width=400;
    var height=175;
	CalculateWindowSize();
	var left = (winW-width)/2;
	var top = (winH-height)/2;
    var w = window.open(location,"PersonalInfo","height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,modal=yes"); 
	w.focus();
}

