

	var slideHtmlBackup = '';
	
	function doSlideSwitch(obj) {
		var $$ = obj;
		
		//wersja dla zwyklych slajdów
		if(!$$.hasClass('adds')){
			//rewitalizacja normalnego html'a slajdu
			if(slideHtmlBackup != '')
				$(".main_image").html(slideHtmlBackup);
				
			var imgAlt = $$.find('a').attr("alt"); //Get Alt Tag of Image
			var imgTitle = $$.find('a').attr("href"); //Get Main Image URL
			var imgDesc = $$.find('.block').html(); //Get HTML of block
			//var imgHeader = $$.find('h2').html();
			var imgDescHeight = $(".main_image").find('.block').height(); 

			// Calculate height of block	
			if ($(this).is(".active")) {  //If it's already active, then...
				return false; // Don't click through
			} else {
				//Animate the Teaser		
				$(".main_image img.sliderImage").animate({ opacity: 0}, 250 );
				$(".main_image .block").animate({ opacity: 0.8, marginLeft: "-600", marginTop: "-50" }, 250 , function() {
					$(".main_image img.sliderImage").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 250 );
					$(".main_image .block").html(imgDesc).animate({ opacity: 1.0, width:"208px", marginLeft: "0", marginTop: "0" }, 400 );
					//$(".main_image .block p").animate({ width:"570px" }, 150 );
					if(imgAlt == '' || imgAlt == undefined) $(".main_image a.playyt").hide(150);
					else $(".main_image a.playyt").attr('alt', imgAlt).show(150);
				});
				
				//$(".main_image h2").html(imgHeader);
				}
		}else{
			if($$.children().not('script').size() == 0){
				$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
				$$.addClass('active');  //add class of 'active' on this list only
				slideSwitch();
				return false;
			}
			slideHtmlBackup = $(".main_image").html();
			$(".main_image").html('').append($$.children().not('script').clone());
		}
		$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
		$$.addClass('active');  //add class of 'active' on this list only
		return false;
	};
