
function xml_check()
{
  this.getValue = function (data,tag_name)
  {
    if (typeof(data)=='object'&&self.checkNode(data, tag_name)&&typeof(data.getElementsByTagName(tag_name).item(0).firstChild)=='object')
      return data.getElementsByTagName(tag_name).item(0).firstChild.data;
    else
    return false;
  }

  this.getNode = function(data,tag_name)
  {
    if (typeof(data)=='object'&&self.checkNode(data, tag_name))
      return data.getElementsByTagName(tag_name).item(0);
    else
      return false;
  }

  this.getNodes = function(data,tag_name)
  {
    if (typeof(data)=='object'&&self.checkNode(data, tag_name))
      return data.getElementsByTagName(tag_name);
    else
      return false;
  }
}

var xml_chk=new xml_check();


String.prototype.trim = function() 
{
   return this.replace(new RegExp("^[\\s]+","g"),"").replace(new RegExp("[\\s]+$","g"),"");
}

Number.prototype.fmt = function(rnd, r_cnt, dot)
{
  if (typeof(rnd)=='undefined'||rnd=='') rnd=false;
  var x_number = this;

  if (rnd!==false)
  {
    with(Math) x_number = round(~~x_number*(i=pow(10,rnd)))/i+(rnd>0?'.'+(i=''+round(x_number*i)).slice(i.length-rnd):'');
  }
  
  if (typeof(r_cnt)=='undefined'||r_cnt=='') r_cnt=false;
  if (typeof(dot)=='undefined'||dot=='') dot='.';
  
  if (r_cnt!==false)
  {
    var xx=x_number.toString();
    var re = new RegExp(/([+-]{0,})[ ]{0,}([0-9]+)(?:\.([0-9]+)|)/ig);
    var re1 = new RegExp("([0-9]{1,"+r_cnt+"})","ig");
    var tmp01='';
    var tmp02='';

    var xx1='';
    var xx2='';

    var res=new Array();
    if ((tmp01= re.exec(xx))!==null)
    {
      for (var i=(tmp01[2].length)-1;i>=0;i--) xx1+=tmp01[2].charAt(i);

      while ((tmp02= re1.exec(xx1))!==null) res[res.length]=tmp02[1];

      xx1='';
      xx2=res.join(' ');
      for (var i=(xx2.length)-1;i>=0;i--) xx1+=xx2.charAt(i);

      xx2='';

      if (rnd!==false&&typeof(tmp01[3])!='undefined')
      {
        xx2=tmp01[3];
        if (xx2.length<rnd) 
          for (var i=xx2.length;i<rnd+1;i++) xx2+='0';
        xx2=dot+xx2;
      }


      return tmp01[1]+xx1+xx2;
    }
  }
  return x_number;
}

Array.prototype.inArray = function(needle) {
  for(var key in this) if(this[key]===needle) return true;
  return false
}

function $(id)
{
  return document.getElementById(id);
}

function setCookie(name, value, expires, path, domain, secure)
{
   var curCookie = name + "=" + escape(value) +
       ((expires) ? "; expires=" + expires.toGMTString() : "") +
       ((path) ? "; path=" + path : "") +
       ((domain) ? "; domain=" + domain : "") +
       ((secure) ? "; secure" : "");
   document.cookie = curCookie;
}

function getCookie(name)
{
   var dc = document.cookie;
   var prefix = name + "=";
   var begin = dc.indexOf("; " + prefix);
   if (begin == -1)
   {
      begin = dc.indexOf(prefix);
      if (begin != 0)
         return null;
   }else
      begin += 2;
      var end = document.cookie.indexOf(";", begin);
      if (end == -1)
         end = dc.length;
   return unescape(dc.substring(begin + prefix.length, end));
}

