// @Titel:				Anleitungs-System
// @Version:			1.1
// @Filename:			tutorial.js
// @Rev:				2
// @Autor:				Michael (KleenMicha) Schüler
// @letzte Änderung:	03. Oktober 2007

//////////////////////////////////////////////////////////////////////
// Functions for Showing ImagePreview								//
//////////////////////////////////////////////////////////////////////

function picshow(id) {
	target = document.getElementById('preview');
	target.innerHTML='<img src="tutorial_thumb.php?image=tutpics/'+id+'" alt="'+id+' einfügen" onclick="tinyMCE.execCommand(\'mceInsertContent\',false,\'[img]tutpics/'+id+'[/img]\')" title="'+id+' einfügen" />';
}

function picshow_panel(id) {
	document.preview.src = 'tutorial_thumb.php?image=tutpics/'+id;
}

//////////////////////////////////////////////////////////////////////
// Functions for Showing a Box										//
//////////////////////////////////////////////////////////////////////
function showBrowser(id) {
	id = document.getElementById(id);
	id.style.display = (id.style.display == 'none')? 'block' : 'block';
}

//////////////////////////////////////////////////////////////////////
// Functions for Hiding a Box										//
//////////////////////////////////////////////////////////////////////
function hideBrowser(id) {
	id = document.getElementById(id);
	id.style.display = (id.style.display == 'none')? 'none' : 'none';
}

//////////////////////////////////////////////////////////////////////
// Functions for Showing PrintPreview								//
//////////////////////////////////////////////////////////////////////
function printentry(tutid) {
	window.open("tutorial.php?action=print&tutid="+tutid, "print", "toolbar=no,scrollbars=yes,resizable=yes,width=680,height=600");
}

//////////////////////////////////////////////////////////////////////
// Functions for Showing the PDF Document							//
//////////////////////////////////////////////////////////////////////
function pdfentry(tutid) {
	window.open("tutorial.php?action=pdf&tutid="+tutid, "pdf", "toolbar=no,scrollbars=yes,resizable=yes,width=640,height=600");
}

//////////////////////////////////////////////////////////////////////
// Functions for Validating Comment-Text							//
//////////////////////////////////////////////////////////////////////
function validate(theform) {
	if (theform.commenttext.value=="") {
		alert(alert_message);
		theform.commenttext.style.backgroundColor = "#F1BBBB";
		theform.commenttext.style.borderColor = "#E63232";
		return false;
	}
	else return true;
}

//////////////////////////////////////////////////////////////////////
// Functions for Validating Picname									//
//////////////////////////////////////////////////////////////////////
function validate2(theform) {
	if (theform.npicname.value=="") {
		alert(alert_message);
		theform.npicname.style.backgroundColor = "#F1BBBB";
		theform.npicname.style.borderColor = "#E63232";
		return false;
	}
	else return true;
}

//////////////////////////////////////////////////////////////////////
// Functions for Validating Entry-Title								//
//////////////////////////////////////////////////////////////////////
function validate3(theform) {
	if (theform.title.value=="") {
		alert(alert_message);
		theform.title.style.backgroundColor = "#F1BBBB";
		theform.title.style.borderColor = "#E63232";
		return false;
	}
	else return true;
}
