function initSlide()
{
	$(".slide").each(function()
	{
		$(this).parent().addClass("sld_box").end().css("display","none");
	});
	$(".sld_box").each(function()
	{
		loopSlide($(this).attr("id"));
	});
}
function loopSlide(eleid)
{
	var lp=true;
	var nxt=false;
	var tim=$("#"+eleid+" > .slide_timing").attr("value");
	var typ=$("#"+eleid+" > .slide_type").attr("value");
	if(typ=="slideout")
	{
		$("#"+eleid+" div").css("display","block");
		$("#"+eleid+" img").css("display","inline");
	}
	var xx=0;
	var slide_no=0;
	$("#"+eleid).each(function()
	{
		xx=0;
		$(this).children(".slide").each(function()
		{
			xx++;
			if(lp)
			{
				if($(this).hasClass("disp"))
				{
					switch(typ)
					{
						case "slideout":
							$(this).animate({"top":$("#"+eleid).height()+"px"},(tim/2)).removeClass("disp");
							$("#"+$(this).attr("id").replace("slide_","slide_img_")).animate({"top":$("#"+eleid).height()+"px"},(tim/2));
							break;
						case "slidein":
							$(this).hide("slide", { direction: "down"}, (tim/2) ).removeClass("disp");
							$("#"+$(this).attr("id").replace("slide_","slide_img_")).hide("slide", { direction: "down"}, (tim/2) );
							break;
						default:
							$(this).fadeOut( (tim/2) ).removeClass("disp");
							$("#"+$(this).attr("id").replace("slide_","slide_img_")).fadeOut( (tim/2) );
							break;
						
					}
					nxt=true;
				}
				else if(nxt)
				{
					switch(typ)
					{
						case "slideout":
							$(this).addClass("disp");
							break;
						case "slidein":
							$(this).show("slide", { direction: "down"}, (tim/2) ).addClass("disp");
							$("#"+$(this).attr("id").replace("slide_","slide_img_")).show("slide", { direction: "down"}, (tim/2) );
							break;
						default:
							$(this).fadeIn( (tim/2) ).addClass("disp");
							$("#"+$(this).attr("id").replace("slide_","slide_img_")).fadeIn( (tim/2) );
							break;
					}
					lp=false;
					slide_no=xx;
				}
			}
			
		});
		if($(this).children(".disp").size()==0)
		{
			switch(typ)
			{
				
				case "slideout":
					$(this).children(".slide:first").addClass("disp");
					$("#"+eleid+" div").stop().css({"display":"block","top":"0px"});
					$("#"+eleid+" img").stop().css({"display":"inline","top":"0px"});
					break;
				case "slidein":
					$(this).show("slide", { direction: "down"}, (tim/2) ).addClass("disp");
					$("#"+$(this).attr("id").replace("slide_","slide_img_")).show("slide", { direction: "down"}, (tim/2) );
					break;
				default:
					$(this).children(".slide:first").fadeIn( (tim/2) ).addClass("disp");
					$(this).children(".slide_img:first").fadeIn( (tim/2) );
					break;
			}
			slide_no=1;
		}
		lp=true;
	});
	setTimeout("loopSlide('"+eleid+"');",tim);
	$(".slide_control_"+eleid+" > .slide_tracker_on").removeClass("slide_tracker_on");
	$(".slide_control_"+eleid+" > #slide_tracker_"+slide_no).addClass("slide_tracker_on");
}