function scrollToo(pos)
{
  var win = window;

  if (win.document.compatMode && win.document.compatMode == "CSS1Compat")
  {
    var xobj = win.document.documentElement;
  }
  else if(typeof win.pageXOffset != 'undefined')
  {
    var xobj = win.document.getElementsByTagName('body').item(0);
  }
  else
  {
    var xobj = win.document.body;
  }
  xobj.scrollTop=pos;
}

//search  functions

function checkTo(cal,date)
{
  var el=document.getElementById('inputFromDate');

  var date_from=Date.parseDate(el.value,'%Y-%m-%d');
  var date_to=Date.parseDate(date,'%Y-%m-%d');

  if (!runSel(cal, date_from, date_to))
  {
//    alert(langV.getLV('dfrom_lt_dto'));
  }
}

function checkFrom(cal,date)
{
  var el=document.getElementById('inputToDate');

  var date_to=Date.parseDate(el.value,'%Y-%m-%d');
  var date_from=Date.parseDate(date,'%Y-%m-%d');
//  if (!document.getElementById('select1b').checked)
  if (!runSel(cal, date_from, date_to))
  {
     var el1=document.getElementById('inputFromDate');
     el.value=el1.value;
//    alert(langV.getLV('dto_gt_dfrom'));
  }

}

function runSel(cal, date_from, date_to)
{
  var p = cal.params;
  var ok = false;
  
  if (date_from.getFullYear() < date_to.getFullYear() || 
      (date_from.getFullYear() == date_to.getFullYear()&&
       date_from.getMonth() < date_to.getMonth()
      )||
      (date_from.getFullYear() == date_to.getFullYear()&&
       date_from.getMonth() == date_to.getMonth()&&
       date_from.getDate() <= date_to.getDate()
      )
  
     )
    ok=true;

  if ((document.getElementById('select1b').checked)) ok=true;

//  if (ok==true)
  {
    var update = (cal.dateClicked || p.electric);
    if (update && p.inputField) 
    {
      p.inputField.value = cal.date.print(p.ifFormat);
      if (typeof p.inputField.onchange == "function")
      p.inputField.onchange();
    }
    if (update && p.displayArea)
      p.displayArea.innerHTML = cal.date.print(p.daFormat);
    if (update && typeof p.onUpdate == "function")
      p.onUpdate(cal);
    if (update && p.flat) 
    {
      if (typeof p.flatCallback == "function")
      p.flatCallback(cal);
    }
    if (update && p.singleClick && cal.dateClicked)
      cal.callCloseHandler();
  }
  return ok;
}


function s_result(data)
{
  var x_data=data.split("\n");
  document.location.href=x_data[0];
//    alert(langV.getLV('search_errors'));
}

function o_result(data)
{
  var x_data=data.split("\n");
  document.location.href=x_data[0];
}

function s_submit(ff)
{
  var errors=new Array();

  if (ff.elements['from'].value.trim().length==0) 
  {  
//    (false && false) || true && !false
    if((window.pull_from.ajax_obj.noxml_status&&window.pull_from.ajax_obj.noxml_data!==false)||
       (!(window.pull_from.ajax_obj.noxml_status)&&window.pull_from.ajax_obj.noxml_data===false)
      )
      errors[errors.length]=langV.getLV('err_no_from');
    else
      errors[errors.length]=langV.getLV('err_no_from_wait');
  }

  if (ff.elements['to'].value.trim().length==0) 
  {
    if((window.pull_to.ajax_obj.noxml_status&&window.pull_to.ajax_obj.noxml_data!==false)||
       (!(window.pull_to.ajax_obj.noxml_status)&&window.pull_to.ajax_obj.noxml_data===false)
      )
      errors[errors.length]=langV.getLV('err_no_to');
    else
      errors[errors.length]=langV.getLV('err_no_to_wait');
  }

  if (ff.elements['f_date'].value.trim().length==0||disallowDateFrom(Date.parseDate(ff.elements['f_date'].value,'%Y-%m-%d'))) errors[errors.length]=langV.getLV('err_no_date_from');
  if (document.getElementById('select1a').checked&&(ff.elements['t_date'].value.trim().length==0||disallowDateTo(Date.parseDate(ff.elements['t_date'].value,'%Y-%m-%d')))) errors[errors.length]=langV.getLV('err_no_date_to');

  var kids = parseInt(ff.elements['child'].value)+parseInt(ff.elements['infant'].value);
  var adults = parseInt(ff.elements['adult'].value);

  if (kids>adults) errors[errors.length]=langV.getLV('err_too_many_child');

  if (errors.length==0&&ff.elements['to'].value.trim()==ff.elements['from'].value.trim()) errors[errors.length]=langV.getLV('err_from_eq_to');

  if (errors.length==0)
    ff.submit();
//    get_data.sendFormData('search', s_result, 'index.php?a=search', true);
  else
    alert(errors.join('\n'));
  return false;
}

