$(document).ready(function(){

	// set action to the login name and password field on the top
	$("#form_quicklogin input[name='username']").focus(function(){
		if ($(this).val() == "Benutzername"){
			$(this).val("").css({ color: '#000' });
			if ($("#form_quicklogin input[type='password']").val() == "Passwort"){
				$("#form_quicklogin input[type='password']").val("").css({ color: '#000' });
			}
		}
	});

	$("#form_quicklogin input[type='password']").focus(function(){
		if ($(this).val() == "Passwort"){
			$(this).val("").css({ color: '#000' });
		}
	});

});




/**
 *
 * helper function to display info dialogs
 *
 */
function show_info(message, width){
	$("body").append('<div id="uidialog_info"><p class="ui-state-highlight ui-corner-all" style="padding: 4px; margin: 5px auto; width: '+width+'px; text-align: left;"><span class="ui-icon ui-icon-info fl" style="margin-right: 0.3em;"></span>'+message+'</p></div>');
	$("#uidialog_info").dialog({
		resizable : false, overlay: { opacity: 0.5, background: "#888" }, modal: true, width : (width + 40),
	   	title : 'Aktion erfolgreich!',
	   	close : function(){
	   		$(this).dialog("destroy").remove();
	   	},
		buttons: {
	  		"OK": function(){
	 			$(this).dialog("destroy").remove();
	 		}
	   	}
	});
}




/**
 *
 * helper function to display error dialogs
 *
 */
function show_error(message, width){
	$("body").append('<div id="uidialog_info"><p class="ui-state-error ui-corner-all" style="padding: 4px; width: '+width+'px; margin: 5px auto; text-align: left;"><span class="ui-icon ui-icon-alert fl" style="margin-right: 0.3em;"></span>'+message+'</p></div>');
	$("#uidialog_info").dialog({
		resizable : false, overlay: { opacity: 0.5, background: "#888" }, modal: true, width : (width + 40),
		title : 'Aktion fehlgeschlagen!',
	   	close : function(){
	   		$(this).dialog("destroy").remove();
	   	},
		buttons: {
	  		"OK": function(){
	 			$(this).dialog("destroy").remove();
	 		}
	   	}
	});
}


