// dva skripty pro barveni okynek

function TR_OnMouseOver(id){
	var tritem = document.getElementById('Row' + id);
	if(tritem.style.backgroundColor != 'red'){
		tritem.style.backgroundColor = 'red';
	}
}

function TR_OnMouseOut(id){
	var tritem =  document.getElementById('Row' + id);
	if(tritem.className == 'Odd') {
		tritem.style.backgroundColor = '#c7c6de';
	}else{
		tritem.style.backgroundColor = 'transparent';
	}
}

//


var httpRequest = new Array();

function OpenPopup(url, width, height, ret){
    var wpop = window.open(url, "", "dependent=yes, menubar=no, location=no, resizable=yes, width=" + width + ", height=" + height + ", toolbar=no, screenX=50, screeny=50, scrollbars=yes" );
	if(ret){
		return wpop;
	}
}

function load_serial(serial_no, term, apart){
	var ser_n = document.getElementById('serial_no');
	ser_n.value = serial_no;
	var pr_n = document.getElementById('price');
	pr_n.value = term;
	var apr_n = document.getElementById('apartman');
	apr_n.value = apart;
}

function OpenPopupPrihlaska(zajezd,termin)
{
	if(OpenPopupPrihlaska.arguments.length > 1)
  {
	 if (OpenPopupPrihlaska.arguments[1] == true) 
   {
	  var wpop = window.open('http://www.worldtravel.cz/stary/?action=popup&objForm=1&pid=' + zajezd + '&bNoL=true', "_blank", "dependent=yes, menubar=no, location=no, resizable=yes, toolbar=no, scrollbars=yes" );
	  return false;
	 }
	}
	OpenPopup('http://www.worldtravel.cz/objednavka.php?zajezd='+zajezd+'&termin='+termin, 670, 650, false);
	return false;
}

function OpenPopupRezervace(zajezd,termin)
{
	OpenPopup('http://www.worldtravel.cz/rezervace.php?zajezd='+zajezd+'&termin='+termin, 670, 650, false);
	return false;
}

function OpenPopupPoznamka(url_param){
	OpenPopup('http://www.worldtravel.cz/stary/?action=popup&poznForm=1&pid=' + url_param, 670, 650, false);
	return false;
}

function TransferPopupInfo(serial_no, term, apart){
	load_serial(serial_no, term, apart);	
	OpenPopup('http://www.worldtravel.cz/stary/?action=popup&objForm=1', 650, 650, false);
	return false;
}

function winH() {
   if (window.innerHeight)
      return window.innerHeight;
   else if(document.documentElement && document.documentElement.clientHeight)
      return document.documentElement.clientHeight;
   else if(document.body && document.body.clientHeight)
      return document.body.clientHeight;
   else
      return null;
}

function winW() {
   if (window.innerWidth)
      return window.innerWidth;
   else if(document.documentElement && document.documentElement.clientWidth)
      return document.documentElement.clientWidth;
   else if(document.body && document.body.clientWidth)
      return document.body.clientWidth;
   else
      return null;
}

function resize(){
	var n_w;
	var n_h;
	var d_w = winW() - 10;
	var d_h = winH() - 10;
	var w_max = screen.availWidth;
	var h_max = screen.availHeight;
	if(d_w < w_max){
		n_w = d_w;
	}else{
		n_w = w_max;
	}
	if(d_h < h_max){
		n_h = d_h;
	}else{
		n_h = h_max;
	}
	window.resizeTo(n_w, n_h);
}

function Menu_OnMouseOver(id){
	var mitem =  document.getElementById('menu_' + id);
	if (mitem.className != 'hSelMenuItem') {
		mitem.className = 'hSelMenuItem';
	} 
}

function Menu_OnMouseOut(id){
	var mitem =  document.getElementById('menu_' + id);
	if (mitem.className != 'hMenuItem') {
		mitem.className = 'hMenuItem';
	} 
}

function TR_OnMouseOver(id){
	var tritem = document.getElementById('Row' + id);
	if(tritem.style.backgroundColor != 'red'){
		tritem.style.backgroundColor = 'red';
	}
}

function TR_OnMouseOut(id){
	var tritem =  document.getElementById('Row' + id);
	if(tritem.className == 'Odd') {
		tritem.style.backgroundColor = '#c7c6de';
	}else{
		tritem.style.backgroundColor = 'transparent';
	}
}