$(document).ready(function() {
	$("ul").prev("span.ListMinus").prev("span.ListPlus").show();
	$("span.ListPlus").parent().children("ul").hide("slow");
        $(".previewComponent").click(function() {
                $("#preview-embed").append("<iframe id='embed' src='"+$(this).find('input').val()+"' width='100%' height='342px' style='border:none;'/>");
        });
	$("span.ListPlus").click(function(){
		$(this).hide();
		$(this).next("span.ListMinus").show();
		//slideDown animation doesn't work in IE6:
		if(navigator.userAgent.match("MSIE 6")) 
		{
		    $(this).parent().find("span.ListPlus").hide();
		    $(this).parent().find("span.ListMinus").show();
		    $(this).parent().find("span.ListMinus + span.bold ~ ul").show();
		}
		else
		{
		    $(this).parent().children("ul").slideDown("fast");
		}
	});
	$("span.ListMinus").click(function(){
		$(this).hide();
		$(this).prev("span.ListPlus").show();
		//slideUp animation doesn't work in IE6:
		if(navigator.userAgent.match("MSIE 6")) 
		{
		    $(this).parent().find("span.ListPlus").show();
		    $(this).parent().find("span.ListMinus").hide();
		    $(this).parent().find("span.ListMinus + span.bold ~ ul").hide();
		}
		else
		{
		    $(this).parent().children("ul").slideUp("fast");
		}
	});

});

