
$(document).ready(function(){

//    $('#hp_1_house.hp-house').cycle({
    $('.hp-house').cycle({
        speed:  2000
    });

//    $('#hp_1_house.hp-house img').css('display', 'block'); // nahrada za cykleni aby se nemusel opravovat i display none u obrazku ve stylu

});

function Detail(path)
{
	window.open("detail.php?file="+path, '_blank', 'left=400, top=100, width=610, height=480, status=1, resizable=1');
}

function openView(idsz) {
	location = 'byty-na-prodej/byt-'+idsz+'/';
}


 function winopen(path)
  {
  window.open(path, '_blank', 'left=400, top=100, width=500, height=350, resizable=1');
  return false;
  }

  
// javascript bez javascriptu - otevirani odkazu v novem okne pomoci classy popup

function aktualizujOdkazy() {
  if(!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if(links[i].className.match("popup")) {
      links[i].onclick = function () {
        return !window.open(this.href);
      }
    }
  }
}
window.onload=aktualizujOdkazy;



/**
 *    rolovaci posunuti kotvy
 *
 *    je pouze na uvodni strane aby nezrusil funkcnost napriklad malych klikacich otazniku v detailu pneumatiky
 *
 */


$(document).ready(function(){

    $('a[href*=#]').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
      && location.hostname == this.hostname) {
        var $target = $(this.hash);
        $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
        if ($target.length) {
          //var windowHeight = $(window).height();
          var targetOffset = $target.offset().top;
          $('html,body')
          .animate({scrollTop: targetOffset}, 800);
         return false;
        }
      }
    });

});
