/*!
 * Ext JS Library 3.1.1
 * Copyright(c) 2006-2010 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
 
Ext.onReady(function(){
    new Ext.ToolTip({
        target: 'tip1',
        html: 'A very simple tooltip'
    });

    new Ext.ToolTip({
        target: 'ajax-tip',
        width: 400,
        autoLoad: {url: '../meta/tooltip/warning.php'},
        dismissDelay: 15000 // auto hide after 15 seconds
    });
    
    new Ext.ToolTip({
        target: 'copyleft',
        width: 400,
        autoLoad: {url: '../meta/tooltip/copyleft.php'},
        dismissDelay: 15000 // auto hide after 15 seconds
    });
    
    new Ext.ToolTip({
        target: 'cloud',
        width: 400,
        autoLoad: {url: '../meta/tooltip/cloud.php'},
        dismissDelay: 15000 // auto hide after 15 seconds
    });

    new Ext.ToolTip({
        target: 'tip2',
        html: 'Click the X to close me',
        title: 'My Tip Title',
        autoHide: false,
        closable: true,
        draggable:true
    });
    
    new Ext.ToolTip({
        target: 'track-tip',
        title: 'Mouse Track',
        width:200,
        html: 'This tip will follow the mouse while it is over the element',
        trackMouse:true
    });

    new Ext.ToolTip({
        target: 'track-tip1',
        title: 'Manifesto',
        width:360,
        html: null,
        contentEl: 'content-manifesto',
        trackMouse:true
    });
    
        new Ext.ToolTip({
        target: 'track-tip2',
        title: 'Containerz as cloud',
        width:360,
        html: null,
        contentEl: 'content-as_cloud',
        trackMouse:true
    });
    
        new Ext.ToolTip({
        target: 'track-tip3',
        title: 'Containerz as graph',
        width:360,
        html: null,
        contentEl: 'content-as_graph',
        trackMouse:true
    });
    
        new Ext.ToolTip({
        target: 'track-tip7',
        title: 'Containerz as desktop',
        width:360,
        html: null,
        contentEl: 'content-as_desktop',
        trackMouse:true
    });    
    
        new Ext.ToolTip({
        target: 'track-tip4',
        title: 'UpGradZ',
        width:360,
        html: null,
        contentEl: 'content-upgradz',
        trackMouse:true
    });
    
            new Ext.ToolTip({
        target: 'track-tip5',
        title: 'Containerz as timeline',
        width:360,
        html: null,
        contentEl: 'content-as_list',
        trackMouse:true
    });
    
            new Ext.ToolTip({
        target: 'track-tip6',
        title: 'Containerz as tree',
        width:360,
        html: null,
        contentEl: 'content-as_tree',
        trackMouse:true
    });
    
        new Ext.ToolTip({
        target: 'tooltip1985',
        title: 'Autoportraits médiatiques',
        width:360,
        html: null,
        contentEl: 'tooltip-1985',
        trackMouse:true,
        dismissDelay: 18000
    });
        new Ext.ToolTip({
        target: 'tooltip1986a',
        title: '1986',
        width:360,
        html: null,
        contentEl: 'tooltip-1986a',
        trackMouse:true
    });
        new Ext.ToolTip({
        target: 'tooltip1986b',
        title: '1986',
        width:360,
        html: null,
        contentEl: 'tooltip-1986b',
        trackMouse:true
    });
        new Ext.ToolTip({
        target: 'tooltip1988a',
        title: '1988',
        width:360,
        html: null,
        contentEl: 'tooltip-1988a',
        trackMouse:true
    });
        new Ext.ToolTip({
        target: 'tooltip1988b',
        title: '1988',
        width:360,
        html: null,
        contentEl: 'tooltip-1988b',
        trackMouse:true
    });
        new Ext.ToolTip({
        target: 'tooltip1988c',
        title: '1988',
        width:360,
        html: null,
        contentEl: 'tooltip-1988c',
        trackMouse:true
    });
        new Ext.ToolTip({
        target: 'tooltip1989',
        title: '1989',
        width:360,
        html: null,
        contentEl: 'tooltip-1989',
        trackMouse:true
    });
    
    new Ext.ToolTip({        
        title: '<a href="#">About TXO [14]</a>',
        id: 'content-anchor-tip',
        target: 'leftCallout',
        anchor: 'right',
        html: null,
        width: 428,
        autoHide: false,
        closable: true,
		mouseOffset  : [40,40],
        collapsible  : true,
        contentEl: 'content-tip', // load content from the page
        listeners: {
            'render': function(){
                this.header.on('click', function(e){
                    e.stopEvent();
                    Ext.Msg.alert('Link', 'Vers quelque de chose d\'intéréssant. | Link to something interesting.');
                    Ext.getCmp('content-anchor-tip').hide();
                }, this, {delegate:'a'});
            }
        }
    });
    
    new Ext.ToolTip({
        target: 'bottomCallout',
        anchor: 'top',
        anchorOffset: 85, // center the anchor on the tooltip
        html: 'This tip\'s anchor is centered'
    });
    
    new Ext.ToolTip({
        target: 'trackCallout',
        anchor: 'right',
        trackMouse: true,
        html: 'Tracking while you move the mouse'
    });


    Ext.QuickTips.init();


    var form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        layout:'absolute', // au lieu de absolute
        url:'save-form.php',
        defaultType: 'textfield',

        items: [{
            x:0,
            y:0,
            xtype: 'textarea',
            name: 'msg',
            anchor: '100% 100%'  // anchor width and height
        }]
    });

    var window = new Ext.Window({
        //collapsible: true,
        //collapsed: true,
        closable: false,
        width: 150,
        height:80,
        minWidth: 140,
        minHeight: 40,
        autoHeight:true,
        pageX:80,
        pageY:10,
        layout: 'fit',
        plain:false,
        bodyStyle:'padding:4px;background-color:#fff',
        bodyBorder:false,
        buttonAlign:'center',
        html: montest.join('')
        //autoLoad: 'cloud.php',
        //contentEl:'tree'
//items: form
    });

    window.show();
   
});

var  montest = ['<h3><a title="Back to homepage | retour à l\'accueil" href="http://www.txo.bz/">Accueil • Homepage</a></h3>'
];
