$(document).ready(function(){
	
	$(document).bind('keydown', 'Ctrl+l',function(){
		$(".login").load("Templates/loginform.php");
		$(".login").slideDown("slow");
		$("#user").focus();
		return false;
	}); 

});

// Initiate the Tiny MCE content editor
tinyMCE.init({
	mode : "exact",
	elements : "addPageContent",
	theme : "advanced",
	width : "560",
	height : "400",
	language : "en",
	skin : "o2k7",
	skin_variant : "silver",
	plugins : "paste, preview, youtube, advimage, safari, ibrowser",
	content_css : "style/stylesheet.css",
	extended_valid_elements : "a[name|href|target|title|onclick]",
	theme_advanced_toolbar_align : "left",
	theme_advanced_toolbar_location : "top",
	theme_advanced_buttons1 : "bold,italic,underline, separator, bullist, numlist, separator, undo, redo, separator, link, unlink",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword, cleanup, separator, preview, separator, code",
	theme_advanced_buttons3 : ""
});

// Initiate the Tiny MCE content editor
tinyMCE.init({
	mode : "exact",
	elements : "newsContent",
	theme : "advanced",
	width : "600",
	height : "400",
	language : "en",
	skin : "o2k7",
	skin_variant : "silver",
	plugins : "paste, preview, youtube, advimage, safari, ibrowser",
	content_css : "style/stylesheet.css",
	extended_valid_elements : "a[name|href|target|title|onclick]",
	theme_advanced_toolbar_align : "left",
	theme_advanced_toolbar_location : "top",
	theme_advanced_buttons1 : "bold,italic,underline, separator, bullist, numlist, separator, undo, redo, separator, link, unlink",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword, cleanup, separator, preview, separator, code",
	theme_advanced_buttons3 : ""
});

// Initiate the Tiny MCE content editor
tinyMCE.init({
	mode : "exact",
	elements : "newsShort",
	theme : "advanced",
	width : "600",
	height : "100",
	language : "en",
	skin : "o2k7",
	skin_variant : "silver",
	plugins : "paste, preview, youtube, advimage, safari, ibrowser",
	content_css : "style/stylesheet.css",
	extended_valid_elements : "a[name|href|target|title|onclick]",
	theme_advanced_toolbar_align : "left",
	theme_advanced_toolbar_location : "top",
	theme_advanced_buttons1 : "bold,italic,underline, separator, bullist, numlist, separator, undo, redo, separator, link, unlink, separator, cut,copy,paste,pastetext,pasteword, cleanup",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : ""
});




// Used for inserting a new page or editing a page
function checkPageTitle(title){
	$.post("Modules/MODtitletest.php?title=" + title, {func: "checkPageTitle"}, function(data){
		if(data.response == 'failed'){
			$("#title").addClass("failed");
			$(".checkResponse").html("<p>Deze titel is reeds in gebruik.</p>");
			$(".checkResponse").slideDown("slow");
		}
		else{
			$("#title").removeClass("failed");
			$(".checkResponse").slideUp("fast");
			$(".checkResponse").empty();
		}
	}, "json");
}

function confirmdelete(id){
	var r = confirm("Weet u zeker dat u deze pagina wilt verwijderen?");
	if(r==true){
		window.location="?action=deletepage&id="+id;
	}
	else{
		return;
	}
}