function sp_submit(ff)
{
  var errors=new Array();

  if (ff.elements['name'].value.trim().length==0) errors[errors.length]=langV.getLV('err_no_fl_name');
  if (ff.elements['phone'].value.trim().length==0) errors[errors.length]=langV.getLV('err_no_phone');
  if (ff.elements['email'].value.trim().length==0) errors[errors.length]=langV.getLV('err_no_email');

  if (errors.length==0)
    ff.submit();
  else
    alert(errors.join('\n'));
  return false;
}


//;

function sel_run(data, ss)
{
  ss.array=new Array();
  var xxxx=new Array();
  var re = new RegExp(/(([^\n]+)\n)/ig);
  var sre = new RegExp(/(([^;]+)(;|$))/ig);

  var tmp01=null;
  var el_val=null;
  if (ss.input.getAttribute('id')=='inputFrom') 
  {
    el_val= document.getElementById('h_from');
  }
  if (ss.input.getAttribute('id')=='inputTo')   
  {
    el_val= document.getElementById('h_to');
  }
  while ((tmp01= re.exec(data))!==null)
  {
    var n=xxxx.length;
    xxxx[n]=new Array();
    var tmp02=null;
    xxxx[n]=tmp01[2].split(';');
/*
    while ((tmp02= sre.exec(tmp01[2]))!==null)
    {
      xxxx[n][xxxx[n].length]=tmp02[2];
    }
*/
    var xval=xxxx[n][0];
    var xid=xxxx[n][1];
    var is_ok=xxxx[n][2];
    var is_plus=xxxx[n][3];
    el_val.value=(is_ok=='t'?xid:'');
    ss.array[ss.array.length]={id:xid, val:xval, plus:(is_plus=='t')};
  }
}

function pull_my_draw(arr)
{
  return (arr.plus?'':'<b>['+arr.id+']</b> ')+''+arr.val+''+(arr.plus?' <b>[+]</b>':'');
}

function pull_my_from_select(id)
{
  if (typeof(id)!='undefined'&&id.length>0)
  {
    document.getElementById('h_from').value=id;
  }
  else
   window.pull_from.ajax_req(id);
}

function pull_my_to_select(id)
{
  if (typeof(id)!='undefined'&&id.length>0)
  {
    document.getElementById('h_to').value=id;
  }
  else
   window.pull_to.ajax_req(id);
}

function onchange(obj)
{
//  alert(1);
  if (typeof(obj.input)!='undefined')
  {
//    document.title=document.title+1;
    if (obj.input.getAttribute('id')=='inputFrom') document.getElementById('h_from').value='';
    if (obj.input.getAttribute('id')=='inputTo')   document.getElementById('h_to').value  ='';
  }
}

function checkFormInput(el)
{
  if (el)
  {
    if (el.value.trim().length==0)
    {
      el.className='input err';
      return false;
    }
  }
  else
  {
      return false;

  }
  el.className='input';
  return true;
}

