<!--

var base = "menu";
var maxMenuItem = 10;
var timer;
var visible = 0;
var curr_index;
var ids = new Array();
function collapseMenu() {
for (var i=0; i<ids.length; i++) {
var div = document.getElementById(base).getElementsByTagName('div')[2*i+1];
div.style.visibility = "hidden";
var ul = document.getElementById(base).getElementsByTagName('div')[2*i+1].getElementsByTagName('ul')[0];
ul.style.display = "none";
var item = document.getElementById(ids[i]);
item.className = ""; 
}
visible = 0;
}
function showMenu() {
var index = 0;
while (index<ids.length && document.getElementById(ids[index])!=this) {index++}
if (!visible) {
curr_index = index;
timer = setTimeout("writeMenu('"+index+"')",250);
} 
else {	
if (timer) {
clearTimeout(timer);
if (curr_index == index) 
visible = 1;
else {
curr_index = index;
writeMenu(index);
}
}
}
}		
function hideMenu() {
if (visible) {
timer = setTimeout("collapseMenu()",500);
}
else if (timer) {
clearTimeout(timer);
visible = 0;
}
}
function writeMenu(index) {
var el = document.getElementById(base).getElementsByTagName('div')[2*index+1].getElementsByTagName('ul')[0];
if (el.init==null) {
el.init = true;
el.inc = 1;
el.size = -maxMenuItem;
collapseMenu();
el.style.display = "block";
document.getElementById(base).getElementsByTagName('div')[2*index+1].style.visibility = "visible";
document.getElementById(ids[index]).className = "select";
visible = 1;
}
el.style.top = el.size+"em";
el.size += el.inc;
if (el.size<=0)
setTimeout("writeMenu('"+index+"')",50);
else  el.init = null;
}
function focusMenu() {
var index = 0;
while (index<ids.length && document.getElementById(ids[index])!=this) {index++}
curr_index = index;
writeMenu(index);
} 
window.onload = function() {
if (document.getElementById) {
var links = document.getElementById(base).getElementsByTagName('a');
var divs = document.getElementById(base).getElementsByTagName('div');
for (var i=0, j=0; i<links.length; i++) 
if (links[i].getAttribute('id')) {
ids[j] = links[i].getAttribute('id'); j++;  
}
collapseMenu();
for (var i=0; i<links.length; i++) 
if (links[i].getAttribute('id')) {
links[i].onmouseover = showMenu;
links[i].onfocus = focusMenu;
links[i].onmouseout = hideMenu;
} else  links[i].onclick = function() {collapseMenu(); return true;};
for (var i=0; i<2*ids.length; i+=2) {
divs[i+1].getElementsByTagName('ul')[0].onmouseover = function() {if (visible) clearTimeout(timer);}	
divs[i+1].getElementsByTagName('ul')[0].onmouseout = hideMenu;
}	
links[links.length-1].onblur = hideMenu;
}
}



function OpenWindow(url, jmeno, w, h)
    {
        fokus = window.open(url, jmeno, 'resizable=0,top=20,left=20,menubar=0,width=' + w + ',height=' + h);
        fokus.focus()
    }


