function checkForm()
{
	if(document.getElementById("jme").value.length < 2)
	{
		alert("Prosíme vyplňte vaše jméno");
		document.location = "#jme";
		document.getElementById("jme").focus();
		return false;
	}
	
	if(document.getElementById("pri").value.length < 2)
	{
		alert("Prosíme vyplňte vaše příjmení");
		document.location = "#pri";
		document.getElementById("pri").focus();
		return false;
	}
	
	
	if(document.getElementById("uli").value.length < 3)
	{
		alert("Prosíme vyplňte ulici");
		document.location = "#uli";
		document.getElementById("uli").focus();
		return false;
	}
		
	if(document.getElementById("cp").value.length < 1)
	{
		alert("Prosíme vyplňte číslo popisné");
		document.location = "#cp";
		document.getElementById("cp").focus();
		return false;
	}
		
	if(document.getElementById("mes").value.length < 3)
	{
		alert("Prosíme vyplňte město");
		document.location = "#mes";
		document.getElementById("mes").focus();
		return false;
	}	
	if(document.getElementById("psc").value.length < 4)
	{
		alert("Prosíme vyplňte PSČ");
		document.location = "#psc";
		document.getElementById("psc").focus();
		return false;
	}
	if(document.getElementById("mail").value.length < 7)
	{
		alert("Prosíme vyplňte váš email");
		document.location = "#mail";
		document.getElementById("mail").focus();
		return false;
	}
	if(document.getElementById("ttel").value.length < 8)
	{
		alert("Prosíme vyplňte váš telefon");
		document.location = "#ttel";
		document.getElementById("ttel").focus();
		return false;
	}
	
	if(document.getElementById("x-podminky").checked == false)
	{
		alert("Prosíme odsouhlaste naše všeobecné obchodní podmínky");
		document.location = "#x-podminky";
		document.getElementById("x-podminky").focus();
		return false;
	}
	
	return true;
}



function showThis(id)
{
	var el=document.getElementById( id );;
	if( el )
	{
		el.style.display=(el.style.display == 'block')? 'none' : 'block';
	}
	return false;
}


function selectDoprava(id, KurzEuro)
{
	toHide();
	showThis( 'd-' + id  );
	
	var text = document.getElementById( 't-' + id ).value;
	var cena = document.getElementById( 'c-' + id ).value;
	var cenaBezDPH = Math.round(cena / 1.20);
	var cenaEUR = Math.round(cena / KurzEuro);
	
	document.getElementById( 'dopravaTxt' ).innerHTML = text;
	document.getElementById( 'dopravaCenaDPH' ).innerHTML = cenaBezDPH + ' Kč';
	document.getElementById( 'dopravaCena' ).innerHTML = cena+ ' Kč';
	
	var EUR = document.getElementById( 'dopravaCenaEur' );
	if(EUR)
		EUR.innerHTML = cenaEUR + ' &euro;';
	
}

function showMontaz( el )
{	
	var str = jQuery.trim ( $(el).val() );
	
	if( 'praha' == str.toLowerCase().match( /praha/i ) )
	{
		// document.getElementById( 'montazInfo' ).style.display = 'block';
		$('#montazInfo').show();
	}
	else
	{
		$('#montazInfo').hide();
	}
}

function toHide()
{	
	var inp = myGetElementsByClassName('hiddenInfo');
	for(i = 0; i < inp.length; i++)
  	{
		inp[i].style.display = 'none';		
  	}
}


function myGetElementsByClassName(classname, node) 
{
	if(!node) 
		node = document.getElementsByTagName("body")[0];
	
	var a = [];
	var re = new RegExp('\\b' + classname + '\\b');
	var els = node.getElementsByTagName("*");
	for(var i=0,j=els.length; i<j; i++)
	if(re.test(els[i].className))a.push(els[i]);
	return a;
}

function switchVyrobce()
{
    $('#vyrobce-txt').toggle('slow');
    return false;
}

function moreCodes()
{
    $('#more-codes-switch').hide();
    $('#more-codes').fadeIn();
    return false;
}




