var AC = { 'foo' : null };

AC.showSection = function(section_id) {
    $(section_id+"-content").up().makePositioned();
    Element.setStyle($(section_id+"-content"), {height: Element.getHeight($(section_id+"-content")) + 'px'});
    Effect.BlindDown(section_id + "-content");
    $(section_id + "-arrow-up").hide();    
    $(section_id + "-arrow-down").show();
    $(section_id + "-title").onclick = function() {AC.hideSection(section_id);};
};

AC.hideSection = function(section_id) {
    Effect.BlindUp(section_id + "-content");     
    $(section_id + "-arrow-up").show();    
    $(section_id + "-arrow-down").hide();
    $(section_id + "-title").onclick = function() {AC.showSection(section_id);};
};

AC.previewAlbum = function() {
	$("albumtemp").value = 1;
    new Ajax.Request( webroot + 'albums/preview', {
     	parameters: Form.serialize($("albumform")),
     	onSuccess: function( transport ) {
     		$("albumtemp").value = 0;
     		window.open(webroot + transport.responseText);
     	},
     	onFailure: function( transport ) {
     		$("albumtemp").value = 0;     		
            alert('Error, sorry :-(');
     	}
    });
};