function preload_images() 
  {
    img = new Image();
    img.src = "images/menu/cz-activ.jpg";
    img2 = new Image();
    img2.src = "images/menu/de-activ.jpg";
    img3 = new Image();
    img3.src = "images/menu/en-activ.jpg";
  }
  
function image_new_window(src,alt,width,height) {

  var scbr = 'no';
  var w = width;
  var h = height;

  if (width>=(document.body.clientWidth-20)) {
	w = document.body.clientWidth-20;
	scbr = 'yes';
  }

  if (height>=(document.body.clientHeight-20)) {
	h = document.body.clientHeight-20;
        if (w<(document.body.clientWidth-20)) w = w-0+16;
	scbr = 'yes';
  }

  image = window.open('','','left=10,top=10,toolbar=no,width='+w+',height='+h+',resizable=no,scrollbars='+scbr+',status=no,menubar=no,dialog=yes');
  image.focus();
  image.document.write('<html><head><title>::: Nářadí varc s.r.o.:::</title></head><body style="cursor: hand; cursor: pointer; margin: 0px; padding: 0px; background: url(\'images/engine/loading.jpg\') center center no-repeat #ffffff;"><img id="img" src="'+src+'" width="'+width+'" height="'+height+'" alt="'+alt+'" border="0" onClick="window.close();"></body></html>');
  image.document.close();
  
}

function Open_page(source,width,height) {

  page = window.open(source,'','left=100, top=100, toolbar=no, width='+width+', height='+height+', resizable=no, scrollbars=no, status=no');
  page.focus();
  page.document.close();
}

function Open_page_bars(source,width,height) {

  page = window.open(source,'','left=70, top=70, toolbar=no, width='+width+', height='+height+', resizable=no, scrollbars=yes, status=no');
  page.focus();
  page.document.close();
}


function ControlUserStepDisable(hodnota){
  
  var aDisabled;
  var bDisabled;
  
/*  if(document.UserDataFormStep.user_or_firma.value == '2')
    {
      aDisabled=true;
      bDisabled=false;
    }
  
    
  if(document.UserDataFormStep.user_or_firma.value == '1')
    {
      aDisabled=false;
      bDisabled=true;
    }*/
  
  if(hodnota == '2')
    {
      aDisabled=true;
      bDisabled=false;
    }
  
    
  if(hodnota == '1')
    {
      aDisabled=false;
      bDisabled=true;
    }
  
//  alert("aDisabled: "+aDisabled+"<br>bDisabled: "+bDisabled);  
  
	document.UserDataFormStep.user_name.readOnly = aDisabled;
	document.UserDataFormStep.user_surname.readOnly = aDisabled;
	document.UserDataFormStep.user_street.readOnly = aDisabled;
	document.UserDataFormStep.user_city.readOnly = aDisabled;
	document.UserDataFormStep.user_zip.readOnly = aDisabled;
	document.UserDataFormStep.user_telefon.readOnly = aDisabled;
	if(aDisabled == true){
		document.UserDataFormStep.user_name.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.user_surname.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.user_street.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.user_city.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.user_zip.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.user_telefon.style.backgroundColor = '#E8E8E8';
	}
	else{
		document.UserDataFormStep.user_name.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.user_surname.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.user_street.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.user_city.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.user_zip.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.user_telefon.style.backgroundColor = '#F5F5F5';
	}
	
	
	
  document.UserDataFormStep.firma_name.readOnly = bDisabled;
	document.UserDataFormStep.firma_street.readOnly = bDisabled;
	document.UserDataFormStep.firma_city.readOnly = bDisabled;
	document.UserDataFormStep.firma_zip.readOnly = bDisabled;
	document.UserDataFormStep.firma_telefon.readOnly = bDisabled;
	document.UserDataFormStep.firma_ico.readOnly = bDisabled;
	document.UserDataFormStep.firma_dic.readOnly = bDisabled;
	if(bDisabled == true){
	  document.UserDataFormStep.firma_name.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_street.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_city.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_zip.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_telefon.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_ico.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.firma_dic.style.backgroundColor = '#E8E8E8';
	}
	else{
	  document.UserDataFormStep.firma_name.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_street.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_city.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_zip.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_telefon.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_ico.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.firma_dic.style.backgroundColor = '#F5F5F5';
	}

}

function ControlUserDataStepDisable(bDisabled){
	document.UserDataFormStep.deliver_title.readOnly = bDisabled;
	document.UserDataFormStep.deliver_street.readOnly = bDisabled;
	document.UserDataFormStep.deliver_city.readOnly = bDisabled;
	document.UserDataFormStep.deliver_zip.readOnly = bDisabled;
	document.UserDataFormStep.deliver_state.disabled = bDisabled;
	document.UserDataFormStep.deliver_name.readOnly = bDisabled;
	document.UserDataFormStep.deliver_surname.readOnly = bDisabled;
	document.UserDataFormStep.deliver_firma.readOnly = bDisabled;
	
	if(bDisabled == true){
		document.UserDataFormStep.deliver_title.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_street.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_city.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_zip.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_name.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_surname.style.backgroundColor = '#E8E8E8';
		document.UserDataFormStep.deliver_firma.style.backgroundColor = '#E8E8E8';
		
	}
	else{
		document.UserDataFormStep.deliver_title.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_street.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_city.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_zip.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_name.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_surname.style.backgroundColor = '#F5F5F5';
		document.UserDataFormStep.deliver_firma.style.backgroundColor = '#F5F5F5';
		
	}

}

function prepni()
{
  if (document.getElementById('checkbox10').checked == true) 
  {
    ControlUserDataStepDisable(true); 
    document.getElementById('checkbox10').checked = false;
  }
    
  else 
  {
    ControlUserDataStepDisable(false);
    document.getElementById('checkbox10').checked = true;
  }
    
}

function check(cislo)
{
  if (document.getElementById('checkbox'+cislo).checked == true) 
  {
    
    document.getElementById('checkbox'+cislo).checked = false;
  }
    
  else 
  {
    
    document.getElementById('checkbox'+cislo).checked = true;
  }
    
}

