  function QuickForm(url, jmeno, w, h) {
    Fokus = window.open(url, jmeno,'resizable=0,top=0,left=0,menubar=0,width=' + w + ',height=' + h);
    Fokus.focus()
  }

  function review(number) {
    Fokus = window.open('http://www.pragueholiday.cz/rating/review.php?id='+number+'','review','resizable=1,top=0,left=0,menubar=0,width=400,height=400');
    Fokus.focus()
  }

  function tollfree(url, jmeno, w, h) {
    Fokus = window.open(url, jmeno,'resizable=0,top=20,left=20,menubar=0,width=' + w + ',height=' + h);
    Fokus.focus()
  }

  function cenik() {
    Fokus = window.open('http://www.pragueholiday.net/_pricelist.php?location=pr&HotelID=1','pricelist','resizable=1,top=0,left=0,menubar=0,width=400,height=400');
    Fokus.focus()
  }

  function xmlmap(number) {
    Fokus = window.open('http://www.pragueholiday.cz/maps/?hotelid='+number+'','Map','resizable=0,top=0,left=0,menubar=0,width=400,height=400');
    Fokus.focus()
  }
  
  function menu_image(url) {
  
    image = document.getElementById('load_menu_image');
    if(image) {
     
    data = '<img src='+url+' />';
    image.innerHTML = data;
     
    }
  }
  function zobraz(id) {
    
    sh = document.getElementById(id);
     if(sh) {
       sh.style.display="block";
     }
    
  }
  function schovej(id) {
    
    sh = document.getElementById(id);
     if(sh) {
       sh.style.display="none";
    }
    
  }
  
  var isNN = (navigator.appName.indexOf("Netscape")!=-1);

  function autoTab(input,len, e) {
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  if(input.value.length >= len && !containsElement(filter,keyCode)) {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
  }

  function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}

function checkField(field) {

	if(document.forms['bookingform'][field].value) return true;

}

function checkBookForm1() {

	var msg = '';

	if(!checkField('name')) msg += '\nFirst name';
	if(!checkField('surname')) msg += '\nLast name';
	if(!checkField('email')) msg += '\nE-mail';
	if(!checkField('cnr1') || !checkField('cnr2') || !checkField('cnr3') || !checkField('cnr4')) msg += '\nCredit card number';
	if(!checkField('ccvc')) msg += '\nCVC number';

	if(msg != '') {
		alert('Please fill out this field(s):\n' + msg);
		return false;
	}
}
function checkBookForm0() {

	var msg = '';

	if(!checkField('name')) msg += '\nFirst name';
	if(!checkField('email')) msg += '\nE-mail';
	
	if(msg != '') {
		alert('Please fill out this field(s):\n' + msg);
		return false;
	}
}
function check() {
	var a = document.getElementById('availability')["availablestar[]*"];
	if (!a) { return }

	if (!a.length) {
		a.checked = !a.checked;
	}
	else {
		for (var i=0;i<a.length;i++) {
			a[i].checked = !a[i].checked;
		}
	 }
}

