
$(window).load(function() {
	
	//window.onresize			= arguments.callee;
  //var MyScreenWidth		= window.screen.width;
  //var MyScreenHeight	= window.screen.height;
	//var MyWindowWidth		= $(window).width();	
  //var MyWindowHeight	= $(window).height();

	
	//lightbox	
	$("a[rel*=lightbox]").lightBox();
	
	
	// Nowy wyglad Selekt boxa
	$(".MySelectBox").selectbox( {
		inputClass: 'selectbox'
	});

	
	// Na gore strony...
	$(".LinkTop").click( function() {
		$("html, body").animate({scrollTop: 0}, 250);
	});

  
	// Input - Szukaj 
  if ( $("input[name=NazwaProduktu]").attr("value") == "" || $("input[name=NazwaProduktu]").attr("value") == undefined ) {
		$("input[name=NazwaProduktu]").attr("value", "wpisz nazwę produktu");
  }
	$("input[name=NazwaProduktu]").focus( function() {
		if ( $(this).attr("value") == "wpisz nazwę produktu" ) {
			$(this).attr("value", "");
		}
	});
	$("input[name=NazwaProduktu]").blur( function() {
		if ( $(this).attr("value") == "" || $(this).attr("value") == undefined ) {
			$(this).attr("value", "wpisz nazwę produktu");
		}
	});	

	
  // zapalanie pierwszysz elementow w MiniImgNav
	$(".MiniImgNav").each(function(t) {
		$(this).find(".ImgArrow").first().show();
		$(this).parent("div").find(".CollectPrizesNew").first().show();
	});
	// zdarzenia clickdla MiniImgNav
  $(".MiniImgNav .ImgShowPcoduct").click(function() {
		ThisTab = $(this).attr("title");
		// gaszenie wszystkiego - tak szybciej, bez zadnych warunkow i petli
		$(this).parents(".ItemWithTab").find(".CollectPrizesNew").hide();
		$(this).parent("div").find(".ImgArrow").hide();
		// wlaczenie, aktywawanie kliknietego taba 
		$(this).parents(".ItemWithTab").find(".CollectPrizesNew[title="+ThisTab+"]").show();
		$(this).find(".ImgArrow").show();			
  });

});

