jQuery.fn.initImages2 = function(i){
	jQuery.ajax({	
		type: "GET",  
		url: "/hlavicka/",  
		dataType: "html",  
		success: parseHtml
	});
}

function parseHtml(my_html) {
wrapper = jQuery(my_html).find(".colMain ul")

		
		wrapper.find("li").each(function() {
			arrayOfImages.push(jQuery(this).children("img").attr("src"))
		})	
		
		for(i=0;i<arrayOfImages.length;i++){
			var elem = jQuery("<img src='" + arrayOfImages[i] + "' alt='' />")
			elem.css({position: "absolute", left: 0, top: 0, height: "auto"})
			jQuery("#placeholder_image").append(elem)
		}
		
		jQuery('#placeholder_image').cycle({
			fx: 'fade',
			timeout: 5000,
			speedOut: 2000,
			speedIn: 2000
		});

}

arrayOfImages = []

jQuery(document).ready(function(){
	jQuery(this).initImages2()
	
	/*
	jQuery("#placeholder_logo .filler").animate({opacity: ".5"},0)
	jQuery("#placeholder_text .filler").animate({opacity: ".33"},0)
	
	jQuery(".colSide .pollBlock.ftBox").animate({height: "1px", paddingTop: "0", paddingRight: "0", paddingBottom: "0", paddingLeft: "0"}, 0).css({background: "none", overflow: "hidden"})
	jQuery(".colSide .pollBlock.ftBox .pollHeaderOut").css({display: "none"})
	
	jQuery("#placeholder_text #rbcCompanySlogan").mouseenter(function(){
		jQuery(this).parent().children("span.filler").animate({opacity: ".66", cursor: "arrow"}, 500);
	}).mouseleave(function(){
		jQuery(this).parent().children("span.filler").animate({opacity: ".33"}, 200)
		jQuery(this).blur()
		return false
	})
	
	*/
	
	// PRUHLEDNOST PNGs
	//jQuery.ifixpng('/img/blank.gif');
	//jQuery('#rbcSystemIdentifierLogo').ifixpng();

	
	shown = true;
	
	
	jQuery("#placeholder_image").click(function(){
		if(shown){
			jQuery("#placeholder_logo, #placeholder_logo .filler").animate({width: "1px"}, 500)
			jQuery("#placeholder_text, #placeholder_text .filler").animate({height: "1px"}, 500).css({'line-height': '1px', overflow: 'hidden'}).hide()
		} else {
			jQuery("#placeholder_logo, #placeholder_logo .filler").animate({width: "296px"}, 500)
			jQuery("#placeholder_text, #placeholder_text .filler").animate({height: "45px"}, 500).css({'line-height': '45px', overflow: 'hidden'}).show()
		}
		
		jQuery("#placeholder_logo img").toggle()
		
		shown = !shown;
	})
	
})

