// JavaScript Document
	// increase the default animation speed to exaggerate the effect
	$.fx.speeds._default = 50;
	var name = $( "#kuster_name" ),
		password = $( "#kuster_pw" );
	
	$(function() {
		$( "#dialog" ).dialog({
			autoOpen: false,
			show: "blind",
			hide: "blind",
			modal: true,
			buttons: {
					"OK": function() {
							var username = $("#kuster_user").val();
							var password = $("#kuster_pw").val();
							if ((username == '') || (password == ''))
								{
									$("#warning").html("Benutzername und Kennwort erforderlich !");
								} 
								else
									{
									 $.get("/php/login.php?username="+username+"&password="+password );
									 $( this ).dialog( "close" );
									 location.reload();
									}
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				},
			}
		});
		
		$( "#opener" ).click(function() {
			$( "#dialog" ).dialog( "open" );
			return false;
		});
		
		$('textarea.tinymce').tinymce({
			script_url : '../tiny_mce/tiny_mce.js',
			theme : "advanced",
			language : "de",
			width : "670",
			hight : "400",
			theme_advanced_resizing_max_width : "670",
			plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
			theme_advanced_buttons1 : "save,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,|,sub,sup,|,emotions,|,fullscreen",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
			/* content_css : "kuster/css/screen/basemod_3col.css", */
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js",
		});
		
	});
