function cols_init() {
  document.getElementById('menu_left').style.marginBottom = document.getElementById('box_left_bottom').offsetHeight+'px';
  document.getElementById('box_right').style.marginBottom = document.getElementById('boxes_right_bottom').offsetHeight+'px';
}

var thumbs_path='';
var thumbs_imgs=new Array();
var thumbs_width=new Array();
var thumbs_height=new Array();
var thumbs_temp=new Array();
var thumbs_inshow=new Array(8);
var thumbs_inshowheight=new Array(8);
function thumbs_init() {
  thumbs_temp=thumbs_imgs.slice();
  var num=thumbs_imgs.length;
  var forto=(num>=7)?7:num;
  for(var x=1;x<=forto;x++) thumbs_create(x);
  if(num>=7) for(var x=1;x<=7;x++) setTimeout("thumbs_remove("+x+");",Math.round(10000+Math.random()*10000));
}
function thumbs_create(id) {
  var num=thumbs_temp.length;
  if(num==0) {
  thumbs_temp=thumbs_imgs.slice();
  for(var x=1;x<=7;x++) thumbs_temp.splice(thumbs_temp.indexOf(thumbs_inshow[x]),1);
  num=thumbs_temp.length;
  }
  var img=Math.round(Math.random()*(num-1));
  var image=thumbs_temp[img];
  var width=thumbs_width[thumbs_imgs.indexOf(image)];
  var height=thumbs_height[thumbs_imgs.indexOf(image)];
  thumbs_temp.splice(img,1);
  thumbs_inshow[id]=image;
  thumbs_inshowheight[id]=height;
  var div=document.createElement('div');
  div.id='thumbdiv'+id;
  div.style.width='80px';
  div.style.height='80px';
  div.style.top='-10px';
  div.style.left='10px';
  div.style.filter='alpha(opacity=0, style=0)';
  div.style.opacity='0';
  div.innerHTML='<img border="0" src="'+thumbs_path+'t'+image+'" id="thumbimg'+id+'" style="width:'+Math.round(width*0.8)+'px; height:'+Math.round(height*0.8)+'px; margin-top:'+Math.round(40-height*0.4)+'px;" onload="thumbs_flyin('+id+');">';
  document.getElementById('thumb'+id).appendChild(div);
}
function thumbs_flyin(id) {
  var width=thumbs_width[thumbs_imgs.indexOf(thumbs_inshow[id])];
  var height=thumbs_height[thumbs_imgs.indexOf(thumbs_inshow[id])];
  for(var x=1;x<=10;x++) setTimeout("document.getElementById('thumbdiv"+id+"').style.filter='alpha(opacity="+x+"0, style=0)'; document.getElementById('thumbdiv"+id+"').style.opacity='"+(x/10)+"'; document.getElementById('thumbdiv"+id+"').style.top='"+(x-10)+"px'; document.getElementById('thumbdiv"+id+"').style.left='"+(10-x)+"px'; document.getElementById('thumbdiv"+id+"').style.width='"+Math.round(80+2*x)+"px'; document.getElementById('thumbdiv"+id+"').style.height='"+Math.round(80+2*x)+"px'; document.getElementById('thumbimg"+id+"').style.width='"+Math.round(width*(80+2*x)/100)+"px'; document.getElementById('thumbimg"+id+"').style.height='"+Math.round(height*(80+2*x)/100)+"px'; document.getElementById('thumbimg"+id+"').style.marginTop='"+Math.round(((80+2*x)-height*(80+2*x)/100)/2)+"px';",x*25);
}
function thumbs_remove(id) {
  thumbs_flyout(id);
  setTimeout("thumbs_remove("+id+");",Math.round(10000+Math.random()*10000));
}
function thumbs_flyout(id) {
  var width=thumbs_width[thumbs_imgs.indexOf(thumbs_inshow[id])];
  var height=thumbs_height[thumbs_imgs.indexOf(thumbs_inshow[id])];
  for(var x=10;x>=1;x--) setTimeout("document.getElementById('thumbdiv"+id+"').style.filter='alpha(opacity="+x+"0, style=0)'; document.getElementById('thumbdiv"+id+"').style.opacity='"+(x/10)+"'; document.getElementById('thumbdiv"+id+"').style.top='"+((10-x)*3)+"px'; document.getElementById('thumbdiv"+id+"').style.left='"+(10-x)+"px'; document.getElementById('thumbdiv"+id+"').style.width='"+Math.round(80+2*x)+"px'; document.getElementById('thumbdiv"+id+"').style.height='"+Math.round(80+2*x)+"px'; document.getElementById('thumbimg"+id+"').style.width='"+Math.round(width*(80+2*x)/100)+"px'; document.getElementById('thumbimg"+id+"').style.height='"+Math.round(height*(80+2*x)/100)+"px'; document.getElementById('thumbimg"+id+"').style.marginTop='"+Math.round(((80+2*x)-height*(80+2*x)/100)/2)+"px';",(10-x)*25);
  setTimeout("document.getElementById('thumb"+id+"').removeChild(document.getElementById('thumbdiv"+id+"')); thumbs_create("+id+");",275);
}

	if(!Array.indexOf){
	  Array.prototype.indexOf = function(obj){
	   for(var i=0; i<this.length; i++) if(this[i]==obj) return i;
	   return -1;
	  }
	}

