/**
 * @author bumz
 */
Ext.onReady(function(){
	Ext.QuickTips.init();
	
	// turn on validation errors beside the field globally
	Ext.form.Field.prototype.msgTarget = 'side';
	/*
	var email = 
		new Ext.form.TextField({
			fieldLabel: langlines.main_email_address,
			name: 'email',
			id: 'email',
			vtype: 'email',
			width: 180,
			allowBlank:false
	});
	
	var simple = new Ext.FormPanel({
		//labelWidth: 1, // label settings here cascade unless overridden
		url:'homepage/subscribe',
		xtype:'fieldset',
        style: 'border:none;',
        title: '',
		labelAlign: 'top left',
        autoHeight:true,
		renderTo: 'form-container',
		items: [
		email
		,{
			layout: 'form',
			items: [new Ext.Button({
				text: 'Send',
				id: 'saveButton',
				style: 'text-transform: uppercase',
				align: 'right',
				handler: function(){
					if(email.isValid()){
						Ext.MessageBox.show({
							msg: langlines.main_email_preview_thx,
							progressText: langlines.main_please_wait,
							width:300,
							wait:true,
							waitConfig: {interval:200},
							icon:'download_icon'
						});        
						
						Ext.Ajax.request({
							url: base_url + 'homepage/ajax_add_email',
							method: 'POST',
							success: function(responseObject){
								Ext.MessageBox.hide();
								var resultInfo = Ext.util.JSON.decode(responseObject.responseText);
								if(resultInfo.status)
								{
									Ext.getCmp('email').setValue('');
									showInfoMessage(resultInfo.message);
								}
								else
								{
									showWarningMessage(resultInfo.message);
								}
							},
							failure: function(){
								Ext.MessageBox.hide();
								showErrorMessage(langlines.main_server_error);                                                        
							},
							params: {
								email: Ext.getCmp('email').getValue()                                                                    
							}
						});
					}
					else
					{
						showErrorMessage(langlines.main_please_fill_all_fields);                                
					}
				}
			})]
		}]
	});*/
	
	$f("flowplayer", "/files/flowplayer-3.1.4.swf", { 
	    clip: { 
	        url: "/files/videos/linktive_intro.mp4", 
	        autoPlay: false
	
	    },
		canvas: { 
        	background: 'url(/files/previews/howitworks.jpg) no-repeat 0 0'
	    },
	     
	    screen: {         
	        width:362, height:285
	    },
		
		// controlbar settings 
	    plugins:  { 
	        controls: {             
	             
	            // setup a background image 
				backgroundColor: '#eeece0', 
	             
	            /* you may want to remove the gradient */ 
	            backgroundGradient: 'high', 
	             
	            // these buttons are visible 
	            /*all:false, 
	            scrubber:true, 
	            play:true, 
	            mute:true,*/ 
	             
	            // custom colors 
				timeColor: '#3e469d',			// Value for the font color in the time field that specifies the total duration of the clip or "total time". 
				durationColor: '#3e469d',		// Value for the font color in the time field. This is the running time. 
				progressColor: '#6d92cc',		// Color of the progress bar. This is the bar in the timeline from zero time to the point where playback is at a given time.
				progressGradient: 'none',		// Gradient setting for the progress bar. none, low, medium or high
				bufferColor: '#3e469d',			// Color of the buffer. The buffer is the bar that indicates how much video data has been read into the player's memory.
				bufferGradient: 'low',			// Gradient setting for the buffer.
				sliderColor: '#6d92cc',			// Background color for the timeline before the buffer bar fills it. The same background color is also used for the volume slider.
				sliderGradient: 'low',			// Gradient setting for the sliders.
				buttonColor: '#6d92cc',			// Color of the player buttons: stop, play, pause and fullscreen.
				buttonOverColor: '#3e469d',		// Button color when the mouse is positioned over them
				volumeSliderColor: '#6d92cc',	// Background color for the volume slider
				volumeSliderGradient: 'low',	// Volume slider background color gradient
				timeBgColor: '#eeece0',			// Background color for the time/duration display   
	            
	            // tooltip background color (since 3.1.0) 
	            tooltipColor: '#6d92cc', 
	             
	            // custom height 
	            //height: 30, 
	             
	            // setup auto hide 
	            autoHide: 'always',             
	             
	            // a little more styling              
	            /*width: '98%',  
	            bottom: 5, 
	            left: '50%',*/ 
	            borderRadius: 5
	
	 
	        } 
	    } 
	}); 
	
	loadPageWindow('a[rel="terms"]', 'Terms');
	loadPageWindow('a[rel="privacy_policy"]', 'Privacy Policy');
    loadPageWindow('a[rel="badges"]', 'Badges');
	
	$('a[rel="external"]').attr('target', '_blank');
});