
		function submit_form(obj) {
                                /**
                                 * This empties the log and shows the spinning indicator
                                 */
                                var log = $('log_res').empty().addClass('ajax-loading');
                                /**
                                 * send takes care of encoding and returns the Ajax instance.
                                 * onComplete removes the spinner from the log.
                                 */
				$(obj.className).set('send', {
					onComplete: function(response) {
						topdistance = findPageOffset2();
        	                                document.getElementById("fade").style.top = parseInt(topdistance) + "px";
                	                        document.getElementById("log_res").style.top = parseInt(topdistance) + 100 + "px";
                        	                log.addClass('show');
                                	        log.removeClass('ajax-loading');			
                                        	document.getElementById("fade").style.display = "block";
						log.set('html', response);
                                        }
                                });

				$(obj.className).send();

		}

		window.addEvent('domready', function(){

			if(document.getElementById("myForm")) {
			$('myForm').addEvent('submit', function(e) {

				/**
				 * Prevent the submit event
				 */
				new Event(e).stop();

				/**
				 * This empties the log and shows the spinning indicator
				 */
				var log = $('log_res').empty().addClass('ajax-loading');
				/**
				 * send takes care of encoding and returns the Ajax instance.
				 * onComplete removes the spinner from the log.
				 */
				this.set('send', {
					onComplete: function(response) {
						topdistance = findPageOffset2();
        	                                document.getElementById("fade").style.top = parseInt(topdistance) + "px";
                	                        document.getElementById("log_res").style.top = parseInt(topdistance) + 100 + "px";
						log.addClass('show');
						log.removeClass('ajax-loading');
						document.getElementById("fade").style.display = "block";
						setTimeout("document.getElementById('fade').style.display = 'none'; document.getElementById('log_res').className=''",5000);
						log.set('html', response);
					}
				});
	
				this.send();
			});
			}
		}); 

