﻿    if(!BrowserValid())
    {
      $get('dvBrowser').style.display = 'block';
    }
        
    if(window.parent)
    {
        if(window.parent.frames.length > 0)
        {
            window.parent.location = "LoginSAM2007.aspx";
        }
    }
    
            var dialogWin = new Object();
        
        function openDialog(url, width, height, returnFunc) {
            if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) {
                   // Initialize the properties of the modal dialog object.
                   dialogWin.returnFunc = returnFunc;										
                   dialogWin.url = url;
                   dialogWin.width = width;
                   dialogWin.height = height;
                   // Keep the name unique so an existing dialog isn't overwritten.
                   dialogWin.name = (new Date()).getSeconds().toString();  
                    // Assemble the window attributes and try to center the dialog.           
	           dialogWin.left = (screen.width - dialogWin.width) / 2;
	           dialogWin.top = (screen.height - dialogWin.height) / 2;
	           var attr = "left=" + dialogWin.left + ",top=" + 
	              dialogWin.top + ",resizable=no,scrollbars=yes,width=" + 
			           dialogWin.width + ",height=" + dialogWin.height;
                   
                   // Generate the dialog and make sure it has focus.
                   dialogWin.win = window.open(dialogWin.url, dialogWin.name, attr);
	           wnd = dialogWin.win;
                   dialogWin.win.focus();
            } else {
                   dialogWin.win.focus();
            }
        }

        function BrowserValid()
        {
           if(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version > 5)
            {
                return true;
            }
            else
            {
               return false;
            }  
        }
        
        function BrowserCheck()
        {
            if(BrowserValid())
            {
                return true;
            }
            else
            {
              var Message = 'To use this application, you must use one of the following versions of Internet Explorer:';
                  Message = Message + '\n - Internet Explorer 6';
                  Message = Message + '\n - Internet Explorer 7';
                  Message = Message + '\n - Internet Explorer 8';
              alert(Message);  
              return false;
            }
        }
    
    // to check whether the user already logged in any other machine 
    function checkDuplicateSession(msg)
    {
        var i=confirm(msg);
        if (i==true)
        {
            document.getElementById('ctl00__mainConentPlaceholder_hdnDupCheck').value='1';
          
            document.getElementById('ctl00__mainConentPlaceholder_tbPassword').value=document.getElementById('ctl00__mainConentPlaceholder_hdnPassword').value;
            __doPostBack('ctl00$_mainConentPlaceholder$btnLogin', '')
            
            
        }
        else
        {
            document.getElementById('ctl00__mainConentPlaceholder_hdnDupCheck').value='-1';
        }
        
        
    }
    




    

    

 

