var win;function checkUserUrl(theelement){Ext.Ajax.request({url:"index.cfm?event=general.userURLCheck",method:"POST",callback:function(options,success,response){result=top.doJSON(response.responseText);if(!result.SUCCESS){Ext.MessageBox.alert(result.ERROR,result.MSG)}else{eval(result.MSG);return false}},scope:this})}Ext.onReady(function(){Ext.QuickTips.init();var C=new Ext.TabPanel({region:"center",id:"myTabPanel",deferredRender:false,activeTab:0,layoutOnTabChange:true,enableTabScroll:true,border:false,margins:"0 0 0 5",defaultType:"iframepanel",defaults:{closable:true,autoShow:true},items:[{defaultSrc:"index.cfm?event=general.dspWelcome",title:"Home",id:"Home",iconCls:"homeIconTab",closable:false,autoScroll:true,loadMask:{hideOnReady:true,msg:"Loading..."}}]});C.on("tabchange",function(D,E){if(E.id=="News"){Ext.getCmp("newsPanel").expand()}else{if(E.id=="ten-pin-bowling"){Ext.getCmp("aboutPanel").expand()}else{if(E.id=="messaging-tab"){Ext.getCmp("messagingPanel").expand()}else{if(E.id=="friends-tab"){Ext.getCmp("friendsPanel").expand()}else{if(E.id=="profile-tab"){Ext.getCmp("profilePanel").expand()}else{if(E.id=="help-policy"){Ext.getCmp("helpPanel").expand()}}}}}}});var B=new Ext.Panel({title:"Navigation",layout:"accordion",id:"west-panel-accordion",region:"center",width:190,minSize:190,maxSize:190,border:true,collapsible:false,autoScroll:true,floatable:false,defaults:{border:false,animate:true,fill:true,autoHeight:true,autoScroll:true},layoutConfig:{titleCollapse:false,activeOnTop:false,maskDisabled:true,autoScroll:true,animate:true},defaultType:"panel",items:[{contentEl:"west-messaging",id:"messagingPanel",title:"Messaging",iconCls:messagingIconClass},{contentEl:"west-friends",id:"friendsPanel",title:"Friends",iconCls:friendsIconClass},{contentEl:"west-profile",id:"profilePanel",title:"Profile",iconCls:profileIconClass},{contentEl:"west-news",id:"newsPanel",title:"Bowling News",iconCls:"newsIcon"},{contentEl:"west-info",id:"aboutPanel",title:"Bowling Info",iconCls:"infoIcon"},{contentEl:"west-help-policies",id:"helpPanel",title:"Help &amp; Policies",iconCls:"helpIcon"}]});var A=new Ext.Viewport({layout:"border",id:"theViewPort",items:[new Ext.BoxComponent({region:"north",el:"north",height:65}),{region:"south",contentEl:"south",split:false,height:40,minSize:40,maxSize:40,collapsible:false,margins:"0 0 0 0"},{region:"west",id:"west-panel",split:false,width:190,minSize:190,maxSize:190,collapsible:false,margins:"0 0 0 0",layout:"border",border:true,borderWidth:3,items:[{title:"Community",region:"north",id:"mainNavPanel",contentEl:"west-main-navigation",height:140,width:190,minSize:190,maxSize:190,autoScroll:true,border:true},B]},C]});A.doLayout()});function addTab(E,F,H,D,C,B,A,G){if(G){Ext.getCmp("myTabPanel").insert(G,{xtype:D,title:F,defaultSrc:H,iconCls:C?C:"",closable:!A,id:E,loadMask:B?{hideOnReady:true,msg:"Loading..."}:false}).show()}else{Ext.getCmp("myTabPanel").add({xtype:D,title:F,defaultSrc:H,iconCls:C?C:"",closable:!A,id:E,loadMask:B?{hideOnReady:true,msg:"Loading..."}:false}).show()}}function updateTabTitle(A,C){var B=Ext.getCmp("myTabPanel").getItem(A);if(B){B.setTitle(C)}}function updateTab(B,I,A,E,H,G,F,D){var C=Ext.getCmp("myTabPanel").getItem(B);if(!C){C=addTab(B,I,A,E,H,G,F,D)}else{C.setTitle(I);C.iframe.setSrc(A)}Ext.getCmp("myTabPanel").setActiveTab(C)}function removeTab(A){var B=Ext.getCmp("myTabPanel").getItem(A);if(B){Ext.getCmp("myTabPanel").remove(A,true)}}function updateAccordion(J,C,G,D,B,F,H,A,I){var E=Ext.getCmp(J);if(!E){addAccordion(J,C,G,D,B,F,H,A,I)}else{E.setSrc(G,true)}}function addAccordion(J,C,G,D,B,F,H,A,I){var E="hidden";if(A){E="auto"}Ext.getCmp("west-panel-accordion").add({xtype:D,title:C,id:J,border:false,defaultSrc:G,iconCls:I?I:"",loadMask:H?{hideOnReady:true,msg:"Loading..."}:false,autoScroll:A,iframeStyle:{overflow:E}});Ext.getCmp("west-panel-accordion").doLayout();if(B){p=Ext.getCmp(J);Ext.getCmp("west-panel-accordion").activeItem=p;p.el.dom.parentNode.insertBefore(p.el.dom,p.el.dom.parentNode.firstChild)}if(F){Ext.getCmp(J).expand()}}function removeAccordion(A){Ext.getCmp("west-panel-accordion").remove(A,true);Ext.getCmp("west-panel-accordion").doLayout()}function CheckMessagesRequestsLogin(){Ext.Ajax.request({url:"index.cfm?event=general.userLoginCheck",method:"POST",callback:function(B,C,A){result=doJSON(A.responseText);if(result.SUCCESS){GetNewMessagesRequests()}return true},scope:this})}function GetNewMessagesRequests(){Ext.Ajax.request({url:"index.cfm?event=user.common.message.getNewMessageRequestCounts",method:"POST",callback:function(C,E,A){result=doJSON(A.responseText);if(result&&result.SUCCESS){if(result.MSGCOUNT!==0){document.getElementById("inboxMsgCount").innerHTML="("+result.MSGCOUNT+")"}else{document.getElementById("inboxMsgCount").innerHTML=""}if(result.REQCOUNT!==0){document.getElementById("friendRequestCount").innerHTML="("+result.REQCOUNT+")"}else{document.getElementById("friendRequestCount").innerHTML=""}if(result.ALERTDIV&&result.ALERTDIV!=""){var B=Ext.getCmp("myTabPanel").getItem("UserHome");var D=B.iframe.getDocument();if(D.getElementById("alertDiv")&&D.getElementById("alertDiv").innerHTML!==undefined){D.getElementById("alertDiv").innerHTML=result.ALERTDIV}}else{var B=Ext.getCmp("myTabPanel").getItem("UserHome");var D=B.iframe.getDocument();if(D.getElementById("alertDiv")&&D.getElementById("alertDiv").innerHTML!==undefined){D.getElementById("alertDiv").innerHTML=""}}}chkmsg=setTimeout("CheckMessagesRequestsLogin()",300000);return true},scope:this})}function profileLink(B,C,A){checkLogin(this,"top.updateTab('profile-tab','Profile - "+B+"','index.cfm?event="+C+"','iframepanel','profileIconTab')",A)}function updateAlertMyHome(B,C,A){if(!A){A=0}Ext.Ajax.request({method:"POST",url:"index.cfm?event=user.common.home.updateUserAlerts&thefield="+B+"&theval="+C+"&toRemove="+A,callback:function(E,F,D){result=top.doJSON(D.responseText);if(result.SUCCESS){GetNewMessagesRequests()}return true},scope:this})};