function getViewportHeight() {
  if (self.innerHeight) {
    // all except Explorer
    return self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight) {
    // Explorer 6 Strict Mode
    return document.documentElement.clientHeight;
  }
  else if (document.body) {
    // other Explorers
    return document.body.clientHeight;
  }
  
  return 0;
}


function suggestSef(fromId, toId) {
  input = document.getElementById(fromId).value;
  
  temp = input.replace(/[ÅÄåä]/g, 'a');
  temp = temp.replace(/[Öö]/g, 'o');
  temp = temp.toLowerCase();
  temp = temp.replace(/\s/g, '_');
  temp = temp.replace(/[\-_]+/g, '_');
  
  outputField = document.getElementById(toId);
  
  outputField.value = temp.replace(/[^a-z0-9_\-]/g, '');
}

function jq(myid) { 
  return myid.replace(/(:|\.)/g,'\\$1');
}

if (!("console" in window)) {
  window.console = {};
  window.console.log = function() {};
}
