
if(dom.browser()=='ie') {
  dom.loadStyle('css/ie.css');
}

function loadSameMovie() {
};
function fixFooter() {
  var avail_h = dom.getViewportDimensions().height;
  var page_h = dom.el('pageholder').offsetHeight;
  if(page_h < avail_h) {
    dom.el('pageholder').style.height = '100%';
    dom.el('page').style.height = '100%';
    dom.el('footer').style.position = 'absolute';
    dom.el('footer').style.bottom = '0px';
  } else {
    dom.el('pageholder').style.height = 'auto';
    dom.el('page').style.height = 'auto';
    dom.el('footer').style.position = 'static';
  }
}
/*
dom.addEvent(window,'load',fixFooter);
dom.addEvent(window,'resize',fixFooter);
*/

function popup(url,w,h) {
   if(!w) w=400;
   if(!h) h=350;
   if(screen.width) x = (screen.width-w)/2;
   if(screen.height) y = (screen.height-h)/2;
   identity_window=window.open(url, "Check", "width="+w+",height="+h+",resizable=yes"+(x?(",screenX="+x):"")+(y?(",screenY="+y):""));
   identity_window.focus();
   return false;
}

var inputEnterKeyHandler = function() {
  /*
  * watch over text input fields and submit their form, when they are focussed and enter is pressed
  * - problem: selecting autocomplete suggestions with enter key is impossible because the form will be submitted.
  *  - solution: only submit if focus lies on a password field    
  */
 
  var inputs = document.getElementsByTagName('input');
  for (var i=0; i<inputs.length; i++) {
    var inp = inputs[i];
    if(inp['type']=='password'){
      inp.checkKey = function(e) {
        var code;
        if(e && e.which){e = e;code = e.which;}else{e = event;code = e.keyCode;}
        if(code == 13){ if(this.form){this.form.submit();} }
      };
      inp.watchMe = function() {this.onkeyup = this.checkKey};
      inp.unwatchMe = function() {this.onkeyup = null};
      dom.addEvent(inp, 'focus',  inp.watchMe);
      dom.addEvent(inp, 'blur',   inp.unwatchMe);
    }
  }
}
dom.addEvent(window,'load',inputEnterKeyHandler);

function loadPage(url) {
  dom.element('content').innerHTML = '';
  ajaxpage(url+'?time='+new Date().getTime(),'content')
}
function pageLoaded(file) {
//alert('loaded')
  var links = dom.element('navi').getElementsByTagName('a');
  for (var i in links) {
    //alert(links[i].href)
  }
}

