function apri(prmId) {
	var file = true;
	var titolo = '';
	switch(prmId){
		case 1:
			file='prova_a.html';
			titolo='FINESTRA A';
		break;
		case 2:
			file='prova_b.html';
			titolo='FINESTRA B';
		break;
		default:
			file= false;
		break;
	}
	if($('#window').css('display') == 'none' && file) {
		$('#windowTopContent').html(titolo);
		$('#windowContent').load(file,'a=1', function(){$('#window').show();});
	}
}
function apri2(file,finestra) {

	var file = file;
	var titolo = finestra;
	
	if($('#window').css('display') == 'none' && file) {
		$('#windowTopContent').html(titolo);
		$('#windowContent').load(file,'a=1', function(){$('#window').show();});
	}
}
$(document).ready(
	function(){
		$('#windowClose').bind(
			'click',
			function()
			{
				$('#window').TransferTo(
					{
						to:'windowOpen',
						className:'transferer2', 
						duration: 400
					}
				).hide();
			}
		);
		$('#window').Resizable(
			{
				minWidth: 200,
				minHeight: 60,
				maxWidth: 700,
				maxHeight: 400,
				dragHandle: '#windowTop',
				handlers: {
					se: '#windowResize'
				},
				onResize : function(size, position) {
					$('#windowBottom, #windowBottomContent').css('height', size.height-33 + 'px');
					var windowContentEl = $('#windowContent').css('width', size.width - 25 + 'px');
					if (!document.getElementById('window').isMinimized) {
						windowContentEl.css('height', size.height - 48 + 'px');
					}
				}
			}
		);
	}
);

