// test na povinne parametry formulare
function checkMe(tf,text,pars)
{
	pole=pars.split(',');
	for(i=0;i<pole.length;i+=2)
	{
		if(eval('typeof  tf.'+pole[i])!='undefined'){
			if(eval('tf.'+pole[i]+'.value')=='')
			{
				alert(pole[(i+1)]+' '+text);
				eval('tf.'+pole[i]+'.focus()');
				return false;
			}
		}
	}
	return true;
}

// nove okno
function previewWindow(url, title)
{
	window.open(url, title, "toolbar=no,status=no,scrollbars=yes,resizable=yes,width=800,height=600");
}

function newwindow(url,title){
	window.open(url, title, "toolbar=yes,status=yes,scrollbars=yes,resizable=yes");
}


// vraci hodnotu z popup okna zpet do formulara
function backToForm(elName, newId, newName){

//	if (window.showModalDialog) {
//		dialogArguments.document.all(dialogArguments.elementFk).value = newId;
//		dialogArguments.document.all(dialogArguments.elementName).innerHTML = newName;
//	} else { //Netscape
		var opnr=window.opener;
		opnr.document.getElementById(elName+'_fk').value=newId;
		opnr.document.getElementById(elName+'_name').innerHTML=newName;	
//	}
	window.setTimeout('window.close()',10);
}

// smaza hodnoty z formulare u tematu 
function deleteFormInput(name){
	document.getElementById(name+'_fk').value='';
	document.getElementById(name+'_name').innerHTML='';
}

// Otevre okno pro vyber souboru (reuse)
function chooseFile(inpId){
//	if (window.showModalDialog) {
//		window.elementFk = inpId+'_fk';
//		window.elementName = inpId+'_name';
//		showModalDialog ("../fileman/files.asp?inpID="+inpId, window, "dialogheight=600px;dialogwidth=800px;status=no;toolbar=no;menubar=no;location=no;resizable=yes;scroll:yes")
//	} else {
		window.open("../fileman/files.asp?inpID="+inpId, 'zipWindow', 'width=800,height=600,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,')
//	}
}