var APP=window.APP||{};
APP.Cookie=function(){var c=function(b){return RegExp("(?:^|;\\s*)"+escape(b).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)};return{set:function(b,c,d,e,a,h){d||(d=new Date,d.setDate(d.getDate()+14),d=void 0);e=e||"/";a=a||false;h=h||false;if(b&&!/^(?:expires|max\-age|path|domain|secure)$/.test(b)){var g="";if(d)switch(typeof d){case "number":g="; max-age="+d;break;case "string":g="; expires="+d;break;case "object":g="; expires="+d.toGMTString()}document.cookie=escape(b)+"="+escape(c)+
g+(a?"; domain="+a:"")+(e?"; path="+e:"")+(h?"; secure":"");return this.get(b)}},get:function(b){return!b||!c(b)?void 0:unescape(document.cookie.replace(RegExp("(?:^|.*;\\s*)"+escape(b).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"),"$1"))},remove:function(b){if(b&&c(b)){var f=new Date;f.setDate(f.getDate()-1);document.cookie=escape(b)+"=; expires="+f.toGMTString()+"; path=/";return this.get(b)}}}}();APP=window.APP||{};
APP.Image=function(){var c=[];return{add:function(b){c.push(b)},preload:function(){for(var b=0;b<c.length;b++)(new Image).src=c[b]}}}();APP=window.APP||{};
APP.init=function(c){APP.base=APP.Url.base(c.baseUrl||"");$.fn.accordion&&$(".accordion").accordion();$.fn.message&&$(".message").message();$.fn.tabs&&$(".tabs").tabs();APP.Mobile.isTouchDevice()||($.fn.tooltip&&$(".tooltip").tooltip(),$.fn.modal&&$(".modal").each(function(){$(this).modal({height:"480px",width:"640px"})}));APP.Mobile.isSmallTouchDevice()&&$(window).bind("load",function(){APP.Mobile.hideUrlBar()}).bind("orientationchange",function(){APP.Mobile.hideUrlBar()});tinyMCE.init({mode:"textareas",
plugins:"fullscreen",theme:"advanced",theme_advanced_buttons1:"cut,copy,paste,|,bullist,numlist,|,fullscreen,code",theme_advanced_buttons2:"bold,italic,underline,|,fontsizeselect,|,redo,undo",theme_advanced_buttons3:"",theme_advanced_buttons4:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left"})};APP=window.APP||{};APP.log=function(){this.history=this.history||[];this.history.push(arguments);window.console&&console.log(Array.prototype.slice.call(arguments))};
APP=window.APP||{};APP.Mobile={hideUrlBar:function(){setTimeout(function(){pageYOffset||window.scrollTo(0,1)},0)},isTouchDevice:function(){return"ontouchstart"in window},isSmallTouchDevice:function(){return APP.Mobile.isTouchDevice()&&$(window).width()<768}};APP=window.APP||{};
APP.Url=function(){var c="",b=function(a){a=typeof a==="string"&&a.length?a.split("://").shift():c.split("://").shift();return a.substr(0,4)==="http"?a:window.location.protocol.replace(/\:/,"")},f=function(){var a=c.split("://").shift().substr(0,4)=="http"?c.split("/").slice(2,3):c.split("/").slice(0,1);return a.toString().length?a:window.location.host},d=function(){var a=c.replace(/http(s)?\:\/\//,"").split("/");return a.length>2?a.slice(1,a.length).join("/"):""},e=function(a){typeof a==="string"&&
a.length&&(c=b(a)+"://"+a.replace(/http(s)?\:\/\//,""))};return{protocol:function(){return b()},host:function(){return f()},uri:function(){return d()},base:function(a){typeof a==="string"&&e(a);c||e(window.location.protocol+"//"+window.location.host+"/");return b()+"://"+f()+"/"+d()}}}();

