function toggleDiv(divid, checkboxid)
{
    $(".autohide").hide();
    if (checkboxid == false)
    {
	if ($("#"+divid+"").css('display') == 'none')
	{
	    $("#"+divid+"").show();
	}
	else
	{
	    $("#"+divid+"").hide();
	}
    }
    else
    {
	if ($("#"+checkboxid+"").attr('checked') == true)
	{
	    $("#"+divid+"").show();
	}
	else
	{
	    $("#"+divid+"").hide();
	}
    }
}

function set_add_del()
{
	$('.remove').show();
	$('.add').hide();
	$('.add:last').show();
	$("#banner_rotation_container > .banner_rotation_inner:only-child > .remove").hide();
}

function selrem(clickety)
{
	$(clickety).parent().remove();
	set_add_del();
	return false;
}

function seladd(clickety)
{
	$('#banner_rotation_container > .banner_rotation_inner:last').after($('#banner_rotation_container > .banner_rotation_inner:last').clone());
	set_add_del();
	return false;
}
$(document).ready(function(){set_add_del();});

function toggleDivRadio(divid, radioname)
{
    if (radioname == false)
    {
	if ($("#"+divid+"").css('display') == 'none')
	{
	    $("#"+divid+"").show();
	}
	else
	{
	    $("#"+divid+"").hide();
	}
    }
    else
    {
	if ($("input[name='"+radioname+"']").attr('checked') == true)
	{
	    $("#"+divid+"").show();
	}
	else
	{
	    $("#"+divid+"").hide();
	}
    }
}