function openModal() {
									//var overlay = document.getElementById("modal_overlay");
									//$(overlay).addClass("model_show");
									//
		//$("div:visible").hide();
		$("#modal_form").addClass("modal");
		$("#modal_overlay").addClass("modal");
		
		
		}
	
function closeModal() {
									//var overlay = document.getElementById("modal_overlay");
									//$(overlay).addClass("model_show");
									//
		//$("div:visible").hide();
		$("#modal_form").removeClass("modal");
		$("#modal_overlay").removeClass("modal");
		
		
		}
	
	
function adjustModalForm()
{
					modal_form_width = 350;
					modal_form_height = 290;
					client_height = document.documentElement.clientHeight;
					client_width = document.documentElement.clientWidth;
					xPos = (client_width / 2) - (modal_form_width / 2);
					xPos = xPos > 0 ? xPos : 0;
					yPos = (client_height / 2) - (modal_form_height / 2);
					yPos = yPos > 0 ? yPos : 0;
					$("#modal_form").css({ top: yPos, left: xPos });
}

function adjustModalBackground()
{
				min_width = 775;
					
					client_height = document.documentElement.clientHeight;
					client_width = document.documentElement.clientWidth;
					scroll_width = document.documentElement.scrollWidth;
					client_width = document.documentElement.clientWidth;
					modal_bg_width = scroll_width > client_width ? client_width : scroll_width;
					modal_bg_width = min_width > modal_bg_width ? min_width : modal_bg_width;
					scroll_height = document.documentElement.scrollHeight;
					client_height = document.documentElement.clientHeight;
					if( $.browser.safari ) {
						scroll_height = document.body.scrollHeight;
						client_height = document.body.clientHeight;
					}
					modal_bg_height = scroll_height > client_height ? scroll_height : client_height;
					
					$("#modal_overlay").css({ height: modal_bg_height, width: modal_bg_width });
}

		
$(document).ready(function(){
					
					
	adjustModalForm();
	adjustModalBackground();
					
});
				
				
		
$(window).resize(function(event) {
					
		adjustModalBackground();				
		adjustModalForm();
				
});
		