﻿var contact = new Ext.Window({
    closable:true,
    modal: true,
    frame:true,
    width:400,
    height:300,
    border:false,
    plain:true,
    resizable:false,
    closeAction:'hide',
    items:[
        {
            frame:false,
            height:544,
            items:new Ext.form.FormPanel({
                style:'padding:15px 0px 0px 5px',
                border:false,
                url:'contactus.aspx',
                defaultType:'textfield',
                defaults:{
                    hideLabel:true,
                    fieldClass:'i-form',
                    width:300
                },
                items:[
                    {
                        name:'name',
                        emptyText:'name'
                    },
                    {
                        name:'email',
                        emptyText:'email'
                    },
                    {
                        name:'business',
                        emptyText:'business name'
                    },
                    {
                        name:'phone',
                        emptyText:'phone'
                    },
                    {
                        name:'besttime',
                        emptyText:'best time to call'
                    },
                    {
                        xtype:'textarea',
                        name:'comments',
                        emptyText:'comments'
                    },
                    {
                        xtype:'hidden',
                        id:'formName',
                        name:'formName'
                    },
                    {
                        xtype:'button',
                        text:'Submit',
                        cls:'i-button',
                        listeners:{
                            click:{
                                fn:function(){
                                    Ext.getCmp('formName').setValue(contact.title);
                                    contact.items.itemAt(0).items.itemAt(0).form.submit({waitMsg:'Logging you in...'});
                                }
                            }
                        }
                    }
                ],
                onSubmit: Ext.emptyFn,
                submit: function() {
                    this.el.dom.action = this.url;
                    this.el.dom.method = 'POST';
                    this.el.dom.target = '_top';
                    this.el.dom.submit();
                    return true;
                }           
            })
            
            
        }
    ]
});
Ext.onReady(function(){
    var imgs = Ext.select('img[class="roll"]');
    imgs.on('mouseover',function(o){
        this.src=this.src.replace('off.gif','on.gif');
    });
    imgs.on('mouseout',function(o){
        this.src=this.src.replace('on.gif','off.gif');
    });
    /*imgs.on('click',function(o){
        contact.setTitle(this.getAttribute('alt'));
        contact.show(this);
    });*/
});
