﻿


$(document).ready(function() {	
	
	//if close button is clicked
	$('.teamwindow #close').click(function () {
		$('#mask').hide();
		$('.teamwindow').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.teamwindow').hide();
	});			
	
});

function launchwindow(id) {
	
		 
		
        //Get the screen height and width  
         var maskHeight = $(document).height();  
         var maskWidth = $(window).width();  
       
         //Set height and width to mask to fill up the whole screen  
         $('#mask').css({'width':maskWidth,'height':maskHeight});  
           
         //transition effect       
         $('#mask').fadeIn(1000);      
         $('#mask').fadeTo("slow",0.8);   
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
		
		var boxtop = winH/2-$("#"+id).height()/2;
		
		var boxleft = 960/2-$("#"+id).width()/2;
		
		//Set the popup window to center

		$("#"+id).css('top',  boxtop);
		$("#"+id).css('left', boxleft);
		

	
	//alert('window width: '+winW+', box width: '+$("#"+id).width()+", top left: "+boxleft);
	
		//transition effect
		$("#"+id).fadeIn(500); 

}

function closewindow(id) {
		$('#mask').hide();
		$('.teamwindow').hide();
	}
 
 
 
