function findPageSize() {
  if (top.innerWidth) {
    pageW=top.innerWidth;
    pageH=top.innerHeight;
  }
  else if (top.document.body.clientWidth) {
    pageW=top.document.body.clientWidth;
    pageH=top.document.body.clientHeight;
  }
}

function resize() {
  oldW=pageW;
  oldH=pageH;
  findPageSize();
  if (pageW != oldW || pageH != oldH)
    location.reload();
}
//onresize=resize;

findPageSize();

/*function popup(filename) {
  xsize=((pageW-150)>500)?(pageW-150):500;
  ysize =((pageH-150)>300)?(pageH-150):300;
  xpos=(screen.width>xsize)?(screen.width-xsize)/2:0;
  ypos=(screen.height>ysize)?(screen.height-ysize)/2:0;
  window.open(filename,'Popup','status=true,width='+xsize+',height='+ysize+',screenX='+xpos+',screenY='+ypos+',left='+xpos+',top='+ypos);
} */

/* function popup(filename){

var xsize = 650;
var ysize = 400;

	window.open(filename,'Popup', 'width=' + xsize + ',height=' + ysize + ',menubars=yes,toolbars=yes,resizable=yes,scrollbars=yes');
}
*/


function popup(filename,x,y){

/* Standard Sizes to be used if none are supplied */
var xsize = 660;
var ysize = 400;

  /* Check to see if any dimentions have been passed. If so, use them, if not, use the standard */
  if (x != null) { xsize = x; }
  if (y != null) { ysize = y; }

    /* Open the popup window using the variables required */
    window.open(filename,'Popup', 'width=' + xsize + ',height=' + ysize + ',resizable=yes,scrollbars=yes');

}

function DownloadForm(filename){
	document.location.href = '/tools/contactus/download_form.asp?sPageHeading=Download&Doc=' + filename;
}


