/*!
 * @author Jonathon Hibbard
 */
(function(b){var a={getDataStoreByKey:function(c,e){var d=b(this).data(c);b(this).flexTools("applyCallback",e,d);return this},getDataStoreCollection:function(d){var c=b(this).data();b(this).flexTools("applyCallback",d,c);return this},addToDataStore:function(c){var d={keyName:"",keyData:{},onKeyExists:"overwrite"},f={},e=b(this);if(c&&!b.isEmptyObject(c)){b.extend(d,c)}f=e.data(d.keyName);if(f){switch(d.onKeyExists){case"skip":break;case"overwrite":e.data(d.keyName,d.keyData);break;case"push":e.data(d.keyName,f.push(d.keyData));break;e.data(d.keyName,b.extend(f,d.keyData));default:}}else{e.data(d.keyName,d.keyData)}return this},destroyDataStore:function(c){if(c){if(b.isArray(c)){b.each(c,function(e,d){b(this).removeData(d)})}else{if(typeof c=="string"){b(this).removeData(c)}}}return this},consoleLog:function(c,d){console.log("%s: %o",c,d);return this},disableChildrenLinks:function(c){var d=b(this);if(!c||(c!="live"&&c!="bind")){c="bind"}if(c=="bind"){d.bind("click",function(f){f.stopImmediatePropagation();f.preventDefault()})}else{d.live("click",function(f){f.stopImmediatePropagation();f.preventDefault()})}return this},reportError:function(c,d){a.showNotification(c,d);return this},showNotification:function(c,d){if(b.isFunction(d)){a.applyCallback(d,c)}else{if(typeof notifyMessage=="function"||typeof window.notifyMessage=="function"){notifyMessage(b.extend({notifyType:"error"},c))}else{if(window.opener.notifyMessage=="function"){window.opener.notifyMessage(b.extend({notifyType:"error"},c))}else{alert(c.title+" -- Message Reported: "+c.message)}}}return this},createToolbar:function(f,g){var e,d,c;e=b('<div class="toolbar ui-widget-header ui-corner-all"></div>').css({opacity:0.8}).hover(function(){b(this).stop().fadeTo("fast",1)},function(){b(this).stop().fadeTo("fast",0.8)});d=b('<div class="buttons"></div>');c=b('<span class="label">'+f+"</span>");e.append(c);e.append(d);b(this).flexTools("applyCallback",g,{toolbar:e,buttons:d})},loadElementTitleBar:function(){var d=b(this),e={title:"Category",open_new_window:false},f=d.find(".flex_titlebar_headlines_list:first"),c={title:f.attr("title"),title_link:f.attr("rel")};if(c.title&&c.title.length>0){if(!c.title_link||c.title_link.length<1){c.title_link=false}f.flexTitleBar(b.extend({},e,c))}return this},getJSONData:function(f,e,g,i,c){var h=b(this),d={throwError:true,messages:{noResponse:{title:"ERROR",message:"A request was made but a response was not recieved!",notifyType:"error"},onError:{title:"ERROR",message:"An internal error has occurred with "+f+"!",notifyType:"error"}},onError:function(){},onTimeout:function(){}};if(!e||!b.isPlainObject){e={}}if(c&&!b.isEmptyObject(c)){b.extend(d,c)}if(!f||f.length<0){b.error("makeAjaxCall needs a url!");return this}g=!!g;b.ajax({async:g,url:f,type:"GET",dataType:"json",data:e,timeout:5000,success:function(j){if(!j){if(d.throwError===true){h.flexTools("reportError",d.noReponse,d.onError)}h.flexTools("applyCallback",i,false)}else{if(j.ERROR){if(d.throwError===true){h.flexTools("reportError",d.onError+" (Error Response: "+j.ERROR+")")}h.flexTools("applyCallback",i,false)}else{h.flexTools("applyCallback",i,j)}}},error:function(k,l,j){if(l==="timeout"){c.onTimeout();h.flexTools("applyCallback",i,false)}else{if(d.throwError===true){h.flexTools("reportError","An unknown error occurred!"+(!j||j.length<1?"":" Error: "+j),c.onError)}h.flexTools("applyCallback",i,false)}}});return this},isValidObject:function(c){return(!c||!b.isPlainObject(c)||b.isEmptyObject(c)?false:true)},getUrlParts:function(g){if(!g||g.length<1){return false}var e=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,d=g,c=e.exec(d),f=false;if(!b.isArray(c)||!c[0]||c[0].length<1){return false}else{if(c[3].length>0){f=c[3].substring(c[3].length-4);if(f){switch(f.toLowerCase()){case".com":case".net":case".org":f=true;break;default:f=false}}else{f=false}}return{url:c[0],schema:(c[1]&&c[1].length>0?c[1]:false),slash:(c[2]&&c[2].length>0?c[2]:false),host:(c[3]&&c[3].length>0?c[3]:false),port:(c[4]&&c[4].length>0?c[4]:false),path:(c[5]&&c[5].length>0?c[5]:false),query:(c[6]&&c[6].length>0?c[6]:false),hash:(c[7]&&c[7].length>0?c[7]:false),hasTLD:f}}},openNewWindow:function(){var c=b(this).attr("href"),d=b(this).attr("title");if(c.length<1){return}if(d.length<1){d="Social"}window.open(c,d);event.preventDefault()},loadDialog:function(d,f,c){var e={modal:true,autoOpen:true,resizable:false,show:"fade",hide:"fade",width:680,zIndex:502,position:"center"},g=b(this);if(a.isValidObject(d)){b.extend(e,d)}if(f&&f.length>0){if(c){if(!a.isValidObject(c)&&!b.isArray(c)){c=[]}}g.load(f,c,function(){g.dialog(e)})}else{g.dialog(e)}return this},applyCallback:function(c){if(b.isFunction(c)){c.apply(this,Array.prototype.slice.call(arguments,1))}}};b.fn.flexTools=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1))}else{b.error("Method "+c+" does not exist on jQuery.flexTools");return this}}})(jQuery);
/*!
 * @author Jonathon Hibbard
 */