String.prototype.upper_nopl = function ()
{
  var str=this.toUpperCase();
  var diacritics =[
    /[\u00c0-\u00c6\u0100\u0102\u0104]/g, /[\u00e0-\u00e6\u0101\u0103\u0105]/g, // A, a
    /[\u00c8-\u00cb\u0112\u0114\u0116\u0118\u011A]/g, /[\u00e8-\u00eb\u0113\u0115\u0117\u0119\u011B]/g, // E, e
    /[\u00cc-\u00cf]/g, /[\u00ec-\u00ef]/g, // I, i
    /[\u00d2-\u00d6]/g, /[\u00f2-\u00f8]/g, // O, o
    /[\u00d9-\u00dc]/g, /[\u00f9-\u00fc]/g,  // U, u
    /[\u00d1\u0143\u0145\u0147\u014A]/g, /[\u00f1\u0144\u0146\u0148\u0149\u014B]/g, // N, n
    /[\u00c7\u0106\u0108\u010A\u010C]/g, /[\u00e7\u0107\u0109\u010B\u010D]/g, // C, c
    /[\u015A\u015C\u015E\u0160]/g, /[\u015B\u015D\u015F\u0161]/g, // S, s
    /[\u0141]/g, /[\u0142]/g, // L, l
    /[\u0179\u017B\u017D]/g, /[\u017A\u017C\u017E]/g // Z, z
  ];

  var chars = ['A','a','E','e','I','i','O','o','U','u','N','n','C','c','S','s','L','l','Z','z'];

  for (var i = 0; i < diacritics.length; i++)
  {
    str = str.replace(diacritics[i],chars[i]);
  }
  return str;
}

function checkCardForm(tt)
{
  var errors=new Array();

  if (!(checkFormInput(tt.elements['c_f_name']))) errors[errors.length]=langV.getLV('no_c_f_name');
  if (!(checkFormInput(tt.elements['c_l_name']))) errors[errors.length]=langV.getLV('no_c_l_name');
  if (!(tt.elements['c_type'])||(tt.elements['c_type']&&parseInt(tt.elements['c_type'].value)==0)) errors[errors.length]=langV.getLV('no_c_type');
  if (!(checkFormInput(tt.elements['c_num']))) errors[errors.length]=langV.getLV('no_c_num');

  if (!(tt.elements['c_v_year'])||(tt.elements['c_v_year']&&(parseInt(tt.elements['c_v_year'].value)==0||isNaN(parseInt(tt.elements['c_v_year'].value))))) errors[errors.length]=langV.getLV('no_c_v_year');
  if (!(tt.elements['c_v_month'])||(tt.elements['c_v_month']&&(parseInt(tt.elements['c_v_month'].value)==0||isNaN(parseInt(tt.elements['c_v_month'].value))))) errors[errors.length]=langV.getLV('no_c_v_month');

  if (errors.length>0)
  {
    $('a_div_r').style.display='';
    $('a_head_r').innerHTML=langV.getLV('all_errors');
    $('a_txt_r').innerHTML=errors.join("<br/>");
    scrollToo(0);
    return false;
  }
  else
    return true;
}

