
function update_banner(imageId,bannerSize)
{var url='?';new Ajax.Request(url,{method:'post',parameters:{controller:'EditWebsite',action:'accent_image_display',product:'Web',acnt:$F('ACNT'),banner_id:imageId,banner_size:bannerSize},onSuccess:function(transport){$("ReservedImage").replace(transport.responseText);$("FlashBannerTextForm").hide();$("EditTextBtn").show();},onFailure:function(){alert("The ajax request failed - was trying to load a banner");}});}
Event.observe(window,'load',function(){if($("accent_image_edit"))
{update_banner($('imageList').value,'small');var banner_carousel=new Carousel("BannerCarousel",{slide_class:"banner",duration:"0.5",lpp:3});$$(".banner_thumb_shield").each(function(shield){shield.observe("click",function(){var imageId=shield.readAttribute('rel');$("imageList").value=imageId;update_banner(imageId,'small');$$(".banner").invoke("removeClassName","selected");shield.up().addClassName("selected");});});$("FlashBannerTextBtn").observe("click",function(event){Event.stop(event);var url='?';new Ajax.Request(url,{method:'post',parameters:{controller:'EditWebsite',action:'accent_image_text_edit',product:'Web',acnt:$F('ACNT'),title_text:$("flash_banner_title").getValue(),subtitle_text:$("flash_banner_subtitle").getValue()},onSuccess:function(transport){if(transport.responseText=="success"){update_banner($('imageList').value,'small');}
else{alert("there was an error saving your banner text!");}},onFailure:function(){alert("The ajax request failed - was trying to change the banner text");}});});$("FlashBannerTextCancel").observe("click",function(){$("FlashBannerTextForm").hide();$("EditTextBtn").show();});$("EditTextBtn").observe("click",function(){if(Prototype.Browser.IE){$('FlashBannerTextForm').show();}
else{Effect.BlindDown('FlashBannerTextForm',{scaleContent:false,duration:0.5});}
$("EditTextBtn").hide();});}
else
{if($('banner_id')){update_banner($('banner_id').value,'');}}});