/****************************************
 * 設定 window 的寬與高
 * Reference: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
 ***************************************/
var pdaWidth = 0, pdaHeight = 0;

function setPDAWindowSize() 
{
  if(window.innerWidth && typeof( window.innerWidth ) == 'number' ) 
  {
  	// alert("Non-IE");
    //Non-IE
    pdaWidth = window.innerWidth;
    pdaHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.offsetWidth || document.documentElement.offsetHeight ) ) 
  {
  	// alert("IE 6+");
    //IE 6+ in 'standards compliant mode'
    pdaWidth = document.documentElement.offsetWidth;
    pdaHeight = document.documentElement.offsetHeight;
  } 
  else if( document.body && ( document.body.offsetWidth || document.body.offsetHeight ) ) 
  {
  	// alert("IE 4");
    //IE 4 compatible
    pdaWidth = document.body.offsetWidth;
    pdaHeight = document.body.offsetHeight;
  }

	// 設定畫面表格的寬度
	var table = document.getElementById("top_level_table");
	if(table)
	{
		table.width = pdaWidth;
	}
	// 設定 logo 的寬度	
	var logo = document.getElementById("logo");

	if(logo && logo.width > pdaWidth )
	{
		logo.width = pdaWidth;
	}
}

/****************************************
 * 設定 window 的寬與高
 * Reference: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
 ***************************************/
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}
