function openlayoutwin(id,titlewin){
/*
    // tabs for the center
    var tabs = new Ext.TabPanel({
        region: 'center',
        margins:'3 3 3 0', 
        activeTab: 0,
        defaults:{autoScroll:true},    
        items:[{
            title: 'Descrizione',
			autoLoad: 'infowins/wincomplex_descr.php?id='+id
        },{
            title: 'Galleria Fotografica',
			autoLoad: 'infowins/wincomplex_gall.php?id='+id
        //}, {
        //    title: 'box',
		//    xtype: 'box',
		    //autoEl: {tag:'img', src:'foto.jpg'}
		    //
			//xtype:'box', autoEl: 'div', cls:'my-class'
		//	xtype:'box', autoEl: {tag:'blockquote', html:'autoEl is cool!'} // with DomHelper		    
		},{
            title: 'Foto 360gradi',
			//autoLoad: 'infowins/wincomplex_360.php?id='+id
			html: 'id: '+id
        //},{
        //    title: 'Nelle vicinanze',
        //    html: 'id: '+id
        }]
	});
*/
    // tabs for the center
    var descr = new Ext.Panel({
        region: 'center',
        layout:'fit',
        defaults:{autoScroll:true},   
        plain:true,
        items: {
            title: titoloLang[9],
    			  autoLoad: 'infowins/wincomplex_descr.php?id='+id,
            border: false
        }
	});	
    // Panel for the west
    var nav = new Ext.Panel({
        title: titoloLang[10],
        region: 'west',
		autoLoad: 'infowins/wincomplex_info.php?id='+id,
        split: true,
        width: 180,
        collapsible: true,
        margins:'3 0 3 3',
        cmargins:'3 3 3 3'
    });
    var animazione_da = Ext.get('imgdettagli'); /* link approfondimenti */
    var lwin = new Ext.Window({
      animateTarget:animazione_da,
	   	id:'layoutwin',
        title: titlewin,
        closable:true,
        width:530,
        height:350,
        draggable: true,
        //border:false,
        plain:true,
        layout: 'border',
        modal: true,
        //items: [nav, tabs]
        items: [nav, descr]
    });
    lwin.show();	
} 

/* apre/chiude finestra 'opzioniwin' */
     //$("center1").on('activate', function() {
     //      var w = Ext.getCmp('opzioniwin');
     //      w.hidden ? w.show() : w.hide(); 
     //}); 
    /* apre/chiude panel west */
    function toggleWest() {
       var w = Ext.getCmp('west-panel');
       w.collapsed ? w.expand() : w.collapse(); 
    }
    function closeInfoWin() {
       var infowin = Ext.getCmp('infowin');
       if(infowin){
       //infowin.hidden ? infowin.show() : infowin.hide(); 
       infowin.hide();
       }
    }
    /* apre una finestra semplice 
    function opensimplewindow(id,titlewin){
    var win = new Ext.Window({
        id:'infowin',
        //layout:'fit',
        width:350,      
        y: 280,
		    autoHeight: true,
        //height:250,
        draggable: true,
        closable: true,
        resizable: true,
        title: titlewin,
        plain: true,
        modal: true,
		    autoLoad: 'infowins/winsimple.php?id='+id,
		    //html:'<p>cccvvv fsdfa  f.</p>',
        autoScroll:true
  		  //items:[{
              //html:'<p>cccvvv fsdfa  f.</p>',
              //autoLoad: 'finestraprova.php?id='+id,
              //title: 'Sottotitolo',
          //}]     
	});
	win.show();
	}   
*/
    /* apre una finestra semplice */
    function opensimplewindow(ide,titlewin){
		var infowindow = Ext.get('infowinz');
		infowindow.setStyle('display','block');
		infowindow.load({
			url: "infowins/winsimple.php?ide="+ide,
      //params: {ide: "ide", titlewin: "titlewin"}, // or a URL encoded string
			text: '<div class="attendi">'+msgLang[0]+'</div>'
		});
    infowindow.show();
    //infowindow.fadeIn({ duration: 1});
	}   


    /* apre una finestra semplice con la descrizione del percorso selezionato */
    function percorsoWin(id){
		var infowindow = Ext.get('infowinz');
		infowindow.setStyle('display','block');
		infowindow.load({
			url: "infowins/percorsoWin.php?id="+id,
      //params: {ide: "ide", titlewin: "titlewin"}, // or a URL encoded string
			text: '<div class="attendi">'+msgLang[0]+'</div>'
		});
    infowindow.show();
    //infowindow.fadeIn({ duration: 1});
	} 


function updateimg(img,w,h){

		var fotopopup = Ext.get('fotopopup');
		
    //Ext.get('fotopopup').update('');
    Ext.get('fotopopup').setStyle('background', '');  
    Ext.get('fotopopup').setStyle('visibility', 'hidden');  

		fotopopup.load({
			url: 'foto.php?foto='+img+'&opt=gall',
			text: '<br /><b>'+msgLang[1]+'</b>'
		});
    fotopopup.fadeIn({ duration: 1});
    //fotopopup.slideIn('l', { duration: 1 });   
}


