		function submit_close_window_form()

		{

	

			new Ajax.Request('/close_window/form/', {
				method: 'post',
		  		parameters: $('close_window_form').serialize(true),
		  		onSuccess: function(transport){
		      		var response = transport.responseText;
					$('TB_ajaxContent').update(response);      		
		    	},
		  		onFailure: function(){ 
		  			alert("Connection Error. Please Try Again.")
		  		}
			});
		}

		var myclose = false;
		var notclosed = true;
		function ConfirmClose(text)
		{
//			alert("Window is closed  - ");
//			window.showModalDialog("test.htm","name","dialogWidth:255px;dialogHeight:250px");
			if (notclosed) 
			{
				tb_show("Vote","#TB_inline?height=400&width=400&modal=true&inlineId=CloseWindowVote","");
			//	location.href="test.html";
			
			notclosed=false;
			return text;
			} else 
			{
				return;
			}
			if (event.clientY < 0)
			{
				alert("Window is closed 2");
				event.returnValue = 'Any message you want';

			//	setTimeout('myclose=false',100);
				myclose=true;
			}
		}

	/*	function HandleOnClose()
		{
			//if (myclose==true) alert("Window is closed");
			return true;
		}*/
		
		jQuery(document).ready(function() {
			jQuery("a").click(function() {
     			notclosed=false;
   				
   			});
 		});
		 jQuery(document).ready(function() {
			 jQuery("form").submit(function() {
     			notclosed=false;
   				
   			});
 		});