﻿function openPopup( url, wdh, hgh)
{
  window.open( url, '_blank', 'width='+(wdh ? wdh : '800')+'px,height='+(hgh ? hgh : '600')+'px,scrollbars=1,resizable=yes');
  return false;
}

//pristup k prvkum kvuli browserum
function objGet(x) {
	if (typeof x != 'string') return x;
	else if (Boolean(document.getElementById)) return document.getElementById(x);
	else if (Boolean(document.all)) return eval('document.all.'+x);
	else return null;
}

//hinty 
function hintOff(name) {
	objGet(name).style.display = 'none';
	}
//hinty
function hintOn(name) {
	objGet(name).style.display = 'block';
	}


		


function zkontroluj_email(adresa)
{
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
  return adresa.search(re) == 0;
}

function zkontroluj_www(wwwadresa)
{
  re = /^[a-z0-9]+[a-z0-9\-]+[a-z0-9]$/;
  return wwwadresa.search(re) == 0;
}


function validate(formular)
{
		
		if (!zkontroluj_www(formular.namev.value))
		{
			alert ("Pole \"www adresa\" je chybně vyplněno!");
			formular.namev.focus();
			return false;
		}
		
		else if (!zkontroluj_email(formular.emailv.value))
		{
			alert ("Pole \"E-mail\" je chybně vyplněno!");
			formular.emailv.focus();
			return false;
		}		
		
		
		
		else if (formular.VOP.checked==false)
		{
			alert ("Musí být zaškrtnuto Souhlasím s podmínkami");
			
			return false;
		}
		else
		return true;
	}
