

// index.js (www.claudiagraef.de)

// Copyright © 2007 Sergej Proskudin, Eugen Rubin

// e-mail: sergej.proskudin[#64]web.de

// Updated on 2007-06-05


var claudia_graef_main_window = true;

var window_width = 0;

var window_height = 0;

var main_table_width = 770;

var main_table_height = 520;



function get_window_width()

{

  if (window.innerWidth) return window.innerWidth;

  if (document.body && document.body.offsetWidth) return document.body.offsetWidth;

  return 0;

}



function get_window_height()

{

  if (window.innerHeight) return window.innerHeight;

  if (document.body && document.body.offsetHeight) return document.body.offsetHeight;

  return 0;

}



function set_main_table_new_position()

{

  if (window_width != get_window_width() || window_height != get_window_height())

  {

    window_width = get_window_width();

    window_height = get_window_height();

    var new_left = window_width - main_table_width;

    new_left -= new_left % 6; new_left /= 2;

    if (new_left < 0) new_left = 0;

    var new_top = window_height - main_table_height;

    new_top -= new_top % 6; new_top /= 2;

    if (new_top < 0) new_top = 0;

    document.getElementById("main").style.left = new_left;

    document.getElementById("main").style.top = new_top;

  }

}



function init()

{

  set_main_table_new_position();

  document.getElementById("loading").style.visibility = "hidden";

  document.getElementById("main").style.visibility = "visible";

  window.onresize = set_main_table_new_position;

}



// end of file

