Ext.ns('Ext.ux.clv2')

Ext.ux.clv2.FooterWindow = function(config) {
    // call parent constructor
    Ext.ux.clv2.FooterWindow.superclass.constructor.call(this, config);
	
	this.on('beforeclose', this.hideSpotlight, this);
	this.on('beforehide', this.hideSpotlight, this);
	this.on('beforeshow', this.showSpotlight, this);
	this.on('collapse', this.showSpotlight, this);
	this.on('move', this.showSpotlight, this);
	this.on('resize', this.showSpotlight, this);
}; // end of Ext.ux.clv2.FooterWindow constructor

Ext.extend(Ext.ux.clv2.FooterWindow, Ext.Window, {
	hideSpotlight : hideSpotlight,
	showSpotlight : showSpotlight,
	addTitleBarItems: addExtTitleBarItems,
    setElementAction: setExtElementAction
});

var showPrivacyPolicyPanel = function(){
                    // create the window on the first click and reuse on subsequent clicks

                    var ppanel =  new Ext.Panel({
                            autoLoad:{url: 'footerLink.spr', params: 'linkName=privacyPolicy'},
                            region: 'center',
                            autoScroll:true,
                            collapsible: false,
                            bodyStyle: 'overflow-y: hidden'
                    })
    
                    var privacyWin = new Ext.ux.clv2.FooterWindow({                            
							id:'privacy-policy-window',
                            cls:'clv2-window',
                            closeAction:'close',                            
                            closable:false,
                            width:660,
                            height:600,
                            plain:true,
                            layout: 'fit',
                            resizable:false,
                            draggable:true,
                            items: [ppanel]

                        });                   
		            privacyWin.setPosition(465,80);
                    if(Ext.isIE) privacyWin.show();
										else privacyWin.show(this);
                    privacyWin.addTitleBarItems({title:'Privacy Policy',close:'close window'});
}

var showTermsOfServicePanel = function(){
                    var panel =  new Ext.Panel({
                            autoLoad:{url: 'footerLink.spr', params: 'linkName=termsOfService'},
                            autoScroll:true,
                            region: 'center',
                            collapsible: false,
                            bodyStyle: 'overflow-x: hidden'
                    })
                    // create the window on the first click and reuse on subsequent clicks
                    var termWin = new Ext.ux.clv2.FooterWindow({
							id:'terms-service-window',
                            cls:'clv2-window',
                            closeAction:'close',
                            closable:false,
                            draggable:true,
                            width:660,
                            height:600,
                            plain:true,
                            layout: 'fit',
                            resizable:false,
                            items: [panel]
                        });
		            termWin.setPosition(465,80);
                    if(Ext.isIE) termWin.show(); else termWin.show(this);
                    termWin.addTitleBarItems({title:'Terms of Service',close:'close window'});    
}        