jQuery(function() {
//document.observe('dom:loaded', function() {
  $$('.ajaxwindow').each(function(element) {    
    
                          
    $(element).onclick = function() {
                          
        var src_path = element.down("input"); 
        winHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight);
        //src_path = element.down("input");
        
        var win = new Window(element.id, {
                                           className: "alphacube"
                                         , title: element.title
                                         , width : ($$(".container")[0].getWidth() + 20)
                                         , height: (winHeight * 80 / 100)
                                         , maximizable: true
                                         , minimizable: false
                                         , url: $F(src_path)
    //                                     , OnDestroy : function() { Dialog.info("Test of info panel, it will close <br>in 3s ...", {width:250, height:100, showProgress: true}); Dialog.show(); }
                                         //, OnClose: function() { /*Dialog.closeInfo();*/  window.location.reload(); }
                    });
       
        win.setCloseCallback( function() {  window.location.reload(); });
        win.setDestroyOnClose(); 
//    pluto = new Ajax.Request(pippo[0].value, { onComplete: function(transport) { win.setContent(transport.request, true, ture); } });
    
    //win.setAjaxContent(pippo[0].value, { onComplete: function(transport) { pluto =  transport.responseText; win.updateHeight();  win.updateWidth(); win.show();   } }, true);
    
    

    
    
  //  win.setHTMLContent(pluto.responseText);
//    win.updateHeight();  win.updateWidth();
        win.showCenter(true);  

    };
   

  });
});  
