var gazeta_pl = {};

/* galerio artykul - fotostory */
var gal_photoArrows = {
 init: function(){
  var _photoCtr = jQuery('#container_gal');
  if(_photoCtr.length < 1) return;

  var _prevPhotoLink = _photoCtr.find('#gal_btn_prev a').attr('href');
  var _nextPhotoLink = _photoCtr.find('#gal_btn_next a').attr('href');

  var _photoPhoto = _photoCtr.find('#gal_picture');
  var _photoPhotoImg = _photoCtr.find('#gal_picture img');

  if(_photoPhotoImg.length < 0) return;

  var _pOvHeight = _photoPhotoImg.height();
  var _pOvWidth = _photoPhotoImg.width();

  //add styles to overaly and show it
  var _photoOverlay = _photoCtr.find('#photoOverlay');
  _photoOverlay.css({height: _pOvHeight + "px"})
  _photoOverlay.show();

  //add styles to author and show it
  var _authorDescription = _photoCtr.find('#gal_picture p');
  _authorDescription.css({width: _pOvWidth + "px"})
  _authorDescription.show();

  //add styles to arrows and show it
  var _arrowsHeight = _photoCtr.find('#gal_picture #photoOverlay a .ico');
  _arrowsHeight.css({height: _pOvHeight + "px"})
  _arrowsHeight.show();
 }
}

jQuery(document).ready(function() {
gal_photoArrows.init(); // fotostory

  jQuery('#k12 .index .head,.ZJwrp1 h1,.galeriesBox h4,.MZBChead,.ZBCspecH h3,.zajSzukaj h1,.wideoIndex h2').each(function() {
    if (jQuery(this).find('a').length == 0) {
      jQuery(this).wrapInner('<span>');     
    } else {
      jQuery(this).find('a').wrapInner('<span>');
    }
  });

  jQuery('.MZBCwrp_5 .MZBClead a').hover(
    function() { jQuery(this).parent().parent().addClass('hover'); },
    function() { jQuery(this).parent().parent().removeClass('hover'); }
  );

  jQuery('.MZBCwrp_4 .MZBimgC').each(function() {
    jQuery(this).find('img').eq(0).show();
  });

  jQuery('.MZBCwrp_4 .MZBimgC').hover(
    function() { jQuery(this).find('img').eq(0).hide(); jQuery(this).find('img').eq(1).show(); },
    function() { jQuery(this).find('img').eq(0).show(); jQuery(this).find('img').eq(1).hide(); }
  );
  
    // embed flash
  (function() {
    if (gazeta_pl.flash_holders) {
      var l = gazeta_pl.flash_holders.length;
      if (l > 0) {
        var params = { wmode: 'opaque', allowScriptAccess: 'always' };
        for (var i = 0; i < l; i++) {
          var fl = gazeta_pl.flash_holders[i];
          params.flashvars = fl.vars;
          swfobject.embedSWF(fl.url, fl.id, fl.width, fl.height, '9.0.0', '/info/expressInstall.swf', {}, params);
        }
      }
    }
  }());
  
  ie6();
});

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.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);
	}
}


