function sortNumber(a,b) {
	return a - b;
}

function NormalizeColumnHeight() {

	var item = 0;
	var strDivName = 'CenterColumn_msg';
	
	var divs = window.document.getElementsByTagName("div");
	
	colLength = new Array();
	colId     = new Array();

	// COLLECT AL DIVS AND PUT THEIR HEIGHT INSIDE A NEW ARRAY
	for(var i=0; i < divs.length-1; i++) {
	      if(divs[i].id.indexOf(strDivName) > -1 ) { 
		    colLength[item] = divs[i].offsetHeight; 
		    colId[item]     = divs[i].id; 
		   //alert(item + ") Bericht " + colId[item] + " is " + colLength[item] + " px hoog!") ;
		    item++;
	      } else {
		    //DO NOTHING
	      }
	}
	
	
	// RE-ORDER AND REVERSE ALL DIFFERENT HEIGHTS
	colLength.sort(sortNumber);
	colLength.reverse();
	var divLen = colLength[0];

	// RESET ALL DIVS WITH THE SAME HEIGHTS
	for(var j=0; j<((colId.length) ); j++) {
		//alert(j + ") Bericht " + colId[j] + " is " + colLength[j] + " px hoog!") ;
		document.getElementById(colId[j]).style.height = divLen+"px";
	}
}



function Thumbnailer(imgId,w,h) {
	
	var imgId;
	var w;
	var h;
	
        if(document.getElementById("" + imgId).src.search('thumbnail.php')==-1){
        	document.getElementById("" + imgId).src = 'thumbnail.php?w=' + w + '&h=' + h + '&url=' + document.getElementById("" + imgId).src;
	}
	
}

function ShowActiveMenu(style,buttonId) {

	var buttonId;
	var style;

	if (document.getElementById("button" + buttonId) == undefined) {
		//alert ("Undefined " + buttonId) ;
	} else {
		document.getElementById("button" + buttonId).src = document.getElementById("button" + buttonId).src.replace(".gif","_active.gif");
		document.getElementById("button" + buttonId).src = document.getElementById("button" + buttonId).src.replace("_active_active","_active");
		document.getElementById("button" + buttonId).src = document.getElementById("button" + buttonId).src.replace("_hover_active.gif","_active");
		//alert ("DOE!:  "+ document.getElementById("button" + buttonId).src) ;
	}

}

function ScrolltoAnchor(messageID) { 
	var messageID;
	if (messageID != undefined) window.location.hash = messageID;
}
