function HomeAktKolo(co) {
//	if(co=='3') {
//	fopen('incl/homesoupiska.htm', 'r');
//fread(handle, 10);
window.clearTimeout(casovac);//	}
document.getElementById('nhak1').style.color='white';
document.getElementById('nhak2').style.color='white';
document.getElementById('nhak3').style.color='white';
document.getElementById('nhak'+co).style.color='#CCCCCC';
document.getElementById('aa1').style.display='none';
document.getElementById('aa2').style.display='none';
document.getElementById('aa3').style.display='none';
document.getElementById('aa'+co).style.display='';
	
}
function HomeTab01(co) {
document.getElementById('naht011').style.color='white';
document.getElementById('naht012').style.color='white';
document.getElementById('naht013').style.color='white';
document.getElementById('naht01'+co).style.color='#CCCCCC';
document.getElementById('ba1').style.display='none';
document.getElementById('ba2').style.display='none';
document.getElementById('ba3').style.display='none';
document.getElementById('ba'+co).style.display='';
}

function HomeTab02(co) {
document.getElementById('naht021').style.color='white';
document.getElementById('naht022').style.color='white';
document.getElementById('naht023').style.color='white';
document.getElementById('naht02'+co).style.color='#CCCCCC';
document.getElementById('ca1').style.display='none';
document.getElementById('ca2').style.display='none';
document.getElementById('ca3').style.display='none';
document.getElementById('ca'+co).style.display='';
}
function HomeTab03(co) {
document.getElementById('naht031').style.color='white';
document.getElementById('naht032').style.color='white';
document.getElementById('naht033').style.color='white';
document.getElementById('naht03'+co).style.color='#CCCCCC';
document.getElementById('da1').style.display='none';
document.getElementById('da2').style.display='none';
document.getElementById('da3').style.display='none';
document.getElementById('da'+co).style.display='';
}
function HomeTab04(co) {
document.getElementById('naht041').style.color='white';
document.getElementById('naht042').style.color='white';
document.getElementById('naht043').style.color='white';
document.getElementById('naht04'+co).style.color='#CCCCCC';
document.getElementById('ea1').style.display='none';
document.getElementById('ea2').style.display='none';
document.getElementById('ea3').style.display='none';
document.getElementById('ea'+co).style.display='';
}


function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}
function AnimHome()
{
cas =5000;
if (obr+1==4) obr=1;
else obr++;
document.getElementById('nhak1').style.color='white';
document.getElementById('nhak2').style.color='white';
document.getElementById('nhak3').style.color='white';
document.getElementById('nhak'+obr).style.color='#CCCCCC';
document.getElementById('aa1').style.display='none';
document.getElementById('aa2').style.display='none';
document.getElementById('aa3').style.display='none';
document.getElementById('aa'+obr).style.display='';
casovac=window.setTimeout('AnimHome()',cas);
}

function AnimHomeTab01()
{
cas1 =4000;
if (obra+1==4) obra=1;
else obra++;
/*document.getElementById('naht01').innerHTML='';*/
document.getElementById('ba1').style.display='none';
document.getElementById('ba2').style.display='none';
document.getElementById('ba3').style.display='none';
document.getElementById('ba'+obra).style.display='';
casovac1=window.setTimeout('AnimHomeTab01()',cas1);
}

function AnimHomeTab02()
{
cas2 =4000;
if (obrc+1==4) obrc=1;
else obrc++;
/*document.getElementById('naht01').innerHTML='';*/
document.getElementById('ca1').style.display='none';
document.getElementById('ca2').style.display='none';
document.getElementById('ca3').style.display='none';
document.getElementById('ca'+obrc).style.display='';
casovac2=window.setTimeout('AnimHomeTab02()',cas2);
}
function AnimHomeTab03()
{
cas3 =4000;
if (obrd+1==4) obrd=1;
else obrd++;
/*document.getElementById('naht01').innerHTML='';*/
document.getElementById('da1').style.display='none';
document.getElementById('da2').style.display='none';
document.getElementById('da3').style.display='none';
document.getElementById('da'+obrd).style.display='';
casovac3=window.setTimeout('AnimHomeTab03()',cas3);
}
function AnimHomeTab04()
{
cas4 =4000;
if (obre+1==4) obre=1;
else obre++;
/*document.getElementById('naht01').innerHTML='';*/
document.getElementById('ea1').style.display='none';
document.getElementById('ea2').style.display='none';
document.getElementById('ea3').style.display='none';
document.getElementById('ea'+obre).style.display='';
casovac4=window.setTimeout('AnimHomeTab04()',cas4);
}