function checkStartForm(tt, acnt, ccnt, icnt)
{
  var errors=new Array();

  for (var i=0; i<acnt; i++)
  {
    if (!(checkFormInput(tt.elements['adult['+i+'][a_title]'])))      errors[errors.length]=langV.getLV('no_sex_for_a')+(i+1);
    if (!(checkFormInput(tt.elements['adult['+i+'][a_first_name]']))) errors[errors.length]=langV.getLV('no_f_name_for_a')+(i+1);
    if (!(checkFormInput(tt.elements['adult['+i+'][a_last_name]'])))  errors[errors.length]=langV.getLV('no_l_name_for_a')+(i+1);
  }

  for (var i=0; i<ccnt; i++)
  {
    if (!(checkFormInput(tt.elements['child['+i+'][c_title]'])))      errors[errors.length]=langV.getLV('no_sex_for_c')+(i+1);
    if (!(checkFormInput(tt.elements['child['+i+'][c_first_name]']))) errors[errors.length]=langV.getLV('no_f_name_for_c')+(i+1);
    if (!(checkFormInput(tt.elements['child['+i+'][c_last_name]'])))  errors[errors.length]=langV.getLV('no_l_name_for_c')+(i+1);


    if (tt.elements['child['+i+'][c_birth][y]']&&
        tt.elements['child['+i+'][c_birth][m]']&&
        tt.elements['child['+i+'][c_birth][d]'])
    {
      var x_data=new Date(tt.elements['child['+i+'][c_birth][y]'].value,
                          tt.elements['child['+i+'][c_birth][m]'].value-1, 
                          tt.elements['child['+i+'][c_birth][d]'].value, 0,0,0);
      if (x_data.getFullYear()!=tt.elements['child['+i+'][c_birth][y]'].value||
          x_data.getMonth()!=   tt.elements['child['+i+'][c_birth][m]'].value-1||
          x_data.getDate()!=    tt.elements['child['+i+'][c_birth][d]'].value
         )
      {
         tt.elements['child['+i+'][c_birth][y]'].className=
         tt.elements['child['+i+'][c_birth][m]'].className=
         tt.elements['child['+i+'][c_birth][d]'].className='input err';
         errors[errors.length]=langV.getLV('no_valid_birth_for_c')+(i+1);
      }
      else
        tt.elements['child['+i+'][c_birth][y]'].className=
        tt.elements['child['+i+'][c_birth][m]'].className=
        tt.elements['child['+i+'][c_birth][d]'].className='input';

    }
    else
    {
       errors[errors.length]=langV.getLV('no_valid_birth_for_c')+(i+1);
    }
  }

  for (var i=0; i<icnt; i++)
  {
    if (!(checkFormInput(tt.elements['infant['+i+'][i_title]'])))      errors[errors.length]=langV.getLV('no_sex_for_i')+(i+1);
    if (!(checkFormInput(tt.elements['infant['+i+'][i_first_name]']))) errors[errors.length]=langV.getLV('no_f_name_for_i')+(i+1);
    if (!(checkFormInput(tt.elements['infant['+i+'][i_last_name]'])))  errors[errors.length]=langV.getLV('no_l_name_for_i')+(i+1);

    if (tt.elements['infant['+i+'][i_birth][y]']&&
        tt.elements['infant['+i+'][i_birth][m]']&&
        tt.elements['infant['+i+'][i_birth][d]'])
    {
      var x_data=new Date(tt.elements['infant['+i+'][i_birth][y]'].value,
                          tt.elements['infant['+i+'][i_birth][m]'].value-1, 
                          tt.elements['infant['+i+'][i_birth][d]'].value, 0,0,0);
      if (x_data.getFullYear()!=tt.elements['infant['+i+'][i_birth][y]'].value||
          x_data.getMonth()!=   tt.elements['infant['+i+'][i_birth][m]'].value-1||
          x_data.getDate()!=    tt.elements['infant['+i+'][i_birth][d]'].value
         )
      {
         tt.elements['infant['+i+'][i_birth][y]'].className=
         tt.elements['infant['+i+'][i_birth][m]'].className=
         tt.elements['infant['+i+'][i_birth][d]'].className='input err';
         errors[errors.length]=langV.getLV('no_valid_birth_for_i')+(i+1);
      }
      else
        tt.elements['infant['+i+'][i_birth][y]'].className=
        tt.elements['infant['+i+'][i_birth][m]'].className=
        tt.elements['infant['+i+'][i_birth][d]'].className='input';
    }
    else
    {
       errors[errors.length]=langV.getLV('no_valid_birth_for_i')+(i+1);
    }

  }

  if (!(checkFormInput(tt.elements['o_f_name']))) errors[errors.length]=langV.getLV('no_o_f_name');
  if (!(checkFormInput(tt.elements['o_l_name']))) errors[errors.length]=langV.getLV('no_o_l_name');
  if (!(checkFormInput(tt.elements['o_email'])))  errors[errors.length]=langV.getLV('no_o_email');

  if ((tt.elements['o_phone_ch'].checked&&!(checkFormInput(tt.elements['o_phone_std'])))||
      (tt.elements['o_phone_ch'].checked==false&&!(checkFormInput(tt.elements['o_phone']))))  errors[errors.length]=langV.getLV('no_o_phone');

  if (tt.elements['paytype'])
  {
    var xcheck=false;
    if (typeof(tt.elements['paytype'].length)=='undefined')
    {
      if (tt.elements['paytype'].checked) {xcheck=true;}
    }
    else
    {
      for(var i=0,n=tt.elements['paytype'].length;i<n;i++)
        if (tt.elements['paytype'][i].checked) {xcheck=true; break;}
    }
    if (!(xcheck))
      errors[errors.length]=langV.getLV('no_paytype_select');      
  }
  else
    errors[errors.length]=langV.getLV('no_paytype_select');      

  if (tt.elements['bill'])
  {
    var xcheck=false;
    for(var i=0,n=tt.elements['bill'].length;i<n;i++)
      if (tt.elements['bill'][i].checked) 
      {
        xcheck=true; 
        if (tt.elements['bill'][i].value=='invoice')
        {
          if (!(checkFormInput(tt.elements['comp_name'])))    errors[errors.length]=langV.getLV('no_comp_name');
          if (!(checkFormInput(tt.elements['comp_address']))) errors[errors.length]=langV.getLV('no_comp_address');
          if (!(checkFormInput(tt.elements['comp_nip'])))     errors[errors.length]=langV.getLV('no_comp_nip');
        }
        
        break;
      }
    if (!(xcheck))
      errors[errors.length]=langV.getLV('no_bill_select');
  }
  else
    errors[errors.length]=langV.getLV('no_paytype_select');      

  if (!(tt.elements['a_chd'])||!(tt.elements['a_chd'].checked))  errors[errors.length]=langV.getLV('no_accept_chd');
  if (!(tt.elements['a_iata'])||!(tt.elements['a_iata'].checked))  errors[errors.length]=langV.getLV('no_accept_iata');
  if (!(tt.elements['a_efly'])||!(tt.elements['a_efly'].checked))  errors[errors.length]=langV.getLV('no_accept_efly');


  if (errors.length>0)
  {
    $('a_div_r').style.display='';
    $('a_head_r').innerHTML=langV.getLV('all_errors');
    $('a_txt_r').innerHTML=errors.join("<br/>");
    scrollToo(0);
    return false;
  }
  else
    return true;
}

