/*
 * in the Groove inc. Official Site
 * Copyright(c) 2007-2008, in the groove inc.
 * licensing@inthegroove.co.jp
 * 
 * http://www.inthegroove.co.jp
 *
 * NOTE:
 * This code is based on code from the original Ext JS desktop demo.
 * I have made many modifications/additions.
 *
 * The Ext JS licensing can be viewed here:
 *
 * Ext JS Library 3.0.0
 * Copyright(c) 2006-2009 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 *
 */

// Sample desktop configuration
MyDesktop = new Ext.app.App({
	init :function(){
		Ext.QuickTips.init();
	},

	getModules : function(){
		return [
            new MyDesktop.CompanyProfilesWindow(),
            new MyDesktop.InformationWindow(),
            new MyDesktop.AccessWindow(),
            new MyDesktop.RecruitWindow(),
            new MyDesktop.ContactsWindow(),
            new MyDesktop.SitemapWindow(),
            new MyDesktop.FavoriteWindow()
		];
	},

    // config for the start menu
    getStartConfig : function(){
        return {
            title: 'in the Groove inc.',
            iconCls: 'user',
            toolItems: []
        };
    }
});

/* 会社概要 */
MyDesktop.CompanyProfilesWindow = Ext.extend(Ext.app.Module, {
    id: 'comp-win',
    init : function(){
        this.launcher = {
            text: 'company profiles',
            iconCls:'comp-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('comp-win');
        if(!win){
            win = desktop.createWindow({
                id: 'comp-win',
                title: 'company profiles',
                width:640,
                height:480,
                html : '<p><iframe width="620" height="480" frameborder="0" scrolling="yes" marginheight="0" marginwidth="5" src="contents/company_profiles.html"></iframe><br /></p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* インフォメーション */
MyDesktop.InformationWindow = Ext.extend(Ext.app.Module, {
    id: 'info-win',
    init : function(){
        this.launcher = {
            text: 'infomation',
            iconCls:'info-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('info-win');
        if(!win){
            win = desktop.createWindow({
                id: 'info-win',
                title: 'information',
                width:640,
                height:480,
                html : '<p><iframe width="620" height="480" frameborder="0" scrolling="yes" marginheight="0" marginwidth="5" src="contents/info.html"></iframe><br /></p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* アクセス */
MyDesktop.AccessWindow = Ext.extend(Ext.app.Module, {
    id: 'acce-win',
    init : function(){
        this.launcher = {
            text: 'access',
            iconCls:'acce-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('acce-win');
        if(!win){
            win = desktop.createWindow({
                id: 'acce-win',
                title: 'access',
                width:640,
                height:500,
                html : '<p>株式会社インザグルーヴ<br /><br />東京メトロ銀座線/南北線溜池山王駅11番出口より徒歩1分<br />東京メトロ千代田線赤坂駅2番出口より徒歩5分 <br /><br /><br /><iframe width="600" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.jp/maps?f=q&amp;source=s_q&amp;hl=ja&amp;geocode=&amp;q=%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%82%A4%E3%83%B3%E3%82%B6%E3%82%B0%E3%83%AB%E3%83%BC%E3%83%B4&amp;sll=35.672219,139.74052&amp;sspn=0.00268,0.004807&amp;ie=UTF8&amp;cid=5439597993262409419&amp;ll=35.672245,139.740354&amp;spn=0.001525,0.003219&amp;z=18&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co.jp/maps?f=q&amp;source=embed&amp;hl=ja&amp;geocode=&amp;q=%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%82%A4%E3%83%B3%E3%82%B6%E3%82%B0%E3%83%AB%E3%83%BC%E3%83%B4&amp;sll=35.672219,139.74052&amp;sspn=0.00268,0.004807&amp;ie=UTF8&amp;cid=5439597993262409419&amp;ll=35.672245,139.740354&amp;spn=0.001525,0.003219&amp;z=18&amp;iwloc=A" style="color:#0000FF;text-align:left">大きな地図で見る</a></small></p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* 採用情報 */
MyDesktop.RecruitWindow = Ext.extend(Ext.app.Module, {
    id: 'recr-win',
    init : function(){
        this.launcher = {
            text: 'recruit',
            iconCls:'recr-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('recr-win');
        if(!win){
            win = desktop.createWindow({
                id: 'recr-win',
                title: 'recruit',
                width:400,
                height:300,
                html : '<p>coming soon...</p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* お問い合わせ */
MyDesktop.ContactsWindow = Ext.extend(Ext.app.Module, {
    id: 'cont-win',
    init : function(){
        this.launcher = {
            text: 'contacts',
            iconCls:'cont-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('cont-win');
        if(!win){
            win = desktop.createWindow({
                id: 'cont-win',
                title: 'contacts',
                width:400,
                height:200,
                html : '<p>各種お問い合わせは電話またはメールにてお願いいたします。<br/><br/>株式会社インザグルーヴ<br/><br/>TEL：03-5575-0428 (代表)</p><p><a href="mailto:info@inthegroove.co.jp">info@inthegroove.co.jp</a>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* サイトマップ */
MyDesktop.SitemapWindow = Ext.extend(Ext.app.Module, {
    id: 'site-win',
    init : function(){
        this.launcher = {
            text: 'sitemap',
            iconCls:'site-menu',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('site-win');
        if(!win){
            win = desktop.createWindow({
                id: 'site-win',
                title: 'sitemap',
                width:400,
                height:200,
                html : '<p>coming soon...</p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});

/* お気に入り */
MyDesktop.FavoriteWindow = Ext.extend(Ext.app.Module, {
    id: 'favo-win',
    init : function(){
        this.launcher = {
            text: '',
            iconCls:'',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('favo-win');
        if(!win){
            win = desktop.createWindow({
                id: 'favo-win',
                title: 'favorite',
                width:640,
                height:480,
                html : '<p>ここにお気に入りが入ります。</p>',
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true
            });
        }
        win.show();
    }
});
