function select_jump (targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

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 deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function menu_show()
{
  for (i=0; i<200; i=i+1)
  {
    	  
    if (getCookie('menu'+i))
      document.getElementById('menu'+i).style.display='block';
  }
}

function people_count()
{
  selected_item = document.getElementById('count').selectedIndex;
  n = document.getElementById('count').options[selected_item].value;

  for (i=1; i<=9; i=i+1)
  {
    if(i<=n)
      document.getElementById('people'+i).style.display='block';
    else
      document.getElementById('people'+i).style.display='none';
  }
}


function menu(n){
  if (document.getElementById('menu'+n).style.display=='none')
  {
    document.getElementById('menu'+n).style.display='block';
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    setCookie('menu'+n, "set", now);
    document.getElementById('div'+n).style.backgroundImage='url(images/main/menu_up.gif)';
  }
  else
  {
    document.getElementById('menu'+n).style.display='none';
    deleteCookie('menu'+n);
    document.getElementById('div'+n).style.backgroundImage='url(images/main/menu_down.gif)';
  }
}

function menu_over(n){
  document.getElementById('div'+n).style.backgroundColor='#deeff7';
}

function menu_out(n){
  document.getElementById('div'+n).style.backgroundColor='#f8fdff';
}

function win_open(url, winname, width, height)
{
  popup = window.open(url, winname, "width="+width+", height="+height+", toolbar=0, location=0, directories=0, menubar=0, scrollbars=0, status=0");
  popup.focus();
}

function win_close() 
{
  popup.close();
}

function print_it() { 
  window.print(); 
  return false;
}




function show_open(element) {
  $(element).parent().next().toggle();
  return false;
}

function show_cities(country_id) {
  $('#a_tours > div:visible').hide();
  $('#a_cities > div:visible').hide();
  $('#a_cities'+country_id).toggle();
  $('.a_tc'+country_id).toggle();
   return false;
}

function show_tours(country_id) {
  $('#a_tours > div:visible').hide();
  $('#a_tours'+country_id).toggle();
  return false;
}



function counter (name) {
  if (name == 'Google') {
    document.write('<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-7009227-3"); pageTracker._trackPageview(); } catch(err) {}</script>');
  }
}


