$(document).ready( function() { $('#windowdistribuzioneOpen').bind( 'click', function() { if($('#windowdistribuzione').css('display') == 'none') { $(this).TransferTo( { to:'windowdistribuzione', className:'transferer2', duration: 400, complete: function() { if($('#windowchisiamo').css('display') != 'none') { $('#windowchisiamo').TransferTo( { to:'windowchisiamoOpen', className:'transferer2', duration: 400 } ).hide(); } $('#windowdistribuzione').show(); } } ); } this.blur(); return false; } ); $('#windowdistribuzioneClose').bind( 'click', function() { $('#windowdistribuzione').TransferTo( { to:'windowdistribuzioneOpen', className:'transferer2', duration: 400 } ).hide(); } ); $('#windowdistribuzioneMin').bind( 'click', function() { $('#windowdistribuzioneContent').SlideToggleUp(300); $('#windowdistribuzioneBottom, #windowdistribuzioneBottomContent').animate({height: 10}, 300); $('#windowdistribuzione').animate({height:40},300).get(0).isMinimized = true; $(this).hide(); $('#windowdistribuzioneResize').hide(); $('#windowdistribuzioneMax').show(); } ); $('#windowdistribuzioneMax').bind( 'click', function() { var windowSize = $.iUtil.getSize(document.getElementById('windowdistribuzioneContent')); $('#windowdistribuzioneContent').SlideToggleUp(300); $('#windowdistribuzioneBottom, #windowdistribuzioneBottomContent').animate({height: windowSize.hb + 13}, 300); $('#windowdistribuzione').animate({height:windowSize.hb+43}, 300).get(0).isMinimized = false; $(this).hide(); $('#windowdistribuzioneMin, #windowdistribuzioneResize').show(); } ); $('#windowdistribuzione').Resizable( { minWidth: 200, minHeight: 60, maxWidth: 700, maxHeight: 400, dragHandle: '#windowdistribuzioneTop', handlers: { se: '#windowdistribuzioneResize' }, onResize : function(size, position) { $('#windowdistribuzioneBottom, #windowdistribuzioneBottomContent').css('height', size.height-33 + 'px'); var windowContentEl = $('#windowdistribuzioneContent').css('width', size.width - 25 + 'px'); if (!document.getElementById('windowdistribuzione').isMinimized) { windowContentEl.css('height', size.height - 48 + 'px'); } } } ); } );