function OpenNewWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=720,height=420')
} 
function OpenChildWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=740,height=450')
}
function OpenLittleWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}
function OpenTinyWin(url, win) {
	popupWin = window.open(url, win, 'menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,dependent=1,width=320,height=240')
}

	function OpenNewsWindow(NewsID){
		window.open("/popupNews.asp?NewsID=" + NewsID,"NewsWindow","Width=550,Height=500,Scrollbars=1,Resizable=yes")
	}
$(document).ready(function(){
	$('a[name=modal]').click(function(e) {
			//Cancel the link behavior
			e.preventDefault();		
			//Get the A tag
			var id = $(this).attr('href');	
				
			
			//Get the screen height and width
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth 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();
	             
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 
	});
	$('.window #close').click(function () { 		
		$("#video-holder").remove();		 
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () { 
		$("#video-holder").remove();
		$(this).hide();
		$('.window').hide();
	});
});