var timer;
var counter_head = "null";
var counter_foot = "null";
var counter_step = 1;
var counter_runtext1 = "null";
var counter_runtext2 = "null";
var width = document.documentElement.clientWidth || window.innerWidth;
var height = document.documentElement.clientHeight || window.innerHeight;
/*
function open_news(year){
  document.getElementById("year_" + year).innerHTML = "";
  document.getElementById("news_" + year).style.display = "block";
}
function redirect(type){
  if(type == "schedule/in") document.location.href = "../schedule/0";
  if(type == "schedule/out") document.location.href = "../schedule/1";
  if(type == "kd_schedule/in") document.location.href = "../flights/in";
  if(type == "kd_schedule/out") document.location.href = "../flights/out";
}
*/
function play(){
  counter_step = 1;
}
function pause(){
  counter_step = 0;
}
function scroll(){
  try{
    var height = document.getElementById("scroll_head").offsetHeight;
    if(counter_head == "null") counter_head = 0;
    if(counter_foot == "null") counter_foot =  - height;
    counter_head += counter_step;
    counter_foot += counter_step;
    if(counter_head >= height){
      counter_head = - (height + counter_foot);
    }
    if(counter_foot >= height){
      counter_foot = - (height + counter_head);
    }
    document.getElementById("scroll_head").style.top = - counter_head + "px";
    document.getElementById("scroll_foot").style.top = - counter_foot + "px";
    setTimeout("scroll()", 100);
  }catch(error){}
}
/*
function search(){
	var from = (document.getElementById("from") ? document.getElementById("from") : document.getElementById("station_from"));
	var to = (document.getElementById("to") ? document.getElementById("to") : document.getElementById("station_to"));
	document.location.href = "../timetable/" + from.value + "-" + to.value;
}
function backSearch(){
  var from = (document.getElementById("to") ? document.getElementById("to") : document.getElementById("station_to"));
  var to = (document.getElementById("from") ? document.getElementById("from") : document.getElementById("station_from"));
  document.location.href = "../timetable/" + from.value + "-" + to.value;
}
function open_city(){
  clearTimeout(timer);
  var width = document.documentElement.clientWidth - 1000;
  if(width < 0) width = 0;
  width = width / 2;
  var citylist = document.getElementById("citylist");
  citylist.style.top = "30px";
  citylist.style.left = width + 540 + "px";
  citylist.style.visibility = "visible";
}
function close_city(){
  timer = setTimeout("hide_city()", 500);
}
function hide_city(){
  clearTimeout(timer);
  var citylist = document.getElementById("citylist");
  citylist.style.visibility = "hidden";
}
function validation(){
  var flag = true;
  if(document.getElementById("name").value.length < 1) flag = false;
  if(document.getElementById("surname").value.length < 1) flag = false;
  if(document.getElementById("nationality").value.length < 1) flag = false;
  if(document.getElementById("citizenship").value.length < 1) flag = false;
  if(document.getElementById("telephone").value.length < 1) flag = false;
  if(document.getElementById("mail").value.length < 1) flag = false;
  if(document.getElementById("doc_number").value.length < 1) flag = false;
  if(document.getElementById('doc_type').value == 2 && document.getElementById('doc_valid').value.length < 1) flag = false;
  return flag;
}
function switchSabre(){
	document.getElementById('sabre_form').style.display='block';
	document.getElementById('voyage_form').style.display='none';
}
function switchVoyage(){
	document.getElementById('sabre_form').style.display='none';
	document.getElementById('voyage_form').style.display='block';
}
*/
