function setDisplay(id, how) {
	obj = document.getElementById(id);

	if (how == 1) {
		obj.style.display = "block"
	} else {
		obj.style.display = "none"
	}
}


function toggleDisplay(id) 
{
	obj = document.getElementById(id);
      obj.style.display = (obj.style.display == "none" ) ? "block" : "none";
 }		   

function toggleDisplay2(id1, id2) 
{
	obj1 = document.getElementById(id1);
	obj2 = document.getElementById(id2);

      obj1.style.display = "block";
      obj2.style.display = "none";
 }		   




function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }

	return this;
}

function layout() {
	var m = getMiddlePoint();
	var x = new getObj('idxLogin');
	
	x.style.left = m[0] -10;
	x.style.top = 320;
	x.style.visibility = "visible";
	
}

function getMiddlePoint() {
	var sizes = null;
	sizes = getWidthandHeight();
	
	middlePoint = new Array(2);
	middlePoint[0] = sizes[0]/2;
	middlePoint[1] = sizes[1]/2;
	
	return middlePoint;
}


function getWidthandHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  sizes = new Array(2);
  sizes[0] = myWidth;
  sizes[1] = myHeight;
  return sizes;
}

function getBodyWidth() {
	var measures = new Array(2);
	measures = getWidthandHeight();
	return measures[0];
}

function getBodyHeight() {
	var measures = new Array(2);
	measures = getWidthandHeight();
	return measures[1];
}

function openWindow(file, w, h, scrollbar) {
NewWin=window.open(file,'NewWin', 'toolbar=no,status=no,scrollbars='+scrollbar+',width='+w+',height='+h+',left=100, top=0');
}

function openWindow2(file, w, h, scrollbar) {
NewWin2=window.open(file,'NewWin2', 'toolbar=no,status=no,scrollbars='+scrollbar+',width='+w+',height='+h+',left=150, top=50');
}

