$(document).everyTime(
                1000, 
                function() {
                  var url = "/modules/time.php?ms=" + new Date().getTime();
                  $.ajax({
                    url : url, success : function (data) { $("#actualServerTime").html(data); }
                  });
                },
                0 
);

$(document).ready(function(){
  $(".uhr_1").click(function(){
    $("#uhr_info_1").show(1000);
    
    $("#uhr_info_5").hide(1000);
    $("#uhr_info_2").hide(1000);
    $("#uhr_info_3").hide(1000);
    $("#uhr_info_4").hide(1000);
  });

  $(".uhr_2").click(function(){
    $("#uhr_info_2").show(1000);
    
    $("#uhr_info_5").hide(1000);
    $("#uhr_info_1").hide(1000);
    $("#uhr_info_3").hide(1000);
    $("#uhr_info_4").hide(1000);
  });                     

  $(".uhr_3").click(function(){
    $("#uhr_info_3").show(1000);
    
    $("#uhr_info_5").hide(1000);
    $("#uhr_info_2").hide(1000);
    $("#uhr_info_1").hide(1000);
    $("#uhr_info_4").hide(1000);
  });

  $(".uhr_4").click(function(){
    $("#uhr_info_4").show(1000);
    
    $("#uhr_info_5").hide(1000);
    $("#uhr_info_2").hide(1000);
    $("#uhr_info_3").hide(1000);
    $("#uhr_info_1").hide(1000);
  });
  
  $(".uhr_5").click(function(){
    $("#uhr_info_5").show(1000);
    
    $("#uhr_info_4").hide(1000);
    $("#uhr_info_2").hide(1000);
    $("#uhr_info_3").hide(1000);
    $("#uhr_info_1").hide(1000);
  });
});


(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);


(function($)
{
	$.fn.blink = function(options)
	{
		var defaults = { delay:500 };
		var options = $.extend(defaults, options);
		
		return this.each(function()
		{
			var obj = $(this);
			setInterval(function()
			{
				if($(obj).css("visibility") == "visible")
				{
					$(obj).css('visibility','hidden');
				}
				else
				{
					$(obj).css('visibility','visible');
				}
			}, options.delay);
		});
	}
}(jQuery))

function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
}

