function GetWindowHeight(){
  //ognunu pe cazzi soi... fatelu un meeting
  if (navigator.appName == 'Netscape') 
  {
   return (window.innerHeight-16);
  } 
  else {
   if (navigator.appName == 'Opera') 
   {
    return document.body.clientHeight;
   }
   else return parent.document.body.clientHeight;
  }
}

function GetWindowWidth(){
  //ognunu pe cazzi soi... fatelu un meeting
  if (navigator.appName == 'Netscape') 
  {
   return (window.innerWidth);
  } 
  else {
   if (navigator.appName == 'Opera') 
   {
    return document.body.clientWidth;
   }
   else return parent.document.body.clientWidth;
  }
}

function CalcRepHeight(RepElement, SubHeight) {
  var newHeight, elem;
  
  newHeight = GetWindowHeight()-SubHeight;
  if (newHeight<19) { newHeight =19 };
    
  elem = document.getElementById(RepElement);
//  if (KeepAspectRatio) {
//	  ratio = elem.width / elem.height;
	  //elem.width = newHeight * ratio;
//  }
  
  elem.height = newHeight;

//alert(GetWindowHeight()+' - '+elem.width+' - '+elem.height);
}

function CalcRepWidth(RepElement, SubWidth) {
  var newWidth, elem;
  
  newWidth = GetWindowWidth()-SubWidth;
  if (newWidth<19) { newWidth =19 };
    
  elem = document.getElementById(RepElement);
//  if (KeepAspectRatio) {
//	  ratio = elem.width / elem.height;
	  //elem.width = newHeight * ratio;
//  }
  
  elem.width = newWidth;
//alert(GetWindowWidth()+' -  '+elem.width+' - '+elem.height);
}