function showTip(text)
{
  document.getElementById('tip').innerHTML=text;
  document.getElementById('tip').style.display='block';
}

function hideTip(obj)
{
  document.getElementById('tip').style.display='none';
}

function expire_func()
{
  if (confirm(langV.getLV('connection_expire')+"\n"+langV.getLV('search_again')))
  {
    $('search').submit();
  }

}

function disallowDate(date) 
{
 if (((date.getFullYear() > date_to_cal.y) ||
      (
         date.getFullYear() == date_to_cal.y &&
         date.getMonth()    >  date_to_cal.m-1
      )||
      (
         date.getFullYear() == date_to_cal.y &&
         date.getMonth()    == date_to_cal.m-1 &&
         date.getDate()     >= date_to_cal.d  
      ) 

     )&&
     (!(document.getElementById('select1b').checked)||
     (date.getFullYear() < date_to_cal.y+1 ||
      (
       date.getFullYear() == date_to_cal.y+1 &&
       date.getMonth()    <  date_to_cal.m-1
      )||
      (
       date.getFullYear() == date_to_cal.y+1 &&
       date.getMonth()    == date_to_cal.m-1 &&
       date.getDate()     <= date_to_cal.d  
      )
     ))
    )
 {
   return false;
 }
 return true;
};

function disallowDateFrom(date_from) 
{
  if (!(disallowDate(date_from)))
  {
    if (document.getElementById('select1b').checked) return false;
    return false;
/*
    var el=$('inputToDate');
    var date_to=Date.parseDate(el.value,'%Y-%m-%d');

    if (date_from.getFullYear() < date_to.getFullYear() || 
        (date_from.getFullYear() == date_to.getFullYear()&&
         date_from.getMonth() < date_to.getMonth()
        )||
        (date_from.getFullYear() == date_to.getFullYear()&&
         date_from.getMonth() == date_to.getMonth()&&
         date_from.getDate() <= date_to.getDate()
        )
    
       )
       return false;
*/
  }
  return true;
}

