Ext.onReady(function() {
	Ext.BLANK_IMAGE_URL = '/scripts/ext-2.0/resources/images/default/s.gif';			 
	/* Ext.QuickTips.init();
	Ext.form.Field.prototype.msgTarget = 'side'; */
		
	Ext.get('login_box').setLocation(Ext.get('login_placeholder').getX(), Ext.get('login_placeholder').getY());
	/* Ext.get('login_head').on('click', function(e, t) {
		if (Ext.get('login_form_container').isVisible()) {
			Ext.get('login_form_container').slideOut('t');
		} else {
			Ext.get('login_form_container').slideIn('t', {
				callback: function() {
					if (Ext.isIE == true) {
						Ext.get('login_form').repaint();
					}
				}
			});
			
		}
	});
	
	var form = new Ext.form.FormPanel({
		renderTo: 'login_form',
		url: '/scripts/login.php',
		method: 'POST',
		labelAlign: 'left',
		bodyStyle: 'background: none; padding: 5px;',
		border: false,
		labelWidth: 50,
		defaults: {
			width: 85
		},
		items: [{
			xtype: 'textfield',
			name: 'username',
			fieldLabel: 'Username',
			allowBlank: false
		},{
			xtype: 'textfield',
			name: 'password',
			fieldLabel: 'Password',
			inputType: 'password',
			allowBlank: false
		},{
			xtype: 'button',
			text: 'Login',
			style: (Ext.isIE == true ? 'margin-left: 24px;' : 'margin-left: 68px;'),
			handler: submitForm
		}],
		keys: [{
			key: Ext.EventObject.ENTER,
			fn: submitForm
		}]
	});
	
	function submitForm() {
		if (form.getForm().isValid()) {
			form.getForm().submit({
				waitMsg: 'Processing...',
				params: {'action': 'login'},
				success: function(form, action) {
					self.location = '/sub_contractors/index.php';
				},
				failure: function(form, action) {
					Ext.Msg.alert('Login Failure', action.result.message);
				}
			});
		}
	} */
});
	