(function(c){var a="/common/js/flex/actions",b={init:function(){return this.each(function(){})},destroy:function(){return this.each(function(){var d=c(this);d.removeClass("module_manager");d.removeData("module_manager")})},getModuleByLabel:function(d,f){var e={};if(d&&d.length>0){b.requestModuleInfo({module_label:d},f)}else{c(this).flexTools("applyCallback",f,e)}return this},getModuleById:function(f,e){var d={};if(f&&true===(f===parseInt(f))){b.requestModuleInfo({module_id:f},e)}else{c(this).flexTools("applyCallback",e,d)}return this},requestModuleInfo:function(f,h){var g,e={throwError:false,onTimeout:function(){c.error("Error obtaining module information");c(window).flexTools("applyCallback",h,{})}},d="site";if(c(window).flexTools("isValidObject",$section_manager_globals)&&"resource_type" in $section_manager_globals){d=$section_manager_globals.resource_type}if(!f||c.isEmptyObject(f)){c(this).flexTools("applyCallback",h,{})}else{if("module_id" in f){g=a+"/get_module_by_id.php"}else{if("module_label" in f){g=a+"/get_module_by_label.php"}else{c(this).flexTools("applyCallback",h,{})}}}c(window).flexTools("getJSONData",g,c.extend({},{resource_type:d},f),false,h,e);return this},getModuleDisplay:function(f,g){var e={throwError:false,onTimeout:function(){c.error("Error obtaining display information");c(window).flexTools("applyCallback",g,{body:"<!-- -->",js_css:""})}},d="site";if(c(window).flexTools("isValidObject",$section_manager_globals)&&"resource_type" in $section_manager_globals){d=$section_manager_globals.resource_type}if(!f||!c.isPlainObject(f)||c.isEmptyObject(f)){c(this).flexTools("applyCallback",g,{body:"<!-- -->",js_css:""})}else{c(window).flexTools("getJSONData",a+"/display.php",{module_info:c.extend({},{resource_type:d},f)},true,g,e)}return this}};c.fn.module_manager=function(d){if(b[d]){return b[d].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof d==="object"||!d){return b.init.apply(this,arguments)}else{c.error("Method "+d+" does not exist on jQuery.module_manager")}}}})(jQuery);
/*!
 * @author Jonathon Hibbard
 */
(function(c){var d={link_url:"#",link_text:"More",new_window:false},b=false,a={init:function(e,f){return this.each(function(){var j=c(this),i=c("<h1></h1>"),l=c("<span></span>"),g=c("<a></a>"),k=c("<a></a>"),h={prepend:true,title:"Category",title_link:null,open_new_window:false,more_link:{}};if(j.flexTools("isValidObject",e)){c.extend(h,e)}b=(!f||f=="false"||f=="0"?false:true);i.addClass("flexTitleBar");if(h.title_link&&h.title_link.length>0){g.text(h.title);i.append(g);g.addClass("flexTitleBarLink");g.flexTitleBar("configureLink",h.title,h.title_link,h.open_new_window)}else{l.addClass("flexTitleBarText").text(h.title);i.append(l)}if(j.flexTools("isValidObject",h.more_link)){k.addClass("flexTitleBarLink_more");k.text(h.more_link.link_text);h.more_link=c.extend({},d,h.more_link);k.flexTitleBar("configureLink",h.more_link.link_title,h.more_link.link_url,h.more_link.new_window);i.append(k)}if(h.prepend===true){j.prepend(i)}else{j.append(i)}})},configureLink:function(h,f,i){var g=c(this),e=g.flexTools("getUrlParts",f);if(g.flexTools("isValidObject",e)){if(e.hasTLD===true&&e.schema===false){f="http://"+f}g.attr("href",f);g.attr("title",h);if(i&&!b){g.click(function(l){var j=c(this).attr("href"),k=c(this).attr("title");if(j.length<1){return}if(k.length<1){k="Category"}window.open(j,k);l.preventDefault()})}}return this},destroy:function(){return this.each(function(){c(this).find(".flexTitleBar:first").remove()})}};c.fn.flexTitleBar=function(e){if(a[e]){return a[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return a.init.apply(this,arguments)}else{c.error("Method "+e+" does not exist on jQuery.flexTitleBar");return this}}}})(jQuery);
