function fnEmptySubjectBox() {
	document.getElementById("obsah__ctl0__ctl1_boxSubject").value = "";
}


function forumCommentAdd_Check( name, surname, subject, fieldsreq )
{
	if (checkInput(subject)) {
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumCommentAdd_Check1( name, surname, subject, fieldsreq, dropcats )
{
	if (checkInput(subject) && document.getElementById(dropcats).options.selectedIndex > 0) {
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumCommentAdd_Check2( subject, fieldsreq )
{
	if (checkInput(subject)) {
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumCommentAdd_Check21( subject, fieldsreq, dropcats )
{
	if (checkInput(subject) && document.getElementById(dropcats).options.selectedIndex > 0) {
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}



function forumCheckLogin( name, password, namepassreq )
{
	if (checkInput(name) && checkInput(password))
		return true;
	else {
		alert(namepassreq);
		return false;
	}
}

function forumRegister_Check(name, surname, login, pass1, pass2, mail1, lbllogininuse, logininuse, fieldsreq, passsamereq)
{
	//if (checkInput(name) && checkInput(surname) && checkInput(mail1) && checkInput(login) && checkInput(pass1) && checkInput(pass2))
	if (checkInput(mail1) && checkInput(login) && checkInput(pass1) && checkInput(pass2))
	{
		if (document.getElementById(pass1).value != document.getElementById(pass2).value)
		{
			alert(passsamereq);
			return false;
		}
		
		if (checkSpanHasText(lbllogininuse))
		{
			alert(logininuse);
			return false;
		}
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumUpdateRegistration__Check(name, surname, mail, fieldsreq)
{
	if (checkInput(mail))
	{
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumLogin_CheckMailForCredentials(mail)
{
	var value = document.getElementById(mail).value;
	if (value!="" && value!="@")
		return true;
	else
		return false;
}

function forumChangePass_Check(currentpass, newpass1, newpass2, wrongoldpass, fieldsreq, passsamereq)
{
	if (checkInput(currentpass) && checkInput(newpass1) && checkInput(newpass2))
	{
		if (checkSpanHasText(wrongoldpass))
		{
			alert(wrongoldpass);
			return false;
		}
		
		if (document.getElementById(newpass1).value != document.getElementById(newpass2).value)
		{
			alert(passsamereq);
			return false;
		}
		
		return true;
	}
	else {
		alert(fieldsreq);
		return false;
	}
}

function forumPlaceManage_Check(name, droplogin, dropregister, dropcommentadd, dropupdateregistration, dropchangepassword, namereq, articlesreq)
{
	var ok = true;
	var mess = "";
	
	if (!checkInput(name))
	{
		ok = false;
		mess += namereq;
	}
	
	if (!checkSelect(droplogin) || !checkSelect(dropregister) || !checkSelect(dropcommentadd) || !checkSelect(dropupdateregistration) || !checkSelect(dropchangepassword))
	{
		ok = false;
		if (mess!="")
			mess += "\n";
			
		mess += articlesreq;
	}
	
	if (!ok)
		alert(mess);
		
	return ok;
}

function forumCategoryAdd_Check(name, priority, places, namereq, priorityreq, placesreq)
{
	var ok = true;
	var mess = "";
	
	if (!checkInput(name))
	{
		ok = false;
		mess = namereq;
	}
	
	if (!checkSelect(places))
	{
		ok = false;
		if (mess!="")
			mess += "\n";
		mess += placesreq;
	}
	
	if (!checkInput(priority))
	{
		ok = false;
		if (mess!="")
			mess += "\n";
			
		mess += priorityreq;
	}
	
	if (!ok)
		alert(mess);
		
	return ok;
}

function forumCategoryManage_ThreadDetail_GetRadWindow()
{
	var oWindow = null;
	if (window.radWindow) oWindow = window.radWindow;
	else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
	return oWindow;
}

function forumCategoryManage_ThreadDetail_CallBack(radWindow, returnValue)
{
	if (returnValue!="refresh")
		windowRadOpen(returnValue, 'commentupdate', '', 770, 531, 300, 300 );
	else
		GetRadWindowManager().GetWindowById('threaddetail').Reload();
}

function forumCategoryManage_ThreadCommentContextClick(node, itemText)
{
	//	operace pro itemText v češtině (cs-CZ).
	if (itemText=="Upravit") {
		//	otevření nového okna.
		forumCategoryManage_ThreadContext_Edit(node.Value);
	}
	else if (itemText.indexOf("Smazat")!=-1) {
		//	zavolání callbacku.
		forumCategoryManage_ThreadContext_Remove(node.Value);
	}
	
	return true;
}

function forumCategoryManage_ThreadContext_Edit(id)
{
	forumCategoryManage_ThreadDetail_GetRadWindow().CallBack( location.href + '&Update='+id, true );
}

function forumCategoryManage_ThreadContext_Remove(id)
{
	callback_threaddetail.MakeCallback('remove', id);
}

function forumCategoryManage_Check(name, priority, namereq, priorityreq)
{
	var ok = true;
	var mess = "";
	
	if (!checkInput(name))
	{
		ok = false;
		mess = namereq;
	}
	
	if (!checkInput(priority))
	{
		ok = false;
		if (mess!="")
			mess += "\n";
		mess += priorityreq;
	}
	
	if (!ok)
		alert(mess);
	
	return ok;
}