if(parent.frames.length!=0)parent.location.replace(location.href)
function $(i){return document.getElementById(i);}
function addclass(el, na) { el.className+=' '+na; }
function remclass(el, na) { var re=new RegExp('( ?'+na+')','g'); el.className=el.className.replace(re,''); }
function isDefined(variable){
	return eval('(typeof('+variable+') != "undefined");');
}

var misio = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5 && @_jscript_version <= 6)
misio=true;
@end @*/
var ms6 = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5 && @_jscript_version <= 5.6)
ms6=true;
@end @*/

window.onload = function()
{
 for(var i = 0; i < document.links.length; i++) {
  if(document.links[i].rel && document.links[i].rel == 'external') {
   document.links[i].target = '_blank';
  }
 }
 function add_fokus(a)
 {
  var el = a;
  el.onfocus = function() { el.className += " fokus"; }
  el.onblur = function() { el.className = el.className.replace(/( ?fokus)/g, ''); }
 }
 if(misio && !ms6)
 {
  n = document.getElementsByTagName('a');
  for(var i=0; i<n.length; i++) add_fokus(n[i]);
 }
}

function uzupelnij()
{
 $('title').value = '219';
 $('uz').style.display = 'none';
}

function page_set()
{
 var pageh = $('podstrona').offsetHeight;
 var lefth = $('lewa').offsetHeight;
 if(pageh < lefth) $('podstrona').style.height = lefth+'px';
}

var axt = false;
function temat(el, nr)
{
 if(axt == false && nr > 0 && el.className != 'act')
 {
  var lista = $('tematy').getElementsByTagName('UL')[0].getElementsByTagName('A');
  for(var i=0; i<lista.length; i++) lista[i].className = '';
  el.className = 'act';
  axt = new sack();
  axt.setVar("nr", nr);
  axt.requestFile = 'ax_temat.php';
  axt.method = 'post';
  axt.element = 'ax_tyg';
  axt.onCompletion = function() { axt = false; }
  axt.onError = function() { alert('Błąd AJAX: brak komunikacji z serwerem!'); axt = false; }
  axt.runAJAX();
 }
 return true;
}

var axo = false;
function ocena(x,a,d)
{
 if(x == 0) // podmień na linki
 {
  $('oceny').innerHTML = '<a class="oce" href="#" onclick="ocena(1,'+a+','+d+'); return!1;" title="1"></a><a class="oce" href="#" onclick="ocena(2,'+a+','+d+'); return!1;" title="2"></a><a class="oce" href="#" onclick="ocena(3,'+a+','+d+'); return!1;" title="3"></a><a class="oce" href="#" onclick="ocena(4,'+a+','+d+'); return!1;" title="4"></a><a class="oce" href="#" onclick="ocena(5,'+a+','+d+'); return!1;" title="5"></a><span id="podp">&lsaquo; wskaż swoją ocenę</span>';
  $('obtn').style.display = 'none';
 }
 if(axt == false && x > 0 && x < 6 && a > 0 && d > 0)
 {
  $('podp').innerHTML = '<span class="saving">Zapisywanie oceny...</span>';
  axo = new sack();
  axo.setVar("art", a);
  axo.setVar("dzial", d);
  axo.setVar("ocena", x);
  axo.requestFile = 'ax_ocena.php';
  axo.method = 'post';
  axo.element = 'oceny';
  axo.onCompletion = function() { $('podp').innerHTML = 'Dziękujemy!'; axo = false; }
  axo.onError = function() { $('podp').innerHTML = '&lsaquo; wskaż swoją ocenę'; alert('Błąd AJAX: brak komunikacji z serwerem!'); axo = false; }
  axo.runAJAX();
 }
 return true;
}