/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
 
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
function displayWindow(url, width, height) {
            var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,menubar=no' );
    }
function pokazZamknij(numer)
{
     zamien('opcja' + numer);
     zamien('formularz' + numer);
}

function zamien(elementId)
{
    if (document.getElementById)
    {
        object = document.getElementById(elementId);
        if (object.style.display == "none") { object.style.display = ""; }
        else { object.style.display = "none"; }
    }
}
function resizeIframe(x){try{x.scrolling='no',x.style.height=x.contentWindow.document.body.offsetHeight+60+'px'}catch(x){}}

//raportowanie wynikow
function raportujWynik(spotkanie, id)
{
  var komentarz = "Tu mozesz dodac swoj komentarz";
  var wiadomosc = prompt("Czy jesteś pewien, że podany wynik dla spotkania:\n" + spotkanie + "\njest błędny ?","" + komentarz + "");
  if(wiadomosc != null)
  {
    if(wiadomosc != "" && wiadomosc != komentarz)
    {
      document.getElementById("msgtypraport"+id).value = wiadomosc;
    }
    return true;
  }
  else
  {
    return false;
  }
}

//raportowanie spotkan
function raportujSpotkanie(spotkanie, id)
{
  var komentarz = "Tu mozesz dodac swoj komentarz";
  var wiadomosc = prompt("Czy jesteś pewien, że dane spotkania:\n" + spotkanie + "\npowinny zostać poprawione ?","" + komentarz + "");
  if(wiadomosc != null)
  {
    if(wiadomosc != "" && wiadomosc != komentarz)
    {
      document.getElementById("msgspotkraport"+id).value = wiadomosc;
    }
    return true;
  }
  else
  {
    return false;
  }
}

//funkcja kolorujaca nick aktywnego typera na glownej statystyce
var typer;

function active_typer()
{
  if($('#active_typer'))
  {
    typer = $('#active_typer').text();
    return true;
  }
  else
  {
    return false;
  } 
}

function kolorujNick()
{
  if(active_typer())
	{
	   $("#main_stat > li[title='"+typer+"']").addClass("active");
	}
}
function buttonRelease()
{
  $(".button").click(function()
  {
   this.blur();
  });
}
$(document).ready(function()
{
  kolorujNick();
  buttonRelease();  
});

