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 <= 5.7)
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';
  }
 }
 if($('nopole')) $('nopole').value = '122';
}

function nwin(page, x, y, scr)
{
 var sx = screen.availWidth;
 var sy = screen.availHeight;
 var px = (sx/2)-(x/2);
 var py = (sy/2)-(y/2);
 var nwi = window.open(page,'mwin','dependent=yes,toolbar=no,top='+py+',left='+px+',width='+x+',height='+y+',resizable=no,scrollbars='+scr+',status=yes', true);
 nwi.focus();
 return;
}

function adfv(domain, title)
{
 if(window.sidebar && window.sidebar.addPanel) { window.sidebar.addPanel(title,domain,null); }
 if(document.all) { window.external.addFavorite(domain,title); }
 return;
}

var ax_l = null;
function loginchk(im)
{
 if(ax_l == null)
 {
  ax_l = new sack();
  ax_l.requestFile = 'ax_imie.php';
  ax_l.method = 'POST';
  ax_l.element = 'axp';
  ax_l.setVar('imie', im);
  ax_l.setVar('m1', $('acity').value);
  ax_l.setVar('m2', $('cname').value);
  ax_l.onCompletion = function() { ax_l=null; }
  ax_l.onError = function() { alert('Błąd! Nieudane połączenie z serwerem!'); ax_l=null; }
  $('axp').innerHTML = '...';
  ax_l.runAJAX();
 } else return false;
 return true;
}

var ax_m = null;
function selcity(idc)
{
 if(ax_m == null)
 {
  if(parseInt(idc)==idc && idc>0) $('cname').value = ''; else $('acity').value='0';
  ax_m = new sack();
  ax_m.requestFile = 'ax_miasto.php';
  ax_m.method = 'POST';
  ax_m.element = 'axmiasto';
  ax_m.setVar('idc', idc);
  ax_m.onCompletion = function() { ax_m=null; loginchk($('notit').value); }
  ax_m.onError = function() { alert('Błąd! Nieudane połączenie z serwerem!'); ax_m=null; }
  $('axmiasto').innerHTML = '<img alt="" src="img/loading.gif">';
  ax_m.runAJAX();
 } else return false;
 return true;
}
