function openwin(url,name) {
  var height = 600;
  var width = 800;
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = Math.floor((aw - width) / 2);
    var yc = Math.floor((ah - height) / 2);
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  str += ",directories=0,location=0,menubar=1,personalbar=1,scrollbars=1,status=1,toolbar=1,resizable=1";
  //return window.open(url,name,str);
  window.open(url,name,str);
  return false;
}

/******------------------------------------------------****/



	
$(document).ready(function(){


	function AnimateBilds(obrazek){
		  if (obrazek > 5){
		  		obrazek = 1;
		  	}
		  var sirka = $(document).width();
		  
		  if (sirka < 950){
		  		sirka = 950;
		  	}
	    var vyska = 800 * (sirka / 1500); //vyska obrazku
			var mensivyska = vyska - 350;
			var rychlost =  mensivyska*30;
			//alert(sirka);
		$('#HomeFlash-bild-0'+obrazek+'').css({'z-index':'2','width':''+sirka+'px','height':''+vyska+'px','visibility':'visible'}).animate({
			   bottom: '-=' +mensivyska+ 'px'
			 	}, rychlost, 'linear', function() {
			    $(this).animate({bottom: "-=" +vyska+ "px"}, 200, 'linear', function() {
			   			$(this).css({'bottom' : '0px','z-index' : '1','visibility':'hidden'});
			   			obrazek = obrazek + 1;
			   			AnimateBilds(obrazek);
			   			});
			});	
	}

	AnimateBilds(1);



 	// externi odkazy
	$("#ikony a, .lista-seo-ext a, .lista-seo a, div.menu a, a#pocasi").each(function() {
		if(this.href.indexOf(location.hostname) == -1) {
		$(this).click(function(){window.open(this.href); return false;});
	}	
	});



		
});


//$('#HomeFlash-bild-01').css('bottom','0px');

/*
$(window).bind('resize', function () { 
		globalvar sirka = $(document).width();
		//$("#img").css('width', $(window).width());
});
*/
/*

if (AnimateBilds()){
		AnimateBilds();
}

		$('#HomeFlash-bild-01').animate({
		   bottom: '-=' +mensivyska+ 'px'
		 	}, 2000, 'linear', function() {
		    $(this).animate({bottom: "-=" +vyska+ "px"}, 500, 'linear', function() {
		   			$(this).css('bottom','0px');
		   			});
		});


$i = 5;
 while($i > 0){
     rows.eq($i).slideUp();
 }



for(i=1; i<=6; i++){}	
*/
/*, 'linear', BildAnim()*/
/*
$('#clickme').click(function() {
  $('#book').animate({
    width: ['toggle', 'swing'],
    height: ['toggle', 'swing'],
    opacity: 'toggle'
  }, 5000, 'linear', function() {
      $(this).after('<div>Animation complete.</div>');
  });
});

*/
