$(document).ready(function() {

   var site = String(document.location)
       .replace(/^(https?:\/\/[^:\/]+).*$/, "$1")
       .replace(/^((site)?(file:\/\/.+\/))[^\/]+$/, "$3")
       .replace(/(\\.)/g, "\\$1");
   $("a", this).filter(function (i) {
       var href = $(this).attr("href");
       if (href == null)
           return false;
       return (
              href.match(RegExp("^("+site+"|(https?:)?/[^/])")) == null
           && href.match(RegExp("^(https?|ftp)://.+")) != null
       );
   }).each(function () {
    $(this).click(function() {
      window.open($(this).attr('href'));
               return false;
            });
  });
  $("a[rel=external]").click(function() {
	  window.open($(this).attr('href'));
		return false;
	}); 
	$("input.date").datepicker({dateFormat: 'dd.mm.yy'});
  $('.pics').cycle('fade');
});