var CommunityVoiceResourcesInitiative=GetJson("/Admin/CommunityVoice/Initiative/Localization");$.fn.ValueToCSV=function(){return $(this).map(function(){return this.value}).get().join()}; $(function(){$(".sidebar .buttons .saveChanges").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit",document.aspnetForm.submit())});$(".sidebar .buttons .saveAndSubmit").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit?submit\x3dtrue",document.aspnetForm.submit())});$(".sidebar .buttons .saveAndPublish").click(function(){ValidateFields()&&(document.aspnetForm.action="/Admin/CommunityVoice/Initiative/Edit?publish\x3dtrue", document.aspnetForm.submit())})});function ValidateFields(){return""==$("#CategoryName").val()?(alert(CommunityVoiceResourcesInitiative.InitiativeNameTooShort),!1):255<$("textarea[name\x3dDescription]").val().length?(alert(CommunityVoiceResourcesInitiative.InitiativeDescriptionTooLong),!1):!0} $(document).ready(function(){$.ajaxSetup({cache:!1});"undefined"!=typeof LiveEditMenu&&(LiveEditMenu.callBack=ReloadCommunityVoice);document.getElementById("ysnLiveEditShowAllItemsAndCategoriesKAMs")&&document.getElementById("ysnLiveEditShowAllItemsAndCategoriesKAMs").checked?$(".liveEditControl").show():$(".liveEditControl").hide()}); function SaveInitiative(c,a){var m="",f="",l="",p="",n="",y="false";ValidateFields()&&($('input[name\x3d"txtGroupViewList"]:checked').each(function(){m=m+","+$(this).val()}),m=m.substring(1),$('input[name\x3d"txtGroupReadOnlyList"]:checked').each(function(){f=f+","+$(this).val()}),f=f.substring(1),$('input[name\x3d"txtGroupAuthorList"]:checked').each(function(){l=l+","+$(this).val()}),l=l.substring(1),$('input[name\x3d"txtGroupPublishList"]:checked').each(function(){p=p+","+$(this).val()}),p=p.substring(1), $('input[name\x3d"txtGroupOwnerList"]:checked').each(function(){n=n+","+$(this).val()}),n=n.substring(1),$('input[name\x3d"ShowArchive"]').is(":checked")&&(y="true"),y={CategoryID:$("#CommunityVoiceCategoryID").val(),CategoryName:$("#CategoryName").val(),Description:$("#txtDescription").val(),ShowArchive:y,txtGroupViewList:m,txtGroupReadOnlyList:f,txtGroupAuthorList:l,txtGroupPublishList:p,txtGroupOwnerList:n,publish:c,submit:a,IconID:$("#iconID").val()},$.ajax({url:"/Admin/CommunityVoice/Initiative/LiveEdit", type:"post",data:y,success:function(a){ReloadCommunityVoice();closeCpModal()},error:function(a,c,f){blockMenuSpawn=!1;alert("Error: "+a.statusText+"\nStatus: "+a.status)}}))}function ReloadCommunityVoice(){$(".listing.initiatives .list").load("/CommunityVoice/InitiativeList")}function changePage(c,a){loadIdeaPageList(a,$("#paginationOption").val())} function loadIdeaPageList(c,a){var m=$("#divIdeaList"),f="",f=$(".listing.ideas .tabs li.active").text().toLowerCase();"newest"==f&&(f="Date");f=0A&&(b%=d.length);h.goToSlide(b,!1)},a.pause):"prev"==a.autoDirection&&(B=setInterval(function(){b-=a.moveSlideQty;0>b&&(negativeOffset=b%d.length,b=0==negativeOffset?0:d.length+negativeOffset);h.goToSlide(b,!1)},a.pause)):a.ticker&&(a.tickerSpeed*=10,c(".pager",g).each(function(a){s+=c(this).width();t+=c(this).height()}),"prev"==a.tickerDirection&&"horizontal"==a.mode?e.css("left","-"+(s+D)+"px"):"prev"==a.tickerDirection&&"vertical"==a.mode&&e.css("top","-"+(t+E)+"px"),"horizontal"== a.mode?(L=parseInt(e.css("left")),x(L,s,a.tickerSpeed)):"vertical"==a.mode&&(M=parseInt(e.css("top")),x(M,t,a.tickerSpeed)),a.tickerHover&&S())}function V(){if("horizontal"==a.mode||"vertical"==a.mode){var b=m(d,0,a.moveSlideQty,"backward");c.each(b,function(a){e.prepend(c(this))});b=m(d,0,d.length+a.moveSlideQty-1-(d.length-a.displaySlideQty),"forward");a.infiniteLoop&&c.each(b,function(a){e.append(c(this))})}}a=c.extend({mode:"horizontal",infiniteLoop:!0,hideControlOnEnd:!1,controls:!0,speed:500, easing:"swing",pager:!1,pagerSelector:null,pagerType:"full",pagerLocation:"bottom",pagerShortSeparator:"/",pagerActiveClass:"pager-active",nextText:"next",nextImage:"",nextSelector:null,prevText:"prev",prevImage:"",prevSelector:null,captions:!1,captionsSelector:null,auto:!1,autoDirection:"next",autoControls:!1,autoControlsSelector:null,autoStart:!0,autoHover:!1,autoDelay:0,pause:3E3,startText:"start",startImage:"",stopText:"stop",stopImage:"",ticker:!1,tickerSpeed:5E3,tickerDirection:"next",tickerHover:!1, wrapperClass:"bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:!1,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},onNextSlide:function(){},onPrevSlide:function(){},buildPager:null},a);var h=this,e="",d="",g="",F="",P="",G="",O="",Q="",w="",B="",q="",J="",K="",r=!0,C=0,u=0,b=0,D=0,E=0,s=0,t=0,L=0,M=0,k=!1,I=0,A=d.length-1;this.goToSlide=function(c,g){if(!k){k=!0;b=c;a.onBeforeSlide(b,d.length,d.eq(b));"undefined"==typeof g&& (g=!0);g&&a.auto&&h.stopShow(!0);slide=c;if(slide==I)a.onFirstSlide(b,d.length,d.eq(b));if(slide==A)a.onLastSlide(b,d.length,d.eq(b));"horizontal"==a.mode?e.animate({left:"-"+f(slide,"left")+"px"},a.speed,a.easing,function(){k=!1;a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"-"+f(slide,"top")+"px"},a.speed,a.easing,function(){k=!1;a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N();l();1A&&(b%=d.length,g=!0),a.onNextSlide(b,d.length,d.eq(b)),a.onBeforeSlide(b,d.length,d.eq(b)),"horizontal"==a.mode?e.animate({left:"-\x3d"+a.moveSlideQty*G+"px"},a.speed,a.easing,function(){k=!1;g&&e.css("left","-"+f(b,"left")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"-\x3d"+a.moveSlideQty*u+"px"},a.speed,a.easing,function(){k=!1;g&&e.css("top", "-"+f(b,"top")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N(),1b&&(negativeOffset=b%d.length,b=0==negativeOffset?0:d.length+negativeOffset,H=!0),a.onPrevSlide(b,d.length, d.eq(b)),a.onBeforeSlide(b,d.length,d.eq(b)),"horizontal"==a.mode?e.animate({left:"+\x3d"+a.moveSlideQty*G+"px"},a.speed,a.easing,function(){k=!1;H&&e.css("left","-"+f(b,"left")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"vertical"==a.mode?e.animate({top:"+\x3d"+a.moveSlideQty*u+"px"},a.speed,a.easing,function(){k=!1;H&&e.css("top","-"+f(b,"top")+"px");a.onAfterSlide(b,d.length,d.eq(b))}):"fade"==a.mode&&N(),1b&&(b=0,a.hideControlOnEnd&&c(".bx-prev",g).hide());l();a.onPrevSlide(b,d.length,d.eq(b));h.goToSlide(b)}};this.goToFirstSlide=function(a){"undefined"==typeof a&&(a=!0);h.goToSlide(I,a)};this.goToLastSlide=function(){if("undefined"==typeof a)var a=!0;h.goToSlide(A,a)};this.getCurrentSlide=function(){return b};this.getSlideCount=function(){return d.length};this.stopShow=function(b){clearInterval(B);"undefined"==typeof b&&(b=!0);b&&a.autoControls&&(q.html(J).removeClass("stop").addClass("start"), r=!1)};this.startShow=function(b){"undefined"==typeof b&&(b=!0);U();b&&a.autoControls&&(q.html(K).removeClass("start").addClass("stop"),r=!0)};this.stopTicker=function(b){e.stop();"undefined"==typeof b&&(b=!0);b&&a.ticker&&(q.html(J).removeClass("stop").addClass("start"),r=!1)};this.startTicker=function(b){if("horizontal"==a.mode){if("next"==a.tickerDirection){b=parseInt(e.css("left"));var c=s+b+d.eq(0).width()}else"prev"==a.tickerDirection&&(b=-parseInt(e.css("left")),c=b-d.eq(0).width());var f= c*a.tickerSpeed/s;x(L,c,f)}else"vertical"==a.mode&&("next"==a.tickerDirection?(c=parseInt(e.css("top")),c=t+c+d.eq(0).height()):"prev"==a.tickerDirection&&(c=-parseInt(e.css("top")),c-=d.eq(0).height()),f=c*a.tickerSpeed/t,x(M,c,f),"undefined"==typeof b&&(b=!0),b&&a.ticker&&(q.html(K).removeClass("start").addClass("stop"),r=!0))};this.initShow=function(){e=c(this);e.clone();d=e.children();g="";F=e.children(":first");P=F.width();C=0;G=F.outerWidth();u=0;O=F.outerWidth()*a.displaySlideQty;Q=F.outerHeight()* a.displaySlideQty;k=!1;w="";E=D=b=0;K=J=q=B="";r=!0;I=M=L=t=s=0;A=d.length-1;d.each(function(a){c(this).outerHeight()>u&&(u=c(this).outerHeight());c(this).outerWidth()>C&&(C=c(this).outerWidth())});if(a.randomStart){var f=Math.floor(Math.random()*d.length);b=f;D=G*(a.moveSlideQty+f);E=u*(a.moveSlideQty+f)}else b=a.startingSlide,D=G*(a.moveSlideQty+a.startingSlide),E=u*(a.moveSlideQty+a.startingSlide);V(a.startingSlide);"horizontal"==a.mode?(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+ O+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"position:relative; overflow:hidden; width:'+O+'px;"\x3e\x3c/div\x3e').css({width:"999999px",position:"relative",left:"-"+D+"px"}),e.children().css({width:P,"float":"left",listStyle:"none"}),g=e.parent().parent(),d.addClass("pager")):"vertical"==a.mode?(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+C+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"width:'+ C+"px; height:"+Q+'px; position:relative; overflow:hidden;"\x3e\x3c/div\x3e').css({height:"999999px",position:"relative",top:"-"+E+"px"}),e.children().css({listStyle:"none",height:u}),g=e.parent().parent(),d.addClass("pager")):"fade"==a.mode&&(e.wrap('\x3cdiv class\x3d"'+a.wrapperClass+'" style\x3d"width:'+C+'px; position:relative;"\x3e\x3c/div\x3e').wrap('\x3cdiv class\x3d"bx-window" style\x3d"height:'+u+"px; width:"+C+'px; position:relative; overflow:hidden;"\x3e\x3c/div\x3e'),e.children().css({listStyle:"none", position:"absolute",top:0,left:0,zIndex:98}),g=e.parent().parent(),d.not(":eq("+b+")").fadeTo(0,0),d.eq(b).css("zIndex",99));a.captions&&null==a.captionsSelector&&g.append('\x3cdiv class\x3d"bx-captions"\x3e\x3c/div\x3e');a.pager&&!a.ticker&&("full"==a.pagerType?y("full"):"short"==a.pagerType&&y("short"));a.controls&&!a.ticker&&(""!=a.nextImage?(nextContent=a.nextImage,nextType="image"):(nextContent=a.nextText,nextType="text"),""!=a.prevImage?(prevContent=a.prevImage,prevType="image"):(prevContent= a.prevText,prevType="text"),R(nextType,nextContent,prevType,prevContent));if(a.auto||a.ticker)a.autoControls&&(""!=a.startImage?(startContent=a.startImage,startType="image"):(startContent=a.startText,startType="text"),""!=a.stopImage?(stopContent=a.stopImage,stopType="image"):(stopContent=a.stopText,stopType="text"),p(startType,startContent,stopType,stopContent)),a.autoStart?setTimeout(function(){h.startShow(!0)},a.autoDelay):h.stopShow(!0),a.autoHover&&!a.ticker&&T();1