/**
  * Application Layout
  * by Jozef Sakalos, aka Saki
  * http://extjs.com/learn/Tutorial:Application_Layout_for_Beginners
  */
 

 
// create namespace
Ext.namespace('headlinepanels');
 
// create application
headlinepanels.app = function() {
    // do NOT access DOM from here; elements don't exist yet
 
    // private variables
    
 
    // private functions
  
    
    
    // public space
    return {
        // public properties, e.g. strings to translate
 		
        
        // public methods
       
        
        init: function() {
            /*
            
            //print pubs panels
            casinoreviewPanel_index = new Ext.Panel({
                title: 'Casino Review Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'casinoreviewpanel_index',
                width:270,
                html:'casino review articles'
            });
            
            bettingbusinessPanel_index = new Ext.Panel({
                title: 'Betting Business Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'bettingbusinesspanel_index',
                width:270,
                html:'betting business articles'
            });
            
            coinslotPanel_index = new Ext.Panel({
                title: 'Coinslot Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'coinslotpanel_index',
                width:270,
                html:'coinslot articles'
            });
            * */
            //industry news panels
            //function to hide or show the scroller when the news 
            //panel is expanded or collapssed
            function toggleScroller(scrollercontainer,scroller,displaytype){
	            
	            if(Ext.get(scroller)){
	            	
	            	var sc = Ext.get(scrollercontainer);
	            	var s = Ext.get(scroller);
	            	var s1 = eval('Ext.get('+scroller+'1)');
	            	var s2 = eval('Ext.get('+scroller+'2)');
	            	
	            	eval('s.'+displaytype+'()');
	            	eval('s1.'+displaytype+'()');
	            	eval('s2.'+displaytype+'()');
	            	eval('sc.'+displaytype+'()');

	            }
            }    
            
            remotePanel_index = new Ext.Panel({
                title: 'Remote Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'remotepanel_index',
                //width:240,
                html:remoteHTML
            });
            remotePanel_index.on('expand',function(){toggleScroller('remotepanelticker_index','remotescrollercss','hide')})
            remotePanel_index.on('collapse',function(){toggleScroller('remotepanelticker_index','remotescrollercss','show')})
            
            
            bettingPanel_index = new Ext.Panel({
                title: 'Betting Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'bettingpanel_index',
                //width:240,
                html: bettingHTML
            });
            bettingPanel_index.on('expand',function(){toggleScroller('bettingpanelticker_index','bettingscrollercss','hide')})
            bettingPanel_index.on('collapse',function(){toggleScroller('bettingpanelticker_index','bettingscrollercss','show')})
            
            bingoPanel_index = new Ext.Panel({
                title: 'Bingo Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'bingopanel_index',
               // width:240,
                html: bingoHTML
            });
            bingoPanel_index.on('expand',function(){toggleScroller('bingopanelticker_index','bingoscrollercss','hide')})
            bingoPanel_index.on('collapse',function(){toggleScroller('bingopanelticker_index','bingoscrollercss','show')})
            
            casinoPanel_index = new Ext.Panel({
                title: 'Casino Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'casinopanel_index',
               // width:240,
                html: casinoHTML
            });
            casinoPanel_index.on('expand',function(){toggleScroller('casinopanelticker_index','casinoscrollercss','hide')})
            casinoPanel_index.on('collapse',function(){toggleScroller('casinopanelticker_index','casinoscrollercss','show')})
            
            coinopPanel_index = new Ext.Panel({
                title: 'Coin-Op Headlines',
                titleCollapse:true,
                collapsible:true,
                collapsed:true,
                renderTo: 'coinoppanel_index',
                //width:240,
                html: coinopHTML
            });
            coinopPanel_index.on('expand',function(){toggleScroller('coinoppanelticker_index','coinopscrollercss','hide')})
            coinopPanel_index.on('collapse',function(){toggleScroller('coinoppanelticker_index','coinopscrollercss','show')})
            
           
        }//end init function    
    };
}(); // end of app
 
// end of file