function MM_jumpMenu(targ,selObj,restore)
	{
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
function RychlyDotaz()
    {
        var jmeno = document.rd.jmeno.value;
        var email = document.rd.email.value;
        var dotaz = document.rd.dotaz.value;
        var delka = email.length;
        var chyba = "", em = 0, tc = 0;
        
        if(jmeno == "")
            {
                chyba += "Není vyplněno jméno. \n";
            }

        if(dotaz == "")
            {
                chyba += "Není vyplněn dotaz. \n";
            } 
        ////////////email//////////
	    
	     if (document.rd.email.value=="")
		    {
		            chyba+="Neni vyplněn e-mail. \n";
		    }
	    else
			{
			for (i=0; i<delka-1; i++)
				{
				if (email.charAt(i)=="@" && i>0 && i<delka-1)
					{
					em=1;
					}
				}	
				if (em!=1)
					{
					        chyba+="Špatná definice e-mailu. \n";
					}
			}            

        ///////////výpis/////////////
	    if(chyba != "")
		    {
		    alert(chyba);
		    return false;
		    }
	       
    }

function Nabidka()
    {
        var typ = document.nabidka.typ.value;
        var druh = document.nabidka.druh.value;
        var obec = document.nabidka.obec.value;
        var popis = document.nabidka.popis.value;
        var jmeno = document.nabidka.jmeno.value;
        var telcislo = document.nabidka.tel.value;
	    var telC = telcislo.length;
        var email = document.nabidka.email.value;
        var delka = email.length;
        var chyba = "", em = 0, tc = 0;
        
        
        if(typ == "")
            {
                chyba += "Musíte zvolit typ nabídky. \n";
            } 
        
        if(druh == "")
            {
                chyba += "Musíte zvolit druh nemovitosti. \n";
            } 
        
        if(obec == "")
            {
                chyba += "Obec musíte vyplnit. \n";
            }
        
        if(popis == "")
            {
                chyba += "Popis musíte vyplnit. \n";
            } 
        
        if(jmeno == "")
            {
                chyba += "Jméno musíte vyplnit. \n";
            } 
        
        /////////// email /////////
        if (email == "")
		    {
		            chyba+="Neni vyplněn e-mail. \n";
		    }
	    else
			{
			for (i=0; i<delka-1; i++)
				{
				if (email.charAt(i)=="@" && i>0 && i<delka-1)
					{
					em=1;
					}
				}	
				if (em!=1)
					{
					        chyba+="Špatná definice e-mailu. \n";
					}
			}            
        
        /////////// telefon /////////
	    if (telcislo == "")
    	    {
                    chyba+="Není vyplněno telefoní číslo. \n";
    	    }
	    else if (isNaN(telcislo))
			    {
			            chyba+="Tel. číslo nesmí obsahovat písmena. \n";
			    }
	    
	    if (telC == 9)
			    {
					    tc=1;			     
			    }
		else if(tc!=1)
			    {	 
				        chyba+="Tel. číslo musí mít 9 číslic. \n";
			    }
                
                
        ///////////výpis/////////////
	    if(chyba != "")
		    {
		    alert(chyba);
		    return false;
		    }                
    
    }

function Poptavka()
    {
        var typ = document.poptavka.typ.value;
        var druh = document.poptavka.druh.value;
        var popis = document.poptavka.popis.value;
        var jmeno = document.poptavka.jmeno.value;
        var telcislo = document.poptavka.tel.value;
	    var telC = telcislo.length;
        var email = document.poptavka.email.value;
        var delka = email.length;
        var chyba = "", em = 0, tc = 0;
        
        
        if(typ == "")
            {
                chyba += "Musíte zvolit typ nabídky. \n";
            } 
        
        if(druh == "")
            {
                chyba += "Musíte zvolit druh nemovitosti. \n";
            } 
        
       
        if(popis == "")
            {
                chyba += "Popis musíte vyplnit. \n";
            } 
        
        if(jmeno == "")
            {
                chyba += "Jméno musíte vyplnit. \n";
            } 
        
        /////////// email /////////
        if (email == "")
		    {
		            chyba+="Neni vyplněn e-mail. \n";
		    }
	    else
			{
			for (i=0; i<delka-1; i++)
				{
				if (email.charAt(i)=="@" && i>0 && i<delka-1)
					{
					em=1;
					}
				}	
				if (em!=1)
					{
					        chyba+="Špatná definice e-mailu. \n";
					}
			}            
        
        /////////// telefon /////////
	    if (telcislo == "")
    	    {
                    chyba+="Není vyplněno telefoní číslo. \n";
    	    }
	    else if (isNaN(telcislo))
			    {
			            chyba+="Tel. číslo nesmí obsahovat písmena. \n";
			    }
	    
	    if (telC == 9)
			    {
					    tc=1;			     
			    }
			    else if(tc!=1)
			    {	 
				        chyba+="Tel. číslo musí mít 9 číslic. \n";
			    }
                
                
        ///////////výpis/////////////
	    if(chyba != "")
		    {
		    alert(chyba);
		    return false;
		    }                
    
    }    
	
// -->
