// JavaScript Document window_size
//--------------------------------------------------------
function initAPI() {
   if (document.images) {
      isCSS = (document.body && document.body.style) ? true : false;
      isW3C = (isCSS && document.getElementById) ? true : false;
      isIE4 = (isCSS && document.all) ? true : false;
      isNN4 = (document.layers) ? true : false;
      isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
   }
}
//--------------------------------------------------------
function getObject(obj) {
   var theObj;
   if (typeof obj == "string") {
      if (isW3C) {
         theObj = document.getElementById(obj);
      } else if (isIE4) {
         theObj = document.all(obj);
      } else if (isNN4) {
         theObj = document.layers(obj).document;
      }
   } else {
      theObj = obj;
   }
   return theObj;
}
//--------------------------------------------------------
window.onload = initAPI;

var x,y;

function w_wh(){
	if (self.innerHeight) {
    x = self.innerWidth;
    y = self.innerHeight;
// IE 6 Strict Mode
} else if (document.documentElement && document.documentElement.clientHeight) {
    x = document.documentElement.clientWidth;
    y = document.documentElement.clientHeight;
// ------------ IE
} else if (document.body) {
    x = document.body.clientWidth;
    y = document.body.clientHeight;
}
}

w_wh();

function div_top(h){
 w_wh();
 t=(y-h)/2;
 if(t<0) t=0;
 return t+"px";
}
function div_left(w){
 w_wh();
 l = (x-w)/2;
 if(l<0) l=0;
 return l+"px";
}
