function login() {
	
	email = document.getElementById('login_email').value;
	password = document.getElementById('login_password').value;
	
	if ( email != "" && password != "" )
		$('#login_box').load('/ajax/login.php?email=' + email + '&password=' + password);
	
	setTimeout("window.location.reload()",2000);
}

/*function delete_item(type,id) {
	
	$("#delete_" + type).load('/ajax/delete.php?type=' + type + '&id=' + id);
	$("#delete_" + type + "_" + id).html("<em>Tar bort...</em>");
	
	setTimeout("window.location.reload()",1000);
}*/

function delete_item(u,q) {

	if ( confirm(q) )
		window.location = u;
}

function paging(element,page,start,limit) {
	
	$("#" + element).load('/ajax/' + page + '?start=' + start + '&limit=' + limit);
}

tinyMCE.init({
	mode : "textareas",
	theme : "advanced",
	theme_advanced_toolbar_location:"top",
	theme_advanced_toolbar_align : "left",
	editor_selector : "mceEditor",
	editor_deselector : "mceNoEditor",
	//convert_newlines_to_brs : true,
	media_use_script : true,
	height:400
});