// window overlay
spd = 300;
function getWindow(html,teamID) {
	$('body').append('<div class="background"></div>').find('.background:last')
		.css('position','absolute').css('top','0').css('left','0').css('z-index','98')
		.css('width','100%').css('height',1800)
		.css('background','#000000').css('opacity',.8).animate({opacity:'0.6'},spd)
		.end()
		.append('<div id="window"></div>').find('#window')
		.css({width:'700px',height:'400px',overflow:'hidden',background:'#063d78',position:'absolute','z-index':'999',border:'solid #615b4e 1px',left:$('body').width()/2-300+'px'})
		//.html(html).css('display','none').animate({height:"show"},spd)
		.html(html).css('display','none').animate({height:"show",width:"show",top:$(window).scrollTop()+100+'px'},spd)
		.end()
		
		.bind('click',function(e){
			if ($(e.target).attr('class')=='background')
				closeWindow();
		});
		$(window).bind('resize',function(){
			$('#window').css({left:$('body').width()/2-300+'px'});
			//$('#window').css({top:$(window).scrollTop()+50+'px'});
			console.log('moving');
		});
		
		$.post('/transfers_screen.php?teamID='+teamID,function(data){
			$('#window').html(data);
		});
}
function closeWindow() {
	$('body').find('#window:last').remove()
	.end().find('.background:last').animate({opacity:'0'},spd).remove()
	.end().unbind('click');
	$(window).unbind('resize');
}
