function upravStyl() {
	 var browser = navigator.appName;
winHeight = document.documentElement.clientHeight;
       if (browser=='Opera') {
			winHeight = document.body.clientHeight;
			}		
tabHeight=winHeight-190;
obj = document.getElementById("doctable");
obj.style.height=tabHeight+'px';

}
function jump(targ,selObj,restore,novyLimit,order,limit1,kateg,velikost,vyrobce){ //v3.0
  eval(targ+".location='?limit="+novyLimit+"&order="+order+"&limit1="+limit1+"&vyrobce="+vyrobce+"&velikost="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function jump1(targ,selObj,restore,novyLimit,order,limit1,kateg,vyrobce,velikost){ //v3.0
  eval(targ+".location='?limit="+novyLimit+"&order="+order+"&limit1="+limit1+"&velikost="+velikost+"&vyrobce="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function jump2(targ,selObj,restore,novyLimit,order,limit1,kateg,velikost){ //v3.0
  eval(targ+".location='?limit="+novyLimit+"&order="+order+"&limit1="+limit1+"&kategory="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function Obrazek(id,width,height)
{
	document.write("<div onclick='javascript:history.go(-1)' style='positon:absolute; top:15; background:none; height:"+height+"px; width:"+width+"px'>");
	document.write(id);
	document.write(width);
	document.write(height);
	document.write("</div>");
//	alert('obrazek');
}
function NactiObr() 
{
if (document.images)
{
  pic1= new Image(13,3); 
  pic1.src="images/bgrdld1.jpg"; 
  pic2= new Image(13,3); 
  pic2.src="images/bgrdld2.jpg"; 
  pic3= new Image(6,3); 
  pic3.src="images/bgrdld3.jpg"; 
  pic4= new Image(6,3); 
  pic4.src="images/bgrdld4.jpg"; 
  pic5= new Image(6,6); 
  pic5.src="images/bgrdld5.jpg"; 
  pic6= new Image(6,6); 
  pic6.src="images/bgrdld6.jpg"; 
  pic7= new Image(6,6); 
  pic7.src="images/bgrdld7.jpg"; 
  pic8= new Image(6,6); 
  pic8.src="images/bgrdld9.jpg"; 
  pic10= new Image(590,114); 
  pic10.src="images/bgrdldtop.jpg"; 
  pic11= new Image(251,100); 
  pic11.src="images/dldgroup.gif"; 
  pic12= new Image(270,114); 
  pic12.src="images/dldtop1.jpg"; 
  pic13= new Image(205,2066); 
  pic13.src="images/pozadi.jpg"; 
  pic14= new Image(157,466); 
  pic14.src="images/pozadi_menu.jpg"; 
  pic15= new Image(208,959); 
  pic15.src="images/pozadi_velke.jpg"; 
 
}
}

function WindObr(img, width, height) {
//	alert(height);
//	height=eval(height)+10;
//	width=eval(width)+10;
//	alert(height);
//	alert(img);
	window.open('windobr.php?img='+img+'&amp;height='+height+'&amp;width='+width,'Kalendar', 'height='+height+',width='+width);
}

function ShowDod(elementId) {
//alert('aa');	
d1 = document.getElementById('1');
d2 = document.getElementById('2');
d3 = document.getElementById('3');
d4 = document.getElementById('4');
d5 = document.getElementById('5');
d6 = document.getElementById('6');
d7 = document.getElementById('7');
d8 = document.getElementById('8');
//d4 = document.getElementById('dodaci');
if (d1.style.display=='none') { d1.style.display='';		
}
 else { 
d1.style.display='none'}
if (d2.style.display=='none') { d2.style.display='';		
}
 else { 
d2.style.display='none'}
if (d3.style.display=='none') { d3.style.display='';		
}
 else { 
d3.style.display='none'}
if (d4.style.display=='none') { d4.style.display='';		
}
 else { 
d4.style.display='none'}
if (d5.style.display=='none') { d5.style.display='';		
}
 else { 
d5.style.display='none'}
if (d6.style.display=='none') { d6.style.display='';		
}
 else { 
d6.style.display='none'}
if (d7.style.display=='none') { d7.style.display='';		
}
 else { 
d7.style.display='none'}
if (d8.style.display=='none') { d8.style.display='';		
}
 else { 
d8.style.display='none'}
}

function ChanPass(elementId) {
d1 = document.getElementById('1');
d2 = document.getElementById('2');
d3 = document.getElementById('3');
d4 = document.getElementById('zmenheslo');
if (d1.style.display=='none') { d1.style.display='';		
}
 else { 
d1.style.display='none'}
if (d2.style.display=='none') { d2.style.display='';		
}
 else { 
d2.style.display='none'}
if (d3.style.display=='none') { d3.style.display='';		
}
 else { 
d3.style.display='none'}
}

function AddComment() {
d1 = document.getElementById('formpozn');
d2 = document.getElementById('button');
d1.style.display='';		
d2.style.display='none';
}

function FormDod () {
document.dodaci.firma1.disabled=false;
document.dodaci.firma1.style.border='1px solid #3399CC';
document.dodaci.jmeno1.disabled=false;
document.dodaci.jmeno1.style.border='1px solid #3399CC';
document.dodaci.ulice1.disabled=false;
document.dodaci.ulice1.style.border='1px solid #3399CC';
document.dodaci.mesto1.disabled=false;
document.dodaci.mesto1.style.border='1px solid #3399CC';
document.dodaci.zmenadod.value='Ano';
//document.dodaci.firma1.style.margin-top='2px';

}


function writeCookie() 
{
 var today = new Date();
 var the_date = new Date("December 31, 2023");
 var the_cookie_date = the_date.toGMTString();
 var the_cookie = "users_resolution="+ screen.width ;
 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
 document.cookie=the_cookie
	 
}
function monZob() {
 var browser = navigator.appName
 var verze = parseInt(navigator.appVersion)
 if ((browser == "Microsoft Internet Explorer" & verze >= 4) | (browser == "Netscape" & verze >= 4))
 { 
 sirka = screen.width
 vyska = screen.height
 return sirka;
// document.write("Rozlišení obrazovky: <b>" + sirka + " x " + vyska + "</b><br>");
 }
// else document.write("Tyto vlastnosti nejsou Vaším prohlížecem podporovány");
}
function zmenForm(value, elementId, cal) {
window.parent.document.forms['form1'][elementId].value=value;
window.parent.document.getElementById(cal).style.display='none';
}
function zavriCal(elementId, cal) {
window.parent.document.getElementById(cal).style.display='none';
}
function ShowFirma(elementId) {
d1 = document.getElementById("tdico");
d2 = document.getElementById("tddic");
a=document.objednavka.firma.value.length;
if (a>0) {
d1.style.display='';
d2.style.display='';
}
else {
d1.style.display='none';
d2.style.display='none';
}
}
function ShowSend(elementId) {
d1 = document.getElementById("tdsend");
//alert(document.objednavka.isok.value);
a=document.objednavka.isok.checked;
if (a==true) {
d1.style.visibility='';
document.objednavka.isok.checked==true;
}
else {
d1.style.visibility='hidden';
document.objednavka.isok.checked==false;
}
}
function HidOkres(elementId) {
d1 = document.objednavka.stat1;
d2 = document.getElementById("tdokres1");
d3 = document.getElementById("tdokres2");
//a=document.objednavka.firma.value.length;
document.objednavka.stat2.value=document.objednavka.stat1.value;
if (d1.value=="Česká republika") {
d2.style.display='';
d3.style.display='';
//d2.style.display='';
}
else {
d2.style.display='none';
d3.style.display='none';
//d2.style.display='none';
}
}
function HidOkres2(elementId) {
d1 = document.objednavka.stat2;
d2 = document.getElementById("tdokres2");
//a=document.objednavka.firma.value.length;
if (d1.value=="Česká republika") {
d2.style.display='';
//d2.style.display='';
}
else {
d2.style.display='none';
//d2.style.display='none';
}
}
function valid (co)
{
d1 = document.getElementById(co);
d2 = document.getElementById(co+'false');
a=d1.value.length;
if (a>7) {
d1.style.background='#FFFFFF';
d2.style.display='none';
}
else {
d1.style.background='#DA9EA5';
d2.style.display='';
}
}
function ValZakid(){ 
//d1 = document.getElementById();
document.objednavka.submit();

//);
//  eval("location=''");
//  if (restore) selObj.selectedIndex=0;
}



function findPos() {
obj = document.getElementById("pozice");
d1 = document.getElementById("footimg");
//if (obj.offsetParent) {
var pozice=	screen.height - obj.offsetTop;
if (pozice>260) {
	d1.style.position='absolute';
}
//}
}
function ShowNapoveda() {
d1 = document.getElementById("napoveda");
if (d1.style.visibility=="hidden") {
d1.style.visibility='visible';
//d2.style.display='';
}
else {
d1.style.visibility='hidden';
//d2.style.display='none';
}
}

function ContFormNewUser() {
//	alert(document.uzivatel.povinn_password1.value);
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();
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 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  -->




function Odkaz() {

d1 = document.getElementById('odkaz');
if (d1.style.display=='none') { d1.style.display='';		
}
 else { 
d1.style.display='none'}
}

function checkObj() {
//	alert(document.uzivatel.povinn_password1.value);
//if (document.dodaci.platba.value.length<1) 
//{
b=document.dodaci.platba[0].checked;
d=document.dodaci.platba[1].checked;
c=b+'a'+d+'a';

if (c=='falseafalsea') {
//{ alert(document.dodaci.platba.value);
alert('Vyberte způsob platby');
	return false;
}
else {
	document.dodaci.submit();
return true;
}
}