	$(document).ready(function() {
		//get the height and width of the page
		var window_width = $(window).width();
		var window_height = $(window).height();
		
		//vertical and horizontal centering of modal window(s)
		/*we will use each function so if we have more then 1 
		modal window we center them all*/
		$('#popupwindow').each(function(){
			
			//get the height and width of the modal
			var modal_height = $(this).outerHeight();
			var modal_width = $(this).outerWidth();
			
			//calculate top and left offset needed for centering
			var top = (window_height-modal_height)/2;
			var left = (window_width-modal_width)/2;
			
			//apply new top and left css values 
			$(this).css({'top' : top , 'left' : left});
		});
	});


	function Show_Popup(action, userid) {
		$("#popupmask").css({"opacity": "0.3"});
		$("#popupmask").css({"background-color": "#aad61d"});
		$("#popupmask").fadeIn("normal");
		$("#popupwindow").fadeIn("normal");
	}

	function Close_Popup() {
		$("#popupmask").fadeOut("normal");
		$("#popupwindow").fadeOut("normal");
	}

	function Show_Popup_One(name, action, userid) {
		var window_width = $(window).width();
		var window_height = $(window).height();
		$("#"+name+"window").each(function(){
			var modal_height = $(this).outerHeight();
			var modal_width = $(this).outerWidth();
			var top = (window_height-modal_height)/2;
			var left = (window_width-modal_width)/2;
			$(this).css({'top' : top , 'left' : left});
		});
		$("#popupmask").css({"opacity": "0.3"});
		$("#popupmask").css({"background-color": "#aad61d"});
		$("#popupmask").fadeIn("normal");
		$("#"+name+"window").fadeIn("normal");
	}

	function Close_Popup_One(name) {
		$("#popupmask").fadeOut("normal");
		$("#"+name+"window").fadeOut("normal");
	}

