include('js/button.js');
include('js/vdslide.js');
include('flowplayer/flowplayer-3.1.4.min.js');

activemenu = 1;

if ( investorMode == 1 )
{
	pluginhtml = '<p><img id="dl_plugin" src="http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-dis.png"/></p>';										   
	installCode = "window.location='http://install.visualdomains.com/VenusPackage-0.3.0.00/venus-package-setup.exe';";
}
else
{
	pluginhtml = '<a href="download_addon.php"><img id="dl_plugin" onmouseover="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-high.png'" +'" onmouseout="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-reg.png'" +'" onmousedown="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-push.png'" +'" onmouseup="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-reg.png'" +'" src="http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-addon-reg.png" /></a>';
	installCode = "DoInstall('http://79.125.3.157/sport3d/dotnetInsPortal.php?file=VenusSetup.exe'" + dl_ver + ")";
}

Ext.namespace('VD');

VD.CenterPanel = Ext.extend(Ext.Panel, {
	initComponent: function (){		
	var config = {			
	    items: [{
	    	xtype: 'container',
        	id: 'download-container',
			style: 'align: center;',
			style: 'padding: 0px 0px 0px 0px;',
        	items: [{
        		xtype: 'container',
        		id: 'download-selector',
				align: 'center',
				style: 'padding: 10px 0px 0px 0px;',
        		layout: 'hbox',
        		items: [{
					xtype: 'box',
  				    style: 'padding: 0px 0px 0px 0px;',
					html: '<img id="dl_img" onmouseover="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-venus-high.png'" +'" onmouseout="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-venus-reg.png'" +'" onmousedown="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-venus-push.png'" +'" onmouseup="this.src=' + "'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-venus-reg.png'" +'" src="http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/download-venus-reg.png" /><a href="#" style="position: absolute; bottom: 10px; right: 10px;" id="venus_href" onclick="' + installCode + '"><img style="width:116px; height: 32px" src="img/btn/btn-download.png" /></a>',
        			id: 'venus',
        			flex:1
        		},{
					xtype: 'box',
  				    style: 'padding: 0px 0px 0px 0px;',
					html: '' + pluginhtml,
        			id: 'addons_g',        			
        			flex:1
        		}]
        	},{        		
        		xtype: 'container',
        		id: 'download-content',
        		layout: 'fit',
        		items: [{
        			xtype: 'container',
        			style: 'padding: 25px 20px 25px 20px;',
        			layout: 'hbox',
        			items: [{
        				xtype: 'container',
        				width: 320,
        				items: [{
        					xtype: 'container',
        					width: 320,
        					style: 'white-space: nowrap',
    	        			items: [{
    	        				xtype: 'vd_button',
    	        				id: 'bt-step1',
    	        				regular: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-1-reg.png',
    	        				over: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-1-high.png',
    	        				high: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-1-push.png',
    	        				pushed: true,
    	        				style: {
    	        					position: 'relative',
    	        					left: '0px'
    	        				},
    	        				listeners: {
    	        					clicked: function(e){
    	        						Ext.getCmp('download-steps').getLayout().setActiveItem(0);
    	        						Ext.getCmp('download-img-container').getLayout().setActiveItem(0);
    	        						e.setPushed();
    	        						Ext.getCmp('bt-step2').setUnPushed();
    	        						Ext.getCmp('bt-step3').setUnPushed();
    	        					}
    	        				}
    	        			},{
    	        				xtype: 'vd_button',
    	        				id: 'bt-step2',
    	        				regular: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-2-reg.png',
    	        				over: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-2-high.png',
    	        				high: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-2-push.png',
    	        				style: {
    	        					position: 'relative',
    	        					left: '-36px',
    	        					top: '-1px'
    	        				},
    	        				listeners: {
    	        					clicked: function(e){   	        						    	        						
    	        						Ext.getCmp('download-steps').getLayout().setActiveItem(1);
    	        						Ext.getCmp('download-img-container').getLayout().setActiveItem(1);
    	        						//Ext.getCmp('download-img-s2').autoPlay.delay(3000);
    	        						e.setPushed();
    	        						Ext.getCmp('bt-step1').setUnPushed();
    	        						Ext.getCmp('bt-step3').setUnPushed();
										eval(installCode);
										//DoInstall('http://79.125.3.157/sport3d/dotnetInsPortal.php?file=VenusSetup.exe' + dl_ver);
    	        						//Ext.get('dl-frame').dom.src = "http://79.125.3.157/sport3d/dotnetInsPortal.php?file=VenusSetup.exe";
										//Ext.Msg.alert("Download","Download will be available soon");
    	        					}
    	        				}	
    	        			},{
    	        				xtype: 'vd_button',
    	        				id: 'bt-step3',
    	        				regular: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-3-reg.png',
    	        				over: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-3-high.png',
    	        				high: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/step3-3-push.png',
    	        				style: {
    	        					position: 'relative',
    	        					left: '-79px'
            					},
    	        				listeners: {
    	        					clicked: function(e){
            							Ext.getCmp('download-steps').getLayout().setActiveItem(2);
            							Ext.getCmp('download-img-container').getLayout().setActiveItem(2);
            							e.setPushed();
    	        						Ext.getCmp('bt-step1').setUnPushed();
    	        						Ext.getCmp('bt-step2').setUnPushed();
    	        					}
    	        				}	
    	        			}]
        				},{
        					xtype: 'container',
        					flex: 1,
    	        			layout:'card',    	        			
    	        			id: 'download-steps',
    	        		    activeItem: 0,
    	        		    defaults: {
    	        				xtype: 'container'
            				},
    	        		    items:[{
    	        		    	contentEl: 'download-step1'
    	        		    },{
    	        		    	contentEl: 'download-step2'
    	        		    },{
    	        		    	contentEl: 'download-step3'
    	        		    }]
        				}]
    				},{    					
    					flex: 1,
    					xtype: 'container',
	        			layout:'card',
	        			id: 'download-img-container',
	        		    activeItem: 0,
	        		    rowspan: 2,
	        		    defaults: {
	        				xtype: 'container'
        				},
	        		    items:[{
	        		    	contentEl: 'download-img-s1'
	        		    },{
	        		    	xtype: 'box',
							html: '<object width="100%" height="100%" id="player-is" data="gs_pic.swf" type="application/x-shockwave-flash"><param name="movie" value="gs_pic.swf"><param name="quality" value="high"><param name="wmode" value="transparent"></object>'
	        		    },{
	        		    	contentEl: 'download-img-s3'
	        		    }]
        			}]
        		}]
        	},{        		
        		xtype: 'box',
        		autoEl:{
        			tag: 'img',
        			src: 'http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/txt/txt-itcanonlybeexperienced-shadow.png'
        		}
        	}]
		},{
			xtype: 'box',
			id: 'support',
			autoEl: {
				html: '<a href="explore.php"><img src="http://d33yedrtgjxwfm.cloudfront.net/visualdomains/img/img/btn/btn-explore-side.png"></img></a>',
				style: 'position: absolute; top: 130px; right: 0px'
			}
		}]
	};
	Ext.apply(this, config);
	Ext.apply(this.initialConfig, config);
	VD.CenterPanel.superclass.initComponent.call(this);	
		
	flowplayer("player-dl", "flowplayer/flowplayer-3.1.5.swf",{
		plugins: {
		   controls: null
		},
		clip: {
			autoPlay: true,
			autoBuffering: true,
			url: 'step3 flash good.flv'
		}
	});
	
}
});

Ext.reg('vd_center', VD.CenterPanel);
