        
function OpenLoginPopUp()
{
    var parent_window=window;
    var child_window = window.showModalDialog('Login.aspx','','dialogWidth=470px;dialogHeight=205px;dialogLeft=300px;dialogTop=300px;status=0;edge: Raised; center: Yes;'); //window.showDialog("Login.aspx");
    var ReLoadPage = document.getElementById("hdReloadPage");
    
    if(parent_window.clipboardData.getData("Text") != ''  &&  parent_window.clipboardData.getData("Text") == 'UserRegistration.aspx')
    {
        window.clipboardData.setData("Text",'');
        window.location = 'UserRegistration.aspx';
    }
    else if(parent_window.clipboardData.getData("Text") != ''  &&  parent_window.clipboardData.getData("Text") == 'Close')
    {
        //do nothing.
        window.clipboardData.setData("Text",'');
    }
    else if(parent_window.clipboardData.getData("Text") != ''  &&  parent_window.clipboardData.getData("Text") == 'ForgotPassword')
    {
        window.clipboardData.setData("Text",'');
        window.location = 'ForgotPassword.aspx';
    }
    else if(ReLoadPage.value == 'Reports')
        parent_window.location.reload();
    else
        window.location = 'MemberArea.aspx';
        
}
function Logout()
{
  window.location = 'Default.aspx?Logout=1';
}
function TakeATour()
{
window.open ("Dr-SIR Explore/Dr-SIR Explore.swf","mywindow1","");
}

function LoginForm()
                {
                  StopTimer();
                  document.form1.txtDescriptionBuy.value = "";
                  document.form1.txtDescriptionBuy.value = "";
                  document.getElementById("ShowLoginForm").style.zIndex  = 3;
                  document.getElementById("mainPage").style.zIndex  = 1;
                  document.getElementById("middleLayer").style.zIndex  = 2;
                  //document.getElementById( "mainPage" ).onclick = null;
                  document.getElementById("middleLayer").style.visibility  = "visible";
                  document.getElementById("middleLayer").style.height  = screenH;
                  document.getElementById("ShowLoginForm").style.visibility  = "visible";
                  document.documentElement.style.overflow = "hidden"; 
                 // makeStatic();
                 var elem = document.getElementById( "middleLayer" );

                 elem.style.filter="alpha(opacity=50)";
                 elem.style.MozOpacity = "0.5";
                


                }
                
var offsettop=0;
function makeStatic() {
document.getElementById("ShowLoginForm").style.top = document.documentElement.scrollTop + offsettop;
document.getElementById("middleLayer").style.top = document.documentElement.scrollTop;
setTimeout("makeStatic()",0);
}

  var screenW = 640, screenH = 480, intleft, inttop;              
  function bodyload()
  {
  
    		 //Screen size......................
			
			if (parseInt(navigator.appVersion)>3)
			 {
			    if(navigator.appName == "Netscape" )
			    {
			         screenW = window.outerWidth;
			         screenH = window.outerHeight;
			    }
			    else
			    {
			         screenW = screen.width;
			         screenH = screen.height;
			    }
			}
			else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled()) 
			{
			     var jToolkit = java.awt.Toolkit.getDefaultToolkit();
			     var jScreenSize = jToolkit.getScreenSize();
			     screenW = jScreenSize.width;
			     screenH = jScreenSize.height;
			}
			
			intleft = (screenW - 265)/2;
			inttop = (screenH - 350)/2 

            document.getElementById("ShowLoginForm").style.top = inttop+"px" ;
			document.getElementById("ShowLoginForm").style.left  = intleft+"px";
			offsettop = inttop;
    	    var ReLoadPage = document.getElementById("hdReloadPage");
    	    if(ReLoadPage.value == 'Invalid')
    	    {
    	    LoginForm();
    	    ReLoadPage.value == '';
    	    }

  }
  function CloseLoginLightBox()
  {
                  StartTimer();
                  document.getElementById("ShowLoginForm").style.zIndex  = 1;
                  document.getElementById("mainPage").style.zIndex  = 3;
                  document.getElementById("middleLayer").style.zIndex  = 2;
                  document.getElementById("middleLayer").style.visibility  = "hidden";
                  document.getElementById("ShowLoginForm").style.visibility  = "hidden";
                  document.documentElement.style.overflow = "auto";
                  document.getElementById("txtPassword").value = "";
                  document.getElementById("txtUserName").value = "";
                  document.getElementById("lblMessage").innerHTML = "";
                  ValidatorEnable(document.getElementById("vldRequiredUserID"), false);
                  ValidatorEnable(document.getElementById("vldValidEmail"), false);
                  ValidatorEnable(document.getElementById("vldRequiredPassword"), false);
                  
}

                                                                              
