var HTMLCache = '';
var SearchFieldTimeOut = false;

function ShowNewsForm()
{
 /* AjaxReq = new Ajax.Request('/ajax-news-form.php', {  
                                                method: 'get',
                                                parameters: 'req=show',
                                                onSuccess: function(transport) 
                                                            {
                                                              var AjaxForm = $('news-details-content');
                                                              //var AjaxForm = $('AjaxNewsForm');
                                                              HTMLCache = AjaxForm.innerHTML; 
                                                              AjaxForm.innerHTML = transport.responseText;                                                              
                                                            
                                                              //AjaxForm.show();
                                                            
                                                              //var pos = $('AjaxForm').positionedOffset();
                                                              //alert('ok');
                                                            
                                                              //AjaxForm.show();
                                                            
                                                             
                                                            }
                                              } );
*/
location.href = "?aktualnosci=show";
}

function CheckNick(parent)
{
  var nick = parent.value;
  AjaxReq = new Ajax.Request('/ajax-nickCheck.php', {  
                                                method: 'get',
                                                parameters: 'nick='+nick,
                                                onSuccess: function(transport)
                                                {
                                                  NickToolTip = $('NickAjax');
                                                  NickToolTipText = $('NickAjaxText');
                                                  NickToolTipText.innerHTML = transport.responseText;
                                                  
                                                  var X = parent.offsetWidth + 15;
                                                  var Y = parent.offsetHeight + 4;
                                                  
                                                  while (parent != null)
                                                  {
                                                    X += parent.offsetLeft;
                                                    Y += parent.offsetTop;
                                                    parent = parent.offsetParent;;
                                                  }
                                                  NickToolTip.style.left = X+'px';
                                                  NickToolTip.style.top  = Y+'px';
                                                  NickToolTip.show();
                                                  
                                                  if(SearchFieldTimeOut)
                                                    clearTimeout(SearchFieldTimeOut);
                                                  SearchFieldTimeOut = setTimeout("HideToolTip('NickAjax')",2000);
                                                  
                                                }
                                    } );
}

function HideToolTip(name)
{
  $(name).hide();
  SearchFieldTimeOut = false;    
}