function o_st_phone(tt)
{
  document.getElementById('id_phone_std').style.display = (tt?'':'none');
  document.getElementById('id_phone_mob').style.display = (tt?'none':'');
}

function disallowDateTo(date_to) 
{
  if (!(disallowDate(date_to)))
  {
    var el=$('inputFromDate');
    var date_from=Date.parseDate(el.value,'%Y-%m-%d');
    
    if (date_from.getFullYear() < date_to.getFullYear() || 
        (date_from.getFullYear() == date_to.getFullYear()&&
         date_from.getMonth() < date_to.getMonth()
        )||
        (date_from.getFullYear() == date_to.getFullYear()&&
         date_from.getMonth() == date_to.getMonth()&&
         date_from.getDate() <= date_to.getDate()
        )
    
       )
       return false;
  }
  return true;
}

document.onmousemove = function (ev)
{
  try
  {
    ev=ev || event;
    document.getElementById('tip').style.left=ev.clientX-50+'px';
    document.getElementById('tip').style.top=ev.clientY+15+document.getElementsByTagName('html').item(0).scrollTop+'px';
  } catch (e) {}
}

function func_qic(tt, xev, xtxt)
{
  if (site_loaded) 
    qi.show(tt, tt, {txt:xtxt,fallow:true,ev:xev});
}

function func_qip(tt, xev, xtxt)
{
  if (site_loaded) 
    qi.show(tt, tt, {txt:xtxt,fallow:true,ev:xev});
}

function func_qia(tt, xev, xtxt)
{
  if (site_loaded) 
    qi.show(tt, tt, {txt:xtxt,fallow:true,ev:xev});
}

function func_pos(tt, xev, xtxt)
{
  if (site_loaded) 
    qi.show(tt, tt, {txt:xtxt,fallow:true,ev:xev});
}

function func_qi_off()
{
  if (site_loaded) qi.off(true);
}


var qi, cex, hist, pull_from, pull_to, get_data;
var site_loaded=false;
window.onload=function() 
{
 window.qi = new quick_info({hideTime: -1, vLeft:-10,vTop:20, defCN:'q_info'});
 window.hist = new quick_info({hideTime: -1, defCN:'q_info'});
 window.cex = new quick_info({hideTime: -1, defCN:'q_info'});
 if ($('inputFrom'))
   window.pull_from=new pull_select('inputFrom', [], {add_func:onchange,def:'nsel',sel:'sel', h:100, forced:true, ajax_url:'index.php?a=get_sel_data', ajax_get_params: [{name:'oth', e_id:'h_to'}], draw_func:pull_my_draw, on_select_func: pull_my_from_select, ajax_run:sel_run});
 if ($('inputTo'))
   window.pull_to=new pull_select('inputTo', [], {add_func:onchange,def:'nsel',sel:'sel', h:100, forced:true, ajax_url:'index.php?a=get_sel_data', ajax_get_params: [{name:'oth', e_id: 'h_from'}], draw_func:pull_my_draw, on_select_func: pull_my_to_select, ajax_run:sel_run});
 window.get_data=new getHTML();
 window.site_loaded=true;
 if (!window.onbeforeunload)
  setCookie('panel_id', panel_id); 
}

if (window.onbeforeunload)
  window.onbeforeunload=function () {setCookie('panel_id', panel_id);};
