 // --Sekce Kontakt 
function VyplnDotazFormAction()
{					  
	var FormElement = document.getElementById("PosliEmailForm");

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

 //-----------------------------------------------------------------------------------
 
 function VyplnNapisNamFormAction()
{					  
	var FormElement = document.getElementById("PosliEmailForm");
	var ErrorMess = document.getElementById("ErrorMess").value;
	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	var error = false;
	var tmp;

	tmp = document.getElementById("jmeno").value;
	if (tmp == '') error = true;
	tmp = document.getElementById("email").value;
	if (tmp == '') error = true;
	tmp = document.getElementById("predmet").value;
	if (tmp == '') error = true;
	tmp = document.getElementById("mess").value;
	if (tmp == '') error = true;


	if (error){
				Ext.MessageBox.show({
			           title: '',
			           msg: ErrorMess,
			           buttons: Ext.MessageBox.OK,
			           icon: Ext.MessageBox.WARNING
			        });
			    return false;    
	} else {
		if (FormElement != undefined){
			FormElement.action = BASE__URL+'tools/napiste_nam.php?AuthKey=' + NahodneCislo; 	
		}
		return true;
	}
} 

//-----------------------------------------------------------------------------------
 
 function VyplnBlogFormAction()
{					  
	var FormElement = document.getElementById("PosliEmailForm");
	var ErrorMess = document.getElementById("ErrorMess").value;
	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	var error = false;
	var tmp;

	tmp = document.getElementById("jmeno").value;
	if (tmp == '') error = true;
	tmp = document.getElementById("komentar").value;
	if (tmp == '') error = true;



	if (error){
				Ext.MessageBox.show({
			           title: '',
			           msg: ErrorMess,
			           buttons: Ext.MessageBox.OK,
			           icon: Ext.MessageBox.WARNING
			        });
			    return false;    
	} else {
		if (FormElement != undefined){
			FormElement.action = BASE__URL+'tools/blog_komentovat.php?AuthKey=' + NahodneCislo; 	
		}
		return true;
	}
} 
 //-----------------------------------------------------------------------------------
 
 
function VyplnPoslatEmailemFormAction()
{					  
	var FormElement = document.getElementById("PosliEmailForm");
	var email = document.getElementById("email").value;
	var mess = document.getElementById("mess").value;
	var BASEURL = document.getElementById("BASEURL").value;
	
	if (email == '@'){
		Ext.MessageBox.show({
	           title: '',
	           msg: 'Vypňte správný email',
	           buttons: Ext.MessageBox.OK,
	           icon: Ext.MessageBox.WARNING
	        });
		return false;
	}
	if (mess == ''){
		Ext.MessageBox.show({
	           title: '',
	           msg: 'Vypňte krátkou zprávu',
	           buttons: Ext.MessageBox.OK,
	           icon: Ext.MessageBox.WARNING
	        });
		return false;
	}
	
	
	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	
	if (FormElement != undefined){
		FormElement.action = BASEURL + 'tools/send_to_friend.php?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 adresovani(nazev) 
	{
		
		if (navigator.appName.indexOf("Microsoft") != -1) {
	        return window[nazev]
	    }
	    else {
	        return document[nazev]
	    }
	
		
	}
	
function send_to_flash(str) 
	{
		adresovani("flash_view").STF_GO(str);
	}
	