function ShowMenu(co) {
aktiv=co;
document.getElementById('menu1').style.display='none';
document.getElementById('menu2').style.display='none';
document.getElementById('menu3').style.display='none';
document.getElementById('menu4').style.display='none';
document.getElementById('menu5').style.display='none';
document.getElementById('menu1_1').style.display='none';
document.getElementById('m1_1').style.color='white';
document.getElementById('m1_1').style.background='#0E1B8D';
document.getElementById('m1_2').style.color='white';
document.getElementById('m1_2').style.background='#0E1B8D';
document.getElementById('m1_3').style.color='white';
document.getElementById('m1_3').style.background='#0E1B8D';
document.getElementById('m1_4').style.color='white';
document.getElementById('m1_4').style.background='#0E1B8D';
document.getElementById('m1_5').style.color='white';
document.getElementById('m1_5').style.background='#0E1B8D';
//document.getElementById('aa3').style.display='none';
document.getElementById('menu'+co).style.display='';
document.getElementById('m1_'+co).style.color='white';
document.getElementById('m1_'+co).style.background='#0066CC';
	
}
function MenuHover (co) {
document.getElementById('m1_'+co).style.color='#0E1B8D';
document.getElementById('m1_'+co).style.background='white';
//if (aktiv==co) 
//document.write(aktiv);
//	}//	do
}
function MenuNorm (co) {
document.getElementById('m1_'+co).style.color='white';
document.getElementById('m1_'+co).style.background='#0E1B8D';
if (aktiv==co) document.getElementById('m1_'+co).style.color='white',
document.getElementById('m1_'+co).style.background='#0066CC';

//	do
}
function ShowMenu1(co) {
document.getElementById('menu1_1').style.display='none';
/*document.getElementById('menu2').style.display='none';
document.getElementById('menu3').style.display='none';
document.getElementById('menu4').style.display='none';
document.getElementById('menu5').style.display='none';*/
//document.getElementById('aa3').style.display='none';
document.getElementById('menu1_'+co).style.display='';
	
}


function AddHracka(teamid) {
	window.open('a-add-hracka.php?teamid='+teamid, 'width=800, height=600, scrollbars=yes');
}



function ContFormNewUser() {
//	alert(document.uzivatel.povinn_password1.value);
if (document.uzivatel.povinn_pjmeno.value.length<1) 
{
	alert('Nezadali jste přihlašovací jméno');
	return false;
}
if (document.uzivatel.povinn_jmeno.value.length<1) 
{
	alert('Nezadali jste jméno');
	return false;
}
if (document.uzivatel.povinn_prijmeni.value.length<1) 
{
	alert('Nezadali jste příjmení');
	return false;
}
if (document.uzivatel.povinn_email.value.length<1) 
{
	alert('Nezadali jste Email');
	return false;
//	else {

//	}
}

if (document.uzivatel.povinn_ulice.value.length<1) 
{
	alert('Nezadali jste adresu');
	return false;
}
if (document.uzivatel.povinn_psc.value.length<1) 
{
	alert('Nezadali jste PSČ');
	return false;
}
if (document.uzivatel.povinn_mesto.value.length<1) 
{
	alert('Nezadali jste město');
	return false;
}
if (document.uzivatel.povinn_password1.value!=document.uzivatel.povinn_password2.value) 
{
	alert('Hesla se neshodují');
	return false;
}
if (document.uzivatel.povinn_password1.value.length<1) 
{
	alert('Neplatné heslo');
	return false;
}
if (document.uzivatel.povinn_password2.value.length<1) 
{
	alert('Neplatné heslo');
	return false;
}

ValidEmail();
ValidJmeno();
return emailCheck(document.uzivatel.povinn_email.value);
/*if (document.uzivatel.povinn_password1.value=='AAA') {
	return true;
else {
	return false;
}
}*/
}

function ValidEmail()
{
var email=	document.uzivatel.povinn_email.value;
//var aaa = emailCheck(document.uzivatel.povinn_email.value);
//alert(aaa);
window.open('validemail.php?email='+email,'Email', 'width=1', 'height=20');
//return check;
}
function ValidJmeno()
{
var email=	document.uzivatel.povinn_pjmeno.value;
//var aaa = emailCheck(document.uzivatel.povinn_email.value);
//alert(aaa);
window.open('validjmeno.php?email='+email,'Email', 'width=1', 'height=20');
//return check;
}


function emailCheck (emailStr) {

var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Emailová adresa není zadána dobře");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Emailová adresa obsahuje nepovolené znaky.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Emailová adresa obsahuje nepovolené znaky.");
return false;
   }
}
if (user.match(userPat)==null) {
alert("Emailová adresa je neplatná.");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("IP adresa není platná");
return false;
   }
}
return true;
}
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("Emailová adresa je neplatná.");
return false;
   }
}
if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("Emailová adresa je neplatná.");
return false;
}
if (len<2) {
alert("Emailová adresa obsahuje nepovolené znaky.");
return false;
}

return true;
}

//  End -->

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->


