if(parent.frames.length!=0)parent.location.replace(location.href)
function $(i){return document.getElementById(i);}
var misio = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
misio=true;
@end @*/

function nwin(page, x, y, scr)
{
 sx = screen.availWidth;
 sy = screen.availHeight;
 px = (sx/2)-(x/2);
 py = (sy/2)-(y/2);
 var nwi = window.open(page,'mwin','top='+py+',left='+px+',width='+x+',height='+y+',resizable=no,scrollbars='+scr+',status=yes', true);
 nwi.focus();
 return;
}

function addfav()
{
 var msg_netscape = "Ta funkcja nie działa z przeglądarką Netscape. Dodaj nas do ulubionych ręcznie.";
 var msg_opera    = "Ta funkcja nie działa z tą wersją Opery. Dodaj nas do ulubionych ręcznie.";
 var msg_other    = "Twoja przeglądarka nie wspiera automatycznego dodawania do ulubionych. Dodaj nas do ulubionych ręcznie.";
 var agt          = navigator.userAgent.toLowerCase();
 var title        = "Sex i Erotyka";
 var url          = "http://www.sexerotyka.pl/";
 if (agt.indexOf("opera") != -1) { 
  if(window.opera && window.print) { return true; } else alert(msg_other);
 } else if (agt.indexOf("firefox") != -1) window.sidebar.addPanel(title,url,"");
 else if ((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) window.external.AddFavorite(url,title); 
 else if (agt.indexOf("netscape") != -1) window.sidebar.addPanel(title,url,"")         
 else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,""); 
 else alert(msg_other);
 return;
}

function rdc(nazwa)
{
 nazwa+="=";
 startCookie=document.cookie.indexOf(nazwa);
 if (startCookie==-1) {return ""}
 startCookie+=nazwa.length;
 if (document.cookie.indexOf(";",startCookie)==-1) {
  koniecCookie=document.cookie.length; }
   else { koniecCookie=document.cookie.indexOf(";",startCookie); }
 textCookie=document.cookie.substring(startCookie,koniecCookie);
 textCookie=unescape(textCookie);
 return textCookie;
}

window.onload = function()
{
 for(var i = 0; i < document.links.length; i++){
  if (document.links[i].rel == 'external'){
   document.links[i].target = '_blank';
  }
 }
 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], 'ig'), 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)email_address($|\s)/)) continue;
  var email = getEmail(as[i].getAttribute('rel'));
  as[i].setAttribute('href', 'mailto:' + email);
  as[i].removeAttribute('rel');
 }
 emailReplaceArray = undefined; 
}