Ext.namespace("Sun");Sun.showAjaxError=function(a){Ext.Msg.alert(Sun.Strings.ApplicationTitle,Sun.Strings.InvalidAjaxResponseMsg)};Sun.logout=function(){document.location.href="/admin/logout"};Sun.loadApp=function(url,callback,scope){Ext.Ajax.addListener("requestcomplete",function(c,r,o){eval(r.responseText)},null,{single:true});Ext.Ajax.addListener("requestcomplete",callback,scope,{single:true});Ext.Ajax.request({url:url,failure:function(response,options){alert("The application could not be loaded because the server sent an invalid response. Please try again later.")}})};Ext.QuickTips.init();Ext.Ajax.addListener("requestException",function(d,a,b){Sun.showAjaxError(a)});Ext.namespace("Sun.Strings");Sun.Strings.ApplicationTitle="Sun Area Technical Institute";Sun.Strings.InvalidAjaxResponseMsg="The server did not send a valid response. Please try again later.";Ext.namespace("Sun.Strings.CMS.Event");Sun.Strings.CMS.Event.OverviewWindowTitle="Events";Sun.Strings.CMS.Event.NewEventWindowTitle="New Event";Ext.namespace("Sun.Strings.CMS.Asset");Sun.Strings.CMS.Asset.UploadPanelTitle="Upload Asset";Ext.namespace("Sun.Strings.Directory.User");Sun.Strings.Directory.User.SelectionFieldEmptyText="No users match your query.";Sun.Strings.Directory.User.SelectionFieldBlankText="You must select a user.";Sun.Strings.Directory.User.SelectionFieldLabel="User";Ext.ns("Sun");Sun.VideoWindow=function(a){if(!a){a={}}html='<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+a.video+'&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+a.video+'&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';Sun.VideoWindow.superclass.constructor.call(this,Ext.apply({autoWidth:true,autoHeight:true,layout:"fit",html:html,modal:true},a))};Ext.extend(Sun.VideoWindow,Ext.Window);Ext.ns("Sun");Sun.FormPanel=function(a){Sun.FormPanel.superclass.constructor.call(this,Ext.apply({defaults:{labelStyle:"font-weight : bold",color:"#333",msgTarget:"under",anchor:"95%"},autoHeight:true,autoWidth:true,bodyStyle:{padding:"10px"},buttonAlign:"right",defaultType:"textfield"},a||{}))};Ext.extend(Sun.FormPanel,Ext.form.FormPanel);Ext.ns("Sun");Sun.Lightbox=function(a){a=Ext.apply({cls:"",innerHtml:""},a);this.innerHtml='<div class="lb {cls}">    <div class="lb-top"></div>    <div class="lb-content">        <h2 class="title">{title}</h2>'+a.innerHtml+'        <p class="caption">{caption}</p>    </div>    <div class="lb-bottom"></div></div>';this.template=new Ext.Template(this.innerHtml);this.content=Ext.get(document.createElement("div"));this.template.compile();c=this.content;c.setOpacity(0);c.position("absolute",10);s=Ext.getBody().getScroll();c.setTop(s.top).setLeft(s.left);c.setWidth("100%");c.setHeight("100%");Ext.getBody().insertFirst(c);c.insertHtml("afterBegin",this.template.apply(a));lbc=Ext.select(".lb-content");lbc.setOpacity(1,true);lbc.center();c.setOpacity(0.9,true);c.addListener("click",function(){this.fadeOut({duration:0.5,remove:true})},c);return false};Ext.ns("Sun.Lightbox");Sun.Lightbox.YoutubePlayer=function(a){Sun.Lightbox.YoutubePlayer.superclass.constructor.call(this,{video:a,cls:"video",innerHtml:'<object type="application/x-shockwave-flash" style="width:560px; height:340px;" data="http://www.youtube.com/v/{video}"><param name="movie" value="http://www.youtube.com/v/{video}" /></object>'});return false};Ext.extend(Sun.Lightbox.YoutubePlayer,Sun.Lightbox);Ext.ns("Sun.Lightbox");Sun.Lightbox.ImageViewer=function(a){Sun.Lightbox.YoutubePlayer.superclass.constructor.call(this,Ext.apply({cls:"img",innerHtml:'<img src="{src}" alt="{title}" />'},a));return false};Ext.extend(Sun.Lightbox.ImageViewer,Sun.Lightbox);
