function trim(x){return x.replace(/^\s+|\s+$/g,'');}
function _aEv(obj, type, fn) { try { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn](window.event); }; obj.attachEvent("on"+type, obj[type+fn]); }} catch (e) {}}
function _gOb(n) { return document.getElementById(n); }
function _gBTC(obj, tag, clName) { var objs = obj.getElementsByTagName(tag); var robj = new Array(); var j = 0; for (var i = 0; i < objs.length; i++) { if (_hCl(objs[i], clName)) robj[j++] = objs[i]; }; return robj; }
function _hCl(obj, clName) { var clN = ' ' + obj.className + ' '; return (clN.match(' ' + clName + ' ') != null); }
function _aCl(obj, clName) { if (_hCl(obj, clName)) return; obj.className = trim(obj.className + ' ' + clName); }
function _rCl(obj, clName) { if (!_hCl(obj, clName)) return; var clN = ' ' + obj.className + ' '; eval("obj.className = trim(clN.replace(/ " + clName + " /g,' '));"); }

function __nav_init(){
 var _navMainList = _gBTC(_gOb('navH'), 'ul', 'p0')[0];
 var _currLoc = window.location + ' ';	
 var isRoot = -1;
 if(_currLoc.indexOf("0,90866.html") > -1 || _currLoc.indexOf("0,0.html") > -1 || _currLoc.indexOf("3481890,67525.html") > -1) isRoot = 1; 

 if(_navMainList){
  var _activeLink = _gBTC(_navMainList, 'li', 'active')[0];
  if(_activeLink){
   var _activeLinkId = _activeLink.getAttribute('id');
   if(_hCl(_activeLink.parentNode, 'p0') && !_hCl(_activeLink, 'pracodawca')){
    var _regExp = /\d{1,2}/;
    var _idNumber = _regExp.exec(_activeLinkId);
    _idNumber++;
    var _nextId = 'e'+ _idNumber;
    var _nextElem = _gOb(_nextId);
    if (_nextElem && !_hCl(_nextElem, 'pracodawca')) _nextElem.style.background = 'none';
   }
   if(_activeLinkId == 'e1' && isRoot > -1 ){
    _navMainList.style.marginBottom = '20px';
    document.write('<style type="text/css">#bg_blk {display: none !important;}</style>');
   }
   if(isRoot == -1){
	document.write('<style type="text/css">#pracaSearch {background: url(\'/i/obrazki/praca2008/topSearch_whiteNarrow.gif\') no-repeat 0 0 !important; margin-bottom: 15px; padding: 14px 25px 14px 23px !important;} #sL {background: #fff;}</style>');
   }
   var _hasChild = _gBTC(_activeLink, 'ul', 'p1')[0];
   if(_hasChild){
    _navMainList.style.height = 42 + _hasChild.offsetHeight + 'px';
   }
   var _show_more = _gBTC(_navMainList, 'li', 'show_more')[0];
   
   if(_show_more){
    _show_more.index = 1;
    _aEv(_show_more, 'click', show_more_links);
   }
   var _show_less = _gBTC(_navMainList, 'li', 'show_less')[0];
   
   if(_show_more){
    _show_less.index = 1;
    _aEv(_show_less, 'click', show_less_links);
   }
  }
 }
}

function show_more_links(e){
 var el; if (window.event && window.event.srcElement) { el = window.event.srcElement; }; if (e && e.target) { el = e.target; }; if (!el) { return; }; (e.preventDefault) ? e.preventDefault() : (e.returnValue = false);
 while (el.index != 1) el = el.parentNode;
 var is_msie = ((navigator.appVersion.indexOf("MSIE")!= -1)&&!window.opera)? true : false;
 var _navMainList = _gBTC(_gOb('navH'), 'ul', 'p0')[0];
 var _activeLink = _gBTC(_navMainList, 'li', 'active')[0];
 var _hasChild = _gBTC(_activeLink, 'ul', 'p1')[0];
 var _lines = _gBTC(_hasChild, 'li', 'newline'); 
 var _hiddenLines = _gBTC(_hasChild, 'li', 'hideme'); 
 var _newHeight = _navMainList.offsetHeight + _lines.length*14 + _lines.length*5;
 if(is_msie) _newHeight += _lines.length;
 _aCl(el, 'hideme');
 _navMainList.style.height = _newHeight + 'px';
 for( var i=0; i <_hiddenLines.length ; i++){_rCl(_hiddenLines[i], 'hideme'); _aCl(_hiddenLines[i], 'showme');}
}

