// Determines the width of the page
function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

// Script to make iFrames possible and widely compatible across browsers
function insertExternalFile(fname,H) {
 var W = f_clientWidth();
 if(navigator.userAgent.indexOf("Firefox")!=-1) {
  var versionindex=navigator.userAgent.indexOf("Firefox")+8
  if (parseInt(navigator.userAgent.charAt(versionindex))>=1)
   W = W -20;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1
  || navigator.appName=="Netscape" 
     && parseInt(navigator.appVersion)>4
 ) 
 {
  document.write(''
  +'<IFRAME src="'+fname+'" scrolling="no" frameborder=0 border=0'
  +(W==null ? '' : ' width='+W)
  +(H==null ? '' : ' height='+H)
  +'></IFRAME>'
  )
 }
 if (navigator.appName=="Netscape" 
     && parseInt(navigator.appVersion)==4) {
  document.write(''
  +'<ILAYER>'
  +'<LAYER src="'+fname+'" '
  +(W==null ? '' : ' width='+W)
  +(H==null ? '' : ' height='+H)
  +'></LAYER></ILAYER>'
  )
 }
}
