// JavaScript Document
function getClientWidth()
//IE5+, Mozilla 1.0+, Opera 7+
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
function getClientHeight()
//IE5+, Mozilla 1.0+, Opera 7+
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
//Размер документа по вертикали  
function getDocumentHeight()  
{  
    return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;  
}  
  
//Размер документа по горизонтали  
function getDocumentWidth()  
{  
    return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;  
}  
function bottom()
{
   var page,bottom,x,y,dY,h,m,c,p,newH,b,t
  // alert("befor if")
   if (document.getElementById) 
   {  
    // alert("after if 1")
     m = document.getElementById("contentMenu").offsetHeight
	 c = document.getElementById("contentText").offsetHeight
	 document.getElementById("contentText").style.height = Math.max(m,c) + "px" 
	
	 y = document.getElementById("contentContainer").offsetHeight
	 h = document.getElementById("header").offsetHeight
	 b = document.getElementById("bottomContainer").offsetHeight
	 
	 p= h + y + b
	 s = getClientHeight()
	 //x = document.getElementById("page").offsetHeight
	 //alert(x)
	 //alert(y)
	 //alert(b)
	 //alert(x+y)
	 //document.write("x=",x, "<br>y=",y,"<br>h=",h,"<br>m=",m,"<br>c=",c,"<br>p=",p,"<br>s=",s)
	 // alert("x=",x, "<br>y=",y,"<br>h=",h,"<br>m=",m,"<br>c=",c,"<br>p=",p)
	// document.getElementById("page").style.borderLeftStyle = "solid"
	
	
	 if ( p <= s )
	 { 
	   document.getElementById("bottomContainer").style.position = "absolute"
	   document.body.minHeight = p
	 }
	 else
	 {
       document.getElementById("bottomContainer").style.position = "relative"
	 }
    //alert(document.body.scrollHeight) 
    
   }
 }

