function isArray(obj) { if (obj.constructor.toString().indexOf("Array") == -1) return false; else return true; } /****************************************************************************** Define Namespace NFW: Navigator FrameWork /*****************************************************************************/ NFW.queueOnLoad=[]; NFW.runOnLoad=function(){for(var i=0;i < arguments.length; i++)this.queueOnLoad.push(arguments[i]);}; NFW.onLoad=function(){for(i=0;i < this.queueOnLoad.length;)eval(this.queueOnLoad.shift())();}; /*...........................................................................*/ NFW.FunctionNS={}; NFW.PageNS={}; NFW.Modules={}; /*...........................................................................*/ function NFW_Includes(){ if (NFW_Includes.caller != NFW_Includes.getInstance) throw new Error("There is no public constructor for NFW_Includes."); this._includes=new Array(); }; NFW_Includes.__instance__=null; NFW_Includes.getInstance=function(){ if (this.__instance__==null) this.__instance__=new NFW_Includes(); return this.__instance__; }; NFW.FunctionNS.Includes=NFW_Includes; NFW.FunctionNS.Includes.prototype.Add=function(arr){ this._includes[this._includes.length]=arr; }; /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ NFW.FunctionNS.Includes.prototype.SetLoaded=function(filename){ for (var i=0;i ul > li', this).remove(); var ul = $(''); var t = MENU_COUNTER + 10; for (; MENU_COUNTER < t; MENU_COUNTER++) { $('> ul', this).append('
  • Item ' + MENU_COUNTER + '
  • '); } } } function unloadMenu() { if (MENU_COUNTER >= 30) { MENU_COUNTER = 1; } } // We're passed a UL function onHideCheckMenu() { return !$(this).parent().is('.LOCKED'); } // We're passed a LI function onClickMenu() { $(this).toggleClass('LOCKED'); return true; } }; /*...........................................................................*/ function NFW_Scripts(json){ if (NFW_Scripts.caller != NFW_Scripts.getInstance) throw new Error("There is no public constructor for NFW_Scripts."); this.includes=eval(json); this.Includes=new NFW.FunctionNS.Includes.getInstance(); }; NFW_Scripts.__instance__=null; NFW_Scripts.getInstance=function(json){ if (this.__instance__==null) this.__instance__=new NFW_Scripts(json); return this.__instance__; }; NFW.FunctionNS.Scripts=NFW_Scripts; /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ NFW.FunctionNS.Scripts.prototype.loadScripts=function(callback){ this.callback=callback; for(i=0;i'+data+''); } ); break; case 'module_script': $.getIfModified( NFWJS.path.mdir+'/'+this.includes[i].modulename+'/'+this.includes[i].filename, function(data){ eval(data); //$('head').append(''); } ); break; case 'style': $.getIfModified( NFWJS.path.idir+'/'+this.includes[i].type+'s/'+this.includes[i].filename, function(data){ eval(data); //$('head').append(''); } ); break; } this.tryToSetCompleted(this.includes[i].filename); }; /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ NFW.FunctionNS.Scripts.prototype.tryToSetCompleted=function(filename){ this.Includes.SetLoaded(filename); //alert(scriptId+':'+this.Includes.Completed()); if(this.Includes.Completed()) if (this.callback!==null)this.callback(); }; /*...........................................................................*/ /*...........................................................................*/ /*...........................................................................*/ /*...........................................................................*/ function NFW_Error(desc,page,line,chr){ //TODO: better error display is to be designed. //alert('NFW_Error Handler\n\n'+msg); alert( 'JavaScript error occurred! \n' +'\nError description: \t'+desc +'\nPage address: \t'+page +'\nLine number: \t'+line ); return true }; NFW_Error._this__=null; NFW_Error.getInstance=function(){ if (this._this__==null) this._this__=new NFW_Error(); return this.__instance__; }; NFW.FunctionNS.Error=NFW_Error; //onerror=NFW.FunctionNS.Error; /*...........................................................................*/ NFWJS={ 'ds':'/', 'path':{ 'tdir':'/templates/kvhp', 'rdir':'/', 'idir':'/nfwinc', 'mdir':'/modules' }, 'page':{ 'menu_id':'112', 'id':'109', 'name':'kgh-care-centre', 'parent_name':'project', 'parent_id':'102', 'params':eval('[]') }, 'lang':{ 'id':'1' }, 'site':{ 'domain':'http://www.kelownavernonhospitalsproject.ca', 'id':'3', 'is_admin':'0' , 'menu_object':{} }, 'modules':{ 'menu':{ 'generator':'sfmenu' } } }; NFW.Page.GlobalLoaded=function(){ $('.confirm-delete').click(function(){ return(NFW.FunctionNS.ConfirmDelete()); }); //$('#NFWJsError').load(function(){$(this).show();}); };