function changeCssAttrib(cssElement, attribute, value){
  //	thx to www.shanolson.net for assisting with this function. :)

  usedStyles = document.styleSheets;

  var cssList    = 0;
  var safariName = cssElement;
	
  if(cssElement.substring(0,1) == "#"){  //  this is needed for safari
    safariName = "*[ID\"" + cssElement.substring(1) + "\"]";
  }

  if(usedStyles){  //  ie, mozilla

    if(usedStyles[0]['rules']){  //  different way for different browsers  (IE)
      cssList = 'rules';
    } else if(usedStyles[0]['cssRules']) {  //  (Mozilla)
      cssList = 'cssRules';
    }

    for( i=0; i<usedStyles.length; i++){  //  walk through all loaded files
      theCSS = usedStyles[i][cssList];
      for(j=0;j<theCSS.length;j++){  //  content of all styles
      
       if(theCSS[j].selectorText == cssElement || theCSS[j].selectorText == safariName){  //  get the desired element
          theCSS[j].style[attribute] = value;
         }
       }
    }
  } else {  //  opera
    name = cssElement.substring(1);
    if(cssElement.substring(0,1) == "#"){
      elem = document.getElementById(name);
      elem.style[attribute] = value;
    } else {
      elems = document.getElementsByTagName("div");
      for(i=0;i<elems.length;i++){
        if(elems[i].getAttribute("class") == name){
          elems[i].style[attribute] = value;
        }
      }
    }
  }
}

function resize(){

  var bottomBorder = 2;
  
  //  get size of the page and of some elements
  var  y_used = document.body.scrollHeight;    //  used height

  if(window.innerHeight){  //  Mozilla, Opera
    y_possible = window.innerHeight;
    y_used += 1;
  } else if(document.body.parentNode.offsetHeight){  //  Internet Explorer
//    y_possible = document.body.offsetHeight;  //  possible height
    y_possible = document.body.parentNode.offsetHeight;  //  possible height
    y_used += 2;
    y_possible -= 16;
  }

  if(y_used < (y_possible)){  //  with scrollbars
    y = y_possible;
  } else {  //  content fits in screen
    y = y_used;
  }
	
  //  here we change the sizes of the elements
  //  this works only with classes in safari!!!!!
 
  changeCssAttrib('#navigation', 'height', (y - 292 - bottomBorder + "px"));
}