function init(){

}
window.onload = init;


up        = null;
upopacity = 0;
animate   = 0;

function changeTopNewsPic(obj){
  var imgs = document.getElementById('topNewsSmall').getElementsByTagName('img');
  var index = 1;
  for(var i = 0; i < imgs.length; i++){
    imgs[i].style.borderColor = "#bbb";
    if(obj == imgs[i]) index = i;
  }
  obj.style.borderColor = "#0066CC";
  
  var img = document.createElement("img");
  img.setAttribute('src', obj.src);
  setOpacity(img, 0);
  document.getElementById('topNewsBig').appendChild(img);
  up = img;
  upopacity = 0;
  animate = setInterval('topNewsAnimate()', 100);
  document.getElementById('topNewsContent').innerHTML = news[index];
//  topNewsAnimate();
}

function topNewsAnimate(){
  if(upopacity > 100){
    var img = document.getElementById('topNewsBig').getElementsByTagName('img');
    for(var i = 0; i < img.length; i++){
      if(img[i] != up) document.getElementById('topNewsBig').removeChild(img[i]);
    }
    clearInterval(animate);
  }else{
    increaseOpacity(up, 10);
  }
}


function setOpacity(obj, value) {
	obj.style.opacity = value/100;
	obj.style.filter = 'alpha(opacity=' + value + ')';
}

function increaseOpacity(obj, value){
  upopacity += value;
	obj.style.opacity = upopacity/100; 
	obj.style.filter = 'alpha(opacity=' + upopacity + ')';
}


function changeForumHeight(height){
  document.getElementById.style.height = height + 'px';
}