function login() {
	login_form = $("<form action='/php/login.php' method='post'><table><tr><td>Email</td><td><input type='text' name='email' class='text'/></td></tr><tr><td>Password</td><td><input type='password' name='password' class='text'/></td></tr><tr><td></td><td><input type='Submit' class='button' value='Login'/></td></tr></table></form>").attr("title","Login");
	login_form.ajaxForm({
		beforeSubmit:function() {
			login_form.block({
				css: iPhotoCss,
				message: "Logging in..."
			});	
		}
	});
	login_form.dialog({
		modal: true,
		width:410,
		buttons: {
			Cancel: function() {
				$(this).dialog('close');	
			}
		}
	});
}
iPhotoCss = { 
	border: 'none', 
	padding: '15px', 
	backgroundColor: '#000', 
	'-webkit-border-radius': '10px', 
	'-moz-border-radius': '10px', 
	opacity: .5, 
	color: '#fff' 
}

$(function() {
	
	$("img.help").each(function() {
								
								
	});
	
});

$(function() {
	
	$(".edit_toggle").click(function() {
		$(this).html("<input type=\"text\" value=\""+$(this).html()+"\"/>");
		$(this).removeClass("edit_toggle");
		$(this).click(function(){return true;});
	});
	
	$(".datepicker").datepicker({
			showOn: "button",
			buttonImage: "/images/silk/calendar.png",
			buttonImageOnly: true,
			dateFormat: "yy-mm-dd",
			changeMonth: true,
			changeYear: true
			
	});
	
});

tinymceoptions = {
			
			script_url : '/js/tiny_mce/tiny_mce.js',
			theme : "advanced",
			width: "450px",
			height: "200px"
			}
			
ajaxFormOptions = {
			beforeSubmit: function(a, form, b) {
				if (!form.valid()) {
					return false;	
				}
				form.block();
			},
			success: function(data, b, c, form) {
				 $.pnotify({
					pnotify_title: "Response",
					pnotify_text: data
				});
				form.resetForm();
				form.children(".valid").each(function() {$(this).removeClass("valid");});
				form.children("label.checked").each(function() {$(this).remove();});
				form.unblock();
			}
		};
datePickerOptions = {
			showOn: "button",
			buttonImage: "/images/silk/calendar.png",
			buttonImageOnly: true,
			dateFormat: "yy-mm-dd",
			changeMonth: true,
			changeYear: true
			
		};
function message(message, type) {
	date = new Date();
	message = $("<div id='"+date+"' class='"+type+"'>"+message+"</div>");
	$("#main").prepend(message);
	setTimeout(function() {message.hide("slow");}, 3000);
	
}