function closewin(lastMarker){
		var infowindow = Ext.get('infowinz');
    infowindow.fadeOut(); 
    if(lastMarker){
      map.removeOverlay(lastMarker);
      map.addOverlay(lastMarker);
      var lastMarker=false;
    return lastMarker;
    }   
    //infowindow.ghost('r', { duration: 1 });
}
    function closeOpenInfoWin() {
		  var infowinz = Ext.get('infowinz');
       if(infowinz){
         //infowinz.fadeOut(); 
         infowinz.ghost('t', {
            easing: 'easeOut',
            duration: 1,
            remove: false,
            useDisplay: false
        });
       }else{
        alert('no infowinz!');
       } 
    }
/*
function openinfowin2(titlewin){
    var win = new Ext.Window({
	    closable: true,
	    resizable: true,
      collapsible: true,
      draggable: false,
	    width:220,    
	    minSize: 190,
	    maxSize: 300,
	    autoHeight: true, 
	    //height:450,    
      shadow: false, 
      y: 120,
	    layout:'fit', 
      id:'infos',   
      plain: true,
	    title: 'Informazioni',
  		  items:[{
              id:'infoemerg',   
	            //height:400,   
	            plain: true,
	            autoHeight: true,  
	            hideBorders : true,  
              html: '<p>informazioni</p>'
        }]  	    
	});
	win.show();
  var el = Ext.get('infos');
	el.setStyle('left','');
	el.setStyle('right','10px');
} 
*/
    /* apre popup foto  */
    function fotowin(file,titlewin,w){
    var animazione_da = Ext.get('simpleimg'); /* thumbnail finestra semplice */
    var win = new Ext.Window({
        id:'fotowin',
        layout:'anchor',
        animateTarget:animazione_da,
        //layout: 'fit',
        title: stripslashes(titlewin),
		    autoHeight: true,
		    //autoWidth : true,
        width:w,
        y: 20,  
  	    defaults: {
  	        // applied to each contained panel
  	        bodyStyle: 'margin:0px'
  	    },
        draggable: true,
        plain: true,
        modal: false,
        closable: true,
        border: false,
        resizable: false,
        shadow : true,
        autoLoad: 'foto.php?foto='+file 
        //html:'<img src="foto/big/'+file+'">'    
        //autoLoad: 'foto.php?foto=http://www.galleries.coolios.net/bodyinmind/Maya_in_black_by_BodyinMind/images/05.jpg' 
        //html:'<img src="http://www.galleries.coolios.net/bodyinmind/Maya_in_black_by_BodyinMind/images/04.jpg">' 
	});
	win.show();
	}  
function opengall(id,first,titlewin){
    var descr = new Ext.Panel({
        region: 'center',
        layout:'fit',
        autoScroll:true,   
        plain:true,
        draggable: true,
        width:570,
	    // expandOnShow : true,
        items: {
            id:'fotobig',
            //title: titlewin,
		        autoLoad: 'foto.php?foto='+first+'&opt=gall',
            margins:'3 0 3 3',
            cmargins:'3 3 3 3'
        }
	   });		   
    // Panel for the west
    var nav = new Ext.Panel({
        id:'elencofoto',
        layout:'fit',
        //title: 'Elenco Foto',
        region: 'west',
    		autoLoad: 'infowins/elencofoto.php?id='+id,
        border: false,
        split: true,
        width: 170,
        height:620,  
        autoScroll:true,
        collapsible: true,
        margins:'3 0 3 3',
        cmargins:'3 3 3 3'
    });
    
    var animazione_da = Ext.get('simpleimg'); /* thumbnail finestra semplice */
    var lwin = new Ext.Window({
        animateTarget:animazione_da,
        //layout:'fit',
        layout: 'border',
        y: 20,  
  	    defaults: {
  	        // applied to each contained panel
  	        bodyStyle: 'margin:0px'
  	    },
	   	  id:'descrwin',
        title: titlewin,
        closable:true,
        width:780,
        height:620,  
        //minHeight: 413,
        //border:false,
        plain:true,
        modal: true,
        //items: [nav, tabs]
        items: [nav, descr]
    });
    lwin.show();	 
    //lwin.fadeIn();
}

	
/*	
// apre una finestra con accordion

function openwindowacc(){
    var winacc = new Ext.Window({
	    closable: true,
	    resizable: true,
        draggable: false,
	    //split:true,
	    width:200,        
	    minSize: 150,
	    maxSize: 300,
	    collapsible: true,
	    margins:'0 0 0 5',
	    title: 'Opzioni',
        shadow: false, 
        //x: 210,
        y: 220,
        id:'opzioniwin',
	    layout:'accordion',
	   	autoHeight: true,    
	    defaults: {
	        // applied to each contained panel
	        bodyStyle: 'padding:15px'
	    },
	    layoutConfig: {
	        // layout-specific configs go here
	        titleCollapse: true,
	        animate: true
	    },
	    items: [{
	    	collapsed : true,
	     	autoHeight: true,
	        title:'<b>Zoom</b>',
		    //contentEl: 'west2'
	        html: '<p>Panel content<br>Panel content<br>Panel content<br>Panel content<br>Panel content<br>Panel content<br></p>'
	    },{
	    	collapsed : true,
	     	autoHeight: true,
	        title: 'Cerca',
	        html: '<p>Panel content<br>Panel content<br>Panel content<br>Panel content<br>Panel content<br>Panel content<br></p>'
	    },{
	    	collapsed : true,
	     	autoHeight: true,  
          id:'Altrowin',   
	        title: 'Altro',
	        html: '<p>Panel content!</p>'
	    }]    
	});
	winacc.show();
	} 
*/
