if(parent.frames.length!=0)parent.location.replace(location.href)
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");');}
if(!isDefined('Prototype')) {
	function $(i){return document.getElementById(i);}
}

var misio = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5 && @_jscript_version <= 5.8)
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';
  }
 }
// addHoverFunc('kategorie');
 if($('nopole')) $('nopole').value = '122';
 xchgm();
}

function xchgm()
{
 var emailReplaceArray = [['0','@'],[',','.']];
 var replTab = emailReplaceArray;
 for (var i = 0; i < replTab.length; i++) {
      var s = escape(replTab[i][0].replace(/\s/g, ''));
      replTab[i][0] = s.replace(/%u/g, '\\u').replace(/%/g, '\\x');
    }
    var getEmail = function(s) {
      s = s.replace(/\s/g, '');
      for (var i = 0; i < replTab.length; i++) {
        s = s.replace(new RegExp(replTab[i][0], 'g'), replTab[i][1]);
      }
      return s;
    };
    var as = document.getElementsByTagName('a');
    var html = document.getElementsByTagName('html')[0];
    var text = html.textContent != undefined ? 'textContent' : 'innerText';
    for (var i = 0; i < as.length; i++) {
      if (! as[i].className.match(/(^|\s)eaddr($|\s)/)) continue;
      var email = getEmail(as[i][text]);
      as[i].setAttribute('href', 'mailto:' + email);
	  as[i][text] = email;
 }
 emailReplaceArray = undefined;
}

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;
}

var pax = null;
function wishlist_add(id, at)
{
 if(parseInt(id)==id && id>0 && pax==null)
 {
  var el = document.createElement('DIV');
  el.setAttribute('id', 'paxmsg');
  document.body.appendChild(el);
  pax = new sack();
  pax.setVar('id', id);
  pax.setVar('at', at);
  pax.requestFile = 'wishlist';
  pax.method = 'GET';
  pax.element = 'paxmsg';
  pax.onCompletion = function() {
   var z;
   if(self.pageYOffset) z=self.pageYOffset;
    else if(document.documentElement && document.documentElement.scrollTop) z=document.documentElement.scrollTop;
     else if(document.body) z=document.body.scrollTop;
   $('paxmsg').style.top = (z+200)+'px';
   $('paxmsg').style.display = 'block';
   $('paxmsg').style.left = Math.round( (screen.width/2) - ($('paxmsg').offsetWidth/2) )+'px';
   window.setTimeout(wishlist_hide, 2000);
   if($('qwlshowhide'))
   {
    $('qwlshowhide').style.display = 'block';
	var dp = parseInt($('qwlcount').innerHTML);
    $('qwlcount').innerHTML = dp + 1;
   }
  }
  pax.onError = function() { alert('AJAX Error!'); }
  pax.runAJAX();
 }
 return;
}

function wishlist_hide()
{
 var el = $('paxmsg');
 el.style.display = '';
 document.body.removeChild(el);
 pax = null;
}

var axss = false;
var oldmd = null;
var oldkp = null;
var sellk = 0;
var globen = '';
function ssearchinit(sbox, el, en)
{
 if(sbox.style.display!='block')
 {
  sbox.style.left = el.offsetLeft+'px';
  sbox.style.top = (el.offsetTop+el.offsetHeight+1)+'px';
  sbox.style.display = 'block';
 }
 oldmd = document.body.onmousedown;
 globen = en;
 document.body.onmousedown = function(e)
    {
     e=e||event;
	 e.cancelBubble=true;
	 document.body.onmousedown=oldmd;
	 oldmd=null;
	 document.onkeydown=oldkp;
	 oldkp=null;
	 $('ssaxbox'+globen).style.display='';
	 $('kszukaj'+globen).blur();
	 return!1;
	}
 oldkp = document.onkeydown;
 sellk = -1;
 document.onkeydown = function(e)
    {
     if(!e) keycode=event.keyCode; else keycode=e.which;
	 e=e||event;
	 if(keycode==38) { sellk--; var lst=$('ssaxbox'+globen).getElementsByTagName('A'); if(sellk<0)sellk=lst.length-1; for(var i=0;i<lst.length;i++) if(i==sellk)lst[i].focus(); e.cancelBubble=true; return!1; }
	 if(keycode==40) { sellk++; var lst=$('ssaxbox'+globen).getElementsByTagName('A'); if(sellk>lst.length-1)sellk=0; for(var i=0;i<lst.length;i++) if(i==sellk)lst[i].focus(); e.cancelBubble=true; return!1; }
	}
}

function ssearch(el, en)
{
 if(!axss)
 {
  ssearchinit($('ssaxbox'+en), el, en);
  var axss = new sack();
  axss.method = 'GET';
  axss.element = 'ssaxbox'+en;
  axss.setVar('text', el.value);
  axss.requestFile = 'ax_szukaj.php';
  axss.onError = function() { alert('AJAX Error!'); axss=false; }
  axss.onCompletion = function() { axss=false; }
  axss.runAJAX();
 }
 return true;
}