function show_less_links(e){
 var el; if (window.event && window.event.srcElement) { el = window.event.srcElement; }; if (e && e.target) { el = e.target; }; if (!el) { return; }; (e.preventDefault) ? e.preventDefault() : (e.returnValue = false);
 while (el.index != 1) el = el.parentNode;
 var is_msie = ((navigator.appVersion.indexOf("MSIE")!= -1)&&!window.opera)? true : false;
 var _navMainList = _gBTC(_gOb('navH'), 'ul', 'p0')[0];
 var _activeLink = _gBTC(_navMainList, 'li', 'active')[0];
 var _hasChild = _gBTC(_activeLink, 'ul', 'p1')[0];
 var _lines = _gBTC(_hasChild, 'li', 'newline'); 
 var _hiddenLines = _gBTC(_hasChild, 'li', 'showme'); 
 var _show_more = _gBTC(_navMainList, 'li', 'show_more')[0];
 var _newHeight = _navMainList.offsetHeight - _lines.length*14 - _lines.length*5;
 if(is_msie) _newHeight -= _lines.length;
 _aCl(el, 'hideme');
 _rCl(_show_more, 'hideme');
 _navMainList.style.height = _newHeight + 'px';
 for( var i=0; i <_hiddenLines.length ; i++){_rCl(_hiddenLines[i], 'showme'); _aCl(_hiddenLines[i], 'hideme');}
}


function ie6(){
 if ( navigator.userAgent.indexOf('MSIE 6.0') > 0 && navigator.userAgent.indexOf('MSIE 7.0') < 0 && navigator.userAgent.indexOf('MSIE 8.0') < 0 ){
	var doc=document.body;
	//doc.style.paddingTop="50px";
	var desc = document.createElement('div');
	desc.setAttribute("id","IE6_warning");
	desc.style.background="#faf0a7";
	desc.style.margin="0";
	desc.style.color="#000";
	desc.style.fontFamily="Arial, sans-serif";
	desc.style.fontSize="14px";
	desc.style.height="50px";
	desc.style.width="100%";
	desc.style.zIndex="99999";
	desc.innerHTML='<div id="IE6_con" style="width: 940px; text-align: left; margin: 0 auto; position: relative; height: 30px; padding: 10px 0;"><strong style="font-weight: bold;">Internet Explorer 6 nie zapewnia ju&#380; odpowiedniego poziomu bezpiecze&#324;stwa. </strong><p>Cz&#281;&#347;&#263; stron b&#281;dzie si&#281; &#378;le wy&#347;wietla&#263;.</p><a id="IE6_btn" href="http://gazeta.hit.gemius.pl/hitredir/id=AkfqlqrNGyYy8Wqp2ABDV2ZUfSqNecbhJ9CvGwgvXf7.k7/url=ie8.gazeta.pl/internet_explorer_8/0,0.html" target="_blank" style="position: absolute; right: 100px; bottom:10px; display: block; border: 1px solid #ccc; padding: 6px 10px; background: #fffbdf; color: #114488; text-decoration: none; font-weight: bold;">Pobierz Internet Explorer 8</a></div><img src="http://gazeta.hit.gemius.pl/redot.gif?id=AkHgkqsrPw2YwOMuYdGfwbR5HSGK7gexhoUlkx6YLh3.H7" height="1" width="1" alt="" />';
	var d = document.getElementById('fb-root');
	doc.insertBefore(desc, d);
	}
}

window.onload=ie6;
