	var download = "";

	printOrWeb = function (file) {
		var id = $('#dialog');  

		//if close button is clicked  
		$('#btn_cancel').click(function (e) {
			$('#mask').hide();
			$('#dialog').hide();  
		});
       
		//if mask is clicked  
		$('#mask').click(function () {  
			$(this).hide();  
			$('#dialog').hide();  
		});

		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});  

		$('#mask').css('opacity',0.8);
		$('#mask').show();

		//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(100);

		download = file;
	}

	printDownload = function () {
			//alert("print " + download + ":" + new Date());  
			window.open(download + '&version=print');
			$('#mask').hide(); 
			$('#dialog').hide();
	}

	webDownload = function () {
			//alert("web " + download + ":" + new Date());  
			window.open(download + '&version=web');
			$('#mask').hide(); 
			$('#dialog').hide();
	}

