function gWH(){
	var e = window, a = 'inner';
	if ( !( 'innerWidth' in window ) ){
		a = 'client';
		e = document.documentElement || document.body;
	}
	return { width : e[ a+'Width' ] , height : e[ a+'Height' ] }
}
// การใช้งาน
// หาความกว้างได้เท่ากับ var DocW=gWH().width;
// หาความสูงได้เท่ากับ var DocH=gWH().height;
//alert(gWH().width);
// แสดงค่าความกว้างของหน้าเพจ
//alert(gWH().height);
// แสดงค่าความสูงของหน้าเพจ

function ResizeTable(){
  var objTable = document.getElementById("maintable") ;
  //objTable.style.width = (screen.width - 20);
  //objTable.style.height = (screen.height - 160);
  objTable.style.width = gWH().width;
  objTable.style.height = gWH().height;
}

function ResizeIframe(){
  var objIframe = document.getElementById("ifmSunday") ;
  //objTable.style.width = (screen.width - 20);
  //objTable.style.height = (screen.height - 160);
  objIframe.style.width = gWH().width-320;
  objIframe.style.height = gWH().height-80;
}

function copyToClipboard(field)
{
    var content = eval("document."+field)
    content.focus()
    content.select()
    range = content.createTextRange()
    range.execCommand("Copy")
    window.status="Contents copied to clipboard"
    setTimeout("window.status=''",1800)
}





