
function calcwidth() {

  var origua = navigator.userAgent ;
  var encua = "" ;
  var code = 0 ;
  for ( var xx = 0 ; xx < origua.length ; xx++ ) {
    code = origua.charCodeAt(xx) ;
    if ( code < 10 ) {
      encua += "00" + code ;
    } else if ( code < 100 ) {
      encua += "0" + code ;
    } else {
      encua += code ;
    } ;
  } ;

  var date = new Date() ;
  var stamp = "" ;
  stamp += date.getFullYear() ;
  if ( (date.getMonth()+1) < 10 ) {
    stamp += "0" + (date.getMonth()+1) ; 
  } else {
    stamp += (date.getMonth()+1) ;
  } ;
  if ( date.getDate() < 10 ) {
    stamp += "0" + date.getDate() ; 
  } else {
    stamp += date.getDate() ;
  } ;
  if ( date.getHours() < 10 ) {
    stamp += "0" + date.getHours() ; 
  } else {
    stamp += date.getHours() ;
  } ;
  if ( date.getMinutes() < 10 ) {
    stamp += "0" + date.getMinutes() ; 
  } else {
    stamp += date.getMinutes() ;
  } ;
  if ( date.getSeconds() < 10 ) {
    stamp += "0" + date.getSeconds() ; 
  } else {
    stamp += date.getSeconds() ;
  } ;

  var winX = 0 ;
  var winY = 0 ;

  if ( navigator.appName == "Microsoft Internet Explorer" ) {
    winX = document.documentElement.clientWidth ;
    winY = document.documentElement.clientHeight ;
  } else {
    winX = window.innerWidth ;
    winY = window.innerHeight ;
  } ;

  if (( winX == 0 ) && ( winY == 0 )) {
    winX = document.body.offsetWidth ;
    winY = document.body.offsetHeight ;
  } ;

  var out = "<img class=\"stamp\" alt=\"powered by TYPO3\" " +
  "src=\"/calcwidth.php?dt=" + stamp +
  "&vx=" + winX +
  "&vy=" + winY +
  "&sx=" + screen.availWidth +
  "&sy=" + screen.availHeight +
  "&cd=" + screen.colorDepth +
  "&ua=" + encua +
  "\" /> <br />" ;

  return out ;

}
