// Global JavaScript that needs to be at the begining of the page.
var dropDownVarList = [];

var enterPress = false;
var fixValidation = false;
var stillLoading=true;

window.onload = function()
{
}


function showLoginPopup(actin)
{
   var el, vis;
   el = $get('loginpanelonly');
   vis = el.style;
   vis.display = actin;
   if (actin != 'none')
   {
     el = $get("progressAnimation");
     el.className = 'progressClass';

     // Set focus in the user field.
     el = $get("ctl00_Login1_UserName");
     if(el)
     {
        el.focus();
     }
     if(!stillLoading) showInfo("");
   }
   else
   {
     el = $get("progressAnimation");
     el.className = 'progressClass';
   }
   return false;
}


function showLoggedInUserInfo(actin)
{
   var el, vis;
   el = $get('loggedinInfo');
   vis = el.style;
   vis.display = actin;

   return false;
}

function ReyLogout(uid)
{  
   el = $get("progressAnimation");
   if (el && null != el)
   {
     el.className = 'hide'; 
   }
   
   Reynolds.CL.Forum.WebServices.ForumLoginFunctions.LogoutUser(LogoutSuccess, LogoutFailed);
   
}

function LogoutSuccess()
{
    ReloadCleanHREF();
}

function ReloadCleanHREF()
{
    var index = window.location.href.indexOf('#');
    var len = window.location.href.length;
    if (index > 0)
    {
        window.location.href = window.location.href.substr(0,index);
    }
    else
    {
        window.location = window.location;
    }
}

function LogoutFailed()
{
    ReloadCleanHREF();
}


function doPostBackAsync(uid)
{
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    var eventName = document.getElementById(uid);
    var eventArgs = "";

    if( !Array.contains( prm._asyncPostBackControlIDs, eventName) )
    {
        prm._asyncPostBackControlIDs.push(eventName);
    }
 
    if( !Array.contains( prm._asyncPostBackControlClientIDs, eventName) )
    {
        prm._asyncPostBackControlClientIDs.push(eventName);
    }
    
    __doPostBack(uid,"");
}

function buttonClick(el)
{
  $get(el).click();
  return false;
}

function fixHeightLoad()
{
    window.onload = fixIEHeight;
}

function fixPNG() {}
function fixIEHeight() {}