



var d = document; 

function getElement(i)
{ 
 var ob = d.all?d.all[i]:d.layers?d.layers[i]:d.getElementById(i); 
 return ob; 
} 




function divMng(id, param)
{ 
 var ob = getElement(id); 
 
 if (last_act!='' && id!=last_act)
   {
    obpop = getElement(last_act);
    obpop.style.display = 'none'; 
    obpop.clpsd = 0; 
   }
 
 if (ob.clpsd && param=='-') 
   { 
    ob.style.display = 'none'; 
    ob.clpsd = 0; 
   }
 else 
   if (!ob.clpsd && param=='+')
     { 
      getElement(id+'').style.display='none'; 
      getElement(id+'').clpsd = 0; 
      ob.style.display = 'block'; 
      ob.clpsd = 1; 
     } 
 
 
 last_act = id;
} 




function init()
{ 
} 
  



function showLoginForm()
{
 if (jQuery('.toploginfields').height()!='0') hideLoginForm();
 else
   {
    if (jQuery('.topnlfields').height()!='0')
      {
       jQuery('.topnlfields').animate({height: '0px'}, 200, function(){
         jQuery('.toploginfields').animate({height: '30px'}, 500)
       });
      }
    else jQuery('.toploginfields').animate({height: '30px'}, 500);
   }
 
 
 return false;
}



function hideLoginForm()
{
 jQuery('.toploginfields').animate({height: '0px'}, 200);

 
 
 return false;
}






function showNLForm()
{
 if (jQuery('.topnlfields').height()!='0') hideNLForm();
 else
   {
    if (jQuery('.toploginfields').length>0 && jQuery('.toploginfields').height()!='0')
      {
       jQuery('.toploginfields').animate({height: '0px'}, 200, function(){
         jQuery('.topnlfields').animate({height: '30px'}, 500)
       });
      }
    else jQuery('.topnlfields').animate({height: '30px'}, 500);
   }
 
 
 return false;
}



function hideNLForm()
{
 jQuery('.topnlfields').animate({height: '0px'}, 200);

 
 
 return false;
}





function logMeIn()
{
 var err = 0;
 
 
 if (jQuery('#f_login').val()=='')
   {
    err++;
    jQuery('#f_login').css({'background-color' : '#ffcccc'});
   }
 else jQuery('#f_login').css({'background-color' : '#ffffff'});
 
 if (jQuery('#f_password').val()=='')
   {
    err++;
    jQuery('#f_password').css({'background-color' : '#ffcccc'});
   }
 else jQuery('#f_password').css({'background-color' : '#ffffff'});
 
 if (err==0)
   {
    jQuery('#loginloader').attr('src', 'gfx/loader.gif');
    
    jQuery.get('da.php?mod=login_form&action=login&f_login='+jQuery('#f_login').val()+'&f_password='+jQuery('#f_password').val(), function(data){
    
      if (data!='')
        {
         jQuery('#loginloader').attr('src', 'gfx/k.gif');
         
         
         if (data!='err')
           {
            panel_reload = data;
            
            gotourl(panel_reload);
           }
         //else loginError();
        }
      
    });
   }
}





function gotourl(url)
{
 if (url!='') document.location.href = url;
}
