﻿  function CheckError()
  {
   var  txtErrorId = document.getElementById('ctl00_MainPH_txtErrorId');
   if(txtErrorId!=null)
   {
        
        if(txtErrorId.value!="")
        {   
           onOpenErrorPopup();
           return false;
        }
   }
  }
  
  function onOpenPopup()
  {
    var spanPanel = document.getElementById("spanPanel");
    
    if(spanPanel != null)
    {
      spanPanel.style.display = "block";  
     
    }
  }
  
  function onOpenErrorPopup()
  {
     var spanPanel = document.getElementById("spanError");
     var  txtErrorId = document.getElementById('ctl00_MainPH_txtErrorId');
     var errorMessage = document.getElementById("ctl00_errForm_lblMessage");
     
     if(spanPanel != null)
     {
        spanPanel.style.display = "block";  
      
     }
     if (txtErrorId !=null)
     {
        //if (txtErrorId.value=="Login Failed");
        errorMessage.innerHTML=txtErrorId.value;
     }
     return false;
  }
  
  function onCloseErrorPopup()
  {
    var spanPanel = document.getElementById("spanError");
     var  txtErrorId = document.getElementById('ctl00$MainPH$txtErrorId');
     var errorMessage = document.getElementById("ctl00_errForm_lblMessage");
     
     if (txtErrorId !=null)
     {
         txtErrorId.value="";
        errorMessage.innerHTML=txtErrorId.value;
     }
     if(spanPanel != null)
     {
        spanPanel.style.display = "none";  
      
     }
  }
  
  function onClosePopup()
  {
    tblForgotPassword.className="forgot_password";
    ResetPasswordForm();  
  }
      
function Reconected(){
  
    try { 
        xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        try {
            xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
        } catch(e) {
            xmlHttp = false;
        }
    }

    if(xmlHttp){
       var TMID = new Date
       xmlHttp.open('GET', '/Reconected.aspx?TMID=' + TMID.getTime(), false); 
       xmlHttp.send();
       //alert(xmlHttp.responsetext);
    }
    

    SetMenuPos('menu_2', 'spnCurLanguage');

    self.setTimeout('Reconected()',40000)
    
} 

 function SetMenuPos(menu,spn)
 {
        var spnLang = document.getElementById(spn);        
        if (spnLang)
        {            
            //var LangSpan = spnLang.parentElement;
            var LangSpan = spnLang.parentNode;
            var curleft =  0;
            var curTop= 0;
            var menu;            
            menu = document.getElementById(menu);            
            if (LangSpan.offsetParent)
            {
                curleft = LangSpan.offsetLeft
                curTop= LangSpan.offsetTop
                while (LangSpan = LangSpan.offsetParent)
                {
	                curleft += LangSpan.offsetLeft
	                curTop+= LangSpan.offsetTop
                }
            }
            menu.style.top = curTop-11;
            //alert( document.getElementById("spnSupport1").clientLeft);
            //menu.style.left = curleft;
            menu.style.left = 57;
             //document.getElementById("spnSupport").offsetLeft+ 461;
            menu.style.visibility = "hidden";
            var FirstChildObj = get_firstchild(menu);
            FirstChildObj.border="0px";
            FirstChildObj.style.visibility = "hidden";
            //menu.firstChild.border="0px";
            //menu.firstChild.style.visibility = "hidden";
        } 
}

    function get_firstchild(n)
    {
        x=n.firstChild;
        while (x.nodeType!=1)
        {
            x=x.nextSibling;
        }
        return x;
    }


