// JavaScript Document
popupStatus = 0;
popupDiv = "#popupform";

	function disablePopupform1()
	{
		if (popupStatus == 1)
		{
			$('#fullbg').fadeOut("slow");
			$(popupDiv).fadeOut("slow");
			$(popupDiv).css("height", "");
			popupStatus = 0;
			$('#popupform').html('');
		}
	}
	disablePopupform = disablePopupform1;
	
	function showPopup1()
	{
		popupDiv = "#popupform";
		$('#fullbg').click(function() { disablePopupform(); } );
		$('#fullbg').css({"opacity": "0.7"});
		$('#fullbg').fadeIn("slow");
		$('#popupform').fadeIn("slow");
		$('#close').click(function () { disablePopupform(); } );
		popupStatus = 1;
	}
	showPopup = showPopup1;
	
	function showEditcopy1()
	{
		popupDiv = "#edittext";
		$('#fullbg').click(function() { disablePopupform(); } );
		$('#fullbg').css({"opacity": "0.7"});
		$('#fullbg').fadeIn("slow");
		$('#edittext').fadeIn("slow");
		centerEdittext();
//		$('#close').click(function () { disablePopupform(); } );
		popupStatus = 1;
	}
	showEditcopy = showEditcopy1;
	
	function centerEdittext1()
	{
		var winW = document.documentElement.clientWidth;
		var winH = document.documentElement.clientHeight;
		var popupW = $('#edittext').width();
		var popupH = $('#edittext').height();
		$('#edittext').css("position", "fixed");
		$('#edittext').css("top", (winH/2)-(popupH/2)-10);
		$('#edittext').css("left", (winW/2)-(popupW/2));
	//  $('#fullbg').css({ "height": winH });
	}
	centerEdittext = centerEdittext1;
	
	function centerPopupform1()
	{
		var winW = document.documentElement.clientWidth;
		var winH = document.documentElement.clientHeight;
		var popupW = $('#popupform').width();
		var popupH = $('#popupform').height();
		$('#popupform').css("position", "fixed");
		$('#popupform').css("top", (winH/2)-(popupH/2)-10);
		$('#popupform').css("left", (winW/2)-(popupW/2));
	//  $('#fullbg').css({ "height": winH });
	}
	centerPopupform = centerPopupform1;
	
	function centerPopupform5001()
	{
		var winW = document.documentElement.clientWidth;
		var winH = document.documentElement.clientHeight;
		var popupW = $('#popupform').width();
		if (popupW > 525) popupW = 525;
		var popupH = $('#popupform').height();
		if (popupH > 500) { popupH = 500; popupW += 10; }
		$('#popupform').css("position", "fixed");
		$('#popupform').css("top", (winH/2)-(popupH/2)-10);
		$('#popupform').css("left", (winW/2)-(popupW/2));
		$('#popupform').css("height", popupH);
		$('#popupform').css("width", popupW);
	//  $('#fullbg').css({ "height": winH });
	}
	centerPopupform500 = centerPopupform5001;
	
	function centerPopupform6001()
	{
		var winW = document.documentElement.clientWidth;
		var winH = document.documentElement.clientHeight;
		var popupW = $('#popupform').width();
		if (popupW > 600) popupW = 625; else popupW = 625;
		var popupH = $('#popupform').height();
		if (popupH > 500) { popupH = 500; } 
		if (popupH < 300) popupH = 310;
		else popupH += 10;
		$('#popupform').css("position", "fixed");
		$('#popupform').css("top", (winH/2)-(popupH/2)-10);
		$('#popupform').css("left", (winW/2)-(popupW/2));
		$('#popupform').css("height", popupH);
		$('#popupform').css("width", popupW);
	//  $('#fullbg').css({ "height": winH });
	}
	centerPopupform600 = centerPopupform6001;
	
	function centerPopupform7501()
	{
		var winW = document.documentElement.clientWidth;
		var winH = document.documentElement.clientHeight;
		var popupW = 775;
		var popupH = 600;
		$('#popupform').css("position", "fixed");
		$('#popupform').css("top", (winH/2)-(popupH/2)-10);
		$('#popupform').css("left", (winW/2)-(popupW/2));
		$('#popupform').css("height", popupH);
		$('#popupform').css("width", popupW);
	//  $('#fullbg').css({ "height": winH });
	}
	centerPopupform750 = centerPopupform7501;

	$(document).keypress(function(e) { if (e.keyCode==27 && popupStatus==1) disablePopupform(); } );

disablePopupform();

