 $(window).load( function(){
	//TODO: Attach event handler to form submit event. If there is JavaScript enebled form will not be submitted, but ajax request will be fired
	//TODO: Take data from <input> elements and pass them to the web-service
	$('#password_form').submit( function() {
		//alert($('#username').val());
		//alert($('#pass').val());
		if( $('#username').val() && $('#pass').val() ){
			$.getJSON('index.php?type=333&no_cache=1',{'tx_rhmuarnet_pi2[submitted]':'1','tx_rhmuarnet_pi2[username]':$('#username').val(),'tx_rhmuarnet_pi2[password]':$('#pass').val()},
			function(data){
				//change content of plugin to values generated by plugin
				$(data.whatToChange).html(data.output);
			});
			return false;
		}else{
			/*if($('#username').val()){
				alert('please input pass');
			}else if($('#pass').val()){
				alert('please input username');
			}else{
				alert('please input password and username');
			}*/
			return false;
		}
	});
});