$(document).ready(function(){
  // Set font size
  if ($.cookie('hel-van_font-size')) {
    $('#rightcol').css('font-size', $.cookie('hel-van_font-size'));
  }

  // Lentoyhtiöt-lista
  $(".lentoyhtiot .lentoyhtio .head, .lentoyhtiot .lentoyhtio .head a").click(function(){
    $(this).parent().find(".moreinfo").toggle("fast");
  }).hover(function(){
    $(this).find(".tunnus").css("visibility", "visible");
    $(this).css("background-color", "#F1F5F9");
  }, function(){
    $(this).find(".tunnus").css("visibility", "hidden");
    $(this).css("background-color", "#FFFFFF");
  });


});

// Text size modify on-the-fly
function text_size(change) {
  new_size = (parseInt($('#rightcol').css('font-size'))+change);
  if(new_size < 12) {
    new_size = 12;
  }
  else if(new_size > 16) {
    new_size = 16;
  }
  $('#rightcol').css('font-size', new_size+'px');
  $.cookie('hel-van_font-size', new_size+'px');
  return false;
}

function getFlashVersion(){ 
  // ie 
  try { 
    try { 
      // avoid fp6 minor version lookup issues 
      // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ 
      var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); 
      try { axo.AllowScriptAccess = 'always'; } 
      catch(e) { return '6,0,0'; } 
    } catch(e) {} 
    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; 
  // other browsers 
  } catch(e) { 
    try { 
      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ 
        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; 
      } 
    } catch(e) {} 
  } 
  return '0,0,0'; 
} 
