// window overlay
spd = 300;
function getWindow(id) {
	console.log($('#'+id));
	$('#'+id).before('<div class="background"></div>').prev('.background')
		.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);
	$('#'+id)//	.append('<div id="window"></div>').find('#window')
		.css({width:'605px',height:'400px',overflow:'hidden',background:'#000000',position:'absolute','z-index':'999',border:'solid #416b87 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);
		
		$('body').bind('click',function(e){
			if ($(e.target).attr('class')=='background')
				closeWindow();
		});
		$(window).bind('resize',function(){
			$('#'+id).css({left:$('body').width()/2-300+'px'});
			//$('#window').css({top:$(window).scrollTop()+50+'px'});
			console.log('moving');
		});
}
function closeWindow() {
	//$('body').find('#window:last').remove();
	$('body').find('.background:last').animate({opacity:'0'},spd)
	.next().hide().prev().remove()
	.end().unbind('click');
	$(window).unbind('resize');
	stepcarousel.autorotate('slider');
}
