function VyplnFormAction(skript)
{					  
	var FormElement = document.getElementById("PosliEmailForm");

	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	
	if (FormElement != undefined){
		FormElement.action = baseUrl + 'tools/'+skript+'?AuthKey=' + NahodneCislo; 	
	}
	
}

 //-----------------------------------------------------------------------------------
 
function initializeInputItem( defaultText, elementId ) {
	var value = document.getElementById(elementId).value;
	if (value == defaultText)
		document.getElementById(elementId).value = "";
	else if (value == "")
	    document.getElementById(elementId).value = defaultText;
	return false;    
}  

//-----------------------------------------------------------------------------------
 
function otevriPanel( divId )
{
	div = document.getElementById(divId);
	
	if (div.style.display=='block') {
		document.getElementById(divId).style.display='none';
	} else {
		document.getElementById(divId).style.display='block';
	}
}

//-----------------------------------------------------------------------------------

function VyplnNapisNamFormAction(skript)
{					  
	var FormElement = document.getElementById("PosliEmailForm");

	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	
	jmeno = document.getElementById("jmeno").value;
	email = document.getElementById("email").value;
	mess = document.getElementById("mess").value;
	
	jmenoErr = document.getElementById("ErrJmeno").value;
	emailErr = document.getElementById("ErrEmail").value;
	messErr = document.getElementById("ErrVzkaz").value;
	
	
	if (!jmeno) {
		return ohlaschybu( jmenoErr );
	}
	if (!mess) {
		return ohlaschybu( messErr );
	}
	if (!email) {
		return ohlaschybu( emailErr );
	}
	
	if (FormElement != undefined){
		FormElement.action = BASE__URL + 'tools/'+skript+'?AuthKey=' + NahodneCislo; 	
	}
	
}
//-----------------------------------------------------------------------------------
function ohlaschybu(str){
   Ext.MessageBox.show({
	   title: 'Informace',
	   msg: str,
	   buttons: Ext.MessageBox.OK,
	   icon: Ext.MessageBox.INFO
	});		
	return false;
}