			var newnumber;
			function switch_image(number) {
				newnumber = number;
				$("#hero").css("background", "url('/img/heroes/"+number+"_hero.png')");
				$("#back").fadeOut(function() {
					var old_image = $(this).attr('src');
					$(this).css("display", "block");
					if (newnumber == number) {
						$(this).attr("src", "/img/heroes/"+newnumber+"_hero.png");
					}
				});
			}

			var newnumberswap;
			function swap_image(number,title,text,slideType) {
				newnumberswap = number;
				$("#hero").css("background", "url('/img/heroes/"+number+"_hero.png')");
				$("#back").fadeOut(function() {
					var old_image = $(this).attr('src');
					$(this).css("display", "block");
					if (newnumberswap == number) {
						$(this).attr("src", "/img/heroes/"+newnumberswap+"_hero.png");
					}
				});
				document.getElementById("caption_title").innerHTML=title;
//				document.getElementById("caption_text").innerHTML=text;
//				$('div#caption_text').html(text);
				$('#caption_text').html(text);

				if (slideType == "low") {
					slide_min = 250;
				} else if (slideType == "half") {
					slide_min = 100;
				} else if (slideType == "full") {
					slide_min = 0;
				}
				
			}
/*
			function preload(arrayOfImages) { 
				$(arrayOfImages).each(function() { 
					$('<img/>')[0].src = this; 
				}); 
			}

			preload([ 
			'/img/heroes/0.0_hero.png', 
			'/img/heroes/1.0_hero.png', 
			'/img/heroes/1.1_hero.png', 
			'/img/heroes/2.0_hero.png', 
			'/img/heroes/2.1_hero.png', 
			'/img/heroes/2.2_hero.png', 
			'/img/heroes/2.3_hero.png', 
			'/img/heroes/2.4_hero.png', 
			'/img/heroes/3.0_hero.png', 
			'/img/heroes/3.1_hero.png', 
			'/img/heroes/3.2_hero.png', 
			'/img/heroes/3.3_hero.png', 
			'/img/heroes/4.0_hero.png', 
			'/img/heroes/4.1_hero.png', 
			'/img/heroes/4.2_hero.png', 
			'/img/heroes/4.3_hero.png', 
			'/img/heroes/5.0_hero.png', 
			'/img/heroes/5.1_hero.png', 
			'/img/heroes/5.2_hero.png', 
			'/img/heroes/5.3_hero.png'
			]);
*/
