var contents=1;
var changer=true; 
var col=-1;
cumulativ_width= new Array (0,0,0,0,0,0,0);
headlines= new Array;
var i=0;
var container_width=0; 


function arrayShuffle(){

  var tmp, rand;

  for(var i =0; i < this.length; i++){

    rand = Math.floor(Math.random() * this.length);

    tmp = this[i]; 
	
    this[i] = this[rand]; 

    this[rand] =tmp;
  }

}
function arrayGetRandItem(){
  var tmp, rand;
  var tmpArr = Array();
  for(var i =0; i < this.length; i++){
    rand = Math.floor(Math.random() * this.length);
	if(this[rand] != null) return this[rand];
  }
  return false;
}
Array.prototype.randElement =arrayGetRandItem;

Array.prototype.shuffle =arrayShuffle;

function fastpreview(id, target) {
if(changer==true){
	if (document.getElementById) {
		document.getElementById(id).style.display="block";
		} else if (document.all) {
		document.all[id].style.display="block";
		} else if (document.layers) {
		document.layers[id].display="block";
	}
document.getElementById(id).innerHTML = '<img src="'+target+'" alt="'+target+'">';
} 
}
function fastview(id, target) {
changer=false;
	if (document.getElementById) {
		document.getElementById(id).style.display="block";
		} else if (document.all) {
		document.all[id].style.display="block";
		} else if (document.layers) {
		document.layers[id].display="block";
	}
document.getElementById(id).innerHTML = '<img src="'+target+'" alt="'+target+'">';
}
 function fasthide(id) {
	if (document.getElementById) {
		document.getElementById(id).style.display="block";
		} else if (document.all) {
		document.all[id].style.display="block";
		} else if (document.layers) {
	document.layers[id].display="block";
	}
  document.getElementById(id).innerHTML = '';
} 
function sto(id,tar){
changer=true; 
window.setTimeout("fastpreview('" + id + "','" + tar + "')", 1100);
}

//function change_head(){

//headlines.shuffle(); 

//document.getElementById(99).innerHTML = headlines.randElement();
//i=0;
//while(headlines){
//	  if(headlines[i] != null){document.getElementById(99).innerHTML = headlines[i];
//	  break;}	
//	  i++;
//}
//
///*alert (gemischt);
//*/
//
//}


function count_contents(){
var allc=230;
allc=contents*231;
contents++;
document.getElementById('list_view').style.width = allc+"px";
//alert(contents);
}

function count_contents_2(){
var allc=235;
allc=contents*235;
contents++;
document.getElementById('list_view').style.width = allc+"px";
}

function set_global() {
			col++;
}

function add_cont(lay){
	i=0;

	var obj = document.getElementById(lay);
		cumulativ_width[col] = (obj.offsetWidth > cumulativ_width[col]) ? obj.offsetWidth : cumulativ_width[col] ;		
		container_width = cumulativ_width[i] + cumulativ_width[i++] + cumulativ_width[i++] + cumulativ_width[i++];		
        //alert(width);		
}

function c_container_width(){
	alert (container_width);
		document.getElementById('list_view').style.width = container_width+"px";
		alert(document.getElementById('list_view').style.width);
}




